Skip to content

Commit bb0fc63

Browse files
Reorganize plot implementations under python/ subdirectory (#5648)
## Summary This PR reorganizes the plot implementation directory structure to explicitly namespace implementations by language. All Python plot implementations are now stored under `plots/{spec_id}/implementations/python/` instead of directly under `plots/{spec_id}/implementations/`, and corresponding metadata files are moved to `plots/{spec_id}/metadata/python/`. ## Key Changes - **Update command documentation** (`agentic/commands/update.md`): Updated all path references to reflect the new `implementations/python/` and `metadata/python/` structure throughout the update workflow, including: - Default library scanning paths - Preview image generation and comparison paths - Ruff formatting and linting commands - Metadata YAML file locations - GCS upload and staging paths - Per-library branch and worktree setup - Agent instruction paths - **Simplify planning command documentation** (`agentic/commands/bug.md`, `feature.md`, `refactor.md`, `chore.md`): Removed redundant "Codebase Structure" sections from each planning command and consolidated guidance to reference `agentic/docs/project-guide.md` as the single source of truth for project layout. Clarified that these commands produce plans only and should not execute implementation. - **Update agent infrastructure** (`agentic/commands/agentic.md`, `audit.md`, `audit/agentic-auditor.md`, `audit/catalog-auditor.md`): Updated Serena tool references from `jet_brains_*` aliases to the canonical `mcp__serena__*` prefix to match `.claude/settings.json` registration. - **Improve command clarity** (`agentic/commands/start.md`, `implement.md`, `test.md`, `commit.md`, `pull_request.md`, `review.md`, `document.md`): Enhanced instructions with more specific guidance on execution order, error handling, scope boundaries, and output format requirements. Removed duplicate "Codebase Structure" sections in favor of referencing the project guide. - **Rename documentation router** (`agentic/commands/docs.md`, formerly `context.md`): Renamed to avoid collision with Claude Code's built-in `/context` command. Updated all references across the codebase. - **Clarify JSON output requirements** (`agentic/commands/classify.md`, `review.md`): Emphasized that JSON responses must be on a single line with no preamble or markdown formatting, as they are parsed directly by downstream code. ## Implementation Details The directory structure change is comprehensive and affects: - Agent workflow paths for reading and writing implementation files - GCS staging and upload paths for plot images and HTML - Metadata file locations for storing review feedback and quality scores - Preview image generation and comparison workflows - Per-library branch creation and file staging All path updates maintain consistency across the update workflow documentation to ensure agents and the lead coordinator work with the correct directory structure. https://claude.ai/code/session_01GWQrCaJZGt4nVRz7ct2LHs --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent bf88d2a commit bb0fc63

19 files changed

Lines changed: 200 additions & 266 deletions

agentic/commands/agentic.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ When routing to a single leverage point, include the point number in the task de
8686
### Phase 2: Parallel Analysis
8787

8888
Each specialist receives a focused prompt (see below). They:
89-
- Use **Serena tools** (`jet_brains_get_symbols_overview`, `jet_brains_find_symbol`, `search_for_pattern`, `list_dir`, `find_file`, `jet_brains_find_referencing_symbols`) and **Glob/Grep/Read** for code analysis
89+
- Use **Serena tools** (`mcp__serena__get_symbols_overview`, `mcp__serena__find_symbol`, `search_for_pattern`, `list_dir`, `find_file`, `mcp__serena__find_referencing_symbols`) and **Glob/Grep/Read** for code analysis
9090
- Do **NOT** use Bash for file discovery or code searching — only for `uv run ruff`, `uv run pytest`, or similar shell-native commands
9191
- Send findings to `agentic-lead` via `SendMessage` when done
9292
- Mark their task completed via `TaskUpdate`
@@ -192,7 +192,7 @@ You are the **core-auditor** on the agentic-audit team. Analyze leverage points
192192
**Where to look:**
193193
- `CLAUDE.md` — primary agent-facing context
194194
- `.claude/` — tool configuration, settings
195-
- `agentic/commands/context.md` — conditional documentation routing
195+
- `agentic/commands/docs.md` — conditional documentation routing (`/docs` slash command)
196196
- `agentic/docs/` — project guides
197197
- `agentic/context/` — feature-specific context documents
198198
- `README.md`, `.github/copilot-instructions.md`
@@ -279,10 +279,10 @@ You are the **core-auditor** on the agentic-audit team. Analyze leverage points
279279

280280
**How to work:**
281281
1. Use `list_dir` to explore directories listed above
282-
2. Use `jet_brains_get_symbols_overview` on key files
282+
2. Use `mcp__serena__get_symbols_overview` on key files
283283
3. Use `search_for_pattern` for patterns like `CLAUDE.md`, model references, `mcp`, `prompt`
284284
4. Use Read to examine prompt files and configuration
285-
5. Use `jet_brains_find_symbol` with `depth=1` to inspect MCP tools and CLI commands
285+
5. Use `mcp__serena__find_symbol` with `depth=1` to inspect MCP tools and CLI commands
286286
6. Use Grep to count lines in large files: check for >1000-line files as context bloat risk
287287
7. **Do NOT use Bash** for `find`, `ls`, `grep`, `cat` — use Serena/Glob/Grep/Read tools instead
288288
8. You MAY use Bash for: `uv run python -c "..."` to inspect tool registrations
@@ -379,7 +379,7 @@ You are the **environment-auditor** on the agentic-audit team. Analyze leverage
379379

380380
**Where to look:**
381381
- `agentic/docs/` — agent-facing documentation
382-
- `agentic/commands/context.md` — conditional documentation router
382+
- `agentic/commands/docs.md` — conditional documentation router (`/docs` slash command)
383383
- `agentic/context/` — feature-specific context documents
384384
- `docs/` — general documentation
385385
- `docs/concepts/`, `docs/reference/`, `docs/workflows/`
@@ -424,7 +424,7 @@ You are the **environment-auditor** on the agentic-audit team. Analyze leverage
424424

425425
**How to work:**
426426
1. Use `list_dir` with `recursive=false` to map top-level and sub-directory structure
427-
2. Use `jet_brains_get_symbols_overview` on key files to check type annotations
427+
2. Use `mcp__serena__get_symbols_overview` on key files to check type annotations
428428
3. Use `search_for_pattern` for anti-patterns (e.g., `Any`, `# type: ignore`, `print(`, `: any`, `console.log`)
429429
4. Use Read to examine config files (`tsconfig.json`, `pyproject.toml` type sections)
430430
5. Use Grep to find logging, error handling, and type annotation patterns
@@ -552,8 +552,8 @@ You are the **workflow-auditor** on the agentic-audit team. Analyze leverage poi
552552

553553
**How to work:**
554554
1. Use `list_dir` to explore `tests/`, `agentic/specs/`, `agentic/workflows/`, `agentic/commands/`, `prompts/`
555-
2. Use `jet_brains_get_symbols_overview` on workflow scripts and test files
556-
3. Use `jet_brains_find_symbol` to inspect workflow classes, fixtures, orchestrators
555+
2. Use `mcp__serena__get_symbols_overview` on workflow scripts and test files
556+
3. Use `mcp__serena__find_symbol` to inspect workflow classes, fixtures, orchestrators
557557
4. Use Read to examine spec files, templates, and workflow configurations
558558
5. Use `search_for_pattern` for patterns like `prompt_claude_code`, `WorkflowState`, `@pytest.fixture`, `$ARGUMENTS`
559559
6. Use Glob to find all test files (`**/*test*.py`, `**/*.test.ts`) and template files

agentic/commands/audit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ You are the **audit-lead**. Your job is to coordinate a team of specialist audit
8787
### Phase 2: Parallel Analysis
8888

8989
Each specialist receives a focused prompt loaded from `agentic/commands/audit/<name>-auditor.md` (see the Specialist Prompts index below). They:
90-
- Use **Serena tools** (`mcp__serena__get_symbols_overview`, `mcp__serena__find_symbol`, `search_for_pattern`, `list_dir`, `find_file`, `mcp__serena__find_referencing_symbols`) and **Glob/Grep/Read** for code analysis. **Tool-naming note:** `mcp__serena__*` is the canonical MCP-registered prefix that matches `.claude/settings.json` (`mcp__serena__*` is in `permissions.allow`); some other repo docs (`CLAUDE.md`, `.serena/project.yml`, `agentic/commands/prime.md`) still reference legacy aliases like `jet_brains_*` or unprefixed names — treat those as the same tools and prefer the `mcp__serena__*` form here.
90+
- Use **Serena tools** (`mcp__serena__get_symbols_overview`, `mcp__serena__find_symbol`, `search_for_pattern`, `list_dir`, `find_file`, `mcp__serena__find_referencing_symbols`) and **Glob/Grep/Read** for code analysis. **Tool-naming note:** `mcp__serena__*` is the canonical MCP-registered prefix that matches `.claude/settings.json` (`mcp__serena__*` is in `permissions.allow`). A few external configs (`CLAUDE.md`, `.serena/project.yml`) may still reference legacy `jet_brains_*` aliases — treat those as the same tools and use the `mcp__serena__*` form here.
9191
- Use `think_about_collected_information` after non-trivial research sequences
9292
- Do **NOT** use Bash for file discovery or code searching — only for the per-auditor whitelisted shell commands
9393
- Stay within the tool budget (~30 calls); set `COVERAGE: partial` if forced to stop early

agentic/commands/audit/agentic-auditor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ You are the **agentic-auditor** on the audit team. Your scope is the **agent erg
88
- `prompts/`: same drift checks the llm-pipeline-auditor does at the SDK layer, but at the *prompt-management* layer — versioning, ownership, where prompts are loaded from, whether inline prompts in code should have moved to files
99
- `.claude/`: settings sanity (`settings.json`, `settings.local.json`), permission/hook configuration, MCP server registration consistency
1010
- `agentic/workflows/`, `agentic/audits/`, `agentic/scripts/`, `agentic/docs/`: directory hygiene, naming conventions, abandoned subdirectories, docs that contradict CLAUDE.md
11-
- TAC-style sanity (only flag what's actually weak): conditional docs (`/context`-style), model routing per task, self-validation loops, ADWs, context-window discipline (commands that load way more than they need)
11+
- TAC-style sanity (only flag what's actually weak): conditional docs (`/docs`-style routing), model routing per task, self-validation loops, ADWs, context-window discipline (commands that load way more than they need)
1212

1313
**How to work:**
1414
1. `list_dir` on the directories above

agentic/commands/audit/catalog-auditor.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ You don't need to query the database or run helper scripts. The repository under
1717
## How to look
1818

1919
- Start with `list_dir` / Glob on `plots/` to get a feel for the size and shape (how many specs, how many implementations each).
20-
- Pick a handful of specs to actually open — mix old and new, big and small, well-covered and sparse. Read their `specification.md`, glance at `specification.yaml`, peek at one or two `metadata/{library}.yaml` files.
20+
- Pick a handful of specs to actually open — mix old and new, big and small, well-covered and sparse. Read their `specification.md`, glance at `specification.yaml`, peek at one or two `metadata/python/{library}.yaml` files.
2121
- Follow your nose. If something looks off (missing file, suspiciously empty metadata, weird tag, mismatched fields), pull on that thread.
2222
- Stop when you have enough material for a few real findings. You are not building a coverage report.
2323

2424
## Things worth a glance (pick whichever feel productive)
2525

26-
- **Implementation coverage** — specs with very few `implementations/*.py` files relative to the 9 supported libraries.
27-
- **Quality score health**`metadata/{library}.yaml` files with `quality_score: null` (review never ran) or low scores that have been sitting around.
28-
- **Missing metadata files** — implementation `.py` exists but no matching `metadata/{library}.yaml` (suggests a manual merge bypassed `impl-merge.yml`).
26+
- **Implementation coverage** — specs with very few `implementations/python/*.py` files relative to the 9 supported libraries.
27+
- **Quality score health**`metadata/python/{library}.yaml` files with `quality_score: null` (review never ran) or low scores that have been sitting around.
28+
- **Missing metadata files** — implementation `.py` exists but no matching `metadata/python/{library}.yaml` (suggests a manual merge bypassed `impl-merge.yml`).
2929
- **Spec-side rot** — specs missing `updated`, missing `tags`, missing one of the required `specification.md` sections (Description / Applications / Data / Notes), or older than the current `prompts/templates/spec.md`.
3030
- **Tag hygiene** — tags that look like typos (used by exactly one spec), or the same concept tagged differently across specs.
31-
- **GCS preview integrity** — for a small sample of `metadata/{library}.yaml` files, `HEAD` the `preview_url` and flag 404 / wrong content-type / 403.
32-
- **Library-version drift**`library_version` in `metadata/{library}.yaml` vs. the floor in `pyproject.toml` `lib-{library}` extras; flag obvious staleness.
31+
- **GCS preview integrity** — for a small sample of `metadata/python/{library}.yaml` files, `HEAD` the `preview_url` and flag 404 / wrong content-type / 403.
32+
- **Library-version drift**`library_version` in `metadata/python/{library}.yaml` vs. the floor in `pyproject.toml` `lib-{library}` extras; flag obvious staleness.
3333
- **Duplicate-looking specs** — descriptions that read almost identically; group them as candidates, false positives are fine.
3434

3535
These are **suggestions**. Skip any that don't yield signal and lean into whichever turn up real findings.

agentic/commands/bug.md

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,14 @@ prompt: $2
1111
## Instructions
1212

1313
- If the run_id or prompt is not provided, stop and ask the user to provide them.
14-
- Investigate the bug described in the `prompt`
15-
- Identify the root cause before planning the fix
16-
- Create the plan in the `agentic/specs/` directory with filename: `{YYMMDD}-{descriptive-name}.md`
17-
- Use today's date as YYMMDD prefix (e.g., "260207-fix-api-timeout.md")
18-
- Research the codebase starting with `README.md`
19-
- Replace every <placeholder> in the `Plan Format` with the requested value
20-
21-
## Codebase Structure
22-
23-
- `README.md` - Project overview and instructions (start here)
24-
- `api/` - FastAPI backend
25-
- `main.py` - App entry point
26-
- `routers/` - API route handlers
27-
- `app/` - React frontend (Vite + TypeScript)
28-
- `src/` - Source code
29-
- `core/` - Shared Python modules
30-
- `config.py` - Configuration
31-
- `database/` - Database utilities, models, and repositories
32-
- `plots/` - Plot specifications and implementations
33-
- `tests/` - Test suites
34-
- `agentic/` - Agentic Layer
35-
- `commands/` - Prompt templates
36-
- `workflows/` - Workflow scripts (`uv run`)
37-
- `specs/` - Generated plans
14+
- Investigate the bug described in the `prompt` — identify the root cause before planning the fix.
15+
- This command produces a **plan only** — do NOT implement the fix here.
16+
- Create the plan at `agentic/specs/{YYMMDD}-{descriptive-name}.md` using today's UTC date (e.g.,
17+
`260501-fix-api-timeout.md`). Run `date -u +%y%m%d` if unsure.
18+
- Research the codebase before writing the plan. For project layout, conventions, and tech stack, see
19+
`agentic/docs/project-guide.md` and read it only if needed.
20+
- Replace every `<placeholder>` in the `Plan Format` with the requested value. Keep it specific and actionable —
21+
vague plans produce vague fixes.
3822

3923
## Plan Format
4024

agentic/commands/chore.md

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,13 @@ prompt: $2
1111
## Instructions
1212

1313
- If the run_id or prompt is not provided, stop and ask the user to provide them.
14-
- Create a plan to complete the chore described in the `prompt`
15-
- The plan should be simple, thorough, and precise
16-
- Create the plan in the `agentic/specs/` directory with filename: `{YYMMDD}-{descriptive-name}.md`
17-
- Use today's date as YYMMDD prefix (e.g., "260207-update-readme.md")
18-
- Research the codebase starting with `README.md`
19-
- Replace every <placeholder> in the `Plan Format` with the requested value
20-
21-
## Codebase Structure
22-
23-
- `README.md` - Project overview and instructions (start here)
24-
- `api/` - FastAPI backend
25-
- `main.py` - App entry point
26-
- `routers/` - API route handlers
27-
- `app/` - React frontend (Vite + TypeScript)
28-
- `src/` - Source code
29-
- `core/` - Shared Python modules
30-
- `config.py` - Configuration
31-
- `database/` - Database utilities, models, and repositories
32-
- `plots/` - Plot specifications and implementations
33-
- `tests/` - Test suites
34-
- `agentic/` - Agentic Layer
35-
- `commands/` - Prompt templates
36-
- `workflows/` - Workflow scripts (`uv run`)
37-
- `specs/` - Generated plans
14+
- Plan the chore described in the `prompt`. This command produces a **plan only** — do NOT execute the chore here.
15+
- Keep the plan simple, thorough, and precise. Avoid over-scoping (no extra modes or speculative steps).
16+
- Create the plan at `agentic/specs/{YYMMDD}-{descriptive-name}.md` using today's UTC date (e.g.,
17+
`260501-update-readme.md`). Run `date -u +%y%m%d` if unsure.
18+
- Research the codebase before writing the plan. For project layout, conventions, and tech stack, see
19+
`agentic/docs/project-guide.md` and read it only if needed.
20+
- Replace every `<placeholder>` in the `Plan Format` with the requested value.
3821

3922
## Plan Format
4023

agentic/commands/classify.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ Analyze the task and classify it:
1717

1818
## Response
1919

20-
Respond with ONLY a JSON object on a single line. No explanation, no markdown, no code fences:
20+
Respond with ONLY a JSON object on a single line. No preamble, no explanation, no markdown, no code fences. The
21+
response will be passed directly to `JSON.parse()`, so any extra text breaks the caller.
22+
23+
Schema (one of `bug`, `feature`, `chore`, `refactor`):
2124

2225
{"type": "bug", "reason": "one sentence explaining why"}

agentic/commands/commit.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,15 @@ task_type: $2
3030

3131
## Run
3232

33-
1. Run `git diff HEAD` to understand what changes have been made
34-
2. Run `git status` to see which files are modified/untracked
35-
3. Stage changes with `git add` — prefer adding specific files over `git add -A`
36-
4. Run `git commit -m "<generated_commit_message>"` to create the commit
33+
Run steps 1 and 2 in parallel; only proceed to staging once you have read the full diff.
34+
35+
1. Run `git diff HEAD` to read every change that will be committed.
36+
2. Run `git status` to confirm the set of modified/untracked files.
37+
3. Stage changes with `git add <specific files>` — never use `git add -A` or `git add .`, which can pull in
38+
`.env`, credentials, or large binaries by accident.
39+
4. Run `git commit -m "<generated_commit_message>"` to create the commit. Do not pass `--no-verify`; if a
40+
pre-commit hook fails, fix the underlying issue and create a new commit (do NOT amend the previous one,
41+
since the failed commit was never written).
3742

3843
## Report
3944

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Conditional Documentation Guide
22

3-
This prompt helps you determine what documentation you should read based on the specific changes you need to make in the codebase. Review the conditions below and read the relevant documentation before proceeding with your task.
3+
> Slash command: `/docs`. Renamed from `context.md` so the project command does not collide with Claude Code's
4+
> built-in `/context` command.
5+
6+
This prompt helps you determine what documentation you should read based on the specific changes you need to make
7+
in the codebase. Review the conditions below and read the relevant documentation before proceeding with your task.
48

59
## Instructions
610

agentic/commands/document.md

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -42,35 +42,21 @@ documentation_screenshots_dir: $3 if provided, otherwise leave it blank
4242
- How to use it (user perspective)
4343
- Any configuration or setup required
4444

45-
### 5. Update Context Documentation
46-
- After creating the documentation file, read `agentic/commands/context.md`
45+
### 5. Update Conditional Documentation Router
46+
- After creating the documentation file, read `agentic/commands/docs.md` (the `/docs` slash command, formerly
47+
`context.md`)
4748
- Add an entry for the new documentation file with appropriate conditions
4849
- The entry should help future developers know when to read this documentation
4950
- Format the entry following the existing pattern in the file
5051

5152
### 6. Final Output
52-
- When you finish writing the documentation and updating context.md, return exclusively the path to the documentation file created and nothing else
53+
- When you finish writing the documentation and updating `agentic/commands/docs.md`, return exclusively the path to
54+
the documentation file created and nothing else
5355

5456
## Codebase Structure
5557

56-
- `README.md` - Project overview (start here)
57-
- `api/` - FastAPI backend
58-
- `main.py` - App entry point
59-
- `routers/` - API route handlers
60-
- `services/` - Business logic
61-
- `app/` - React frontend (Vite + TypeScript)
62-
- `src/` - Source code
63-
- `core/` - Shared Python modules
64-
- `models/` - Pydantic models
65-
- `database/` - Database utilities
66-
- `plots/` - Plot specifications and implementations
67-
- `tests/` - Test suites
68-
- `agentic/` - Agentic Layer
69-
- `commands/` - Prompt templates
70-
- `workflows/` - Workflow scripts (`uv run`)
71-
- `specs/` - Plans (what to do)
72-
- `context/` - Feature docs (what was done)
73-
- `docs/` - Static project documentation
58+
For the full project layout, conventions, and tech stack, see `agentic/docs/project-guide.md`. Read it only if needed
59+
to ground the documentation you generate.
7460

7561
## Documentation Format
7662

@@ -135,7 +121,7 @@ documentation_screenshots_dir: $3 if provided, otherwise leave it blank
135121

136122
## Context Entry Format
137123

138-
After creating the documentation, add this entry to `agentic/commands/context.md`:
124+
After creating the documentation, add this entry to `agentic/commands/docs.md`:
139125

140126
```md
141127
- agentic/context/<your_documentation_file>.md

0 commit comments

Comments
 (0)