一键导入
plan
Produce a detailed implementation plan for a feature. MUST be used before implementing any non-trivial change. Outputs a structured plan — does NOT write code.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Produce a detailed implementation plan for a feature. MUST be used before implementing any non-trivial change. Outputs a structured plan — does NOT write code.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Add a complete REST endpoint from command to controller route. Use when building new API endpoints.
Summarize the API interface changes made during THIS session for the frontend, then optionally spawn an agent to implement them in the frontend repo. Use after changing endpoints, request/response DTOs, or auth.
One-shot guided session — prunes unused code, scaffolds new entities/endpoints, updates project identity config, and replaces the init migration for a specific project.
Compress natural language memory files (CLAUDE.md, todos, preferences) into caveman format to save input tokens. Preserves all technical substance, code, URLs, and structure. Compressed version overwrites the original file. Human-readable backup saved as FILE.original.md. Trigger: /caveman-compress FILEPATH or "compress memory file"
Implement a change with a pipeline scaled to its complexity. Single entry point for all code changes — auto-detects effort or accepts small|mid|tuff override.
Run a Linear task end-to-end — creates an isolated tmux session + worktree, starts a Claude agent to implement it, opens a PR, and watches for review feedback automatically.
| name | plan |
| description | Produce a detailed implementation plan for a feature. MUST be used before implementing any non-trivial change. Outputs a structured plan — does NOT write code. |
| argument-hint | <feature-description> |
Produce a complete, reviewable implementation plan. No code is written.
$0 -- Feature description (e.g., "add invoice domain with PDF generation and email delivery")Before doing ANY research, identify what you don't know. Ask the user about:
Ask at least 3 clarifying questions. Wait for answers before proceeding.
After questions are answered, explore the codebase:
What entities exist that relate to this feature?
!find backend/domain/entities -name "*.py" -not -name "__init__.py" -not -path "*base*" -not -path "*__pycache__*" 2>/dev/null | sort
What handlers exist in the target domain?
!find backend/app/rest/v1/handlers -mindepth 1 -name "*.py" -not -name "__init__.py" -not -path "*base*" -not -path "*__pycache__*" 2>/dev/null | sort
What ports exist?
!find backend/app/shared/ports -name "*.py" -not -name "__init__.py" -not -path "*__pycache__*" 2>/dev/null | sort
What events exist?
!find backend/app/shared/events -name "*.py" -not -name "__init__.py" -not -name "base.py" -not -path "*__pycache__*" 2>/dev/null | sort
Read the relevant existing files to understand current patterns and what can be reused.
Output a structured plan in this exact format:
# Plan: {Feature Name}
## Summary
{1-2 sentences describing the feature}
## Questions Resolved
- Q: {question} -> A: {answer from user}
- ...
## Components (in implementation order)
### 1. Entity: {EntityName}
- File: backend/domain/entities/{name}.py
- Mixins: WithUUIDID, WithTime, ...
- Columns:
- {field}: Mapped[{type}] ({constraints})
- ...
- Relationships: {description}
- Migration message: "{description}"
### 2. Repository: {Entity}Repo
- Protocol: backend/domain/repos/{name}.py
- Impl: backend/infra/database/psql/repos/{name}.py
- Base: CRUDSupported[{Entity}]
- Custom methods:
- get_by_{field}({field}: {type}) -> Option[{Entity}]
- ...
- Gateway property name: {name}
### 3. Port: {PortName} (if needed)
- Protocol: backend/app/shared/ports/{category}/{name}.py
- Methods:
- {method}({params}) -> {return_type}
- Adapter: backend/infra/external/adapters/{name}.py
- Impl class: Impl{Detail}{PortName}
### 4. Event: {EventName} (if needed)
- Definition: backend/app/shared/events/v1/{name}.py
- name: "{snake_case_name}"
- Payload: {field}: {type}, ...
- Triggered by: {which handler}
- Event handler: backend/app/events/v1/handlers/{domain}/{name}.py
- Side effect: {what it does}
### 5. Service: {Name}Service (if needed)
- File: backend/app/rest/v1/services/{name}.py
- Methods:
- {method}({params}) -> {return_type}
- Dependencies: {list}
### 6. Handler: {Action}{Entity}Handler
- File: backend/app/rest/v1/handlers/{domain}/{action}.py
- Command fields: {field}: {type}, ...
- Type: HandlerType.READ | WRITE
- Response DTO: dtos.{Entity} | None
- Dependencies: db, {service}, {port}, ...
- Logic:
1. {step}
2. {step}
3. ...
- Error cases:
- {condition} -> {ErrorType}(message="{message}")
### 7. DTO: {Entity} (if new)
- File: backend/app/rest/v1/dtos/{domain}.py
- Fields: {field}: {type}, ...
### 8. Controller method
- File: backend/entry/rest/v1/{domain}.py
- Method: {http_method} /{path}
- Auth: required | exclude_from_auth=True
- Path params: {param}: {type} (converted from str)
- Body: {CommandType} | {EntryDTO}
### 9. DI Wiring (if needed)
- File: backend/entry/rest/main/ioc.py
- New providers or bindings needed
## Files Created/Modified (checklist)
- [ ] backend/domain/entities/{name}.py (CREATE)
- [ ] backend/domain/entities/__init__.py (MODIFY — add export)
- [ ] backend/domain/repos/{name}.py (CREATE)
- [ ] backend/domain/repos/gateway.py (MODIFY — add property)
- [ ] ...
## Verification
- [ ] `just check` passes
- [ ] New endpoints appear in OpenAPI schema
- [ ] {specific test scenario}
Present the plan and explicitly ask: "Does this plan look correct? Any changes before I implement?"
Do NOT proceed to implementation until the user approves.