Skip to content

Commit 8cec5b9

Browse files
committed
interactiv model groq picker
1 parent 069a39a commit 8cec5b9

21 files changed

Lines changed: 397 additions & 193 deletions

AGENTS.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,14 @@ working on DevMap.
7575
Update the relevant document whenever implementation or verification changes
7676
its contents. Do not duplicate these personal notes into the public `docs/`
7777
folder unless the information is intended for users or contributors.
78+
79+
<!-- DevMap Instruction Block -->
80+
## DevMap Context
81+
82+
Before working in this repository, read `DEVMAP.md` first.
83+
Read `.devmap/index.json` first, then the relevant
84+
`.devmap/features/*.json` map. Inspect files from `sourcePriority` before
85+
exploring broadly. Use `.devmap/snapshot.json` only when those lightweight
86+
navigation files are insufficient. If the navigation files are missing, run
87+
`devmap analyze`.
88+
<!-- End DevMap Instruction Block -->

DEVMAP.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# DevMap
2+
3+
This repository uses DevMap to create reusable project context for developers and AI agents.
4+
5+
## Project Context
6+
7+
- Detected framework: astro
8+
- Agent navigation index: `.devmap/index.json`
9+
- Feature maps: `.devmap/features/*.json`
10+
- Full analysis archive: `.devmap/snapshot.json`
11+
- DevMap config: `~/.devmap/config.json`
12+
13+
## Recommended Workflow
14+
15+
1. Run `devmap analyze` after cloning the repository.
16+
2. Run `devmap analyze --fresh` after major architecture changes.
17+
3. Use `devmap ask "<question>"` before manually exploring unrelated files.
18+
4. Treat DevMap output as an architecture overview, then verify critical behavior in source code.
19+
20+
## Commands
21+
22+
```bash
23+
devmap analyze
24+
devmap analyze --json
25+
devmap ask "how does authentication work?"
26+
devmap ask "where is authentication handled?" --json
27+
devmap doctor
28+
devmap doctor --json
29+
```
30+
31+
## Agent Navigation Contract
32+
33+
This repository uses DevMap as the primary navigation source. Use the lightweight
34+
navigation files before broad repository exploration.
35+
36+
Preferred reading order:
37+
38+
1. Read `.devmap/index.json`.
39+
2. Pick the relevant feature using its name and keywords.
40+
3. Open the matching `.devmap/features/*.json` map.
41+
4. Inspect only the files listed in `sourcePriority` first.
42+
5. Read `.devmap/snapshot.json` only when the index and feature maps are
43+
insufficient or full archive/debug context is required.
44+
45+
Do not scan the whole repository first.
46+
47+
Open source files only when:
48+
49+
- the snapshot is missing;
50+
- the snapshot is stale;
51+
- the snapshot does not contain enough detail;
52+
- exact implementation is required;
53+
- the task is edit, debug, or refactor;
54+
- the user explicitly asks for code changes.
55+
56+
When source inspection is needed, inspect the smallest relevant set first.
57+
Prefer feature entry points and flow steps over broad folder exploration.
58+
59+
## Required Agent Workflow
60+
61+
1. Read `DEVMAP.md`.
62+
2. Read `.devmap/index.json`.
63+
3. Open the relevant feature map.
64+
4. Inspect at most the smallest relevant source-file set from `sourcePriority`.
65+
5. Explain which navigation entry guided the decision when giving advice.
66+
6. Avoid unrelated files unless the navigation data is incomplete or exact
67+
code verification is required.
68+
69+
If `.devmap/index.json` or `.devmap/snapshot.json` is missing, run
70+
`devmap analyze` when DevMap is available and configured. If analyze fails
71+
because DevMap is not initialized, ask the user to run `devmap init` and then
72+
`devmap analyze`.
73+
74+
If the snapshot may be stale, run `devmap analyze --fresh` before relying on
75+
it.
76+
77+
Use `--json` when calling DevMap programmatically so stdout remains one
78+
parseable JSON document without ANSI or terminal decoration.
79+
80+
Do not edit generated files inside `.devmap/`.
81+
82+
## Repository Safety
83+
84+
- `.devmap/` is local generated state and should stay out of Git.
85+
- Never commit API keys or provider credentials.
86+
- DevMap helps locate relevant code; it does not replace source-level verification.

PRD.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -327,16 +327,11 @@ Run static analysis, generate project snapshot, and output a readable project ov
327327

328328
```bash
329329
devmap analyze
330-
devmap analyze --deep
331330
```
332331

333-
**`--deep` flag:**
334-
335-
| | Standard | `--deep` |
336-
|---|---|---|
337-
| Analysis scope | Project-level overview | Per-module detailed explanation |
338-
| AI usage | Lower | Higher |
339-
| Best for | Quick mapping | Large/unfamiliar projects |
332+
`devmap analyze` uses the provider and model stored in
333+
`~/.devmap/config.json`. Groq users choose a model during setup and can change
334+
it later with `devmap config model <model-id>`.
340335

341336
**Generated files:**
342337

@@ -576,9 +571,7 @@ ai/
576571
| Command | Model | Reason |
577572
|---|---|---|
578573
| `analyze` | `openai/gpt-oss-20b` | Balanced architecture interpretation |
579-
| `analyze --deep` | `openai/gpt-oss-120b` | Heavy cross-module reasoning |
580574
| `analyze` fallbacks | `qwen/qwen3.6-27b` -> `llama-3.3-70b-versatile` -> `llama-3.1-8b-instant` | Keep snapshot enrichment available across model-specific limits |
581-
| `analyze --deep` fallbacks | `llama-3.3-70b-versatile` -> `qwen/qwen3.6-27b` -> `openai/gpt-oss-20b` | Degrade heavy reasoning gradually instead of failing immediately |
582575

583576
DevMap retries a rate-limited model up to three times, then advances through
584577
the command-specific chain. It also advances when a model is unavailable or
@@ -591,6 +584,10 @@ Model availability changes over time. Before changing the default routing,
591584
verify the current Groq model list and lifecycle status. Preview models must
592585
not be used as a primary default for a public DevMap release.
593586

587+
Groq setup lists the currently available Groq models after validating the API
588+
key. Users choose one with arrow keys and Enter; the selected model is stored
589+
as the user's preferred model.
590+
594591
OpenRouter setup asks for a model ID after validating the API key. Pressing
595592
Enter selects `openrouter/free`; entering another free or paid model stores
596593
that exact model as the user's preferred model. Explicit user selections take
@@ -1017,7 +1014,7 @@ Rate limit reached.
10171014
10181015
DevMap will retry in 12 seconds.
10191016
1020-
Tip: Use standard analyze instead of --deep for lower token usage.
1017+
Tip: Choose a smaller model with devmap config model <model-id> for lower token usage.
10211018
```
10221019

10231020
All error messages must be:

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,11 @@ AI features require a provider API key. DevMap uses Groq by default — analysis
253253
| OpenAI | Planned |
254254
| Gemini | Planned |
255255

256-
`devmap init` lets you choose Groq or OpenRouter with the arrow keys. For
257-
OpenRouter, pressing Enter at `OpenRouter model [openrouter/free]:` keeps the
258-
free router; typing another model ID uses that free or paid model instead.
259-
Change it later with `devmap config model <model-id>`.
256+
`devmap init` lets you choose Groq or OpenRouter with the arrow keys. Groq
257+
shows the available model list and stores the selected model. For OpenRouter,
258+
pressing Enter at `OpenRouter model [openrouter/free]:` keeps the free router;
259+
typing another model ID uses that free or paid model instead. Change it later
260+
with `devmap config model <model-id>`.
260261

261262
API keys are stored locally:
262263

docs/architecture.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,6 @@ MVP default model routing:
643643
| Command | Primary | Ordered fallbacks |
644644
| ---------------- | -------------------------- | ----------------- |
645645
| `analyze` | `openai/gpt-oss-20b` | `qwen/qwen3.6-27b` -> `llama-3.3-70b-versatile` -> `llama-3.1-8b-instant` |
646-
| `analyze --deep` | `openai/gpt-oss-120b` | `llama-3.3-70b-versatile` -> `qwen/qwen3.6-27b` -> `openai/gpt-oss-20b` |
647646

648647
Each model receives up to three exponential-backoff retries for HTTP 429.
649648
After those retries, or when a model is unavailable or returns HTTP 5xx,
@@ -657,6 +656,10 @@ on 2026-06-20. Recheck provider lifecycle status before publishing a release.
657656
Users can override automatic routing with `devmap config model <model>`.
658657
Running `devmap config model auto` restores the defaults above.
659658

659+
Groq setup lists available Groq models after API-key validation and stores the
660+
selected model in the global config. The stored model is used as the primary
661+
choice until the user changes it with `devmap config model`.
662+
660663
OpenRouter does not use the Groq command-routing table. During `devmap init`,
661664
Enter accepts `openrouter/free`, while a typed model ID is stored and used
662665
exactly as the user selected it. Explicit OpenRouter model choices receive no

docs/commands.md

Lines changed: 12 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ devmap init
4444
* Confirm AI provider
4545
* Input API key or read environment variable
4646
* Validate API key
47+
* Ask for a Groq model from the provider model list
4748
* Ask for an OpenRouter model; Enter defaults to `openrouter/free`
4849
* Save global configuration to `~/.devmap/config.json`
4950
* Detect current project framework
@@ -120,17 +121,12 @@ Analyze the current project and generate a reusable project snapshot.
120121

121122
### Usage
122123

123-
```bash
124-
devmap analyze
125-
devmap analyze --deep
126-
```
127-
128-
### Modes
129-
130-
| Mode | Purpose |
131-
| -------- | -------------------------------------- |
132-
| Standard | Fast project overview |
133-
| `--deep` | More detailed architecture explanation |
124+
```bash
125+
devmap analyze
126+
```
127+
128+
`devmap analyze` uses the model stored in `~/.devmap/config.json`. Change the
129+
stored model with `devmap config model <model-id>`.
134130

135131
### Responsibilities
136132

@@ -219,33 +215,7 @@ Snapshot saved:
219215
220216
```
221217

222-
223-
### Deep Output
224-
225-
When using:
226-
227-
```bash
228-
devmap analyze --deep
229-
```
230-
231-
DevMap adds a deeper module-level explanation.
232-
233-
Example:
234-
235-
```txt
236-
Module Breakdown
237-
238-
app/
239-
Main application routes and layouts.
240-
241-
app/api/
242-
Server-side API routes.
243-
244-
lib/
245-
Shared utilities, database access, authentication logic, and helpers.
246-
```
247-
248-
### Rules
218+
### Rules
249219

250220
* Static analysis must run before AI interpretation
251221
* Do not send the entire project source to AI
@@ -415,7 +385,10 @@ devmap config model auto
415385
`auto` restores command-based routing:
416386

417387
* `analyze` uses `openai/gpt-oss-20b`
418-
* `analyze --deep` uses `openai/gpt-oss-120b`
388+
389+
For Groq, `devmap init` lists available models after API-key validation. Pick a
390+
model with the arrow keys and press Enter. The selected model is stored in the
391+
global config.
419392

420393
For OpenRouter, `devmap init` prompts with:
421394

@@ -430,7 +403,6 @@ The typed model is stored as the primary choice and is not silently replaced.
430403
Automatic routing also uses ordered fallback chains:
431404

432405
* `analyze`: `qwen/qwen3.6-27b`, `llama-3.3-70b-versatile`, then `llama-3.1-8b-instant`
433-
* `analyze --deep`: `llama-3.3-70b-versatile`, `qwen/qwen3.6-27b`, then `openai/gpt-oss-20b`
434406

435407
DevMap advances after model-unavailable and transient provider responses. For
436408
rate limits, it first retries the current model three times with exponential
@@ -476,7 +448,6 @@ integration.
476448
```bash
477449
devmap init --json
478450
devmap analyze --json
479-
devmap analyze --deep --json
480451
devmap onboarding --json
481452
devmap doctor --json
482453
devmap config model auto --json

docs/for-me-personal/PROGRESS.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@ Terakhir diperbarui: 2026-06-23
44

55
## Update 2026-06-23
66

7+
### Groq Model Picker And Analyze Deep Removal
8+
9+
- `~/.devmap/config.json` tetap menyimpan `provider`, `apiKey`, dan `model`.
10+
Config lama tanpa `provider` atau `model` dibaca sebagai `provider: "groq"`
11+
dan `model: "auto"` agar tetap backward compatible.
12+
- `devmap init` untuk Groq sekarang mengambil daftar model dari endpoint model
13+
Groq setelah API key valid, lalu menampilkan picker arrow-key/Enter.
14+
- Model Groq yang dipilih disimpan ke global config dan dapat diganti dengan
15+
`devmap config model <model-id>`.
16+
- OpenRouter setup tidak diubah: tetap memakai prompt model text dengan default
17+
`openrouter/free`.
18+
- Flag `devmap analyze --deep` dihapus dari CLI dan dokumentasi aktif. Hasil
19+
investigasi: analyzer static, snapshot, dan cache path-nya sama; perbedaan
20+
sebelumnya hanya routing model/fallback, prompt/token limit, dan output
21+
`Module Breakdown` kecil.
22+
23+
---
24+
725
### Ask Command — Complete Removal
826

927
- **Seluruh fitur `devmap ask` dihapus permanen.**

docs/for-me-personal/TEST.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,25 @@ Remove-Item Env:OPENROUTER_API_KEY
5252
Jangan simpan atau menyalin API key nyata ke repository, snapshot, output test,
5353
atau dokumentasi debugging.
5454

55+
## Groq Model Picker And Analyze Command
56+
57+
Focused automated tests:
58+
59+
```powershell
60+
pnpm --filter devmap exec tsx --test test/init-and-errors.test.ts test/config-command.test.ts test/analyze-ai.test.ts
61+
```
62+
63+
Expected:
64+
65+
- Config lama di `~/.devmap/config.json` yang hanya berisi `apiKey` tetap
66+
terbaca sebagai Groq dengan `model: "auto"`.
67+
- Setup Groq interaktif menampilkan daftar model Groq setelah API key valid.
68+
- Pilih model dengan arrow key lalu Enter; model tersimpan di global config.
69+
- `devmap config model <model-id>` tetap dapat mengganti model yang tersimpan.
70+
- `devmap analyze --help` tidak menampilkan flag `--deep`.
71+
- OpenRouter setup tetap memakai prompt model text dengan default
72+
`openrouter/free`.
73+
5574
## Mixed Workspace Snapshot Accuracy
5675

5776
Jalankan static analyze pada root DevMap dengan config AI terisolasi:
@@ -258,12 +277,8 @@ pnpm --filter devmap exec tsx --test test/config-command.test.ts test/analyze-ai
258277

259278
Expected automatic routing:
260279

261-
- `ask`: `llama-3.1-8b-instant`
262280
- `analyze`: `openai/gpt-oss-20b`
263-
- `analyze --deep`: `openai/gpt-oss-120b`
264-
- `ask` fallback: Qwen 3.6 27B -> Llama 70B Versatile -> GPT-OSS 20B
265281
- `analyze` fallback: Qwen 3.6 27B -> Llama 70B Versatile -> Llama 8B Instant
266-
- deep fallback: Llama 70B Versatile -> Qwen 3.6 27B -> GPT-OSS 20B
267282

268283
Automated expectations:
269284

@@ -925,12 +940,6 @@ Pastikan:
925940
- raw provider error dan stack trace tidak muncul;
926941
- `doctor` menyatakan key dan model valid.
927942

928-
Tes deep model:
929-
930-
```powershell
931-
devmap analyze --deep --fresh
932-
```
933-
934943
Hapus key:
935944

936945
```powershell

packages/cli/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,15 @@ DevMap-owned server.
9090
```bash
9191
devmap init
9292
devmap analyze
93-
devmap analyze --deep
9493
devmap analyze --fresh
9594
devmap onboarding --write
9695
devmap onboarding --write --language id
9796
devmap doctor
9897
devmap config model auto
9998
```
10099

101-
Groq automatic routing uses a fast model for focused questions and larger
102-
models for architecture analysis. OpenRouter uses the model selected during
103-
init. Change either provider's model with:
100+
Groq and OpenRouter use the model selected during init. Change either
101+
provider's model with:
104102

105103
```bash
106104
devmap config model <model-id>

0 commit comments

Comments
 (0)