一键导入
feature-spec
Define feature requirements (problem, users, scope, acceptance criteria) through guided Q&A and write FEATURE_SPEC.md. Use when starting a new feature.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Define feature requirements (problem, users, scope, acceptance criteria) through guided Q&A and write FEATURE_SPEC.md. Use when starting a new feature.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Delegate code implementation to Codex CLI. Claude decomposes, scopes context, and verifies; Codex implements. Accepts a spec file, text description, or gathers requirements interactively.
Exploratory conversation before /product-spec. Asks one question at a time, runs background research for open-source/off-the-shelf alternatives, and writes DISCOVERY_NOTES.md. Use when the user has an idea but hasn't scoped it yet.
Generate EXECUTION_PLAN.md and scoped AGENTS.md files for a feature. Use after /feature-technical-spec to create the task breakdown.
Define technical approach (architecture, integration points, data model) for a feature through guided Q&A and write FEATURE_TECHNICAL_SPEC.md. Use after /feature-spec.
Orient to project structure and load context. Use at the start of each new session or after context reset to understand the project state.
Generate the greenfield execution plan plus root and scoped AGENTS.md files. Use after /technical-spec to create the phased task breakdown.
| name | feature-spec |
| description | Define feature requirements (problem, users, scope, acceptance criteria) through guided Q&A and write FEATURE_SPEC.md. Use when starting a new feature. |
| argument-hint | <feature-name> |
| allowed-tools | Bash, Read, Write, AskUserQuestion |
Generate a feature specification document for the feature $1.
Copy this checklist and track progress:
Feature Spec Progress:
- [ ] Directory guard
- [ ] Handle arguments (feature name)
- [ ] Create feature directory
- [ ] Existing file guard (prevent overwrite)
- [ ] Run guided Q&A process (from PROMPT.md)
- [ ] Write FEATURE_SPEC.md
- [ ] Capture deferred requirements
- [ ] Cross-model review (if Codex available)
If .toolkit-marker exists in the current working directory → STOP:
"You're in the toolkit repo. Feature skills run from your project directory.
Run: cd ~/Projects/your-project && /feature-spec $1"
Check .claude/toolkit-version.json exists in the current working directory (confirms /setup was run).
If missing → STOP: "Toolkit not installed. Run /setup from the toolkit first."
Check AGENTS.md exists in the current working directory (confirms project root).
If missing → STOP: "Run this from your project root (where AGENTS.md lives)."
$1 = feature name (e.g., analytics, dark-mode)$1 is empty, ask the user for the feature namePROJECT_ROOT = current working directoryFEATURE_DIR = PROJECT_ROOT/features/$1Create features/$1/ if it doesn't exist:
mkdir -p "features/$1"
Before asking any questions, check whether FEATURE_DIR/FEATURE_SPEC.md already exists.
FEATURE_DIR/FEATURE_SPEC.md.bak.YYYYMMDD-HHMMSS, then write the new document to FEATURE_DIR/FEATURE_SPEC.mdFEATURE_DIR/FEATURE_SPEC.md with the new documentRead .claude/skills/feature-spec/PROMPT.md and follow its instructions exactly:
Write the completed specification to FEATURE_DIR/FEATURE_SPEC.md.
IMPORTANT: Capture deferred requirements interactively during the Q&A process, not after.
Write deferred items to PROJECT_ROOT/DEFERRED.md (not the feature directory).
During the Q&A, watch for signals that the user is deferring something:
When you detect a deferral signal, immediately use AskUserQuestion:
Question: "Would you like to save this to your deferred requirements?"
Header: "Defer?"
Options:
- "Yes, capture it" — I'll ask a few quick questions to document it
- "No, skip" — Don't record this
If user selects "Yes, capture it":
Ask these clarifying questions:
What's being deferred? "In one sentence, what's the requirement or feature?" (Pre-fill with your understanding from context)
Why defer it? Options: "Out of scope for this feature" / "Separate feature" / "V2" / "Needs more research" / "Other"
Notes for later? "Any context that will help when revisiting this?" (Optional — user can skip)
After collecting answers, append to PROJECT_ROOT/DEFERRED.md right away.
If file doesn't exist, create it:
# Deferred Requirements
> Captured during specification Q&A. Review when planning future versions.
## From FEATURE_SPEC.md: {FEATURE_NAME} ({date})
| Requirement | Reason | Notes |
|-------------|--------|-------|
| {user's answer} | {selected reason} | {notes or "—"} |
If file exists, add new feature section or append to existing:
## From FEATURE_SPEC.md: {FEATURE_NAME} ({date})
| Requirement | Reason | Notes |
|-------------|--------|-------|
| {user's answer} | {selected reason} | {notes or "—"} |
After capturing (or skipping), continue the spec Q&A where you left off.
After writing FEATURE_SPEC.md, run quality verification:
/verify-spec feature-spec on the generated documentAfter verification, run cross-model review if Codex CLI is available:
codex --version/codex-consult on the generated documentConsultation invocation:
/codex-consult --research "feature requirements, user stories" features/$1/FEATURE_SPEC.md
If Codex finds issues:
If Codex unavailable: Skip silently and proceed to Next Step.
| Situation | Action |
|---|---|
| Feature name argument is empty and user does not provide one | Prompt again with AskUserQuestion; do not proceed without a feature name |
| FEATURE_SPEC.md already exists and user selects "Abort" | Stop immediately, do not write any files, suggest renaming or moving the existing file |
PROMPT.md not found at .claude/skills/feature-spec/PROMPT.md | Stop and report "Skill asset missing — reinstall toolkit or run /setup" |
| DEFERRED.md write fails (permissions or disk) | Output deferred items to terminal, warn user, continue with spec generation |
| Codex CLI invocation fails or times out | Log the error, skip cross-model review, proceed to Next Step |
When complete, inform the user:
FEATURE_SPEC.md created at features/$1/FEATURE_SPEC.md
Deferred Requirements: {count} items captured to DEFERRED.md
Verification: PASSED | PASSED WITH NOTES | NEEDS REVIEW
Cross-Model Review: PASSED | PASSED WITH NOTES | SKIPPED
Next: Run /feature-technical-spec $1