Skip to content

Commit 05ca8b8

Browse files
MarkusNeusingerclaudeCopilot
authored
chore(commands): split /prime into lightweight and deep variants (#5651)
## Summary Reduce per-session token overhead from `/prime`. The previous version pulled in `project-guide.md` (4,030 words), `vision.md`, `pyproject.toml`, and `context.md` on every invocation — ~7,500 tokens before any work started. - **`/prime`** (new, ~330 tokens): self-contained — project description, top-level dirs, GitHub pipeline summary, git status. Enough context to start everyday work without loading the full architecture tour. - **`/prime-deep`** (new): identical to the previous `/prime` — full architecture, vision, all referenced docs. Use when starting refactors or when deep context is genuinely needed. `CLAUDE.md` is auto-loaded by the harness, so neither variant re-includes it. ## Token impact | Command | Before | After | |---|---|---| | `/prime` | ~7,500 tokens | ~330 tokens | | `/prime-deep` | (didn't exist) | ~7,500 tokens (opt-in) | ## Test plan - [ ] Run `/prime` in a fresh session — confirm git status runs and project basics are clear - [ ] Run `/prime-deep` — confirm full project guide loads as before - [ ] Verify both commands appear in the slash-command list --- _Generated by [Claude Code](https://claude.ai/code/session_01SzDY1uajNYDWvjDt1aceXU)_ --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent 47c210f commit 05ca8b8

2 files changed

Lines changed: 85 additions & 30 deletions

File tree

agentic/commands/prime-deep.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Prime (Deep)
2+
3+
> Full project orientation. Use when starting architecture work, refactors, or when unsure about the codebase. For quick starts, use `/prime` instead.
4+
5+
## Run
6+
7+
```bash
8+
# Current state: branch, uncommitted changes, stashes
9+
git status --short --branch
10+
11+
# Recent activity: what's been worked on
12+
git log --oneline --graph -15
13+
14+
# Open PRs: what's in flight
15+
gh pr list --limit 10 2>/dev/null || echo "(gh CLI not available)"
16+
```
17+
18+
## Read
19+
20+
@agentic/docs/project-guide.md
21+
@agentic/commands/context.md
22+
@docs/concepts/vision.md
23+
@pyproject.toml
24+
25+
## Serena
26+
27+
- Run `mcp__serena__check_onboarding_performed`
28+
- Run `mcp__serena__list_memories` and read relevant ones
29+
30+
### Serena MCP tools (prefer over brute-force scanning)
31+
32+
Use Serena's symbol-aware tools for code navigation — they provide semantic understanding that grep/glob cannot.
33+
The canonical, MCP-registered prefix is `mcp__serena__*` (matches `.claude/settings.json`).
34+
35+
- `mcp__serena__get_symbols_overview` — get top-level symbols in a file (classes, functions, variables). Use with `depth: 1` to also see methods of classes. Start here to understand a file before diving deeper.
36+
- `mcp__serena__find_symbol` — search for a symbol by name across the codebase. Supports name-path patterns like `MyClass/my_method`. Use `include_body: true` to read source code, `include_info: true` for docstrings/signatures.
37+
- `mcp__serena__find_referencing_symbols` — find all usages of a symbol (who calls this function? who imports this class?). Essential for understanding impact of changes.
38+
- `mcp__serena__find_declaration` — jump to where a symbol is defined.
39+
- `mcp__serena__find_implementations` — find implementations of an interface/abstract class.
40+
- `mcp__serena__type_hierarchy` — understand class inheritance chains.
41+
42+
### Editing via Serena
43+
44+
For structural edits, prefer Serena's symbol-aware tools over raw text replacement:
45+
46+
- `mcp__serena__replace_symbol_body` — replace an entire function/class body
47+
- `mcp__serena__insert_after_symbol` / `mcp__serena__insert_before_symbol` — add code relative to a symbol
48+
- `mcp__serena__search_for_pattern` — regex search across the codebase (fast, flexible)

agentic/commands/prime.md

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,56 @@
11
# Prime
22

3-
> Execute the following sections to understand the codebase then summarize your understanding.
3+
> Lightweight orientation for everyday work. For deep architecture context, use `/prime-deep`. CLAUDE.md is auto-loaded — critical rules are already in context.
44
55
## Run
66

77
```bash
8-
# Current state: branch, uncommitted changes, stashes
98
git status --short --branch
9+
git log --oneline -5
10+
gh pr list --limit 5 2>/dev/null || echo "(gh CLI not available)"
11+
```
1012

11-
# Recent activity: what's been worked on
12-
git log --oneline --graph -15
13+
## Serena (activate + use)
1314

14-
# Open PRs: what's in flight
15-
gh pr list --limit 10 2>/dev/null || echo "(gh CLI not available)"
16-
```
15+
- Activate the project with `mcp__serena__activate_project` (param: `anyplot`) if not already active.
16+
- Run `mcp__serena__check_onboarding_performed` once per session.
17+
- Prefer Serena's symbol-aware tools over grep/glob for code navigation and edits:
18+
- `mcp__serena__get_symbols_overview` / `mcp__serena__find_symbol` — semantic lookup
19+
- `mcp__serena__find_referencing_symbols` — impact analysis before edits
20+
- `mcp__serena__replace_symbol_body` / `mcp__serena__insert_after_symbol` — structural edits
21+
- See `/prime-deep` for the full tool catalog.
1722

18-
## Read
23+
## What this project is
1924

20-
@agentic/docs/project-guide.md
21-
@agentic/commands/docs.md
22-
@docs/concepts/vision.md
23-
@pyproject.toml
25+
**anyplot**: AI-powered platform that generates Python data-viz examples for 9 libraries (matplotlib, seaborn, plotly, bokeh, altair, plotnine, pygal, highcharts, lets-plot). Spec-driven: every plot starts as a library-agnostic Markdown spec, then AI generates implementations per library.
2426

25-
## Serena
27+
## Where things live
2628

27-
- Run `mcp__serena__check_onboarding_performed`
28-
- Run `mcp__serena__list_memories` and read relevant ones
29+
- `plots/{spec-id}/` — spec + per-library metadata + implementations (one dir per plot)
30+
- `core/` — shared business logic (DB, repositories, config)
31+
- `api/` — FastAPI backend
32+
- `app/` — React frontend (Vite + TS + MUI)
33+
- `agentic/` — AI workflow layer (commands in `agentic/commands/`, docs in `agentic/docs/`)
34+
- `prompts/` — AI prompts for generation/review/tagging
35+
- `automation/` — CI/CD helper scripts
36+
- `.github/workflows/` — GitHub Actions pipelines
2937

30-
### Serena MCP tools (prefer over brute-force scanning)
38+
Stack: Python 3.13+ (uv), PostgreSQL, GCP (Cloud Run + Cloud SQL + GCS).
3139

32-
Use Serena's symbol-aware tools for code navigation — they provide semantic understanding that grep/glob cannot.
33-
The canonical, MCP-registered prefix is `mcp__serena__*` (matches `.claude/settings.json`). Older repo docs may
34-
still mention `jet_brains_*` aliases — treat them as the same tools and prefer the `mcp__serena__*` form below.
40+
## GitHub pipeline (don't bypass it)
3541

36-
- `mcp__serena__get_symbols_overview` — top-level symbols in a file (classes, functions, variables). Use `depth: 1`
37-
to also see methods of classes. Start here before diving deeper.
38-
- `mcp__serena__find_symbol` — search for a symbol by name across the codebase. Supports name-path patterns like
39-
`MyClass/my_method`. Use `include_body: true` to read source code, `include_info: true` for signatures.
40-
- `mcp__serena__find_referencing_symbols` — find all usages of a symbol (who calls this function? who imports this
41-
class?). Essential for understanding the impact of changes.
42+
**New spec:**
43+
1. Create issue (descriptive title, no spec-id) + add `spec-request` label
44+
2. `spec-create.yml` runs → opens PR
45+
3. Add `approved` label to the **issue** (not PR) → auto-merges → `spec-ready`
4246

43-
### Editing via Serena
47+
**Generate implementations:**
48+
1. `gh workflow run bulk-generate.yml -f specification_id=<id> -f library=all`
49+
2. Pipeline: `impl-generate``impl-review` → (`impl-repair` if needed) → `impl-merge`
50+
3. **Never manually merge impl PRs**`impl-merge.yml` handles metadata + GCS promotion
4451

45-
For structural edits, prefer Serena's symbol-aware tools over raw text replacement:
52+
## Need more?
4653

47-
- `mcp__serena__replace_symbol_body`replace an entire function/class body
48-
- `mcp__serena__insert_after_symbol` / `mcp__serena__insert_before_symbol`add code relative to a symbol
49-
- `mcp__serena__search_for_pattern`regex search across the codebase (fast, flexible)
54+
- `/prime-deep`full architecture, metadata schemas, all workflows, deployment
55+
- `agentic/docs/project-guide.md`comprehensive reference
56+
- `docs/`contributing, workflows, API, DB schema

0 commit comments

Comments
 (0)