prizmkit 1.1.7 → 1.1.9

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 (132) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/adapters/codebuddy/skill-adapter.js +21 -7
  3. package/bundled/agents/prizm-dev-team-reviewer.md +53 -173
  4. package/bundled/dev-pipeline/.env.example +45 -0
  5. package/bundled/dev-pipeline/README.md +64 -64
  6. package/bundled/dev-pipeline/SCHEMA_ANALYSIS.md +535 -0
  7. package/bundled/dev-pipeline/assets/feature-list-example.json +0 -1
  8. package/bundled/dev-pipeline/launch-bugfix-daemon.sh +64 -18
  9. package/bundled/dev-pipeline/launch-feature-daemon.sh +15 -12
  10. package/bundled/dev-pipeline/launch-refactor-daemon.sh +64 -18
  11. package/bundled/dev-pipeline/lib/branch.sh +6 -1
  12. package/bundled/dev-pipeline/lib/common.sh +71 -0
  13. package/bundled/dev-pipeline/lib/heartbeat.sh +2 -2
  14. package/bundled/dev-pipeline/reset-bug.sh +10 -9
  15. package/bundled/dev-pipeline/reset-feature.sh +9 -8
  16. package/bundled/dev-pipeline/reset-refactor.sh +10 -9
  17. package/bundled/dev-pipeline/retry-bugfix.sh +67 -29
  18. package/bundled/dev-pipeline/retry-feature.sh +54 -18
  19. package/bundled/dev-pipeline/retry-refactor.sh +112 -29
  20. package/bundled/dev-pipeline/run-bugfix.sh +281 -59
  21. package/bundled/dev-pipeline/run-feature.sh +53 -18
  22. package/bundled/dev-pipeline/run-refactor.sh +392 -66
  23. package/bundled/dev-pipeline/scripts/check-session-status.py +24 -1
  24. package/bundled/dev-pipeline/scripts/cleanup-logs.py +2 -2
  25. package/bundled/dev-pipeline/scripts/detect-stuck.py +195 -85
  26. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +57 -33
  27. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +25 -9
  28. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +104 -17
  29. package/bundled/dev-pipeline/scripts/init-bugfix-pipeline.py +34 -9
  30. package/bundled/dev-pipeline/scripts/init-pipeline.py +10 -10
  31. package/bundled/dev-pipeline/scripts/init-refactor-pipeline.py +19 -8
  32. package/bundled/dev-pipeline/scripts/parse-stream-progress.py +1 -5
  33. package/bundled/dev-pipeline/scripts/patch-completion-notes.py +191 -0
  34. package/bundled/dev-pipeline/scripts/update-bug-status.py +167 -22
  35. package/bundled/dev-pipeline/scripts/update-feature-status.py +104 -62
  36. package/bundled/dev-pipeline/scripts/update-refactor-status.py +351 -21
  37. package/bundled/dev-pipeline/templates/agent-prompts/dev-fix.md +1 -1
  38. package/bundled/dev-pipeline/templates/agent-prompts/reviewer-review.md +7 -11
  39. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +41 -7
  40. package/bundled/dev-pipeline/templates/bootstrap-tier1.md +27 -3
  41. package/bundled/dev-pipeline/templates/bootstrap-tier2.md +43 -19
  42. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +54 -26
  43. package/bundled/dev-pipeline/templates/bug-fix-list-schema.json +6 -15
  44. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +36 -25
  45. package/bundled/dev-pipeline/templates/feature-list-schema.json +109 -31
  46. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +270 -0
  47. package/bundled/dev-pipeline/templates/refactor-list-schema.json +11 -3
  48. package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +3 -1
  49. package/bundled/dev-pipeline/templates/sections/critical-paths-agent.md +1 -0
  50. package/bundled/dev-pipeline/templates/sections/feature-context.md +2 -0
  51. package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +29 -2
  52. package/bundled/dev-pipeline/templates/sections/phase-commit.md +22 -0
  53. package/bundled/dev-pipeline/templates/sections/phase-deploy-verification.md +2 -2
  54. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +8 -6
  55. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +7 -5
  56. package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +3 -3
  57. package/bundled/skills/_metadata.json +5 -22
  58. package/bundled/skills/app-planner/SKILL.md +98 -72
  59. package/bundled/skills/app-planner/assets/app-design-guide.md +1 -1
  60. package/bundled/skills/app-planner/references/architecture-decisions.md +1 -1
  61. package/bundled/skills/app-planner/references/project-brief-guide.md +69 -66
  62. package/bundled/skills/bug-fix-workflow/SKILL.md +52 -9
  63. package/bundled/skills/bug-planner/SKILL.md +139 -197
  64. package/bundled/skills/bug-planner/assets/bug-confirmation-template.md +43 -0
  65. package/bundled/skills/bug-planner/references/critic-and-verification.md +44 -0
  66. package/bundled/skills/bug-planner/references/error-recovery.md +73 -0
  67. package/bundled/skills/bug-planner/references/input-formats.md +53 -0
  68. package/bundled/skills/bug-planner/references/schema-validation.md +25 -0
  69. package/bundled/skills/bug-planner/references/severity-rules.md +16 -0
  70. package/bundled/skills/bug-planner/scripts/validate-bug-list.py +4 -8
  71. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +34 -39
  72. package/bundled/skills/feature-pipeline-launcher/SKILL.md +49 -36
  73. package/bundled/skills/feature-pipeline-launcher/scripts/preflight-check.py +3 -3
  74. package/bundled/skills/feature-planner/SKILL.md +53 -142
  75. package/bundled/skills/feature-planner/assets/evaluation-guide.md +1 -1
  76. package/bundled/skills/feature-planner/assets/planning-guide.md +21 -5
  77. package/bundled/skills/feature-planner/references/browser-interaction.md +2 -4
  78. package/bundled/skills/feature-planner/references/completeness-review.md +57 -0
  79. package/bundled/skills/feature-planner/references/error-recovery.md +16 -35
  80. package/bundled/skills/feature-planner/references/incremental-feature-planning.md +1 -1
  81. package/bundled/skills/feature-planner/references/new-project-planning.md +2 -2
  82. package/bundled/skills/feature-planner/scripts/validate-and-generate.py +19 -20
  83. package/bundled/skills/feature-workflow/SKILL.md +24 -25
  84. package/bundled/skills/prizm-kit/SKILL.md +39 -49
  85. package/bundled/skills/prizmkit-code-review/SKILL.md +51 -64
  86. package/bundled/skills/prizmkit-code-review/rules/dimensions.md +85 -0
  87. package/bundled/skills/prizmkit-code-review/rules/fix-strategy.md +11 -11
  88. package/bundled/skills/prizmkit-committer/SKILL.md +3 -31
  89. package/bundled/skills/prizmkit-deploy/SKILL.md +34 -31
  90. package/bundled/skills/prizmkit-deploy/assets/deploy-template.md +1 -1
  91. package/bundled/skills/prizmkit-implement/SKILL.md +35 -68
  92. package/bundled/skills/prizmkit-init/SKILL.md +112 -65
  93. package/bundled/skills/prizmkit-init/assets/project-brief-template.md +82 -0
  94. package/bundled/skills/prizmkit-plan/SKILL.md +120 -79
  95. package/bundled/skills/prizmkit-plan/assets/plan-template.md +28 -18
  96. package/bundled/skills/prizmkit-plan/assets/spec-template.md +28 -11
  97. package/bundled/skills/prizmkit-plan/references/clarify-guide.md +3 -3
  98. package/bundled/skills/prizmkit-plan/references/verification-checklist.md +60 -0
  99. package/bundled/skills/prizmkit-prizm-docs/SKILL.md +10 -81
  100. package/bundled/skills/prizmkit-prizm-docs/assets/{PRIZM-SPEC.md → prizm-docs-format.md} +41 -526
  101. package/bundled/skills/prizmkit-prizm-docs/references/op-init.md +46 -0
  102. package/bundled/skills/prizmkit-prizm-docs/references/op-rebuild.md +16 -0
  103. package/bundled/skills/prizmkit-prizm-docs/references/op-status.md +14 -0
  104. package/bundled/skills/prizmkit-prizm-docs/references/op-update.md +19 -0
  105. package/bundled/skills/prizmkit-prizm-docs/references/op-validate.md +17 -0
  106. package/bundled/skills/prizmkit-retrospective/SKILL.md +27 -65
  107. package/bundled/skills/prizmkit-retrospective/references/knowledge-injection-steps.md +3 -4
  108. package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +7 -25
  109. package/bundled/skills/recovery-workflow/SKILL.md +22 -22
  110. package/bundled/skills/recovery-workflow/evals/evals.json +5 -5
  111. package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +43 -10
  112. package/bundled/skills/refactor-pipeline-launcher/SKILL.md +48 -40
  113. package/bundled/skills/refactor-planner/SKILL.md +43 -61
  114. package/bundled/skills/refactor-planner/scripts/validate-and-generate-refactor.py +17 -17
  115. package/bundled/skills/refactor-workflow/SKILL.md +23 -24
  116. package/bundled/team/prizm-dev-team.json +1 -1
  117. package/bundled/{skills/prizm-kit/assets → templates}/project-memory-template.md +1 -1
  118. package/package.json +1 -1
  119. package/src/clean.js +3 -4
  120. package/src/gitignore-template.js +7 -9
  121. package/src/scaffold.js +14 -5
  122. package/bundled/dev-pipeline/templates/agent-prompts/reviewer-analyze.md +0 -5
  123. package/bundled/dev-pipeline/templates/sections/phase-analyze-agent.md +0 -19
  124. package/bundled/dev-pipeline/templates/sections/phase-analyze-full.md +0 -19
  125. package/bundled/skills/app-planner/references/project-conventions.md +0 -93
  126. package/bundled/skills/prizmkit-analyze/SKILL.md +0 -207
  127. package/bundled/skills/prizmkit-code-review/rules/dimensions-bugfix.md +0 -25
  128. package/bundled/skills/prizmkit-code-review/rules/dimensions-feature.md +0 -43
  129. package/bundled/skills/prizmkit-code-review/rules/dimensions-refactor.md +0 -25
  130. package/bundled/skills/prizmkit-implement/references/deploy-guide-protocol.md +0 -69
  131. package/bundled/skills/prizmkit-verify/SKILL.md +0 -281
  132. package/bundled/skills/prizmkit-verify/scripts/verify-light.py +0 -402
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "title": "Dev-Pipeline Feature List",
4
- "description": "Schema for .dev-pipeline/feature-list.json",
4
+ "description": "Schema for .prizmkit/plans/feature-list.json",
5
5
  "type": "object",
6
- "required": ["$schema", "project_name", "features"],
6
+ "required": [
7
+ "$schema",
8
+ "project_name",
9
+ "features"
10
+ ],
7
11
  "properties": {
8
12
  "$schema": {
9
13
  "type": "string",
@@ -23,65 +27,103 @@
23
27
  "created_by": {
24
28
  "type": "string"
25
29
  },
26
- "source_spec": {
27
- "type": "string"
28
- },
29
30
  "features": {
30
31
  "type": "array",
31
32
  "minItems": 1,
32
33
  "items": {
33
34
  "type": "object",
34
- "required": ["id", "title", "description", "priority", "dependencies", "acceptance_criteria", "status"],
35
+ "required": [
36
+ "id",
37
+ "title",
38
+ "description",
39
+ "priority",
40
+ "dependencies",
41
+ "acceptance_criteria",
42
+ "status"
43
+ ],
35
44
  "properties": {
36
45
  "id": {
37
46
  "type": "string",
38
- "pattern": "^F-\\d{3}(-[A-Z])?$"
47
+ "pattern": "^F-\\d{3}(-[A-Z])?$",
48
+ "description": "Feature ID, format F-001, F-002... Optional sub-feature suffix: F-001-A"
39
49
  },
40
50
  "title": {
41
51
  "type": "string",
42
- "minLength": 1
52
+ "minLength": 1,
53
+ "description": "Feature title — brief description of the functionality"
43
54
  },
44
55
  "description": {
45
56
  "type": "string",
46
- "minLength": 1
57
+ "minLength": 1,
58
+ "description": "Detailed feature description: what it does, why it's needed"
47
59
  },
48
60
  "priority": {
49
61
  "type": "string",
50
- "enum": ["critical", "high", "medium", "low"],
62
+ "enum": [
63
+ "critical",
64
+ "high",
65
+ "medium",
66
+ "low"
67
+ ],
51
68
  "description": "Feature priority. Pipeline processes critical before high before medium before low; within same level, array order determines sequence."
52
69
  },
53
70
  "estimated_complexity": {
54
71
  "type": "string",
55
- "enum": ["low", "medium", "high"]
72
+ "enum": [
73
+ "low",
74
+ "medium",
75
+ "high"
76
+ ],
77
+ "description": "Estimated implementation complexity. Determines pipeline execution tier: low=lite, medium=standard, high=full."
56
78
  },
57
79
  "dependencies": {
58
80
  "type": "array",
59
81
  "items": {
60
82
  "type": "string",
61
83
  "pattern": "^F-\\d{3}(-[A-Z])?$"
62
- }
84
+ },
85
+ "description": "IDs of features that must be completed before this one"
63
86
  },
64
87
  "acceptance_criteria": {
65
88
  "type": "array",
66
89
  "minItems": 1,
67
90
  "items": {
68
91
  "type": "string"
69
- }
92
+ },
93
+ "description": "Conditions that must be met for the feature to be considered complete"
70
94
  },
71
95
  "status": {
72
96
  "type": "string",
73
- "enum": ["pending", "in_progress", "completed", "failed", "skipped", "split", "auto_skipped"]
97
+ "enum": [
98
+ "pending",
99
+ "in_progress",
100
+ "completed",
101
+ "failed",
102
+ "skipped",
103
+ "split",
104
+ "auto_skipped"
105
+ ],
106
+ "description": "Feature status. Pipeline manages status transitions automatically."
74
107
  },
75
108
  "session_granularity": {
76
109
  "type": "string",
77
- "enum": ["feature", "sub_feature", "auto"],
78
- "default": "feature"
110
+ "enum": [
111
+ "feature",
112
+ "sub_feature",
113
+ "auto"
114
+ ],
115
+ "default": "feature",
116
+ "description": "Session execution strategy: feature=one-session-per-feature, sub_feature=one-session-per-sub-feature, auto=pipeline-decides"
79
117
  },
80
118
  "sub_features": {
81
119
  "type": "array",
82
120
  "items": {
83
121
  "type": "object",
84
- "required": ["id", "title", "description"],
122
+ "required": [
123
+ "id",
124
+ "title",
125
+ "description"
126
+ ],
85
127
  "properties": {
86
128
  "id": {
87
129
  "type": "string",
@@ -110,7 +152,17 @@
110
152
  "critic_count": {
111
153
  "type": "integer",
112
154
  "description": "Number of parallel critic agents. 1 = single critic, 3 = multi-critic voting. Default: 1.",
113
- "enum": [1, 3]
155
+ "enum": [
156
+ 1,
157
+ 3
158
+ ]
159
+ },
160
+ "completion_notes": {
161
+ "type": "array",
162
+ "items": {
163
+ "type": "string"
164
+ },
165
+ "description": "AI-generated summary of key changes from this feature session. Used to provide rich dependency context to downstream features. Each item is a concise statement about what was built/changed (e.g. APIs added, models created, key file paths)."
114
166
  },
115
167
  "browser_interaction": {
116
168
  "type": "object",
@@ -137,7 +189,9 @@
137
189
  "default": true
138
190
  }
139
191
  },
140
- "required": ["url"]
192
+ "required": [
193
+ "url"
194
+ ]
141
195
  }
142
196
  }
143
197
  }
@@ -145,18 +199,42 @@
145
199
  "global_context": {
146
200
  "type": "object",
147
201
  "properties": {
148
- "tech_stack": { "type": "string" },
149
- "language": { "type": "string" },
150
- "runtime": { "type": "string" },
151
- "frontend_framework": { "type": "string" },
152
- "frontend_styling": { "type": "string" },
153
- "backend_framework": { "type": "string" },
154
- "database": { "type": "string" },
155
- "orm": { "type": "string" },
156
- "design_system": { "type": "string" },
157
- "testing_strategy": { "type": "string" },
158
- "bundler": { "type": "string" },
159
- "project_type": { "type": "string" }
202
+ "tech_stack": {
203
+ "type": "string"
204
+ },
205
+ "language": {
206
+ "type": "string"
207
+ },
208
+ "runtime": {
209
+ "type": "string"
210
+ },
211
+ "frontend_framework": {
212
+ "type": "string"
213
+ },
214
+ "frontend_styling": {
215
+ "type": "string"
216
+ },
217
+ "backend_framework": {
218
+ "type": "string"
219
+ },
220
+ "database": {
221
+ "type": "string"
222
+ },
223
+ "orm": {
224
+ "type": "string"
225
+ },
226
+ "design_system": {
227
+ "type": "string"
228
+ },
229
+ "testing_strategy": {
230
+ "type": "string"
231
+ },
232
+ "bundler": {
233
+ "type": "string"
234
+ },
235
+ "project_type": {
236
+ "type": "string"
237
+ }
160
238
  }
161
239
  }
162
240
  }
@@ -0,0 +1,270 @@
1
+ # Dev-Pipeline Refactor Session Bootstrap
2
+
3
+ ## Session Context
4
+
5
+ - **Pipeline Run ID**: {{RUN_ID}}
6
+ - **Session ID**: {{SESSION_ID}}
7
+ - **Refactor ID**: {{REFACTOR_ID}}
8
+ - **Refactor Title**: {{REFACTOR_TITLE}}
9
+ - **Refactor Type**: {{REFACTOR_TYPE}}
10
+ - **Priority**: {{PRIORITY}}
11
+ - **Complexity**: {{COMPLEXITY}}
12
+ - **Retry Count**: {{RETRY_COUNT}} / {{MAX_RETRIES}}
13
+ - **Previous Session Status**: {{PREV_SESSION_STATUS}}
14
+ - **Resume From Phase**: {{RESUME_PHASE}}
15
+
16
+ ## Your Mission
17
+
18
+ You are the **refactor session orchestrator**. Execute Refactor {{REFACTOR_ID}}: "{{REFACTOR_TITLE}}".
19
+
20
+ **CRITICAL SESSION LIFECYCLE RULE**: You MUST NOT exit until ALL work is complete and session-status.json is written. When you spawn subagents, you MUST **wait for each to finish** (run_in_background=false) before proceeding. Do NOT spawn an agent in the background and exit — that kills the session.
21
+
22
+ **NON-INTERACTIVE MODE**: You are running in headless non-interactive mode. There is NO human on the other end. NEVER ask for user confirmation, NEVER wait for user input, NEVER use interactive prompts (e.g. "Would you like me to…"). If a skill has an interactive step (e.g. offer remediation, ask for approval), skip it and proceed autonomously. Make decisions based on the data available and move forward.
23
+
24
+ **MANDATORY TEAM REQUIREMENT**: You MUST use the `prizm-dev-team` agents (Dev + Reviewer). This is NON-NEGOTIABLE. All implementation and review work MUST be performed by the appropriate team agents (Dev, Reviewer). You are the orchestrator — handle coordination, planning, and commit phases directly.
25
+
26
+ **REFACTOR DOCUMENTATION POLICY**:
27
+ - **DEFAULT**: Run `/prizmkit-retrospective` with full sync (Job 1 + Job 2), because refactoring changes code structure and interfaces.
28
+ - **SKIP Job 2** only if the refactor is a pure rename with no interface changes.
29
+ - Commit with `refactor(<scope>):` prefix, NOT `feat:` or `fix:`
30
+
31
+ ### Team Definition Reference
32
+
33
+ - **Team config**: `{{TEAM_CONFIG_PATH}}`
34
+
35
+ ### Refactor Description
36
+
37
+ {{REFACTOR_DESCRIPTION}}
38
+
39
+ ### Scope
40
+
41
+ **Files:**
42
+ {{SCOPE_FILES}}
43
+
44
+ **Modules:**
45
+ {{SCOPE_MODULES}}
46
+
47
+ ### Behavior Preservation
48
+
49
+ - **Strategy**: {{BEHAVIOR_STRATEGY}}
50
+ - **Existing Tests**:
51
+ {{EXISTING_TESTS}}
52
+ - **New Tests Needed**:
53
+ {{NEW_TESTS_NEEDED}}
54
+
55
+ ### Acceptance Criteria
56
+
57
+ {{ACCEPTANCE_CRITERIA}}
58
+
59
+ ### Dependencies
60
+
61
+ {{DEPENDENCIES}}
62
+
63
+ ### App Global Context
64
+
65
+ {{GLOBAL_CONTEXT}}
66
+
67
+ ## Refactor Artifacts Directory
68
+
69
+ **ALWAYS** use per-refactor subdirectory `.prizmkit/refactor/{{REFACTOR_ID}}/`:
70
+
71
+ ```
72
+ .prizmkit/refactor/{{REFACTOR_ID}}/
73
+ ├── spec.md ← /prizmkit-plan output (goals, scope, behavior preservation)
74
+ ├── plan.md ← /prizmkit-plan output (change approach, tasks)
75
+ └── refactor-report.md ← Phase 5 output (generated after commit)
76
+ ```
77
+
78
+ ## Execution Instructions
79
+
80
+ **YOU are the orchestrator. Execute each phase by spawning the appropriate team agent with run_in_background=false.**
81
+
82
+ ## Workflow Checkpoint System
83
+
84
+ A checkpoint file tracks your progress through this workflow:
85
+
86
+ **Path**: `{{CHECKPOINT_PATH}}`
87
+
88
+ **How to use**:
89
+ 1. **Before each step**: Read `workflow-checkpoint.json`, verify the previous step has `status: "completed"` or `status: "skipped"`. If not, complete it first.
90
+ 2. **After completing a step**: Update the step's `status` to `"completed"` in `workflow-checkpoint.json`.
91
+
92
+ ### Step 1: Initialize
93
+
94
+ #### Agent Setup
95
+
96
+ Reference `{{TEAM_CONFIG_PATH}}` for agent definitions:
97
+ - Dev: `{{DEV_SUBAGENT_PATH}}`
98
+ - Reviewer: `{{REVIEWER_SUBAGENT_PATH}}`
99
+
100
+ Create refactor artifacts directory:
101
+ ```bash
102
+ mkdir -p .prizmkit/refactor/{{REFACTOR_ID}}
103
+ ```
104
+
105
+ ### Step 2: Pipeline Phases
106
+
107
+ #### Phase 1: Plan — Specification & Plan Generation
108
+
109
+ **Goal**: Generate spec.md and plan.md with behavior-preserving task breakdown.
110
+
111
+ Run `/prizmkit-plan` with `artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/`:
112
+ - Description: "{{REFACTOR_TITLE}} — {{REFACTOR_DESCRIPTION}}"
113
+ - The spec.md MUST include:
114
+ - Goals with acceptance criteria (from the acceptance criteria above)
115
+ - Scope (files and modules from above)
116
+ - Behavior Preservation section (strategy: {{BEHAVIOR_STRATEGY}}, existing tests, what must not change)
117
+ - The plan.md MUST include:
118
+ - Change approach with behavior preservation strategy
119
+ - Tasks ordered by safety: safe renames first → extractions → structural changes
120
+ - Every task ends with "run test suite to verify behavior preserved"
121
+ - Rollback strategy
122
+
123
+ Resolve any `[NEEDS CLARIFICATION]` markers using the refactor description — do NOT pause for interactive input.
124
+
125
+ - **CP-RF-1**: Both `spec.md` and `plan.md` exist in `.prizmkit/refactor/{{REFACTOR_ID}}/`
126
+ - **Checkpoint update**: set step `prizmkit-plan` to `"completed"` in `{{CHECKPOINT_PATH}}`
127
+
128
+ ---
129
+
130
+ #### Phase 2: Implement — Behavior-Preserving Refactoring
131
+
132
+ **Goal**: Execute all tasks from plan.md while preserving existing behavior.
133
+
134
+ - Spawn Dev agent (Agent tool, subagent_type="prizm-dev-team-dev", run_in_background=false)
135
+ Prompt: "Read {{DEV_SUBAGENT_PATH}}. For refactor {{REFACTOR_ID}} ('{{REFACTOR_TITLE}}'):
136
+ 1. Read `.prizmkit/refactor/{{REFACTOR_ID}}/spec.md` and `.prizmkit/refactor/{{REFACTOR_ID}}/plan.md`
137
+ 2. Read `.prizm-docs/` for affected modules (TRAPS, RULES, PATTERNS)
138
+ 3. Before making any changes, run the existing test suite to establish a green baseline
139
+ 4. Execute each task from plan.md in order:
140
+ - Apply the change
141
+ - Run the test suite after EVERY task — all tests MUST pass
142
+ - If tests fail: revert the task, analyze why, try alternative approach
143
+ - Mark task as [x] in plan.md after tests pass
144
+ 5. Do NOT change behavior — only improve structure
145
+ 6. If the refactor involves multiple files: run `/compact` after completing half the tasks to free context budget. If `/compact` is unavailable, continue without it.
146
+ 7. After all tasks complete, run the full test suite one final time
147
+ "
148
+ - **Wait for Dev to return**
149
+ - If Dev reports test failures that cannot be resolved after 3 attempts: escalate, write status="failed"
150
+ - **CP-RF-2**: All tasks completed, all tests green
151
+ - **Checkpoint update**: set step `prizmkit-implement` to `"completed"` in `{{CHECKPOINT_PATH}}`
152
+
153
+ ---
154
+
155
+ #### Phase 3: Review — Code Review & Behavior Verification
156
+
157
+ **Goal**: Verify refactoring quality and behavior preservation.
158
+
159
+ - Spawn Reviewer agent (Agent tool, subagent_type="prizm-dev-team-reviewer", run_in_background=false)
160
+ Prompt: "Read {{REVIEWER_SUBAGENT_PATH}}. For refactor {{REFACTOR_ID}}:
161
+ 1. Read `.prizmkit/refactor/{{REFACTOR_ID}}/spec.md` for goals and behavior preservation contracts
162
+ 2. Read `.prizmkit/refactor/{{REFACTOR_ID}}/plan.md` for architecture decisions and completed tasks
163
+ 3. Run `/prizmkit-code-review` with artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/ scoped to CHANGED FILES ONLY (both phases: diagnostic + fix strategy)
164
+ 4. Run full test suite and verify ALL tests pass
165
+ 5. Write integration tests covering all goals from spec.md
166
+ 6. review-report.md will be written to .prizmkit/refactor/{{REFACTOR_ID}}/ by prizmkit-code-review
167
+ 7. Report: number of findings found, or 'no findings' if clean
168
+ "
169
+ - **Wait for Reviewer to return**
170
+ - **Verdict decision** (L4 responsibility): If findings exist → return to Phase 2 for refinement (max 2 review rounds). If no findings → proceed.
171
+ - **CP-RF-3**: Code review passes, all tests green, behavior preserved
172
+ - **Checkpoint update**: set step `prizmkit-code-review` to `"completed"` in `{{CHECKPOINT_PATH}}`
173
+
174
+ ---
175
+
176
+ #### Phase 4: Commit & Report
177
+
178
+ **Goal**: Commit the refactor, update docs, generate report.
179
+
180
+ **This phase is executed by YOU (the orchestrator), NOT a subagent.**
181
+
182
+ 1. Run `/prizmkit-retrospective` (full sync — Job 1 + Job 2) to update `.prizm-docs/` with structural changes
183
+
184
+ 2. Run `/prizmkit-committer` with:
185
+ - Commit message: `refactor({{REFACTOR_ID}}): {{REFACTOR_TITLE}}`
186
+ - Include all refactored files and any new/updated tests
187
+ - Do NOT push (user will push manually)
188
+
189
+ 3. Write the refactor report to `.prizmkit/refactor/{{REFACTOR_ID}}/refactor-report.md`
190
+
191
+ The refactor-report.md MUST contain these sections:
192
+ - Refactor Summary (ID, title, type, status, phases completed)
193
+ - What Changed (files modified, structural changes made, diff summary)
194
+ - Behavior Verification (test suite results before/after, specific tests exercised)
195
+ - Code Quality Metrics (if measurable: files consolidated, duplication reduced, etc.)
196
+ - Acceptance Criteria Verification (checklist with pass/fail for each criterion)
197
+
198
+ 4. Write completion summary for downstream dependency context:
199
+
200
+ Write `.prizmkit/refactor/{{REFACTOR_ID}}/completion-summary.json` — this is NOT committed to git. The pipeline runner reads it to propagate context to dependent refactors.
201
+ ```json
202
+ {
203
+ "completion_notes": [
204
+ "<each item: one key structural change that downstream refactors may need to know>",
205
+ "Example: Extracted shared validation logic into src/utils/validation.ts",
206
+ "Example: Renamed UserService → AuthService, moved from src/services/ to src/auth/",
207
+ "Example: Decoupled payment module from user module via PaymentGateway interface"
208
+ ]
209
+ }
210
+ ```
211
+ Rules: focus on structural changes, new module boundaries, renamed/moved files, changed interfaces. 3-8 notes, each under 120 chars.
212
+
213
+ - **CP-RF-4**: Commit recorded, refactor-report.md written, .prizm-docs/ updated
214
+ - **Checkpoint update**: set steps `prizmkit-committer` and `refactor-report` to `"completed"` in `{{CHECKPOINT_PATH}}`
215
+
216
+ ### Step 3: Report Session Status
217
+
218
+ **CRITICAL**: Before this session ends, you MUST write the session status file.
219
+
220
+ Write to: `{{SESSION_STATUS_PATH}}`
221
+
222
+ ```json
223
+ {
224
+ "session_id": "{{SESSION_ID}}",
225
+ "refactor_id": "{{REFACTOR_ID}}",
226
+ "status": "<success|partial|failed>",
227
+ "completed_phases": [1, 2, 3, 4],
228
+ "current_phase": 4,
229
+ "checkpoint_reached": "CP-RF-4",
230
+ "errors": [],
231
+ "can_resume": false,
232
+ "resume_from_phase": null,
233
+ "artifacts": {
234
+ "spec_path": ".prizmkit/refactor/{{REFACTOR_ID}}/spec.md",
235
+ "plan_path": ".prizmkit/refactor/{{REFACTOR_ID}}/plan.md",
236
+ "report_path": ".prizmkit/refactor/{{REFACTOR_ID}}/refactor-report.md"
237
+ },
238
+ "git_commit": "<commit hash>",
239
+ "behavior_preserved": true,
240
+ "timestamp": "{{TIMESTAMP}}"
241
+ }
242
+ ```
243
+
244
+ **Status values**: `success` (all phases done) | `partial` (can resume) | `failed` (unrecoverable)
245
+
246
+ ## Critical Paths
247
+
248
+ | Resource | Path |
249
+ |----------|------|
250
+ | Team Definition (source of truth) | `{{TEAM_CONFIG_PATH}}` |
251
+ | Refactor Artifacts Dir | `.prizmkit/refactor/{{REFACTOR_ID}}/` |
252
+ | Spec | `.prizmkit/refactor/{{REFACTOR_ID}}/spec.md` |
253
+ | Plan | `.prizmkit/refactor/{{REFACTOR_ID}}/plan.md` |
254
+ | Refactor Report | `.prizmkit/refactor/{{REFACTOR_ID}}/refactor-report.md` |
255
+ | Dev Agent Def | {{DEV_SUBAGENT_PATH}} |
256
+ | Reviewer Agent Def | {{REVIEWER_SUBAGENT_PATH}} |
257
+ | Session Status Output | {{SESSION_STATUS_PATH}} |
258
+ | Workflow Checkpoint | {{CHECKPOINT_PATH}} |
259
+ | Project Root | {{PROJECT_ROOT}} |
260
+
261
+ ## Reminders
262
+
263
+ - **MANDATORY**: Use `prizm-dev-team` agents — single-agent execution is FORBIDDEN
264
+ - **Behavior preservation is the #1 priority**: If tests break, stop and fix before proceeding
265
+ - **Run tests after EVERY task** — not just at the end
266
+ - Use `/prizmkit-plan` with `artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/` for spec + plan generation
267
+ - **Commit with** `refactor(<scope>):` prefix, NOT `feat:` or `fix:`
268
+ - **Run full retrospective** (Job 1 + Job 2) — refactoring changes code structure
269
+ - ALWAYS write session-status.json before exiting
270
+ - Do NOT use `run_in_background=true` when spawning agents
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "title": "Dev-Pipeline Refactor List",
4
- "description": "Schema for refactor-list.json \u2014 standardized input for the Refactor Pipeline",
4
+ "description": "Schema for .prizmkit/plans/refactor-list.json \u2014 standardized input for the Refactor Pipeline",
5
5
  "type": "object",
6
6
  "required": [
7
7
  "$schema",
@@ -164,9 +164,10 @@
164
164
  "in_progress",
165
165
  "completed",
166
166
  "failed",
167
- "skipped"
167
+ "skipped",
168
+ "auto_skipped"
168
169
  ],
169
- "description": "Refactor status"
170
+ "description": "Refactor status. Subset of feature status enum."
170
171
  },
171
172
  "model": {
172
173
  "type": "string",
@@ -176,6 +177,13 @@
176
177
  "type": "integer",
177
178
  "description": "Estimated number of lines affected by this refactor"
178
179
  },
180
+ "completion_notes": {
181
+ "type": "array",
182
+ "items": {
183
+ "type": "string"
184
+ },
185
+ "description": "AI-generated summary of key changes from this refactor session. Used to provide rich dependency context to downstream refactors. Each item is a concise statement about what was refactored (e.g. modules extracted, files restructured, interfaces changed)."
186
+ },
179
187
  "critic": {
180
188
  "type": "boolean",
181
189
  "description": "Enable adversarial critic review for this refactor. Default: true for critical/high priority refactors, false for others.",
@@ -1,6 +1,8 @@
1
1
  ## Context Budget Rules (CRITICAL — read before any phase)
2
2
 
3
- You are running in headless mode with a FINITE context window. Exceeding it will crash the session and lose all work. Follow these rules strictly:
3
+ You are running in **headless non-interactive mode** with a FINITE context window. Exceeding it will crash the session and lose all work. Follow these rules strictly:
4
+
5
+ 0. **NON-INTERACTIVE MODE** — There is NO human on the other end. NEVER ask for user confirmation, NEVER wait for user input, NEVER use interactive prompts (e.g. "Would you like me to…"). If a skill has an interactive step (e.g. offer remediation, ask for approval), skip it and proceed autonomously. Make decisions based on the data available and move forward.
4
6
 
5
7
  1. **context-snapshot.md is your single source of truth** — After it is built, ALWAYS read context-snapshot.md instead of re-reading individual source files
6
8
  2. **Never re-read your own writes** — After you create/modify a file, do NOT read it back to verify. Trust your write was correct.
@@ -6,4 +6,5 @@
6
6
  | Context Snapshot | `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` |
7
7
  | Dev Agent Def | {{DEV_SUBAGENT_PATH}} |
8
8
  | Reviewer Agent Def | {{REVIEWER_SUBAGENT_PATH}} |
9
+ | Critic Agent Def (if enabled) | {{CRITIC_SUBAGENT_PATH}} |
9
10
  | Project Root | {{PROJECT_ROOT}} |
@@ -15,6 +15,8 @@
15
15
 
16
16
  ### Dependencies (Already Completed)
17
17
 
18
+ > Below are features that this feature depends on, along with their key implementation notes. Use this context to understand what has already been built and what interfaces/APIs/models are available.
19
+
18
20
  {{COMPLETED_DEPENDENCIES}}
19
21
 
20
22
  ### App Global Context
@@ -1,6 +1,11 @@
1
1
  ### Architecture Sync & Commit (SINGLE COMMIT) — DO NOT SKIP
2
2
 
3
- **For bug fixes**: run `/prizmkit-retrospective` for structural sync only (skip knowledge injection unless a new TRAPS was discovered). Use `fix(<scope>):` commit prefix.
3
+ **Bug Fix Documentation Policy**:
4
+ - DEFAULT: Run `/prizmkit-retrospective` with structural sync only (update file counts, interfaces, dependencies). Skip knowledge injection.
5
+ - UPDATE DOCS (run full retrospective — Job 1 + Job 2) when bug fix causes: interface signature changes, dependency additions/removals, observable behavior changes to existing features, or newly discovered TRAPs.
6
+ - Simple bugs: No new spec.md/plan.md needed. Use fast path.
7
+ - Complex bugs (multi-module, cascading): Use `/prizmkit-plan` with `artifact_dir=.prizmkit/bugfix/<BUG_ID>/`.
8
+ - Commit prefix: `fix(<scope>):` (not `feat:`).
4
9
 
5
10
  **a.** Check if feature already committed:
6
11
  ```bash
@@ -15,7 +20,7 @@ git log --oneline | grep "{{FEATURE_ID}}" | head -3
15
20
  - **L2 coverage check**: For any module/sub-module with source files created or significantly modified in this session but no L2 `.prizm` doc — evaluate whether L2 is warranted and create if so. The current session has the best context for accurate KEY_FILES, TRAPS, and DECISIONS.
16
21
  - Stage doc changes: `git add .prizm-docs/`
17
22
  ⚠️ Do NOT commit here. Only stage.
18
- - **For bug-fix sessions**: structural sync only, skip knowledge injection unless a genuinely new pitfall was discovered
23
+ - **For bug-fix sessions**: structural sync (Job 1) by default. Run knowledge injection (Job 2) when the fix causes interface signature changes, dependency additions/removals, observable behavior changes, or reveals new TRAPs
19
24
 
20
25
  **c.** Stage all feature code explicitly (NEVER use `git add -A` or `git add .`):
21
26
  ```bash
@@ -35,5 +40,27 @@ git status --short
35
40
  ```
36
41
  Working tree MUST be clean after this step. If any feature-related files remain, stage them into the SAME commit via `git add <file> && git commit --amend --no-edit`, do NOT create a separate commit.
37
42
 
43
+ **f.** Write completion summary for downstream dependency context:
44
+
45
+ Write `.prizmkit/specs/{{FEATURE_SLUG}}/completion-summary.json` with the key changes from this session. This file is NOT committed to git — the pipeline runner reads it to propagate context to dependent features.
46
+
47
+ ```json
48
+ {
49
+ "completion_notes": [
50
+ "<each item: one key change, API, model, or integration point that downstream features may need>",
51
+ "Example: Added User model (id, email, password_hash, display_name) in prisma/schema.prisma",
52
+ "Example: POST /api/auth/register and POST /api/auth/login endpoints in src/api/auth.ts",
53
+ "Example: Auth middleware in src/middleware/auth.ts — validates JWT on protected routes"
54
+ ]
55
+ }
56
+ ```
57
+
58
+ Rules for writing completion notes:
59
+ - Focus on **what downstream features need to know**: new APIs, models, exported functions, key file paths
60
+ - Each note should be self-contained and concise (one line, under 120 characters preferred)
61
+ - Include 3-8 notes covering the most important changes
62
+ - Do NOT include test files, config changes, or internal implementation details unless they affect other features
63
+ - If this feature has no downstream dependents, still write the summary (it serves as documentation)
64
+
38
65
 
39
66
  **Checkpoint update**: After `/prizmkit-retrospective` completes, update `workflow-checkpoint.json` — set step `prizmkit-retrospective` to `"completed"`. After `/prizmkit-committer` completes, set step `prizmkit-committer` to `"completed"`.
@@ -25,5 +25,27 @@ git status --short
25
25
  ```
26
26
  Working tree MUST be clean after this step. If any feature-related files remain, stage them into the SAME commit via `git add <file> && git commit --amend --no-edit`, do NOT create a separate commit.
27
27
 
28
+ **e.** Write completion summary for downstream dependency context:
29
+
30
+ Write `.prizmkit/specs/{{FEATURE_SLUG}}/completion-summary.json` with the key changes from this session. This file is NOT committed to git — the pipeline runner reads it to propagate context to dependent features.
31
+
32
+ ```json
33
+ {
34
+ "completion_notes": [
35
+ "<each item: one key change, API, model, or integration point that downstream features may need>",
36
+ "Example: Added User model (id, email, password_hash, display_name) in prisma/schema.prisma",
37
+ "Example: POST /api/auth/register and POST /api/auth/login endpoints in src/api/auth.ts",
38
+ "Example: Auth middleware in src/middleware/auth.ts — validates JWT on protected routes"
39
+ ]
40
+ }
41
+ ```
42
+
43
+ Rules for writing completion notes:
44
+ - Focus on **what downstream features need to know**: new APIs, models, exported functions, key file paths
45
+ - Each note should be self-contained and concise (one line, under 120 characters preferred)
46
+ - Include 3-8 notes covering the most important changes
47
+ - Do NOT include test files, config changes, or internal implementation details unless they affect other features
48
+ - If this feature has no downstream dependents, still write the summary (it serves as documentation)
49
+
28
50
 
29
51
  **Checkpoint update**: After `/prizmkit-retrospective` completes, update `workflow-checkpoint.json` — set step `prizmkit-retrospective` to `"completed"`. After `/prizmkit-committer` completes, set step `prizmkit-committer` to `"completed"`.
@@ -7,7 +7,7 @@ You just implemented this feature — you know the project's tech stack and buil
7
7
  3. **Assess and record** — append to context-snapshot.md:
8
8
  - **ALL builds pass** → `## Deploy Verification: PASS` — proceed to commit
9
9
  - **Some builds fail with fixable errors** → fix and re-verify (already handled in step 2)
10
- - **Cannot build locally** (missing system-level deps you cannot install) → Generate `DEPLOY.md` with:
10
+ - **Cannot build locally** (missing system-level deps you cannot install) → Generate `.prizmkit/deploy.md` with:
11
11
  ```
12
12
  # Local Development Setup
13
13
 
@@ -23,7 +23,7 @@ You just implemented this feature — you know the project's tech stack and buil
23
23
  ## Verify
24
24
  [how to confirm the app is running correctly]
25
25
  ```
26
- Record: `## Deploy Verification: PARTIAL — see DEPLOY.md for missing prerequisites`
26
+ Record: `## Deploy Verification: PARTIAL — see .prizmkit/deploy.md for missing prerequisites`
27
27
 
28
28
  Deploy verification does NOT block the commit, but you MUST attempt it.
29
29