cc-dev-template 0.1.32 → 0.1.34

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.
Files changed (34) hide show
  1. package/bin/install.js +5 -9
  2. package/package.json +1 -1
  3. package/src/commands/done.md +52 -0
  4. package/src/commands/prime.md +40 -4
  5. package/src/skills/initialize-project/SKILL.md +84 -0
  6. package/src/agents/adr-agent.md +0 -167
  7. package/src/agents/claude-md-agent.md +0 -124
  8. package/src/agents/decomposition-agent.md +0 -170
  9. package/src/agents/execution-agent.md +0 -232
  10. package/src/agents/rca-agent.md +0 -192
  11. package/src/agents/tdd-agent.md +0 -205
  12. package/src/commands/create-agent-skill.md +0 -11
  13. package/src/commands/finalize.md +0 -48
  14. package/src/commands/heal-skill.md +0 -69
  15. package/src/hooks/orchestration-guidance.sh +0 -56
  16. package/src/hooks/orchestration-hook.json +0 -14
  17. package/src/scripts/adr-list.js +0 -298
  18. package/src/scripts/adr-tags.js +0 -242
  19. package/src/scripts/validate-yaml.js +0 -142
  20. package/src/scripts/yaml-validation-hook.json +0 -15
  21. package/src/skills/orchestration/SKILL.md +0 -161
  22. package/src/skills/orchestration/references/debugging/describe.md +0 -144
  23. package/src/skills/orchestration/references/debugging/fix.md +0 -117
  24. package/src/skills/orchestration/references/debugging/learn.md +0 -185
  25. package/src/skills/orchestration/references/debugging/rca.md +0 -92
  26. package/src/skills/orchestration/references/debugging/verify.md +0 -102
  27. package/src/skills/orchestration/references/execution/complete.md +0 -175
  28. package/src/skills/orchestration/references/execution/start.md +0 -77
  29. package/src/skills/orchestration/references/execution/tasks.md +0 -114
  30. package/src/skills/orchestration/references/planning/draft.md +0 -269
  31. package/src/skills/orchestration/references/planning/explore.md +0 -160
  32. package/src/skills/orchestration/references/planning/finalize.md +0 -184
  33. package/src/skills/orchestration/references/planning/start.md +0 -119
  34. package/src/skills/orchestration/scripts/plan-status.js +0 -355
@@ -1,102 +0,0 @@
1
- # Debugging Phase 3: Verify
2
-
3
- ## Purpose
4
-
5
- Write a failing test that proves the hypothesis. The test is the TDD gate—we don't fix code until we have a test that demonstrates the bug exists.
6
-
7
- **Success looks like**: A test exists that fails because of the bug. When the test passes later, we'll know the bug is fixed.
8
-
9
- ## What To Do
10
-
11
- <steps>
12
-
13
- <step name="Spawn TDD Agent">
14
- Spawn tdd-agent to write a failing test for the hypothesis:
15
-
16
- ```
17
- Spawn tdd-agent: "Write a failing test for the hypothesis in [debug-path]/debug.md.
18
-
19
- Submodule context: [pass SubmoduleContext from SKILL.md or from debug.md]
20
-
21
- If the bug is in a submodule, ensure the test is created in the
22
- appropriate test directory for that submodule."
23
- ```
24
-
25
- The agent reads the debug context, writes an appropriate test, runs it, and updates the debug.md artifact with the result.
26
-
27
- **Note**: For backward compatibility, if the debug artifact is `debug.yaml` instead of `debug.md`, continue working with that format.
28
- </step>
29
-
30
- <step name="Evaluate Result">
31
- The agent returns one of three outcomes:
32
-
33
- **Test FAILS (hypothesis verified)**:
34
- The bug exists and we can reproduce it. Present to user:
35
-
36
- ```
37
- ## Hypothesis Verified
38
-
39
- The test fails as expected, confirming the hypothesis.
40
-
41
- **Test**: [test file path]
42
- **Failure**: [what the test asserts that fails]
43
-
44
- Ready to fix the code.
45
- ```
46
-
47
- ```
48
- AskUserQuestion:
49
- Question: "Test fails as expected. Ready to fix the code?"
50
- Options:
51
- - "Yes, fix it" - Proceed to fix phase
52
- - "Let me review" - I want to see the test code first
53
- - "Something else" - Different feedback
54
- ```
55
-
56
- **Test PASSES (hypothesis disproven)**:
57
- The hypothesis was wrong—the bug has a different cause. Present to user:
58
-
59
- ```
60
- ## Hypothesis Disproven
61
-
62
- The test passed, meaning the expected behavior works in this scenario.
63
- The hypothesis was incorrect—the bug has a different cause.
64
-
65
- **What we learned**: [what the passing test tells us]
66
- ```
67
-
68
- ```
69
- AskUserQuestion:
70
- Question: "The hypothesis was wrong. How should we proceed?"
71
- Options:
72
- - "Investigate again" - Back to RCA with new evidence
73
- - "I have an idea" - Let me share what I think is happening
74
- - "Something else" - Different approach
75
- ```
76
-
77
- **Test ERRORS (test itself is broken)**:
78
- Work with the user to fix or rewrite the test, then re-run.
79
- </step>
80
-
81
- <checkpoint>
82
- Before proceeding:
83
- - tdd-agent was spawned and returned a result
84
- - Result was evaluated and presented to user
85
- - User has chosen how to proceed
86
- </checkpoint>
87
-
88
- </steps>
89
-
90
- ## Key Principles
91
-
92
- **Tests check expected behavior, not implementation.** The test asserts what SHOULD happen, not how it happens internally.
93
-
94
- **Failing test = verified hypothesis.** A test that fails proves the bug exists.
95
-
96
- **Passing test = wrong hypothesis.** If the test passes, our understanding was incorrect—back to RCA.
97
-
98
- <transition>
99
- If hypothesis verified (test fails) and user approves: Read `references/debugging/fix.md`
100
-
101
- If hypothesis disproven (test passes) and user chooses to investigate: Read `references/debugging/rca.md`
102
- </transition>
@@ -1,175 +0,0 @@
1
- # Execution Phase 3: Complete
2
-
3
- ## Purpose
4
-
5
- Verify the work, capture any new patterns as ADRs, and get human approval before closing out the plan.
6
-
7
- **Success looks like**: Tests pass, code compiles, new patterns are documented, user approves, plan marked complete.
8
-
9
- ## What To Do
10
-
11
- Complete each step in order before proceeding to the next.
12
-
13
- <steps>
14
-
15
- <step name="Automated Verification">
16
- Run the project's verification suite:
17
-
18
- 1. **Tests** - Run all tests (whatever "all tests" means for this project)
19
- 2. **Compile/Build** - Ensure everything compiles with no errors or warnings
20
- 3. **Lint** - Run any linters if the project uses them
21
-
22
- Figure out what's appropriate for the project.
23
-
24
- **If verification fails:** Identify which task caused the failure and spawn an execution-agent to fix it. Provide the error output and task context. Re-run verification after the fix. Repeat until all checks pass.
25
- </step>
26
-
27
- <step name="Capture New Patterns">
28
- Before human review, analyze the work for architectural decisions and tribal knowledge worth documenting.
29
-
30
- **1. Collect ADR candidates from task outcomes:**
31
-
32
- Read each task's outcome field and extract any `adr_candidates` that were flagged during execution. These are decisions the execution agents already identified as potentially ADR-worthy.
33
-
34
- **2. Apply the ADR checklist:**
35
-
36
- For each task outcome AND for the overall implementation, check:
37
- - [ ] Did we choose between multiple valid approaches? (e.g., "used X instead of Y because...")
38
- - [ ] Did we establish a pattern future work should follow? (e.g., "all API calls go through...")
39
- - [ ] Did we constrain how something should/shouldn't be done? (e.g., "never do X because...")
40
- - [ ] Did we deviate from or extend an existing ADR?
41
-
42
- If any checkbox applies, it's an ADR candidate.
43
-
44
- **3. Apply CLAUDE.md criteria:**
45
-
46
- - Non-obvious gotchas discovered during implementation
47
- - Workflow patterns specific to this project
48
- - Behaviors that would trip up a future developer
49
-
50
- Not CLAUDE.md-worthy: Standard practices, info already in docs, obvious behaviors
51
-
52
- **4. Present ADR candidates for user confirmation:**
53
-
54
- If you identified ADR candidates (from task outcomes or your analysis):
55
-
56
- ```
57
- ## ADR Candidates
58
-
59
- These decisions from this work might warrant ADRs:
60
-
61
- 1. **[Brief title]**: [One sentence describing the decision and why it matters]
62
- 2. **[Brief title]**: [One sentence describing the decision and why it matters]
63
-
64
- Which should we codify as ADRs? Enter numbers (e.g., "1, 2"), "all", or "none".
65
- ```
66
-
67
- Wait for user response before creating any ADRs. They choose which decisions become permanent rules.
68
-
69
- **5. Capture what was approved:**
70
-
71
- For each ADR the user approved:
72
- ```
73
- Spawn adr-agent: "Create an ADR for: [pattern description and context]
74
-
75
- Submodule context: [pass SubmoduleContext from SKILL.md]
76
- If this ADR applies only to specific submodules, set the scope field
77
- to list those submodule paths."
78
- ```
79
-
80
- For CLAUDE.md learnings (these don't need user approval—use your judgment):
81
- ```
82
- Spawn claude-md-agent: "Add to CLAUDE.md: [learning]. Discovered during [plan title]. This is non-obvious because [reason].
83
-
84
- If this learning is specific to a submodule, consider whether it
85
- belongs in the submodule's CLAUDE.md or the root CLAUDE.md."
86
- ```
87
- </step>
88
-
89
- <step name="Present Summary for Human Review">
90
- Summarize what was accomplished:
91
-
92
- ```
93
- ## Plan Complete: [plan title]
94
-
95
- **Tasks completed**: [N]
96
-
97
- ### What Was Built
98
- - [Key accomplishment from task outcomes]
99
- - [Another accomplishment]
100
-
101
- ### Files Changed
102
- [List notable files or run `git diff --stat`]
103
-
104
- ### Tests
105
- [Test results summary]
106
-
107
- ### Ready for Review
108
- Please review the implementation. Check for:
109
- - Bugs or issues
110
- - Manual testing needed
111
- - Anything that doesn't look right
112
- ```
113
- </step>
114
-
115
- <step name="Get Approval">
116
- ```
117
- AskUserQuestion:
118
- Question: "Does everything look good?"
119
- Options:
120
- - "Approved" - Mark plan complete
121
- - "Found issues" - Let's fix them together
122
- - "Need more time" - I'll review and get back to you
123
- ```
124
-
125
- **If approved:**
126
- - Update `plan.yaml`: `status: completed`, `completed: [today's date]`
127
- - Confirm: "Plan [title] is complete. Run /prime when you have new work."
128
-
129
- **If issues found:**
130
-
131
- The orchestrator coordinates work—it gathers information and delegates to execution agents. Follow this flow:
132
-
133
- 1. **Understand the issue** - Ask the user to describe what's wrong. Get specific details: what they expected, what actually happened, which files/features are affected.
134
-
135
- 2. **Identify the responsible task** - Determine which task from the plan relates to this issue. Check the task manifest for context.
136
-
137
- 3. **Delegate the fix** - Spawn an execution-agent with clear context:
138
- ```
139
- Spawn execution-agent:
140
- "Fix issue in [task ID]: [Issue description from user]
141
-
142
- Context:
143
- - What was expected: [user's expectation]
144
- - What actually happened: [observed behavior]
145
- - Relevant files: [files if known]
146
-
147
- The task manifest is at: [path to manifest]
148
- Review your original implementation and fix the issue."
149
- ```
150
-
151
- 4. **Re-run verification** - After the fix, run tests/build/lint again
152
-
153
- 5. **Return to approval** - Present updated summary and ask for approval again
154
- </step>
155
-
156
- <checkpoint>
157
- Before closing out:
158
- - Automated verification passed (tests, build, lint)
159
- - Learnings assessment was presented (ADR and CLAUDE.md)
160
- - Any identified learnings were captured
161
- - Summary was presented to user
162
- - User approved the work
163
- </checkpoint>
164
-
165
- <step name="Close Out">
166
- Final state:
167
- - `plan.yaml` has `status: completed`
168
- - All tasks have `status: completed` in manifest
169
- - Any new ADRs are created
170
- - User has approved
171
- </step>
172
-
173
- </steps>
174
-
175
- This is the final phase. The workflow ends here.
@@ -1,77 +0,0 @@
1
- # Execution Phase 1: Start
2
-
3
- ## Purpose
4
-
5
- Load the approved plan and decompose it into executable tasks. This bridges planning (what to build) and execution (doing the work).
6
-
7
- **Success looks like**: Task files exist with clear completion criteria, correct dependencies, and appropriate ADR mapping—ready for the execution loop.
8
-
9
- ## What To Do
10
-
11
- Complete each step in order before proceeding to the next.
12
-
13
- <steps>
14
-
15
- <step name="Load the Plan">
16
- Read the plan at the path provided (or discovered by SKILL.md):
17
-
18
- ```
19
- .claude/plans/[slug]/plan.yaml
20
- ```
21
-
22
- If status is not `approved`, tell the user:
23
-
24
- > "This plan hasn't been approved yet. Run /prime to complete planning first."
25
- </step>
26
-
27
- <step name="Decompose">
28
- Spawn the decomposition-agent to break the plan into tasks:
29
-
30
- ```
31
- Spawn decomposition-agent: "Decompose the plan at [plan-path].
32
-
33
- Submodule context: [pass SubmoduleContext from SKILL.md]
34
-
35
- If the plan has affected_submodules, consider submodule scope when:
36
- - Creating tasks that target specific submodules
37
- - Assigning ADRs to tasks (include both local and inherited ADRs)
38
- - Describing where work should happen
39
-
40
- Tasks should include submodule context in their descriptions when
41
- the work targets specific submodules. This helps execution agents
42
- work in the correct directory scope."
43
- ```
44
-
45
- The agent reads the plan, creates task files, and returns a summary.
46
- </step>
47
-
48
- <step name="Review">
49
- Spawn the decomposition-agent again to review the decomposition:
50
-
51
- ```
52
- Spawn decomposition-agent: "Review the decomposition at [plan-dir]."
53
- ```
54
-
55
- The agent checks coverage, dependencies, ADR mapping, and criteria specificity.
56
- </step>
57
-
58
- <step name="Iterate">
59
- If review returns issues:
60
- 1. Spawn decomposition-agent to fix the specific issues
61
- 2. Review again
62
- 3. Repeat until review returns `APPROVED`
63
- </step>
64
-
65
- <checkpoint>
66
- Before proceeding to task execution:
67
- - Plan has been loaded and verified as approved
68
- - decomposition-agent has created task files
69
- - decomposition-agent has reviewed and approved the decomposition
70
- - manifest.yaml exists with all tasks listed
71
- </checkpoint>
72
-
73
- </steps>
74
-
75
- <transition>
76
- Once decomposition is approved, read `references/execution/tasks.md` to begin the execution loop.
77
- </transition>
@@ -1,114 +0,0 @@
1
- # Execution Phase 2: Tasks
2
-
3
- ## Purpose
4
-
5
- Execute and review tasks until all are complete. Tasks run in parallel where dependencies allow, with a review step to verify each task meets its criteria.
6
-
7
- **Success looks like**: All tasks have `status: completed` in the manifest.
8
-
9
- ## What To Do
10
-
11
- Execute the following loop until all tasks are complete.
12
-
13
- <steps>
14
-
15
- <step name="Find Executable Tasks">
16
- Read `manifest.yaml`. Find tasks where:
17
- - `status: pending`
18
- - All `dependencies` have `status: completed`
19
-
20
- These can all be executed in parallel.
21
- </step>
22
-
23
- <step name="Execute">
24
- For each executable task, spawn execution-agent:
25
-
26
- ```
27
- Spawn execution-agent: "Implement task [task-id] at [task-path].
28
-
29
- Submodule context: [pass SubmoduleContext from SKILL.md if relevant]
30
-
31
- If the task targets a specific submodule, work within that directory.
32
- Use --include-parent with adr-list.js to discover inherited ADRs
33
- when validating against architectural constraints."
34
- ```
35
-
36
- The agent reads the task, does the work, writes the outcome, and updates status to `needs_review`.
37
-
38
- Execute all ready tasks in parallel.
39
- </step>
40
-
41
- <step name="Find Reviewable Tasks">
42
- Read `manifest.yaml` again. Find tasks where:
43
- - `status: needs_review`
44
- </step>
45
-
46
- <step name="Review">
47
- For each reviewable task, spawn execution-agent:
48
-
49
- ```
50
- Spawn execution-agent: "Review task [task-id] at [task-path]."
51
- ```
52
-
53
- The agent verifies each `done_when` criterion. If all pass, it updates status to `completed`. If issues found, it returns the list of problems.
54
-
55
- Review all ready tasks in parallel.
56
- </step>
57
-
58
- <step name="Handle Issues">
59
- If any review returns issues:
60
-
61
- Spawn execution-agent to fix with ADR re-validation instruction:
62
-
63
- ```
64
- Spawn execution-agent: "Fix these issues in task [task-id]: [issues]
65
-
66
- IMPORTANT - Before implementing any fix:
67
- 1. Re-read all ADRs in this task's relevant_adrs
68
- 2. Ensure your fix doesn't violate any ADR constraints
69
- 3. ADR violations are BLOCKING - if the fix would violate an ADR,
70
- you MUST escalate instead of proceeding. ADRs are gospel.
71
- 4. Check the plan's ADR Exceptions section - if an ADR is listed there,
72
- deviation is acceptable (but document you relied on the exception)
73
-
74
- The task manifest is at: [path to manifest]"
75
- ```
76
-
77
- - The agent re-reads ADRs, fixes the issues, and leaves status at `needs_review`
78
- - Next loop iteration will review again (including ADR compliance check)
79
- </step>
80
-
81
- <step name="Continue">
82
- Return to the first step. Find next batch of executable tasks.
83
-
84
- Repeat until `manifest.yaml` shows all tasks with `status: completed`.
85
- </step>
86
-
87
- </steps>
88
-
89
- ## Handling Escalation
90
-
91
- If an execution agent escalates (ADR conflict, invalid assumption, blocked), stop the loop and present to the user:
92
-
93
- ```
94
- AskUserQuestion:
95
- Question: "Task [id] hit an issue: [description]. How should we proceed?"
96
- Options:
97
- - "Help me resolve it" - I'll provide guidance
98
- - "Skip this task" - Mark blocked, continue with others
99
- - "Stop execution" - Let's figure this out first
100
- ```
101
-
102
- After resolving, resume the loop.
103
-
104
- ## Key Points
105
-
106
- **Parallel execution** - Run all independent tasks at once. Don't serialize unnecessarily.
107
-
108
- **Fresh context per spawn** - Each agent spawn is stateless. The task file contains everything it needs.
109
-
110
- **Agents update status** - Execute agent sets `needs_review`, review agent sets `completed`. Orchestrator just reads manifest to find what's ready.
111
-
112
- <transition>
113
- When all tasks show `status: completed` in the manifest, read `references/execution/complete.md` to finish.
114
- </transition>