一键导入
plan
Create graph-informed implementation plans before writing code. Use before any non-trivial task. Skip for small changes (1-2 files, <10 lines).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create graph-informed implementation plans before writing code. Use before any non-trivial task. Skip for small changes (1-2 files, <10 lines).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Meta-orchestrator — dispatches to the right skill for the task. Use before any non-trivial work.
Library-agnostic Flutter/Dart code review checklist covering widget best practices, state management patterns (BLoC, Riverpod, Provider, GetX, MobX, Signals), Dart idioms, performance, accessibility, security, and clean architecture.
Structured 6-phase debugging. Build feedback loop first, reproduce deterministically, hypothesize with ranked falsifiable theories, instrument one variable at a time, fix with regression test, cleanup. Use when a bug exists, tests fail unexpectedly, or behavior is wrong and cause is unknown.
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
Database migration best practices for schema changes, data migrations, rollbacks, and zero-downtime deployments across PostgreSQL, MySQL, and common ORMs (Prisma, Drizzle, Kysely, Django, TypeORM, golang-migrate).
Run integration and e2e tests after unit tests pass. Use after /supergraph:fix when unit tests are green.
基于 SOC 职业分类
| name | plan |
| description | Create graph-informed implementation plans before writing code. Use before any non-trivial task. Skip for small changes (1-2 files, <10 lines). |
| mcp | codebase-memory-mcp |
Scan codebase, map blast radius, create machine-readable plan.
Announce: "📐 /supergraph:plan — scanning codebase, creating plan..."
< 10 lines, 1 file, no hub/bridge nodes → skip to /supergraph:tdd.
0. Read CONTEXT.md (if exists):
cat CONTEXT.md 2>/dev/null | head -60
Use domain vocabulary from CONTEXT.md in all plan task descriptions — never use raw file/class names where a domain term exists.
1. Read the codebase (MANDATORY before planning):
2. Ensure graph:
Reuse graph context from /supergraph:scan. If scan not done → run /supergraph:scan first.
Require CBM_PROJECT and healthy index_status. If stale/degraded, call
index_repository with the absolute repository path before analysis.
3. Graph analysis:
Call detect_changes(project=CBM_PROJECT), search_graph for target symbols,
trace_path inbound/outbound/data-flow, and get_architecture for overview,
clusters, boundaries, and hotspots. After get_graph_schema, run named contract
recipes hubs, bridges, test-gaps, and cross-boundary. Derive risk from
impact plus recipe evidence; never invent missing results. Preserve escalation:
more than 20 files stops for discussion; hub/bridge changes require approval;
cross-boundary findings require justification.
3b. Serena symbol analysis (optional — deepens blast radius):
If /supergraph:scan was not run this session, call mcp__serena__initial_instructions() first.
For key symbols in target files:
mcp__serena__find_referencing_symbols(symbol=<key_symbol>)
mcp__serena__find_implementations(symbol=<interface_or_abstract>)
Cross-reference with graph blast radius — add any missed callers to task Blast radius fields.
Optional — for large blast radius (> 10 files) or hub/bridge nodes: persist caller list for future sessions:
mcp__serena__write_memory(title="<plan-slug>-blast-callers", content="[caller list from find_referencing_symbols]")
Skip gracefully if Serena unavailable — log "Serena unavailable, skipping symbol analysis".
4. Discuss approach with user (MANDATORY, use user's language): Before creating tasks, present findings from steps 1-3 to the user:
Ask for approval in the user's language. If user disagrees with approach → revise. If user wants changes → incorporate, then re-present. Do not proceed to step 5 until user approves the approach.
5. Create plan tasks — each task 2-5 min. Use exact machine-readable format:
## Task N: [Short description]
Status: pending
Risk: low|medium|high
Dependencies: none | Task 1, Task 2
Files:
- Create: path/to/new-file.ext
- Modify: path/to/existing-file.ext
- Test: path/to/test-file.ext
Blast radius:
- path/to/affected-file.ext
Acceptance:
- [observable behavior/result]
- [test/assertion that proves completion]
TDD:
- Behavior: [single externally visible behavior]
- Test file: [exact test path]
- Test name: [behavior-focused test name]
- RED command: `$FOCUSED_TEST_CMD`
- Expected RED failure: [missing behavior, not setup/import/syntax error]
- Minimal GREEN change: [smallest implementation idea]
- Refactor candidates: [optional, only after GREEN]
- Mocking: none | [why unavoidable]
Steps:
1. RED: [write exact failing test]
Command: `$TEST_CMD`
Expected: FAIL
2. GREEN: [write minimal implementation]
Command: `$TEST_CMD`
Expected: PASS
3. REFACTOR: [safe cleanup or "none"]
4. VERIFY:
- `$TEST_CMD`
- `$LINT_CMD` (skip if none)
Checkpoint:
- Files: `path/to/test-file.ext path/to/source-file.ext`
- Commit: `type: short description`
Task status values: pending, in_progress, completed, stuck (managed by executor)
6. Validate:
## Task N: heading exactlyStatus: pending starts at column 0, not spaces7. Save plan: docs/supergraph/plans/YYYY-MM-DD-<slug>.md
8. Analysis Review Gate (if /supergraph:analyze was used): If analyze step was completed — verify plan aligns with documented analysis decisions:
## Analysis Decisions
- Approach: [chosen approach from analyze step]
- Alternatives rejected: [from analyze step with reasons]
If analysis was skipped for ambiguous task → WARN user: "No analyze step — proceeding with plan as-is."
9. Environment Context (MANDATORY at plan end):
## Environment Context
- **Language:** [X] v[Y]
- **Test command:** [from .supergraph-env]
- **Linter command:** [from .supergraph-env]
- **Formatter command:** [from .supergraph-env]
- **Build command:** [from .supergraph-env]
- **Branch:** [current]
- **Conventional commit style:** [e.g., "feat: / fix:"]
**Codebase conventions:** [naming, imports, error handling, test structure]
**Graph Context:**
- Blast radius: M files | Hub nodes: [list]
- Bridge nodes: [list] | Communities crossed: [list]
10. Auto-review:
Dispatch supergraph:plan-reviewer subagent. Fix issues. Do not hand off to execute until Approved.
11. User Review Gate (MANDATORY): Present plan summary to user:
Plan: [plan path]
Tasks: N ([list summaries])
Blast radius: M files | Hub nodes affected: [list/none]
Review: Approved (by plan-reviewer)
Ask user for approval in their language: "[yes / modify / reject]" If modify → incorporate feedback, re-run auto-review. If rejected → ask for direction, return to design.
12. Report:
✅ /supergraph:plan complete
- Plan: docs/supergraph/plans/YYYY-MM-DD-<slug>.md
- Tasks: N | Blast radius: M files | Review: Approved
- User: yes | modify | rejected
- Next: /supergraph:execute plan <slug> (multi-task) or /supergraph:tdd (single-task)
## Task N: for executor parsing