cc-dev-template 0.1.81 → 0.1.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/install.js +10 -1
- package/package.json +1 -1
- package/src/agents/objective-researcher.md +72 -0
- package/src/agents/question-generator.md +52 -0
- package/src/scripts/restrict-researcher.sh +49 -0
- package/src/scripts/restrict-to-spec-dir.sh +43 -0
- package/src/skills/ignore-config/SKILL.md +14 -0
- package/src/skills/ignore-config/references/step-1-analyze.md +32 -0
- package/src/skills/ignore-config/references/step-2-create.md +20 -0
- package/src/skills/ignore-config/references/step-3-reflect.md +18 -0
- package/src/skills/ship/SKILL.md +46 -0
- package/src/skills/ship/references/step-1-intent.md +50 -0
- package/src/skills/ship/references/step-2-questions.md +42 -0
- package/src/skills/ship/references/step-3-research.md +44 -0
- package/src/skills/ship/references/step-4-design.md +70 -0
- package/src/skills/ship/references/step-5-spec.md +86 -0
- package/src/skills/ship/references/step-6-tasks.md +83 -0
- package/src/skills/ship/references/step-7-implement.md +61 -0
- package/src/skills/ship/references/step-8-reflect.md +21 -0
- package/src/skills/execute-spec/SKILL.md +0 -40
- package/src/skills/execute-spec/references/phase-1-hydrate.md +0 -74
- package/src/skills/execute-spec/references/phase-2-build.md +0 -65
- package/src/skills/execute-spec/references/phase-3-validate.md +0 -73
- package/src/skills/execute-spec/references/phase-4-triage.md +0 -79
- package/src/skills/execute-spec/references/phase-5-reflect.md +0 -32
- package/src/skills/research/SKILL.md +0 -14
- package/src/skills/research/references/step-1-check-existing.md +0 -25
- package/src/skills/research/references/step-2-conduct-research.md +0 -65
- package/src/skills/research/references/step-3-reflect.md +0 -29
- package/src/skills/spec-interview/SKILL.md +0 -17
- package/src/skills/spec-interview/references/critic-prompt.md +0 -140
- package/src/skills/spec-interview/references/pragmatist-prompt.md +0 -76
- package/src/skills/spec-interview/references/researcher-prompt.md +0 -46
- package/src/skills/spec-interview/references/step-1-opening.md +0 -78
- package/src/skills/spec-interview/references/step-2-ideation.md +0 -73
- package/src/skills/spec-interview/references/step-3-ui-ux.md +0 -83
- package/src/skills/spec-interview/references/step-4-deep-dive.md +0 -137
- package/src/skills/spec-interview/references/step-5-research-needs.md +0 -53
- package/src/skills/spec-interview/references/step-6-verification.md +0 -89
- package/src/skills/spec-interview/references/step-7-finalize.md +0 -60
- package/src/skills/spec-interview/references/step-8-reflect.md +0 -32
- package/src/skills/spec-review/SKILL.md +0 -91
- package/src/skills/spec-sanity-check/SKILL.md +0 -82
- package/src/skills/spec-to-tasks/SKILL.md +0 -24
- package/src/skills/spec-to-tasks/references/step-1-identify-spec.md +0 -39
- package/src/skills/spec-to-tasks/references/step-2-explore.md +0 -43
- package/src/skills/spec-to-tasks/references/step-3-generate.md +0 -67
- package/src/skills/spec-to-tasks/references/step-4-review.md +0 -90
- package/src/skills/spec-to-tasks/references/step-5-reflect.md +0 -22
- package/src/skills/spec-to-tasks/templates/task.md +0 -30
- package/src/skills/task-review/SKILL.md +0 -18
- package/src/skills/task-review/references/checklist.md +0 -153
package/bin/install.js
CHANGED
|
@@ -280,7 +280,16 @@ console.log('\nCleanup:');
|
|
|
280
280
|
let cleanupPerformed = false;
|
|
281
281
|
|
|
282
282
|
// Remove deprecated skills
|
|
283
|
-
const deprecatedSkills = [
|
|
283
|
+
const deprecatedSkills = [
|
|
284
|
+
'youtube-to-notes',
|
|
285
|
+
'spec-interview',
|
|
286
|
+
'spec-to-tasks',
|
|
287
|
+
'execute-spec',
|
|
288
|
+
'research',
|
|
289
|
+
'spec-review',
|
|
290
|
+
'spec-sanity-check',
|
|
291
|
+
'task-review',
|
|
292
|
+
];
|
|
284
293
|
deprecatedSkills.forEach(skill => {
|
|
285
294
|
const skillPath = path.join(CLAUDE_DIR, 'skills', skill);
|
|
286
295
|
if (fs.existsSync(skillPath)) {
|
package/package.json
CHANGED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: objective-researcher
|
|
3
|
+
description: Answers codebase questions objectively without knowing the feature being built. Produces factual research documentation.
|
|
4
|
+
permissionMode: bypassPermissions
|
|
5
|
+
maxTurns: 30
|
|
6
|
+
model: sonnet
|
|
7
|
+
hooks:
|
|
8
|
+
PreToolUse:
|
|
9
|
+
- matcher: "Read"
|
|
10
|
+
hooks:
|
|
11
|
+
- type: command
|
|
12
|
+
command: "$HOME/.claude/scripts/restrict-researcher.sh"
|
|
13
|
+
- matcher: "Write"
|
|
14
|
+
hooks:
|
|
15
|
+
- type: command
|
|
16
|
+
command: "$HOME/.claude/scripts/restrict-researcher.sh"
|
|
17
|
+
- matcher: "Edit"
|
|
18
|
+
hooks:
|
|
19
|
+
- type: command
|
|
20
|
+
command: "$HOME/.claude/scripts/restrict-researcher.sh"
|
|
21
|
+
- matcher: "Grep"
|
|
22
|
+
hooks:
|
|
23
|
+
- type: command
|
|
24
|
+
command: "$HOME/.claude/scripts/restrict-researcher.sh"
|
|
25
|
+
- matcher: "Glob"
|
|
26
|
+
hooks:
|
|
27
|
+
- type: command
|
|
28
|
+
command: "$HOME/.claude/scripts/restrict-researcher.sh"
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
You are an objective codebase researcher. You receive questions about a codebase and answer them by exploring the source code.
|
|
32
|
+
|
|
33
|
+
You do NOT know what feature is being built. You only have questions. Answer them factually by reading source code.
|
|
34
|
+
|
|
35
|
+
- Report what EXISTS, not what SHOULD exist
|
|
36
|
+
- Do not suggest implementations or improvements
|
|
37
|
+
- Do not speculate about what someone might want to build
|
|
38
|
+
- If you find multiple patterns for the same thing, report ALL of them with locations
|
|
39
|
+
- If a question cannot be answered from the codebase, say so explicitly
|
|
40
|
+
- Explore source code only — not documentation, READMEs, or markdown files in docs/
|
|
41
|
+
|
|
42
|
+
## Process
|
|
43
|
+
|
|
44
|
+
1. Read the questions file at the path provided in your prompt
|
|
45
|
+
2. For each question, explore the codebase using Grep, Glob, and Read
|
|
46
|
+
3. Write findings to the output path provided
|
|
47
|
+
|
|
48
|
+
## Output Format
|
|
49
|
+
|
|
50
|
+
For each question in the questions file:
|
|
51
|
+
|
|
52
|
+
```markdown
|
|
53
|
+
## Q: {Original question}
|
|
54
|
+
|
|
55
|
+
**Finding**: {Your answer with specific details}
|
|
56
|
+
|
|
57
|
+
**Evidence**:
|
|
58
|
+
- `path/to/file.ts:42` — {what this file shows}
|
|
59
|
+
- `path/to/other.ts:108` — {what this code does}
|
|
60
|
+
|
|
61
|
+
**Confidence**: high | medium | low
|
|
62
|
+
|
|
63
|
+
**Notes**: {Any ambiguities, multiple patterns found, or related observations}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
After answering all questions, add a final section:
|
|
67
|
+
|
|
68
|
+
```markdown
|
|
69
|
+
## Additional Observations
|
|
70
|
+
|
|
71
|
+
{Anything noteworthy you discovered while researching that wasn't directly asked about but seems relevant to understanding this area of the codebase}
|
|
72
|
+
```
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: question-generator
|
|
3
|
+
description: Generates research questions from a feature intent document. Cannot explore the codebase — produces questions only.
|
|
4
|
+
tools: Read, Write
|
|
5
|
+
permissionMode: bypassPermissions
|
|
6
|
+
maxTurns: 5
|
|
7
|
+
model: sonnet
|
|
8
|
+
hooks:
|
|
9
|
+
PreToolUse:
|
|
10
|
+
- matcher: "Read"
|
|
11
|
+
hooks:
|
|
12
|
+
- type: command
|
|
13
|
+
command: "$HOME/.claude/scripts/restrict-to-spec-dir.sh"
|
|
14
|
+
- matcher: "Write"
|
|
15
|
+
hooks:
|
|
16
|
+
- type: command
|
|
17
|
+
command: "$HOME/.claude/scripts/restrict-to-spec-dir.sh"
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
You are a question generator. You read a feature intent document and produce research questions that a senior engineer would need answered about the codebase before implementing this feature.
|
|
21
|
+
|
|
22
|
+
You generate questions only. You cannot explore the codebase, suggest implementations, write code, or speculate about how the codebase works.
|
|
23
|
+
|
|
24
|
+
## Process
|
|
25
|
+
|
|
26
|
+
1. Read the intent document at the path provided in your prompt
|
|
27
|
+
2. Think deeply about what you'd need to know to actually build this — not just what the system looks like, but how you'd hook into it
|
|
28
|
+
3. Write organized, specific questions to the output path provided
|
|
29
|
+
|
|
30
|
+
## Thinking Lenses
|
|
31
|
+
|
|
32
|
+
Go beyond "what exists" questions. Apply these lenses:
|
|
33
|
+
|
|
34
|
+
**Integration seams** — Where would this feature plug into the existing system? What hooks, extension points, callbacks, event systems, or middleware would you need? How does the system currently propagate changes, and can you intercept or extend that flow?
|
|
35
|
+
|
|
36
|
+
**Identity and addressing** — How are the entities this feature touches identified, referenced, and addressed? What are their keys, IDs, or paths? What happens to identity when entities are created, split, merged, moved, or deleted?
|
|
37
|
+
|
|
38
|
+
**Implicit contracts** — What assumptions does the existing code likely make that this feature might violate? What invariants exist around data shape, ordering, uniqueness, or lifecycle? What would break if two users did the same thing simultaneously?
|
|
39
|
+
|
|
40
|
+
**Data flow and mutation** — How does data currently flow from user action → state change → persistence → UI update? Can you inject operations into that flow, or do you have to replace it? Is state management pull-based or push-based?
|
|
41
|
+
|
|
42
|
+
**Failure and recovery** — What happens when this feature partially fails? What are the rollback semantics? How does the system currently handle the degraded versions of what this feature introduces?
|
|
43
|
+
|
|
44
|
+
## Output Format
|
|
45
|
+
|
|
46
|
+
Write a markdown file with questions organized by category. Derive categories from the feature — they should reflect the actual problem domains, not generic buckets.
|
|
47
|
+
|
|
48
|
+
Each question must be:
|
|
49
|
+
|
|
50
|
+
- **Specific**: "How does the auth module handle session tokens?" not "How does auth work?"
|
|
51
|
+
- **Codebase-answerable**: Answerable by reading project files, not by asking the user
|
|
52
|
+
- **Deep**: Prioritize "how would I hook into X" over "what does X look like"
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Restricts objective-researcher from reading docs/intent or any documentation.
|
|
3
|
+
# The researcher must answer questions by exploring CODE, not documentation.
|
|
4
|
+
# It can only read questions.md (input) and write research.md (output) in docs/specs/.
|
|
5
|
+
# Receives JSON on stdin with tool_name and tool_input.
|
|
6
|
+
|
|
7
|
+
input=$(cat)
|
|
8
|
+
tool_name=$(echo "$input" | jq -r '.tool_name // empty')
|
|
9
|
+
file_path=$(echo "$input" | jq -r '.tool_input.file_path // empty')
|
|
10
|
+
search_path=$(echo "$input" | jq -r '.tool_input.path // empty')
|
|
11
|
+
|
|
12
|
+
# Write/Edit: only allow research.md in docs/specs/
|
|
13
|
+
if [[ "$tool_name" == "Write" || "$tool_name" == "Edit" ]]; then
|
|
14
|
+
if [[ "$file_path" == */docs/specs/*/research.md ]]; then
|
|
15
|
+
exit 0
|
|
16
|
+
fi
|
|
17
|
+
cat << 'EOF'
|
|
18
|
+
{"permissionDecision":"deny","message":"Write access restricted to research.md only."}
|
|
19
|
+
EOF
|
|
20
|
+
exit 0
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
# Read: allow questions.md, block everything else in docs/
|
|
24
|
+
if [[ "$tool_name" == "Read" ]]; then
|
|
25
|
+
if [[ "$file_path" == */docs/specs/*/questions.md ]]; then
|
|
26
|
+
exit 0
|
|
27
|
+
fi
|
|
28
|
+
if [[ "$file_path" == */docs/* ]]; then
|
|
29
|
+
cat << 'EOF'
|
|
30
|
+
{"permissionDecision":"deny","message":"Cannot read documentation. Research the codebase source code only — not docs, READMEs, or intent files."}
|
|
31
|
+
EOF
|
|
32
|
+
exit 0
|
|
33
|
+
fi
|
|
34
|
+
exit 0
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
# Grep/Glob: block if searching inside docs/
|
|
38
|
+
if [[ "$tool_name" == "Grep" || "$tool_name" == "Glob" ]]; then
|
|
39
|
+
if [[ "$search_path" == */docs/* || "$search_path" == */docs ]]; then
|
|
40
|
+
cat << 'EOF'
|
|
41
|
+
{"permissionDecision":"deny","message":"Cannot search documentation. Research the codebase source code only."}
|
|
42
|
+
EOF
|
|
43
|
+
exit 0
|
|
44
|
+
fi
|
|
45
|
+
exit 0
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
# Allow everything else
|
|
49
|
+
exit 0
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Restricts question-generator to only reading intent.md and writing questions.md.
|
|
3
|
+
# Receives JSON on stdin with tool_name and tool_input.
|
|
4
|
+
|
|
5
|
+
input=$(cat)
|
|
6
|
+
tool_name=$(echo "$input" | jq -r '.tool_name // empty')
|
|
7
|
+
file_path=$(echo "$input" | jq -r '.tool_input.file_path // empty')
|
|
8
|
+
|
|
9
|
+
# If no file_path in the tool input, deny (shouldn't happen for Read/Write)
|
|
10
|
+
if [ -z "$file_path" ]; then
|
|
11
|
+
cat << 'EOF'
|
|
12
|
+
{"permissionDecision":"deny","message":"No file path provided."}
|
|
13
|
+
EOF
|
|
14
|
+
exit 0
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
# Read: only allow intent.md within docs/specs/
|
|
18
|
+
if [[ "$tool_name" == "Read" ]]; then
|
|
19
|
+
if [[ "$file_path" == */docs/specs/*/intent.md ]]; then
|
|
20
|
+
exit 0
|
|
21
|
+
fi
|
|
22
|
+
cat << 'EOF'
|
|
23
|
+
{"permissionDecision":"deny","message":"Read access restricted to intent.md only. You generate questions from the intent — do not explore the codebase."}
|
|
24
|
+
EOF
|
|
25
|
+
exit 0
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
# Write: only allow questions.md within docs/specs/
|
|
29
|
+
if [[ "$tool_name" == "Write" ]]; then
|
|
30
|
+
if [[ "$file_path" == */docs/specs/*/questions.md ]]; then
|
|
31
|
+
exit 0
|
|
32
|
+
fi
|
|
33
|
+
cat << 'EOF'
|
|
34
|
+
{"permissionDecision":"deny","message":"Write access restricted to questions.md only."}
|
|
35
|
+
EOF
|
|
36
|
+
exit 0
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
# Deny anything else
|
|
40
|
+
cat << 'EOF'
|
|
41
|
+
{"permissionDecision":"deny","message":"Access restricted to intent.md (read) and questions.md (write) only."}
|
|
42
|
+
EOF
|
|
43
|
+
exit 0
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ignore-config
|
|
3
|
+
description: Analyze a project and recommend a .claudeignore file. Use when setting up or updating .claudeignore to exclude git-tracked files that aren't useful for Claude.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Claudeignore
|
|
9
|
+
|
|
10
|
+
Analyze the current project and recommend a `.claudeignore` configuration.
|
|
11
|
+
|
|
12
|
+
`.claudeignore` excludes files from Claude's indexing. Since `.gitignore` is already respected, `.claudeignore` targets **git-tracked files** that aren't useful for Claude — lock files, large generated assets, binary files, fixture data, etc.
|
|
13
|
+
|
|
14
|
+
Use the Read tool on `references/step-1-analyze.md` to begin the analysis.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Step 1: Analyze the Project
|
|
2
|
+
|
|
3
|
+
## Check Existing State
|
|
4
|
+
|
|
5
|
+
1. Check if `.claudeignore` already exists. If it does, read it — this is an update flow, and recommendations should complement what's already there.
|
|
6
|
+
2. Check `.gitignore` to understand what's already excluded from Claude's view.
|
|
7
|
+
|
|
8
|
+
## Scan for Candidates
|
|
9
|
+
|
|
10
|
+
Run `git ls-files` and identify tracked files that are poor candidates for Claude's context. Focus on:
|
|
11
|
+
|
|
12
|
+
- **Lock files** — dependency locks are large and not useful for understanding code (package-lock.json, yarn.lock, pnpm-lock.yaml, Gemfile.lock, poetry.lock, Cargo.lock, composer.lock, etc.)
|
|
13
|
+
- **Generated/compiled assets** — minified JS/CSS, source maps, bundled output, compiled protobuf, auto-generated code committed to the repo
|
|
14
|
+
- **Binary files** — images, fonts, compiled binaries, archives, database files
|
|
15
|
+
- **Large data files** — fixtures, seed data, snapshots, migration dumps, sample datasets
|
|
16
|
+
- **Vendored dependencies** — committed vendor/ or third-party directories
|
|
17
|
+
|
|
18
|
+
Use file size as a signal — find the largest tracked files to surface high-impact candidates.
|
|
19
|
+
|
|
20
|
+
## Present Recommendations
|
|
21
|
+
|
|
22
|
+
Group findings by category. For each recommendation, include:
|
|
23
|
+
|
|
24
|
+
- The pattern (e.g., `package-lock.json`, `*.min.js`, `vendor/`)
|
|
25
|
+
- Why it's not useful for Claude
|
|
26
|
+
- The file size or count impact
|
|
27
|
+
|
|
28
|
+
If the project is small and clean with nothing worth ignoring, say so — a `.claudeignore` isn't always needed.
|
|
29
|
+
|
|
30
|
+
If there is an existing `.claudeignore`, highlight only new recommendations not already covered.
|
|
31
|
+
|
|
32
|
+
Present the recommendations and ask the user which patterns to include. Use the Read tool on `references/step-2-create.md` to create the file based on their decisions.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Step 2: Create the File
|
|
2
|
+
|
|
3
|
+
Based on the user's selections, write the `.claudeignore` file.
|
|
4
|
+
|
|
5
|
+
## Format
|
|
6
|
+
|
|
7
|
+
- Group patterns by category with comment headers
|
|
8
|
+
- Add a brief comment at the top explaining the file's purpose
|
|
9
|
+
- One pattern per line
|
|
10
|
+
- Keep it clean — match `.gitignore` conventions
|
|
11
|
+
|
|
12
|
+
## If Updating
|
|
13
|
+
|
|
14
|
+
Read the existing `.claudeignore` and merge. Place new patterns in the appropriate category sections. Avoid duplicates.
|
|
15
|
+
|
|
16
|
+
## After Writing
|
|
17
|
+
|
|
18
|
+
Show the user the final file contents and confirm it looks right. If they want changes, apply them.
|
|
19
|
+
|
|
20
|
+
Use the Read tool on `references/step-3-reflect.md` to review your work and report results to the user.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Step 3: Reflect
|
|
2
|
+
|
|
3
|
+
Review how this skill performed.
|
|
4
|
+
|
|
5
|
+
## Assessment
|
|
6
|
+
|
|
7
|
+
- Were the scan heuristics effective? Did they catch the right files, or miss obvious candidates?
|
|
8
|
+
- Were any recommendations wrong — patterns that would have excluded files Claude actually needs?
|
|
9
|
+
- Did the category groupings make sense for this project type?
|
|
10
|
+
- Was the file size scan command effective, or did it need adjustment?
|
|
11
|
+
|
|
12
|
+
## Action
|
|
13
|
+
|
|
14
|
+
If any instructions were wrong, incomplete, or misleading, identify the specific file where the issue lives, read it, and apply the fix. Only add knowledge a fresh Claude instance would not already have.
|
|
15
|
+
|
|
16
|
+
## Report
|
|
17
|
+
|
|
18
|
+
Tell the user what was created and summarize the impact (approximate number of files/size excluded from Claude's context). If skill files were updated, explain what changed and why.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ship
|
|
3
|
+
description: End-to-end workflow for shipping complex features through intent discovery, contamination-free research, design discussion, spec generation, task breakdown, and implementation. Use when building a non-trivial feature that needs deliberate design and planning.
|
|
4
|
+
argument-hint: <feature-name>
|
|
5
|
+
allowed-tools: Read, Write, Edit, Grep, Glob, Bash, Agent, TaskCreate, TaskList, TaskUpdate, TaskGet, AskUserQuestion
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Ship
|
|
9
|
+
|
|
10
|
+
You orchestrate a multi-phase workflow for shipping complex features. Each phase produces artifacts that feed the next, with clean context separation to prevent intent contamination.
|
|
11
|
+
|
|
12
|
+
Every invocation of this skill is for a complex feature. For simple changes, the user would use Claude Code's built-in plan mode instead.
|
|
13
|
+
|
|
14
|
+
## Determine Feature
|
|
15
|
+
|
|
16
|
+
If an argument was provided, use it as the feature name (convert to hyphen-case). If no argument, ask the user what feature they want to build and derive a short hyphen-case name from their description.
|
|
17
|
+
|
|
18
|
+
The spec directory is `docs/specs/{feature-name}/`.
|
|
19
|
+
|
|
20
|
+
## Check State
|
|
21
|
+
|
|
22
|
+
Look for `docs/specs/{feature-name}/state.yaml`.
|
|
23
|
+
|
|
24
|
+
**If state.yaml exists**, read it. The `phase` field tells you where to resume:
|
|
25
|
+
|
|
26
|
+
| Phase | Step file |
|
|
27
|
+
|---|---|
|
|
28
|
+
| intent | `references/step-1-intent.md` |
|
|
29
|
+
| questions | `references/step-2-questions.md` |
|
|
30
|
+
| research | `references/step-3-research.md` |
|
|
31
|
+
| design | `references/step-4-design.md` |
|
|
32
|
+
| spec | `references/step-5-spec.md` |
|
|
33
|
+
| tasks | `references/step-6-tasks.md` |
|
|
34
|
+
| implement | `references/step-7-implement.md` |
|
|
35
|
+
|
|
36
|
+
Read the step file for the current phase and follow its instructions.
|
|
37
|
+
|
|
38
|
+
**If state.yaml does not exist**, this is a new feature. Create the spec directory and an initial state.yaml:
|
|
39
|
+
|
|
40
|
+
```yaml
|
|
41
|
+
feature: {feature-name}
|
|
42
|
+
phase: intent
|
|
43
|
+
dir: docs/specs/{feature-name}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Then read `references/step-1-intent.md` to begin.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Intent Discovery
|
|
2
|
+
|
|
3
|
+
Capture what the user wants to build through conversation. This produces the intent document — a clear statement of the feature, not a spec, not a plan.
|
|
4
|
+
|
|
5
|
+
## Create Tasks
|
|
6
|
+
|
|
7
|
+
Create these tasks and work through them in order:
|
|
8
|
+
|
|
9
|
+
1. "Discuss the feature with the user" — understand what, why, and constraints
|
|
10
|
+
2. "Write intent.md" — capture the understanding
|
|
11
|
+
3. "Begin question generation" — proceed to the next phase
|
|
12
|
+
|
|
13
|
+
## Task 1: Discuss
|
|
14
|
+
|
|
15
|
+
Have a conversation with the user about:
|
|
16
|
+
|
|
17
|
+
- **What** they want to build — the feature or change
|
|
18
|
+
- **Why** it matters — the problem it solves, who it's for
|
|
19
|
+
- **Constraints** — any technical limitations, patterns to follow, things to avoid
|
|
20
|
+
- **Success** — how they'll know it works (high-level, not formal acceptance criteria yet)
|
|
21
|
+
|
|
22
|
+
Keep this natural. A few rounds of back-and-forth is enough. You're building understanding, not conducting an interrogation.
|
|
23
|
+
|
|
24
|
+
## Task 2: Write intent.md
|
|
25
|
+
|
|
26
|
+
When you have enough understanding, write `{spec_dir}/intent.md`:
|
|
27
|
+
|
|
28
|
+
```markdown
|
|
29
|
+
# Feature: {Feature Name}
|
|
30
|
+
|
|
31
|
+
## What
|
|
32
|
+
{Clear description of what's being built}
|
|
33
|
+
|
|
34
|
+
## Why
|
|
35
|
+
{The problem this solves and who benefits}
|
|
36
|
+
|
|
37
|
+
## Constraints
|
|
38
|
+
{Any stated technical limitations, patterns, or preferences}
|
|
39
|
+
|
|
40
|
+
## Success Criteria
|
|
41
|
+
{High-level criteria for knowing it's done}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Present the intent document to the user for confirmation. Adjust if they have corrections.
|
|
45
|
+
|
|
46
|
+
## Task 3: Proceed
|
|
47
|
+
|
|
48
|
+
Update `{spec_dir}/state.yaml` — set `phase: questions`.
|
|
49
|
+
|
|
50
|
+
Use the Read tool on `references/step-2-questions.md` to generate research questions from the intent.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Question Generation
|
|
2
|
+
|
|
3
|
+
Generate research questions that a senior engineer would need answered about the codebase before implementing this feature. A restricted sub-agent handles this — it reads the intent and produces questions but cannot explore the codebase.
|
|
4
|
+
|
|
5
|
+
The intent document captures what the user wants. The questions document will be used by a DIFFERENT agent to research the codebase — an agent that will NOT see the intent. This separation prevents implementation opinions from contaminating the research.
|
|
6
|
+
|
|
7
|
+
## Create Tasks
|
|
8
|
+
|
|
9
|
+
Create these tasks and work through them in order:
|
|
10
|
+
|
|
11
|
+
1. "Generate research questions from intent" — spawn the question-generator
|
|
12
|
+
2. "Review questions with user" — present and refine
|
|
13
|
+
3. "Begin objective research" — proceed to the next phase
|
|
14
|
+
|
|
15
|
+
## Task 1: Generate Questions
|
|
16
|
+
|
|
17
|
+
Spawn a sub-agent to generate questions:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
Agent tool:
|
|
21
|
+
subagent_type: "question-generator"
|
|
22
|
+
prompt: "Read the intent document at {spec_dir}/intent.md. Write research questions to {spec_dir}/questions.md."
|
|
23
|
+
model: "sonnet"
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The question-generator is restricted — it can only read and write within docs/specs/. It has no search tools. It cannot explore the codebase even if it wanted to.
|
|
27
|
+
|
|
28
|
+
## Task 2: Review Questions
|
|
29
|
+
|
|
30
|
+
Read `{spec_dir}/questions.md` and present the questions to the user. Ask:
|
|
31
|
+
|
|
32
|
+
- Are these the right questions?
|
|
33
|
+
- Any questions missing?
|
|
34
|
+
- Any questions that aren't relevant?
|
|
35
|
+
|
|
36
|
+
Update `questions.md` based on user feedback. The user may add questions about patterns, existing implementations, or concerns they have.
|
|
37
|
+
|
|
38
|
+
## Task 3: Proceed
|
|
39
|
+
|
|
40
|
+
Update `{spec_dir}/state.yaml` — set `phase: research`.
|
|
41
|
+
|
|
42
|
+
Use the Read tool on `references/step-3-research.md` to begin objective codebase research.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Objective Research
|
|
2
|
+
|
|
3
|
+
A sub-agent researches the codebase using ONLY the questions — it does not see the intent document. This produces factual, objective documentation about the codebase without implementation bias.
|
|
4
|
+
|
|
5
|
+
This is the critical contamination prevention step. The research agent answers questions about what EXISTS in the codebase. It does not know what feature is being built, so it cannot steer findings toward a particular implementation.
|
|
6
|
+
|
|
7
|
+
## Create Tasks
|
|
8
|
+
|
|
9
|
+
Create these tasks and work through them in order:
|
|
10
|
+
|
|
11
|
+
1. "Research codebase using questions" — spawn the objective-researcher
|
|
12
|
+
2. "Review research with user" — present findings
|
|
13
|
+
3. "Begin design discussion" — proceed to the next phase
|
|
14
|
+
|
|
15
|
+
## Task 1: Research Codebase
|
|
16
|
+
|
|
17
|
+
Spawn a sub-agent to research the codebase:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
Agent tool:
|
|
21
|
+
subagent_type: "objective-researcher"
|
|
22
|
+
prompt: "Read the questions at {spec_dir}/questions.md. Research the codebase to answer each question. Write your findings to {spec_dir}/research.md. Do NOT read any other files in {spec_dir} — only questions.md."
|
|
23
|
+
model: "sonnet"
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The objective-researcher has full codebase access (Read, Grep, Glob, Bash) but no knowledge of the feature being built. It only sees the questions.
|
|
27
|
+
|
|
28
|
+
## Task 2: Review Research
|
|
29
|
+
|
|
30
|
+
Read `{spec_dir}/research.md` and present a summary to the user. Highlight:
|
|
31
|
+
|
|
32
|
+
- Any questions the researcher couldn't answer (gaps)
|
|
33
|
+
- Places where multiple patterns were found (need disambiguation)
|
|
34
|
+
- Anything surprising or noteworthy
|
|
35
|
+
|
|
36
|
+
The user may add context the researcher missed, or flag patterns that are outdated.
|
|
37
|
+
|
|
38
|
+
If the research is thin or missing critical areas, spawn the objective-researcher again with additional targeted questions.
|
|
39
|
+
|
|
40
|
+
## Task 3: Proceed
|
|
41
|
+
|
|
42
|
+
Update `{spec_dir}/state.yaml` — set `phase: design`.
|
|
43
|
+
|
|
44
|
+
Use the Read tool on `references/step-4-design.md` to begin the design discussion with the user.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Design Discussion
|
|
2
|
+
|
|
3
|
+
This is the highest-leverage phase. You now have the objective research AND the original intent. Combine them to make design decisions with the user.
|
|
4
|
+
|
|
5
|
+
Read `{spec_dir}/intent.md` and `{spec_dir}/research.md` before proceeding.
|
|
6
|
+
|
|
7
|
+
## Create Tasks
|
|
8
|
+
|
|
9
|
+
Create these tasks and work through them in order:
|
|
10
|
+
|
|
11
|
+
1. "Surface patterns and present design questions" — analyze research, identify decisions needed
|
|
12
|
+
2. "Resolve design decisions with user" — interactive discussion
|
|
13
|
+
3. "Write design.md" — capture resolved decisions
|
|
14
|
+
4. "Begin spec generation" — proceed to the next phase
|
|
15
|
+
|
|
16
|
+
## Task 1: Surface Patterns
|
|
17
|
+
|
|
18
|
+
From the research document, identify:
|
|
19
|
+
|
|
20
|
+
**Patterns to Follow**: Code patterns from the codebase relevant to this feature. If the research found multiple patterns for the same thing (e.g., old way vs. new way of handling forms), list them all and flag for disambiguation.
|
|
21
|
+
|
|
22
|
+
**Design Questions**: Decisions that need human input before implementation. For each question:
|
|
23
|
+
|
|
24
|
+
- State the question clearly
|
|
25
|
+
- Provide Option A and Option B (grounded in what the research found)
|
|
26
|
+
- Note which option you'd recommend and why
|
|
27
|
+
- Leave room for the user to propose Option C
|
|
28
|
+
|
|
29
|
+
Common design questions include:
|
|
30
|
+
|
|
31
|
+
- Which existing pattern to follow when there are multiple
|
|
32
|
+
- Where new code should live (which directory, which module)
|
|
33
|
+
- How to handle edge cases and error states
|
|
34
|
+
- What to do about backward compatibility
|
|
35
|
+
- Testing strategy (unit, integration, E2E)
|
|
36
|
+
|
|
37
|
+
## Task 2: Resolve Decisions
|
|
38
|
+
|
|
39
|
+
Present the patterns and design questions to the user. Work through each decision:
|
|
40
|
+
|
|
41
|
+
- Let the user choose options or propose alternatives
|
|
42
|
+
- If the user isn't sure, provide your reasoning
|
|
43
|
+
- If a decision requires understanding external technology the codebase doesn't use yet, note it as an open item — the spec phase can handle external research
|
|
44
|
+
|
|
45
|
+
This is interactive. Go back and forth until all design questions are resolved.
|
|
46
|
+
|
|
47
|
+
## Task 3: Write design.md
|
|
48
|
+
|
|
49
|
+
Write `{spec_dir}/design.md`:
|
|
50
|
+
|
|
51
|
+
```markdown
|
|
52
|
+
# Design Decisions: {Feature Name}
|
|
53
|
+
|
|
54
|
+
## Patterns to Follow
|
|
55
|
+
{List each pattern with code location and why it's relevant}
|
|
56
|
+
|
|
57
|
+
## Resolved Decisions
|
|
58
|
+
{For each design question: the question, the chosen option, and the rationale}
|
|
59
|
+
|
|
60
|
+
## Open Items
|
|
61
|
+
{Anything requiring external research or further investigation}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Present to the user for confirmation.
|
|
65
|
+
|
|
66
|
+
## Task 4: Proceed
|
|
67
|
+
|
|
68
|
+
Update `{spec_dir}/state.yaml` — set `phase: spec`.
|
|
69
|
+
|
|
70
|
+
Use the Read tool on `references/step-5-spec.md` to generate the implementation specification.
|