diff --git a/agentic/commands/prime-deep.md b/agentic/commands/prime-deep.md new file mode 100644 index 0000000000..56740bbfe3 --- /dev/null +++ b/agentic/commands/prime-deep.md @@ -0,0 +1,48 @@ +# Prime (Deep) + +> Full project orientation. Use when starting architecture work, refactors, or when unsure about the codebase. For quick starts, use `/prime` instead. + +## Run + +```bash +# Current state: branch, uncommitted changes, stashes +git status --short --branch + +# Recent activity: what's been worked on +git log --oneline --graph -15 + +# Open PRs: what's in flight +gh pr list --limit 10 2>/dev/null || echo "(gh CLI not available)" +``` + +## Read + +@agentic/docs/project-guide.md +@agentic/commands/context.md +@docs/concepts/vision.md +@pyproject.toml + +## Serena + +- Run `mcp__serena__check_onboarding_performed` +- Run `mcp__serena__list_memories` and read relevant ones + +### Serena MCP tools (prefer over brute-force scanning) + +Use Serena's symbol-aware tools for code navigation — they provide semantic understanding that grep/glob cannot. +The canonical, MCP-registered prefix is `mcp__serena__*` (matches `.claude/settings.json`). + +- `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. +- `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. +- `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. +- `mcp__serena__find_declaration` — jump to where a symbol is defined. +- `mcp__serena__find_implementations` — find implementations of an interface/abstract class. +- `mcp__serena__type_hierarchy` — understand class inheritance chains. + +### Editing via Serena + +For structural edits, prefer Serena's symbol-aware tools over raw text replacement: + +- `mcp__serena__replace_symbol_body` — replace an entire function/class body +- `mcp__serena__insert_after_symbol` / `mcp__serena__insert_before_symbol` — add code relative to a symbol +- `mcp__serena__search_for_pattern` — regex search across the codebase (fast, flexible) diff --git a/agentic/commands/prime.md b/agentic/commands/prime.md index 31ce5fed9e..0596b32026 100644 --- a/agentic/commands/prime.md +++ b/agentic/commands/prime.md @@ -1,49 +1,56 @@ # Prime -> Execute the following sections to understand the codebase then summarize your understanding. +> Lightweight orientation for everyday work. For deep architecture context, use `/prime-deep`. CLAUDE.md is auto-loaded — critical rules are already in context. ## Run ```bash -# Current state: branch, uncommitted changes, stashes git status --short --branch +git log --oneline -5 +gh pr list --limit 5 2>/dev/null || echo "(gh CLI not available)" +``` -# Recent activity: what's been worked on -git log --oneline --graph -15 +## Serena (activate + use) -# Open PRs: what's in flight -gh pr list --limit 10 2>/dev/null || echo "(gh CLI not available)" -``` +- Activate the project with `mcp__serena__activate_project` (param: `anyplot`) if not already active. +- Run `mcp__serena__check_onboarding_performed` once per session. +- Prefer Serena's symbol-aware tools over grep/glob for code navigation and edits: + - `mcp__serena__get_symbols_overview` / `mcp__serena__find_symbol` — semantic lookup + - `mcp__serena__find_referencing_symbols` — impact analysis before edits + - `mcp__serena__replace_symbol_body` / `mcp__serena__insert_after_symbol` — structural edits +- See `/prime-deep` for the full tool catalog. -## Read +## What this project is -@agentic/docs/project-guide.md -@agentic/commands/docs.md -@docs/concepts/vision.md -@pyproject.toml +**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. -## Serena +## Where things live -- Run `mcp__serena__check_onboarding_performed` -- Run `mcp__serena__list_memories` and read relevant ones +- `plots/{spec-id}/` — spec + per-library metadata + implementations (one dir per plot) +- `core/` — shared business logic (DB, repositories, config) +- `api/` — FastAPI backend +- `app/` — React frontend (Vite + TS + MUI) +- `agentic/` — AI workflow layer (commands in `agentic/commands/`, docs in `agentic/docs/`) +- `prompts/` — AI prompts for generation/review/tagging +- `automation/` — CI/CD helper scripts +- `.github/workflows/` — GitHub Actions pipelines -### Serena MCP tools (prefer over brute-force scanning) +Stack: Python 3.13+ (uv), PostgreSQL, GCP (Cloud Run + Cloud SQL + GCS). -Use Serena's symbol-aware tools for code navigation — they provide semantic understanding that grep/glob cannot. -The canonical, MCP-registered prefix is `mcp__serena__*` (matches `.claude/settings.json`). Older repo docs may -still mention `jet_brains_*` aliases — treat them as the same tools and prefer the `mcp__serena__*` form below. +## GitHub pipeline (don't bypass it) -- `mcp__serena__get_symbols_overview` — top-level symbols in a file (classes, functions, variables). Use `depth: 1` - to also see methods of classes. Start here before diving deeper. -- `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 signatures. -- `mcp__serena__find_referencing_symbols` — find all usages of a symbol (who calls this function? who imports this - class?). Essential for understanding the impact of changes. +**New spec:** +1. Create issue (descriptive title, no spec-id) + add `spec-request` label +2. `spec-create.yml` runs → opens PR +3. Add `approved` label to the **issue** (not PR) → auto-merges → `spec-ready` -### Editing via Serena +**Generate implementations:** +1. `gh workflow run bulk-generate.yml -f specification_id= -f library=all` +2. Pipeline: `impl-generate` → `impl-review` → (`impl-repair` if needed) → `impl-merge` +3. **Never manually merge impl PRs** — `impl-merge.yml` handles metadata + GCS promotion -For structural edits, prefer Serena's symbol-aware tools over raw text replacement: +## Need more? -- `mcp__serena__replace_symbol_body` — replace an entire function/class body -- `mcp__serena__insert_after_symbol` / `mcp__serena__insert_before_symbol` — add code relative to a symbol -- `mcp__serena__search_for_pattern` — regex search across the codebase (fast, flexible) +- `/prime-deep` — full architecture, metadata schemas, all workflows, deployment +- `agentic/docs/project-guide.md` — comprehensive reference +- `docs/` — contributing, workflows, API, DB schema