claude-code-pilot 3.1.1 → 3.3.0

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 (198) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +16 -11
  3. package/bin/install.js +127 -11
  4. package/manifest.json +20 -1
  5. package/package.json +4 -3
  6. package/src/agents/a11y-architect.md +141 -0
  7. package/src/agents/code-architect.md +71 -0
  8. package/src/agents/code-explorer.md +69 -0
  9. package/src/agents/code-simplifier.md +47 -0
  10. package/src/agents/comment-analyzer.md +45 -0
  11. package/src/agents/csharp-reviewer.md +101 -0
  12. package/src/agents/dart-build-resolver.md +201 -0
  13. package/src/agents/django-build-resolver.md +252 -0
  14. package/src/agents/django-reviewer.md +169 -0
  15. package/src/agents/fastapi-reviewer.md +79 -0
  16. package/src/agents/fsharp-reviewer.md +109 -0
  17. package/src/agents/pr-test-analyzer.md +45 -0
  18. package/src/agents/silent-failure-hunter.md +50 -0
  19. package/src/agents/swift-build-resolver.md +170 -0
  20. package/src/agents/swift-reviewer.md +116 -0
  21. package/src/agents/type-design-analyzer.md +41 -0
  22. package/src/available-rules/README.md +3 -1
  23. package/src/available-rules/dart/coding-style.md +159 -0
  24. package/src/available-rules/dart/hooks.md +66 -0
  25. package/src/available-rules/dart/patterns.md +261 -0
  26. package/src/available-rules/dart/security.md +135 -0
  27. package/src/available-rules/dart/testing.md +215 -0
  28. package/src/available-rules/web/coding-style.md +105 -0
  29. package/src/available-rules/web/design-quality.md +72 -0
  30. package/src/available-rules/web/hooks.md +129 -0
  31. package/src/available-rules/web/patterns.md +88 -0
  32. package/src/available-rules/web/performance.md +73 -0
  33. package/src/available-rules/web/security.md +66 -0
  34. package/src/available-rules/web/testing.md +64 -0
  35. package/src/commands/ccp/ai-integration-phase.md +36 -0
  36. package/src/commands/ccp/audit-fix.md +33 -0
  37. package/src/commands/ccp/code-review-fix.md +52 -0
  38. package/src/commands/ccp/cost-report.md +107 -0
  39. package/src/commands/ccp/eval-review.md +32 -0
  40. package/src/commands/ccp/extract_learnings.md +22 -0
  41. package/src/commands/ccp/import.md +37 -0
  42. package/src/commands/ccp/ingest-docs.md +42 -0
  43. package/src/commands/ccp/intel.md +179 -0
  44. package/src/commands/ccp/mvp-phase.md +45 -0
  45. package/src/commands/ccp/plan-prd.md +160 -0
  46. package/src/commands/ccp/plan-review-convergence.md +58 -0
  47. package/src/commands/ccp/pr-ecc.md +184 -0
  48. package/src/commands/ccp/scan.md +26 -0
  49. package/src/commands/ccp/security-scan.md +74 -0
  50. package/src/commands/ccp/sketch-wrap-up.md +31 -0
  51. package/src/commands/ccp/sketch.md +54 -0
  52. package/src/commands/ccp/spec-phase.md +62 -0
  53. package/src/commands/ccp/spike-wrap-up.md +31 -0
  54. package/src/commands/ccp/spike.md +51 -0
  55. package/src/commands/ccp/ultraplan-phase.md +33 -0
  56. package/src/hooks/ccp-bash-hook-dispatcher.js +96 -0
  57. package/src/hooks/ccp-context-monitor.js +23 -0
  58. package/src/hooks/ccp-doc-file-warning.js +93 -0
  59. package/src/hooks/ccp-pre-bash-dispatcher.js +24 -0
  60. package/src/hooks/ccp-read-injection-scanner.js +152 -0
  61. package/src/hooks/ccp-write-gateguard.js +868 -0
  62. package/src/hooks/kit-check-update.js +59 -7
  63. package/src/hooks/run-with-flags-shell.sh +1 -0
  64. package/src/hooks/run-with-flags.js +48 -1
  65. package/src/hooks/session-end.js +88 -1
  66. package/src/lib/hook-flags.js +14 -0
  67. package/src/lib/project-detect.js +0 -2
  68. package/src/lib/shell-substitution.js +499 -0
  69. package/src/pilot/references/agent-contracts.md +79 -0
  70. package/src/pilot/references/ai-evals.md +156 -0
  71. package/src/pilot/references/ai-frameworks.md +186 -0
  72. package/src/pilot/references/doc-conflict-engine.md +91 -0
  73. package/src/pilot/references/execute-mvp-tdd.md +81 -0
  74. package/src/pilot/references/gate-prompts.md +100 -0
  75. package/src/pilot/references/gates.md +70 -0
  76. package/src/pilot/references/mandatory-initial-read.md +2 -0
  77. package/src/pilot/references/mvp-concepts.md +49 -0
  78. package/src/pilot/references/planner-graphify-auto-update.md +67 -0
  79. package/src/pilot/references/planner-human-verify-mode.md +57 -0
  80. package/src/pilot/references/planner-mvp-mode.md +53 -0
  81. package/src/pilot/references/project-skills-discovery.md +19 -0
  82. package/src/pilot/references/revision-loop.md +97 -0
  83. package/src/pilot/references/skeleton-template.md +48 -0
  84. package/src/pilot/references/sketch-interactivity.md +41 -0
  85. package/src/pilot/references/sketch-theme-system.md +94 -0
  86. package/src/pilot/references/sketch-tooling.md +45 -0
  87. package/src/pilot/references/sketch-variant-patterns.md +81 -0
  88. package/src/pilot/references/spidr-splitting.md +69 -0
  89. package/src/pilot/references/thinking-models-debug.md +44 -0
  90. package/src/pilot/references/thinking-models-execution.md +50 -0
  91. package/src/pilot/references/thinking-models-planning.md +62 -0
  92. package/src/pilot/references/thinking-models-research.md +50 -0
  93. package/src/pilot/references/thinking-models-verification.md +55 -0
  94. package/src/pilot/references/user-story-template.md +58 -0
  95. package/src/pilot/references/verify-mvp-mode.md +85 -0
  96. package/src/pilot/references/worktree-path-safety.md +89 -0
  97. package/src/pilot/templates/AI-SPEC.md +246 -0
  98. package/src/pilot/templates/spec.md +307 -0
  99. package/src/pilot/workflows/ai-integration-phase.md +284 -0
  100. package/src/pilot/workflows/audit-fix.md +175 -0
  101. package/src/pilot/workflows/code-review-fix.md +497 -0
  102. package/src/pilot/workflows/eval-review.md +155 -0
  103. package/src/pilot/workflows/extract_learnings.md +242 -0
  104. package/src/pilot/workflows/help.md +5 -0
  105. package/src/pilot/workflows/import.md +246 -0
  106. package/src/pilot/workflows/ingest-docs.md +328 -0
  107. package/src/pilot/workflows/mvp-phase.md +199 -0
  108. package/src/pilot/workflows/plan-review-convergence.md +329 -0
  109. package/src/pilot/workflows/scan.md +102 -0
  110. package/src/pilot/workflows/sketch-wrap-up.md +285 -0
  111. package/src/pilot/workflows/sketch.md +360 -0
  112. package/src/pilot/workflows/spec-phase.md +262 -0
  113. package/src/pilot/workflows/spike-wrap-up.md +306 -0
  114. package/src/pilot/workflows/spike.md +452 -0
  115. package/src/pilot/workflows/ultraplan-phase.md +189 -0
  116. package/src/skills/accessibility/SKILL.md +146 -0
  117. package/src/skills/agent-architecture-audit/SKILL.md +256 -0
  118. package/src/skills/agent-eval/SKILL.md +145 -0
  119. package/src/skills/agent-harness-design/SKILL.md +73 -0
  120. package/src/skills/agent-introspection-debugging/SKILL.md +153 -0
  121. package/src/skills/android-clean-architecture/SKILL.md +339 -0
  122. package/src/skills/angular-developer/SKILL.md +154 -0
  123. package/src/skills/angular-developer/references/angular-animations.md +160 -0
  124. package/src/skills/angular-developer/references/angular-aria.md +410 -0
  125. package/src/skills/angular-developer/references/cli.md +86 -0
  126. package/src/skills/angular-developer/references/component-harnesses.md +59 -0
  127. package/src/skills/angular-developer/references/component-styling.md +91 -0
  128. package/src/skills/angular-developer/references/components.md +117 -0
  129. package/src/skills/angular-developer/references/creating-services.md +97 -0
  130. package/src/skills/angular-developer/references/data-resolvers.md +69 -0
  131. package/src/skills/angular-developer/references/define-routes.md +67 -0
  132. package/src/skills/angular-developer/references/defining-providers.md +72 -0
  133. package/src/skills/angular-developer/references/di-fundamentals.md +120 -0
  134. package/src/skills/angular-developer/references/e2e-testing.md +56 -0
  135. package/src/skills/angular-developer/references/effects.md +83 -0
  136. package/src/skills/angular-developer/references/hierarchical-injectors.md +43 -0
  137. package/src/skills/angular-developer/references/host-elements.md +80 -0
  138. package/src/skills/angular-developer/references/injection-context.md +63 -0
  139. package/src/skills/angular-developer/references/inputs.md +101 -0
  140. package/src/skills/angular-developer/references/linked-signal.md +59 -0
  141. package/src/skills/angular-developer/references/loading-strategies.md +61 -0
  142. package/src/skills/angular-developer/references/mcp.md +108 -0
  143. package/src/skills/angular-developer/references/navigate-to-routes.md +69 -0
  144. package/src/skills/angular-developer/references/outputs.md +86 -0
  145. package/src/skills/angular-developer/references/reactive-forms.md +122 -0
  146. package/src/skills/angular-developer/references/rendering-strategies.md +44 -0
  147. package/src/skills/angular-developer/references/resource.md +77 -0
  148. package/src/skills/angular-developer/references/route-animations.md +56 -0
  149. package/src/skills/angular-developer/references/route-guards.md +52 -0
  150. package/src/skills/angular-developer/references/router-lifecycle.md +45 -0
  151. package/src/skills/angular-developer/references/router-testing.md +87 -0
  152. package/src/skills/angular-developer/references/show-routes-with-outlets.md +68 -0
  153. package/src/skills/angular-developer/references/signal-forms.md +795 -0
  154. package/src/skills/angular-developer/references/signals-overview.md +94 -0
  155. package/src/skills/angular-developer/references/tailwind-css.md +69 -0
  156. package/src/skills/angular-developer/references/template-driven-forms.md +114 -0
  157. package/src/skills/angular-developer/references/testing-fundamentals.md +65 -0
  158. package/src/skills/api-connector-builder/SKILL.md +120 -0
  159. package/src/skills/code-tour/SKILL.md +236 -0
  160. package/src/skills/compose-multiplatform-patterns/SKILL.md +299 -0
  161. package/src/skills/csharp-testing/SKILL.md +321 -0
  162. package/src/skills/dart-flutter-patterns/SKILL.md +563 -0
  163. package/src/skills/dashboard-builder/SKILL.md +108 -0
  164. package/src/skills/dotnet-patterns/SKILL.md +321 -0
  165. package/src/skills/error-handling/SKILL.md +376 -0
  166. package/src/skills/fastapi-patterns/SKILL.md +327 -0
  167. package/src/skills/flox-environments/SKILL.md +496 -0
  168. package/src/skills/frontend-design/SKILL.md +145 -0
  169. package/src/skills/frontend-slides/SKILL.md +184 -0
  170. package/src/skills/frontend-slides/STYLE_PRESETS.md +330 -0
  171. package/src/skills/fsharp-testing/SKILL.md +280 -0
  172. package/src/skills/gateguard/SKILL.md +121 -0
  173. package/src/skills/github-ops/SKILL.md +144 -0
  174. package/src/skills/hookify-rules/SKILL.md +128 -0
  175. package/src/skills/ios-icon-gen/SKILL.md +157 -0
  176. package/src/skills/ios-icon-gen/scripts/generate_icons.swift +258 -0
  177. package/src/skills/ios-icon-gen/scripts/iconify_gen.sh +235 -0
  178. package/src/skills/knowledge-ops/SKILL.md +154 -0
  179. package/src/skills/liquid-glass-design/SKILL.md +279 -0
  180. package/src/skills/make-interfaces-feel-better/SKILL.md +151 -0
  181. package/src/skills/mysql-patterns/SKILL.md +412 -0
  182. package/src/skills/nestjs-patterns/SKILL.md +230 -0
  183. package/src/skills/plan-orchestrate/SKILL.md +220 -0
  184. package/src/skills/prisma-patterns/SKILL.md +371 -0
  185. package/src/skills/production-audit/SKILL.md +206 -0
  186. package/src/skills/security-bounty-hunter/SKILL.md +99 -0
  187. package/src/skills/security-scan/references/agentshield-policy-exception/candidate-playbook.md +49 -0
  188. package/src/skills/security-scan/references/agentshield-policy-exception/report.json +35 -0
  189. package/src/skills/security-scan/references/agentshield-policy-exception/scenario.json +62 -0
  190. package/src/skills/security-scan/references/agentshield-policy-exception/trace.json +45 -0
  191. package/src/skills/security-scan/references/agentshield-policy-exception/verifier-result.json +35 -0
  192. package/src/skills/swift-actor-persistence/SKILL.md +143 -0
  193. package/src/skills/swift-protocol-di-testing/SKILL.md +190 -0
  194. package/src/skills/swiftui-patterns/SKILL.md +259 -0
  195. package/src/skills/terminal-ops/SKILL.md +109 -0
  196. package/src/skills/ui-demo/SKILL.md +465 -0
  197. package/src/skills/vite-patterns/SKILL.md +449 -0
  198. package/src/skills/windows-desktop-e2e/SKILL.md +887 -0
@@ -0,0 +1,242 @@
1
+ <purpose>
2
+ Extract decisions, lessons learned, patterns discovered, and surprises encountered from completed phase artifacts into a structured LEARNINGS.md file. Captures institutional knowledge that would otherwise be lost between phases.
3
+ </purpose>
4
+
5
+ <required_reading>
6
+ Read all files referenced by the invoking prompt's execution_context before starting.
7
+ </required_reading>
8
+
9
+ <objective>
10
+ Analyze completed phase artifacts (PLAN.md, SUMMARY.md, VERIFICATION.md, UAT.md, STATE.md) and extract structured learnings into 4 categories: decisions, lessons, patterns, and surprises. Each extracted item includes source attribution. The output is a LEARNINGS.md file with YAML frontmatter containing metadata about the extraction.
11
+ </objective>
12
+
13
+ <process>
14
+
15
+ <step name="initialize">
16
+ Parse arguments and load project state:
17
+
18
+ ```bash
19
+ INIT=$(gsd-sdk query init.phase-op "${PHASE_ARG}")
20
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
21
+ ```
22
+
23
+ Parse from init JSON: `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `padded_phase`.
24
+
25
+ If phase not found, exit with error: "Phase {PHASE_ARG} not found."
26
+ </step>
27
+
28
+ <step name="collect_artifacts">
29
+ Read the phase artifacts. PLAN.md and SUMMARY.md are required; VERIFICATION.md, UAT.md, and STATE.md are optional.
30
+
31
+ **Required artifacts:**
32
+ - `${PHASE_DIR}/*-PLAN.md` — all plan files for the phase
33
+ - `${PHASE_DIR}/*-SUMMARY.md` — all summary files for the phase
34
+
35
+ If PLAN.md or SUMMARY.md files are not found or missing, exit with error: "Required artifacts missing. PLAN.md and SUMMARY.md are required for learning extraction."
36
+
37
+ **Optional artifacts (read if available, skip if not found):**
38
+ - `${PHASE_DIR}/*-VERIFICATION.md` — verification results
39
+ - `${PHASE_DIR}/*-UAT.md` — user acceptance test results
40
+ - `.planning/STATE.md` — project state with decisions and blockers
41
+
42
+ Track which optional artifacts are missing for the `missing_artifacts` frontmatter field.
43
+ </step>
44
+
45
+ <step name="extract_learnings">
46
+ Analyze all collected artifacts and extract learnings into 4 categories:
47
+
48
+ ### 1. Decisions
49
+ Technical and architectural decisions made during the phase. Look for:
50
+ - Explicit decisions documented in PLAN.md or SUMMARY.md
51
+ - Technology choices and their rationale
52
+ - Trade-offs that were evaluated
53
+ - Design decisions recorded in STATE.md
54
+
55
+ Each decision entry must include:
56
+ - **What** was decided
57
+ - **Why** it was decided (rationale)
58
+ - **Source:** attribution to the artifact where the decision was found (e.g., "Source: 03-01-PLAN.md")
59
+
60
+ ### 2. Lessons
61
+ Things learned during execution that were not known beforehand. Look for:
62
+ - Unexpected complexity in SUMMARY.md
63
+ - Issues discovered during verification in VERIFICATION.md
64
+ - Failed approaches documented in SUMMARY.md
65
+ - UAT feedback that revealed gaps
66
+
67
+ Each lesson entry must include:
68
+ - **What** was learned
69
+ - **Context** for the lesson
70
+ - **Source:** attribution to the originating artifact
71
+
72
+ ### 3. Patterns
73
+ Reusable patterns, approaches, or techniques discovered. Look for:
74
+ - Successful implementation patterns in SUMMARY.md
75
+ - Testing patterns from VERIFICATION.md or UAT.md
76
+ - Workflow patterns that worked well
77
+ - Code organization patterns from PLAN.md
78
+
79
+ Each pattern entry must include:
80
+ - **Pattern** name/description
81
+ - **When to use** it
82
+ - **Source:** attribution to the originating artifact
83
+
84
+ ### 4. Surprises
85
+ Unexpected findings, behaviors, or outcomes. Look for:
86
+ - Things that took longer or shorter than estimated
87
+ - Unexpected dependencies or interactions
88
+ - Edge cases not anticipated in planning
89
+ - Performance or behavior that differed from expectations
90
+
91
+ Each surprise entry must include:
92
+ - **What** was surprising
93
+ - **Impact** of the surprise
94
+ - **Source:** attribution to the originating artifact
95
+ </step>
96
+
97
+ <step name="capture_thought_integration">
98
+ **What this step is:** `capture_thought` is an **optional convention**, not a bundled GSD tool. GSD does not ship one and does not require one. The step is a hook for users who run a memory / knowledge-base MCP server (for example ExoCortex-style servers, `claude-mem`, or `mem0`-style servers) that exposes a tool with this exact name. If any MCP server in the current session provides a `capture_thought` tool with the signature below, each extracted learning is routed through it with metadata. If no such tool is present, the step is a silent no-op — `LEARNINGS.md` is always the primary output.
99
+
100
+ **Detection:** Check whether a tool named `capture_thought` is available in the current session. Do not assume any specific MCP server is connected.
101
+
102
+ **If available**, call once per extracted learning:
103
+
104
+ ```
105
+ capture_thought({
106
+ category: "decision" | "lesson" | "pattern" | "surprise",
107
+ phase: PHASE_NUMBER,
108
+ content: LEARNING_TEXT,
109
+ source: ARTIFACT_NAME
110
+ })
111
+ ```
112
+
113
+ **If not available** (no MCP server in the session exposes this tool, or the runtime does not support it), skip the step silently and continue. The workflow must not fail or warn — this is expected behavior for users who do not run a knowledge-base MCP.
114
+ </step>
115
+
116
+ <step name="write_learnings">
117
+ Write the LEARNINGS.md file to the phase directory. If a previous LEARNINGS.md exists, overwrite it (replace the file entirely).
118
+
119
+ Output path: `${PHASE_DIR}/${PADDED_PHASE}-LEARNINGS.md`
120
+
121
+ The file must have YAML frontmatter with these fields:
122
+ ```yaml
123
+ ---
124
+ phase: {PHASE_NUMBER}
125
+ phase_name: "{PHASE_NAME}"
126
+ project: "{PROJECT_NAME}"
127
+ generated: "{ISO_DATE}"
128
+ counts:
129
+ decisions: {N}
130
+ lessons: {N}
131
+ patterns: {N}
132
+ surprises: {N}
133
+ missing_artifacts:
134
+ - "{ARTIFACT_NAME}"
135
+ ---
136
+ ```
137
+
138
+ Individual items may carry an optional `graduated:` annotation (added by `graduation.md` when a cluster is promoted):
139
+ ```markdown
140
+ **Graduated:** {target-file}:{ISO_DATE}
141
+ ```
142
+ This annotation is appended after the item's existing fields and prevents the item from being re-surfaced in future graduation scans. Do not add this field during extraction — it is written only by the graduation workflow.
143
+
144
+ The body follows this structure:
145
+ ```markdown
146
+ # Phase {PHASE_NUMBER} Learnings: {PHASE_NAME}
147
+
148
+ ## Decisions
149
+
150
+ ### {Decision Title}
151
+ {What was decided}
152
+
153
+ **Rationale:** {Why}
154
+ **Source:** {artifact file}
155
+
156
+ ---
157
+
158
+ ## Lessons
159
+
160
+ ### {Lesson Title}
161
+ {What was learned}
162
+
163
+ **Context:** {context}
164
+ **Source:** {artifact file}
165
+
166
+ ---
167
+
168
+ ## Patterns
169
+
170
+ ### {Pattern Name}
171
+ {Description}
172
+
173
+ **When to use:** {applicability}
174
+ **Source:** {artifact file}
175
+
176
+ ---
177
+
178
+ ## Surprises
179
+
180
+ ### {Surprise Title}
181
+ {What was surprising}
182
+
183
+ **Impact:** {impact description}
184
+ **Source:** {artifact file}
185
+ ```
186
+ </step>
187
+
188
+ <step name="update_state">
189
+ Update STATE.md to reflect the learning extraction:
190
+
191
+ ```bash
192
+ gsd-sdk query state.update "Last Activity" "$(date +%Y-%m-%d)"
193
+ ```
194
+ </step>
195
+
196
+ <step name="report">
197
+ ```
198
+ ---------------------------------------------------------------
199
+
200
+ ## Learnings Extracted: Phase {X} — {Name}
201
+
202
+ Decisions: {N}
203
+ Lessons: {N}
204
+ Patterns: {N}
205
+ Surprises: {N}
206
+ Total: {N}
207
+
208
+ Output: {PHASE_DIR}/{PADDED_PHASE}-LEARNINGS.md
209
+
210
+ Missing artifacts: {list or "none"}
211
+
212
+ Next steps:
213
+ - Review extracted learnings for accuracy
214
+ - /ccp:progress — see overall project state
215
+ - /ccp:execute-phase {next} — continue to next phase
216
+
217
+ ---------------------------------------------------------------
218
+ ```
219
+ </step>
220
+
221
+ </process>
222
+
223
+ <success_criteria>
224
+ - [ ] Phase artifacts located and read successfully
225
+ - [ ] All 4 categories extracted: decisions, lessons, patterns, surprises
226
+ - [ ] Each extracted item has source attribution
227
+ - [ ] LEARNINGS.md written with correct YAML frontmatter
228
+ - [ ] Missing optional artifacts tracked in frontmatter
229
+ - [ ] capture_thought integration attempted if tool available
230
+ - [ ] STATE.md updated with extraction activity
231
+ - [ ] User receives summary report
232
+ </success_criteria>
233
+
234
+ <critical_rules>
235
+ - PLAN.md and SUMMARY.md are required — exit with clear error if missing
236
+ - VERIFICATION.md, UAT.md, and STATE.md are optional — extract from them if present, skip gracefully if not found
237
+ - Every extracted learning must have source attribution back to the originating artifact
238
+ - Running extract-learnings twice on the same phase must overwrite (replace) the previous LEARNINGS.md, not append
239
+ - Do not fabricate learnings — only extract what is explicitly documented in artifacts
240
+ - If capture_thought is unavailable, the workflow must not fail — graceful degradation to file-only output
241
+ - LEARNINGS.md frontmatter must include counts for all 4 categories and list any missing_artifacts
242
+ </critical_rules>
@@ -47,6 +47,7 @@ These commands manage the full project lifecycle: initialization, planning, exec
47
47
  | `/ccp:discuss-phase <N>` | Gather phase context through adaptive questioning before planning |
48
48
  | `/ccp:research-phase <N>` | Research how to implement a phase (standalone ecosystem research) |
49
49
  | `/ccp:plan-phase <N>` | Create detailed phase plan (PLAN.md) with verification loop |
50
+ | `/ccp:mvp-phase <N>` | Plan a phase as a vertical MVP slice -- user story, SPIDR splitting, then plan-phase |
50
51
  | `/ccp:validate-phase <N>` | Retroactively audit and fill Nyquist validation gaps for a completed phase |
51
52
  | `/ccp:list-phase-assumptions <N>` | Surface Claude's assumptions about a phase approach before planning |
52
53
 
@@ -107,6 +108,7 @@ These commands manage the full project lifecycle: initialization, planning, exec
107
108
  | `/ccp:plant-seed [idea]` | Capture a forward-looking idea with trigger conditions |
108
109
  | `/ccp:ship [phase]` | Create PR, run review, and prepare for merge after verification |
109
110
  | `/ccp:pr-branch [target]` | Create a clean PR branch by filtering out .planning/ commits |
111
+ | `/ccp:pr-ecc [base]` | Create a GitHub PR from the current branch's unpushed commits (no .planning/ filtering, unlike pr-branch) |
110
112
  | `/ccp:session-report` | Generate a session report with token usage, summary, and outcomes |
111
113
  | `/ccp:milestone-summary` | Generate a comprehensive project summary from milestone artifacts |
112
114
 
@@ -129,6 +131,7 @@ These are utility commands for day-to-day development: code quality, testing, bu
129
131
  | Command | Description |
130
132
  |---------|-------------|
131
133
  | `/ccp:code-review` | Comprehensive security and quality review of uncommitted changes |
134
+ | `/ccp:security-scan` | Scan your `.claude/` config for security issues via AgentShield (external, opt-in via `npx`) |
132
135
  | `/ccp:tdd` | Enforce TDD workflow -- scaffold interfaces, generate tests first, then implement |
133
136
  | `/ccp:test-coverage` | Analyze test coverage, identify gaps, and generate missing tests for 80%+ |
134
137
  | `/ccp:refactor-clean` | Safely identify and remove dead code with test verification at every step |
@@ -150,6 +153,7 @@ These are utility commands for day-to-day development: code quality, testing, bu
150
153
  | Command | Description |
151
154
  |---------|-------------|
152
155
  | `/ccp:plan` | Restate requirements, assess risks, and create step-by-step implementation plan |
156
+ | `/ccp:plan-prd` | Generate a lean, problem-first PRD and hand off to `/ccp:plan` for implementation planning |
153
157
  | `/ccp:orchestrate` | Sequential and tmux/worktree guidance for multi-agent workflows |
154
158
  | `/ccp:aside` | Answer a quick side question without losing context from the current task |
155
159
  | `/ccp:context-budget` | Analyze context window usage and find optimization opportunities |
@@ -169,6 +173,7 @@ These are utility commands for day-to-day development: code quality, testing, bu
169
173
  | Command | Description |
170
174
  |---------|-------------|
171
175
  | `/ccp:eval` | Manage eval-driven development workflow |
176
+ | `/ccp:cost-report` | Generate a local Claude Code cost report from a cost-tracker SQLite database |
172
177
  | `/ccp:harness-audit` | Run a deterministic repository harness audit and return a scorecard |
173
178
  | `/ccp:skill-create` | Analyze git history to extract coding patterns and generate SKILL.md files |
174
179
  | `/ccp:skill-health` | Show skill portfolio health dashboard with charts and analytics |
@@ -0,0 +1,246 @@
1
+ # Import Workflow
2
+
3
+ External plan ingestion with conflict detection and agent delegation.
4
+
5
+ - **--from**: Import external plan → conflict detection → write PLAN.md → validate via gsd-plan-checker
6
+
7
+ Future: `--prd` mode (PRD extraction into PROJECT.md + REQUIREMENTS.md + ROADMAP.md) is planned for a follow-up PR.
8
+
9
+ ---
10
+
11
+ <step name="banner">
12
+
13
+ Display the stage banner:
14
+
15
+ ```
16
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
17
+ GSD ► IMPORT
18
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
19
+ ```
20
+
21
+ </step>
22
+
23
+ <step name="parse_arguments">
24
+
25
+ Parse `$ARGUMENTS` to determine the execution mode:
26
+
27
+ - If `--from` is present: extract FILEPATH (the next token after `--from`), set MODE=plan
28
+ - If `--prd` is present: display message that `--prd` is not yet implemented and exit:
29
+ ```
30
+ GSD > --prd mode is planned for a future release. Use --from to import plan files.
31
+ ```
32
+ - If neither flag is found: display usage and exit:
33
+
34
+ ```
35
+ Usage: /ccp:import --from <path>
36
+
37
+ --from <path> Import an external plan file into GSD format
38
+ ```
39
+
40
+ **Validate the file path:**
41
+
42
+ Verify the path does not contain traversal sequences and the file exists:
43
+
44
+ ```bash
45
+ case "{FILEPATH}" in
46
+ *..* ) echo "SECURITY_ERROR: path contains traversal sequence"; exit 1 ;;
47
+ esac
48
+ test -f "{FILEPATH}" || echo "FILE_NOT_FOUND"
49
+ ```
50
+
51
+ If FILE_NOT_FOUND: display error and exit:
52
+
53
+ ```
54
+ ╔══════════════════════════════════════════════════════════════╗
55
+ ║ ERROR ║
56
+ ╚══════════════════════════════════════════════════════════════╝
57
+
58
+ File not found: {FILEPATH}
59
+
60
+ **To fix:** Verify the file path and try again.
61
+ ```
62
+
63
+ </step>
64
+
65
+ ---
66
+
67
+ ## Path A: MODE=plan (--from)
68
+
69
+ <step name="plan_load_context">
70
+
71
+ Load project context for conflict detection:
72
+
73
+ 1. Read `.planning/ROADMAP.md` — extract phase structure, phase numbers, dependencies
74
+ 2. Read `.planning/PROJECT.md` — extract project constraints, tech stack, scope boundaries.
75
+ **If PROJECT.md does not exist:** skip constraint checks that rely on it and display:
76
+ ```
77
+ GSD > Note: No PROJECT.md found. Conflict checks against project constraints will be skipped.
78
+ ```
79
+ 3. Read `.planning/REQUIREMENTS.md` — extract existing requirements for overlap and contradiction checks.
80
+ **If REQUIREMENTS.md does not exist:** skip requirement conflict checks and continue.
81
+ 4. Glob for all CONTEXT.md files across phase directories:
82
+ ```bash
83
+ find .planning/phases/ -name "*-CONTEXT.md" -o -name "CONTEXT.md" 2>/dev/null
84
+ ```
85
+ Read each CONTEXT.md found — extract locked decisions (any decision in a `<decisions>` block)
86
+
87
+ Store loaded context for conflict detection in the next step.
88
+
89
+ </step>
90
+
91
+ <step name="plan_read_input">
92
+
93
+ Read the imported file at FILEPATH.
94
+
95
+ Determine the format:
96
+ - **GSD PLAN.md format**: Has YAML frontmatter with `phase:`, `plan:`, `type:` fields
97
+ - **Freeform document**: Any other format (markdown spec, design doc, task list, etc.)
98
+
99
+ Extract from the imported content:
100
+ - **Phase target**: Which phase this plan belongs to (from frontmatter or inferred from content)
101
+ - **Plan objectives**: What the plan aims to accomplish
102
+ - **Tasks listed**: Individual work items described in the plan
103
+ - **Files modified**: Any files mentioned as targets
104
+ - **Dependencies**: Any referenced prerequisites
105
+
106
+ </step>
107
+
108
+ <step name="plan_conflict_detection">
109
+
110
+ Run conflict checks against the loaded project context. The report format, severity semantics, and safety-gate behavior are defined by `references/doc-conflict-engine.md` — read it and apply it here. Operation noun: `import`.
111
+
112
+ ### BLOCKER checks (any one prevents import):
113
+
114
+ - Plan targets a phase number that does not exist in ROADMAP.md → [BLOCKER]
115
+ - Plan specifies a tech stack that contradicts PROJECT.md constraints → [BLOCKER]
116
+ - Plan contradicts a locked decision in any CONTEXT.md `<decisions>` block → [BLOCKER]
117
+ - Plan contradicts an existing requirement in REQUIREMENTS.md → [BLOCKER]
118
+
119
+ ### WARNING checks (user confirmation required):
120
+
121
+ - Plan partially overlaps existing requirement coverage in REQUIREMENTS.md → [WARNING]
122
+ - Plan has `depends_on` referencing plans that are not yet complete → [WARNING]
123
+ - Plan modifies files that overlap with existing incomplete plans → [WARNING]
124
+ - Plan phase number conflicts with existing phase numbering in ROADMAP.md → [WARNING]
125
+
126
+ ### INFO checks (informational, no action needed):
127
+
128
+ - Plan uses a library not currently in the project tech stack → [INFO]
129
+ - Plan adds a new phase to the ROADMAP.md structure → [INFO]
130
+
131
+ Render the full Conflict Detection Report using the format in `references/doc-conflict-engine.md`.
132
+
133
+ **If any [BLOCKER] exists:** apply the safety gate from the reference — exit WITHOUT writing any files. No PLAN.md is written when blockers exist.
134
+
135
+ **If only WARNINGS and/or INFO (no blockers):**
136
+
137
+ **Text mode (`workflow.text_mode: true` in config or `--text` flag):** Set `TEXT_MODE=true` if `--text` is present in `$ARGUMENTS` OR `text_mode` from init JSON is `true`. When TEXT_MODE is active, replace every `AskUserQuestion` call with a plain-text numbered list and ask the user to type their choice number. This is required for non-Claude runtimes (OpenAI Codex, Gemini CLI, etc.) where `AskUserQuestion` is not available.
138
+
139
+ Ask via AskUserQuestion using the approve-revise-abort pattern (see `references/gate-prompts.md`):
140
+ - question: "Review the warnings above. Proceed with import?"
141
+ - header: "Approve?"
142
+ - options: Approve | Abort
143
+
144
+ If user selects "Abort": exit cleanly with message "Import cancelled."
145
+
146
+ </step>
147
+
148
+ <step name="plan_convert">
149
+
150
+ Convert the imported content to GSD PLAN.md format.
151
+
152
+ Ensure the PLAN.md has all required frontmatter fields:
153
+ ```yaml
154
+ ---
155
+ phase: "{NN}-{slug}"
156
+ plan: "{NN}-{MM}"
157
+ type: "feature|refactor|config|test|docs"
158
+ wave: 1
159
+ depends_on: []
160
+ files_modified: []
161
+ autonomous: true
162
+ must_haves:
163
+ truths: []
164
+ artifacts: []
165
+ ---
166
+ ```
167
+
168
+ **Reject PBR naming conventions in source content:**
169
+ If the imported plan references PBR plan naming (e.g., `PLAN-01.md`, `plan-01.md`), rename all references to GSD `{NN}-{MM}-PLAN.md` convention during conversion.
170
+
171
+ Apply GSD naming convention for the output filename:
172
+ - Format: `{NN}-{MM}-PLAN.md` (e.g., `04-01-PLAN.md`)
173
+ - NEVER use `PLAN-01.md`, `plan-01.md`, or any other format
174
+ - NN = phase number (zero-padded), MM = plan number within the phase (zero-padded)
175
+
176
+ Determine the target directory:
177
+ ```
178
+ .planning/phases/{NN}-{slug}/
179
+ ```
180
+
181
+ If the directory does not exist, create it:
182
+ ```bash
183
+ mkdir -p ".planning/phases/{NN}-{slug}/"
184
+ ```
185
+
186
+ Write the PLAN.md file to the target directory.
187
+
188
+ </step>
189
+
190
+ <step name="plan_validate">
191
+
192
+ Delegate validation to gsd-plan-checker:
193
+
194
+ ```
195
+ Task({
196
+ subagent_type: "gsd-plan-checker",
197
+ prompt: "Validate: .planning/phases/{phase}/{plan}-PLAN.md — check frontmatter completeness, task structure, and GSD conventions. Report any issues."
198
+ })
199
+ ```
200
+
201
+ If the checker returns errors:
202
+ - Display the errors to the user
203
+ - Ask the user to resolve issues before the plan is considered imported
204
+ - Do not delete the written file — the user can fix and re-validate manually
205
+
206
+ If the checker returns clean:
207
+ - Display: "Plan validation passed"
208
+
209
+ </step>
210
+
211
+ <step name="plan_finalize">
212
+
213
+ Update `.planning/ROADMAP.md` to reflect the new plan:
214
+ - Add the plan to the Plans list under the correct phase section
215
+ - Include the plan name and description
216
+
217
+ Update `.planning/STATE.md` if appropriate (e.g., increment total plan count).
218
+
219
+ Commit the imported plan and updated files:
220
+ ```bash
221
+ gsd-sdk query commit "docs({phase}): import plan from {basename FILEPATH}" .planning/phases/{phase}/{plan}-PLAN.md .planning/ROADMAP.md
222
+ ```
223
+
224
+ Display completion:
225
+ ```
226
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
227
+ GSD ► IMPORT COMPLETE
228
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
229
+ ```
230
+
231
+ Show: plan filename written, phase directory, validation result, next steps.
232
+
233
+ </step>
234
+
235
+ ---
236
+
237
+ ## Anti-Patterns
238
+
239
+ Do NOT:
240
+ - Violate the shared conflict-engine contract in `references/doc-conflict-engine.md` (no markdown tables, no new severity labels, no bypass of the BLOCKER gate)
241
+ - Write PLAN.md files as `PLAN-01.md` or `plan-01.md` — always use `{NN}-{MM}-PLAN.md`
242
+ - Use `pbr:plan-checker` or `pbr:planner` — use `gsd-plan-checker` and `gsd-planner`
243
+ - Write `.planning/.active-skill` — this is a PBR pattern with no GSD equivalent
244
+ - Reference `pbr-tools`, `pbr:`, or `PLAN-BUILD-RUN` anywhere
245
+ - Write any PLAN.md file when blockers exist — the safety gate must hold
246
+ - Skip path validation on the --from file argument