prizmkit 1.0.68 → 1.0.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/VERSION.json +3 -3
- package/bundled/agents/prizm-dev-team-dev.md +104 -90
- package/bundled/agents/prizm-dev-team-reviewer.md +111 -100
- package/bundled/dev-pipeline/retry-bug.sh +7 -0
- package/bundled/dev-pipeline/retry-feature.sh +7 -0
- package/bundled/dev-pipeline/run-bugfix.sh +2 -0
- package/bundled/dev-pipeline/run.sh +32 -2
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +6 -0
- package/bundled/dev-pipeline/scripts/parse-stream-progress.py +62 -18
- package/bundled/dev-pipeline/templates/agent-knowledge-template.md +13 -0
- package/bundled/dev-pipeline/templates/bootstrap-tier1.md +47 -21
- package/bundled/dev-pipeline/templates/bootstrap-tier2.md +56 -27
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +80 -35
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +5 -5
- package/bundled/rules/USAGE.md +53 -53
- package/bundled/rules/prizm/prizm-commit-workflow.md +1 -1
- package/bundled/skills/_metadata.json +6 -6
- package/bundled/skills/app-planner/SKILL.md +4 -4
- package/bundled/skills/bug-fix-workflow/SKILL.md +2 -2
- package/bundled/skills/bug-planner/SKILL.md +5 -5
- package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +11 -11
- package/bundled/skills/dev-pipeline-launcher/SKILL.md +15 -15
- package/bundled/skills/feature-workflow/SKILL.md +13 -13
- package/bundled/skills/prizm-kit/SKILL.md +8 -3
- package/bundled/skills/prizm-kit/assets/project-memory-template.md +1 -1
- package/bundled/skills/prizmkit-code-review/SKILL.md +4 -2
- package/bundled/skills/prizmkit-committer/SKILL.md +4 -4
- package/bundled/skills/prizmkit-implement/SKILL.md +10 -4
- package/bundled/skills/prizmkit-init/SKILL.md +1 -1
- package/bundled/skills/prizmkit-prizm-docs/SKILL.md +3 -3
- package/bundled/skills/prizmkit-prizm-docs/assets/PRIZM-SPEC.md +6 -6
- package/bundled/skills/prizmkit-retrospective/SKILL.md +79 -18
- package/bundled/skills/prizmkit-tool-adr-manager/SKILL.md +2 -2
- package/bundled/skills/refactor-workflow/SKILL.md +13 -13
- package/bundled/team/prizm-dev-team.json +1 -1
- package/package.json +1 -1
|
@@ -56,10 +56,51 @@ class ProgressTracker:
|
|
|
56
56
|
self._current_tool_input_parts = []
|
|
57
57
|
|
|
58
58
|
def process_event(self, event):
|
|
59
|
-
"""Process a single stream-json event and update state.
|
|
59
|
+
"""Process a single stream-json event and update state.
|
|
60
|
+
|
|
61
|
+
Supports two formats:
|
|
62
|
+
1. Claude API raw stream: message_start, content_block_start, content_block_delta, etc.
|
|
63
|
+
2. Claude Code verbose stream-json: assistant, user, tool_result, system, etc.
|
|
64
|
+
(produced by claude/claude-internal --verbose --output-format stream-json)
|
|
65
|
+
"""
|
|
60
66
|
event_type = event.get("type", "")
|
|
61
67
|
|
|
62
|
-
|
|
68
|
+
# ── Claude Code verbose format ──────────────────────────────
|
|
69
|
+
if event_type == "assistant":
|
|
70
|
+
self.message_count += 1
|
|
71
|
+
self.is_active = True
|
|
72
|
+
message = event.get("message", {})
|
|
73
|
+
content_blocks = message.get("content", [])
|
|
74
|
+
for block in content_blocks:
|
|
75
|
+
block_type = block.get("type", "")
|
|
76
|
+
if block_type == "tool_use":
|
|
77
|
+
tool_name = block.get("name", "unknown")
|
|
78
|
+
self.current_tool = tool_name
|
|
79
|
+
self.tool_call_counts[tool_name] += 1
|
|
80
|
+
self.total_tool_calls += 1
|
|
81
|
+
# Extract summary from input
|
|
82
|
+
tool_input = block.get("input", {})
|
|
83
|
+
if isinstance(tool_input, dict):
|
|
84
|
+
self._extract_tool_summary_from_dict(tool_input)
|
|
85
|
+
self._detect_phase(json.dumps(tool_input, ensure_ascii=False)[:500])
|
|
86
|
+
elif block_type == "text":
|
|
87
|
+
text = block.get("text", "")
|
|
88
|
+
if text.strip():
|
|
89
|
+
self.last_text_snippet = text.strip()[:120]
|
|
90
|
+
self._detect_phase(text)
|
|
91
|
+
|
|
92
|
+
elif event_type == "tool_result" or event_type == "user":
|
|
93
|
+
# tool_result contains output from tool execution
|
|
94
|
+
self.is_active = True
|
|
95
|
+
|
|
96
|
+
elif event_type == "system":
|
|
97
|
+
# System events (hooks, init, etc.) — track but don't count as messages
|
|
98
|
+
subtype = event.get("subtype", "")
|
|
99
|
+
if subtype == "init":
|
|
100
|
+
self.is_active = True
|
|
101
|
+
|
|
102
|
+
# ── Claude API raw stream format ────────────────────────────
|
|
103
|
+
elif event_type == "message_start":
|
|
63
104
|
self.message_count += 1
|
|
64
105
|
self.is_active = True
|
|
65
106
|
|
|
@@ -141,28 +182,31 @@ class ProgressTracker:
|
|
|
141
182
|
return
|
|
142
183
|
|
|
143
184
|
def _extract_tool_summary(self, raw_input):
|
|
144
|
-
"""Extract a human-readable summary from tool input JSON."""
|
|
185
|
+
"""Extract a human-readable summary from tool input JSON string."""
|
|
145
186
|
try:
|
|
146
187
|
data = json.loads(raw_input)
|
|
147
|
-
|
|
148
|
-
if isinstance(data, dict):
|
|
149
|
-
# Agent tool - look for description or prompt
|
|
150
|
-
if "description" in data:
|
|
151
|
-
self.current_tool_input_summary = str(data["description"])[:100]
|
|
152
|
-
elif "command" in data:
|
|
153
|
-
self.current_tool_input_summary = str(data["command"])[:100]
|
|
154
|
-
elif "file_path" in data:
|
|
155
|
-
self.current_tool_input_summary = str(data["file_path"])[:100]
|
|
156
|
-
elif "pattern" in data:
|
|
157
|
-
self.current_tool_input_summary = str(data["pattern"])[:100]
|
|
158
|
-
elif "query" in data:
|
|
159
|
-
self.current_tool_input_summary = str(data["query"])[:100]
|
|
160
|
-
elif "prompt" in data:
|
|
161
|
-
self.current_tool_input_summary = str(data["prompt"])[:100]
|
|
188
|
+
self._extract_tool_summary_from_dict(data)
|
|
162
189
|
except (json.JSONDecodeError, TypeError):
|
|
163
190
|
# Keep whatever partial summary we had
|
|
164
191
|
pass
|
|
165
192
|
|
|
193
|
+
def _extract_tool_summary_from_dict(self, data):
|
|
194
|
+
"""Extract a human-readable summary from tool input dict."""
|
|
195
|
+
if isinstance(data, dict):
|
|
196
|
+
# Common patterns in tool inputs
|
|
197
|
+
if "description" in data:
|
|
198
|
+
self.current_tool_input_summary = str(data["description"])[:100]
|
|
199
|
+
elif "command" in data:
|
|
200
|
+
self.current_tool_input_summary = str(data["command"])[:100]
|
|
201
|
+
elif "file_path" in data:
|
|
202
|
+
self.current_tool_input_summary = str(data["file_path"])[:100]
|
|
203
|
+
elif "pattern" in data:
|
|
204
|
+
self.current_tool_input_summary = str(data["pattern"])[:100]
|
|
205
|
+
elif "query" in data:
|
|
206
|
+
self.current_tool_input_summary = str(data["query"])[:100]
|
|
207
|
+
elif "prompt" in data:
|
|
208
|
+
self.current_tool_input_summary = str(data["prompt"])[:100]
|
|
209
|
+
|
|
166
210
|
def to_dict(self):
|
|
167
211
|
"""Export current state as a dictionary for JSON serialization."""
|
|
168
212
|
tool_calls = [
|
|
@@ -42,6 +42,28 @@ You are the **session orchestrator**. Implement Feature {{FEATURE_ID}}: "{{FEATU
|
|
|
42
42
|
|
|
43
43
|
## Execution
|
|
44
44
|
|
|
45
|
+
### Phase 0.5: Agent Knowledge Setup
|
|
46
|
+
|
|
47
|
+
Create the agent knowledge directory and initialize your own knowledge doc:
|
|
48
|
+
```bash
|
|
49
|
+
mkdir -p .prizmkit/specs/{{FEATURE_SLUG}}/agents
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Write `.prizmkit/specs/{{FEATURE_SLUG}}/agents/orchestrator.md`:
|
|
53
|
+
```markdown
|
|
54
|
+
# Orchestrator
|
|
55
|
+
|
|
56
|
+
## FINDINGS
|
|
57
|
+
|
|
58
|
+
## DECISIONS
|
|
59
|
+
|
|
60
|
+
## INTERFACES_DISCOVERED
|
|
61
|
+
|
|
62
|
+
## CONTEXT_BUILT
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
After each phase, append notable DECISIONS/FINDINGS to your `agents/orchestrator.md`.
|
|
66
|
+
|
|
45
67
|
{{IF_INIT_NEEDED}}
|
|
46
68
|
### Phase 0: Project Bootstrap
|
|
47
69
|
- Run `/prizmkit-init` (invoke the prizmkit-init skill)
|
|
@@ -108,24 +130,19 @@ Key decisions: [list]
|
|
|
108
130
|
|
|
109
131
|
**CP-2**: All acceptance criteria met, tests pass, code review passed.
|
|
110
132
|
|
|
111
|
-
### Phase 4.5: Memory
|
|
133
|
+
### Phase 4.5: Architecture Sync & Memory Sedimentation (mandatory before commit)
|
|
112
134
|
|
|
113
|
-
Run `/prizmkit-retrospective` —
|
|
135
|
+
Run `/prizmkit-retrospective` — maintains `.prizm-docs/` (architecture index) and platform memory files:
|
|
114
136
|
1. **Structural sync**: Use `git diff --cached --name-status` to locate changed modules, update KEY_FILES/INTERFACES/DEPENDENCIES/file counts in affected `.prizm-docs/` files
|
|
115
|
-
2. **
|
|
116
|
-
3.
|
|
137
|
+
2. **Architecture knowledge** (feature sessions only): Extract TRAPS/RULES from completed work into `.prizm-docs/`
|
|
138
|
+
3. **Memory sedimentation** (feature sessions only): Sediment DECISIONS and interface conventions to platform memory file (`CLAUDE.md` for Claude Code, BOTH `CODEBUDDY.md` AND `memory/MEMORY.md` for CodeBuddy)
|
|
139
|
+
4. Stage all doc changes: `git add .prizm-docs/`
|
|
117
140
|
|
|
118
141
|
Doc maintenance pass condition (pipeline-enforced): `.prizm-docs/` changed in the final commit.
|
|
119
142
|
|
|
120
|
-
### Phase 5: Commit
|
|
143
|
+
### Phase 5: Session Status + Commit
|
|
121
144
|
|
|
122
|
-
|
|
123
|
-
- MANDATORY: commit must be done via `/prizmkit-committer` skill. Do NOT run manual `git add`/`git commit` as a substitute.
|
|
124
|
-
- Do NOT run `update-feature-status.py` here — the pipeline runner handles feature-list.json updates automatically after session exit.
|
|
125
|
-
|
|
126
|
-
---
|
|
127
|
-
|
|
128
|
-
## Step 3: Write Session Status
|
|
145
|
+
**5a. Write preliminary session-status.json** (safety net — ensures pipeline sees a status file even if session terminates during commit):
|
|
129
146
|
|
|
130
147
|
Write to: `{{SESSION_STATUS_PATH}}`
|
|
131
148
|
|
|
@@ -135,8 +152,8 @@ Write to: `{{SESSION_STATUS_PATH}}`
|
|
|
135
152
|
"feature_id": "{{FEATURE_ID}}",
|
|
136
153
|
"feature_slug": "{{FEATURE_SLUG}}",
|
|
137
154
|
"exec_tier": 1,
|
|
138
|
-
"status": "
|
|
139
|
-
"completed_phases": [0, 1, 2, 3, 4
|
|
155
|
+
"status": "partial",
|
|
156
|
+
"completed_phases": [0, 1, 2, 3, 4],
|
|
140
157
|
"current_phase": 5,
|
|
141
158
|
"checkpoint_reached": "CP-2",
|
|
142
159
|
"tasks_completed": 0,
|
|
@@ -150,23 +167,31 @@ Write to: `{{SESSION_STATUS_PATH}}`
|
|
|
150
167
|
"context_snapshot_path": ".prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md",
|
|
151
168
|
"plan_path": ".prizmkit/specs/{{FEATURE_SLUG}}/plan.md"
|
|
152
169
|
},
|
|
153
|
-
"git_commit": "
|
|
154
|
-
"timestamp": "
|
|
170
|
+
"git_commit": "",
|
|
171
|
+
"timestamp": "<current ISO timestamp>"
|
|
155
172
|
}
|
|
156
173
|
```
|
|
157
174
|
|
|
158
|
-
|
|
175
|
+
**5b. Commit** — Run `/prizmkit-committer` → `feat({{FEATURE_ID}}): {{FEATURE_TITLE}}`, do NOT push
|
|
176
|
+
- MANDATORY: commit must be done via `/prizmkit-committer` skill. Do NOT run manual `git add`/`git commit` as a substitute.
|
|
177
|
+
- Do NOT run `update-feature-status.py` here — the pipeline runner handles feature-list.json updates automatically after session exit.
|
|
178
|
+
|
|
179
|
+
**5c. Update session-status.json to success** — After commit succeeds, update `{{SESSION_STATUS_PATH}}`:
|
|
180
|
+
- Set `"status": "success"`
|
|
181
|
+
- Set `"completed_phases": [0, 1, 2, 3, 4, 5]`
|
|
182
|
+
- Set `"git_commit": "<actual commit hash from git log -1 --format=%H>"`
|
|
183
|
+
- Set `"timestamp": "<current ISO timestamp>"`
|
|
159
184
|
|
|
160
|
-
|
|
185
|
+
**5d. Final Clean Check** — Verify repository is clean:
|
|
161
186
|
|
|
162
187
|
```bash
|
|
163
188
|
git status --short
|
|
164
189
|
```
|
|
165
190
|
|
|
166
|
-
If any files remain (
|
|
191
|
+
If any files remain, stage them **explicitly by name** (do NOT use `git add -A`) and create a follow-up commit:
|
|
167
192
|
|
|
168
193
|
```bash
|
|
169
|
-
git add -
|
|
194
|
+
git add <specific-file-1> <specific-file-2>
|
|
170
195
|
git commit -m "chore({{FEATURE_ID}}): include session artifacts"
|
|
171
196
|
```
|
|
172
197
|
|
|
@@ -186,6 +211,7 @@ Re-check `git status --short` and ensure it is empty before exiting.
|
|
|
186
211
|
- Tier 1: you handle everything directly — invoke skills yourself (no subagents needed for simple tasks)
|
|
187
212
|
- MANDATORY skills: `/prizmkit-code-review`, `/prizmkit-retrospective`, `/prizmkit-committer` — never skip these
|
|
188
213
|
- Build context-snapshot.md FIRST; use it throughout instead of re-reading files
|
|
189
|
-
-
|
|
214
|
+
- Session-status.json is written BEFORE commit (as partial), then updated to success AFTER commit — this prevents pipeline from treating a terminated session as crashed
|
|
190
215
|
- `/prizmkit-committer` is mandatory — do NOT skip the commit phase, and do NOT replace it with manual git commit commands
|
|
191
216
|
- Before exiting, `git status --short` must be empty
|
|
217
|
+
- When staging leftover files in the final clean check, always use explicit file names — NEVER use `git add -A`
|
|
@@ -46,13 +46,35 @@ You are the **session orchestrator**. Implement Feature {{FEATURE_ID}}: "{{FEATU
|
|
|
46
46
|
|
|
47
47
|
If a subagent times out:
|
|
48
48
|
1. `ls .prizmkit/specs/{{FEATURE_SLUG}}/` — check what exists
|
|
49
|
-
2. Re-spawn with: `"Read .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md for full context. Do NOT re-read individual source files."` + only remaining steps + `model: "lite"`
|
|
49
|
+
2. Re-spawn with: `"Read .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md for full context. Also read .prizmkit/specs/{{FEATURE_SLUG}}/agents/*.md for knowledge from previous agents. Do NOT re-read individual source files."` + only remaining steps + `model: "lite"`
|
|
50
50
|
3. Max 2 retries. After 2 failures, complete the work yourself.
|
|
51
51
|
|
|
52
52
|
---
|
|
53
53
|
|
|
54
54
|
## Execution
|
|
55
55
|
|
|
56
|
+
### Phase 0.5: Agent Knowledge Setup
|
|
57
|
+
|
|
58
|
+
Create the agent knowledge directory and initialize your own knowledge doc:
|
|
59
|
+
```bash
|
|
60
|
+
mkdir -p .prizmkit/specs/{{FEATURE_SLUG}}/agents
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Write `.prizmkit/specs/{{FEATURE_SLUG}}/agents/orchestrator.md`:
|
|
64
|
+
```markdown
|
|
65
|
+
# Orchestrator
|
|
66
|
+
|
|
67
|
+
## FINDINGS
|
|
68
|
+
|
|
69
|
+
## DECISIONS
|
|
70
|
+
|
|
71
|
+
## INTERFACES_DISCOVERED
|
|
72
|
+
|
|
73
|
+
## CONTEXT_BUILT
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
After each phase, append notable DECISIONS/FINDINGS to your `agents/orchestrator.md`.
|
|
77
|
+
|
|
56
78
|
{{IF_INIT_NEEDED}}
|
|
57
79
|
### Phase 0: Project Bootstrap
|
|
58
80
|
- Run `/prizmkit-init` (invoke the prizmkit-init skill)
|
|
@@ -106,7 +128,8 @@ Prompt:
|
|
|
106
128
|
> 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` — all project context, source files, and tests are embedded there.
|
|
107
129
|
> 2. Read `.prizmkit/specs/{{FEATURE_SLUG}}/plan.md` (including Tasks section).
|
|
108
130
|
> 3. Implement task-by-task using TDD. Mark each task `[x]` in plan.md Tasks section immediately after completion.
|
|
109
|
-
> 4. After
|
|
131
|
+
> 4. **Agent Knowledge Doc**: Maintain `.prizmkit/specs/{{FEATURE_SLUG}}/agents/dev-1.md`. After each task, append FINDINGS/DECISIONS/INTERFACES_DISCOVERED if you discovered anything notable. If context-snapshot.md was MISSING, write CONTEXT_BUILT entries after scanning source files.
|
|
132
|
+
> 5. After ALL tasks complete, append an 'Implementation Log' section to `context-snapshot.md`:
|
|
110
133
|
> - Files created/modified (with paths)
|
|
111
134
|
> - Key implementation decisions
|
|
112
135
|
> - Any deviations from plan.md
|
|
@@ -127,10 +150,12 @@ Prompt:
|
|
|
127
150
|
> - Section 1: acceptance criteria to verify against
|
|
128
151
|
> - Section 4: original source files (before changes)
|
|
129
152
|
> - 'Implementation Log': what Dev changed
|
|
130
|
-
> 2.
|
|
131
|
-
> 3. Run
|
|
132
|
-
> 4.
|
|
133
|
-
> 5.
|
|
153
|
+
> 2. Read `.prizmkit/specs/{{FEATURE_SLUG}}/agents/dev-*.md` (if exists) — understand Dev's implementation decisions and trade-offs.
|
|
154
|
+
> 3. Run prizmkit-code-review: verify all acceptance criteria, check code quality and correctness. Only read files mentioned in the Implementation Log.
|
|
155
|
+
> 4. Run the test suite and report results.
|
|
156
|
+
> 5. Append a 'Review Notes' section to `context-snapshot.md`: issues found (severity), test results, final verdict.
|
|
157
|
+
> 6. **Agent Knowledge Doc**: Maintain `.prizmkit/specs/{{FEATURE_SLUG}}/agents/reviewer.md`. Write FINDINGS/DECISIONS after review (e.g., patterns discovered, quality issues, architectural observations).
|
|
158
|
+
> 7. If review uncovers durable pitfalls or conventions, add corresponding TRAPS/RULES notes to relevant `.prizm-docs/` files.
|
|
134
159
|
> Report verdict: PASS, PASS_WITH_WARNINGS, or NEEDS_FIXES."
|
|
135
160
|
|
|
136
161
|
Wait for Reviewer to return.
|
|
@@ -138,24 +163,19 @@ Wait for Reviewer to return.
|
|
|
138
163
|
|
|
139
164
|
**CP-2**: Tests pass, verdict is not NEEDS_FIXES.
|
|
140
165
|
|
|
141
|
-
### Phase 4.5: Memory
|
|
166
|
+
### Phase 4.5: Architecture Sync & Memory Sedimentation (mandatory before commit)
|
|
142
167
|
|
|
143
|
-
Run `/prizmkit-retrospective` —
|
|
168
|
+
Run `/prizmkit-retrospective` — maintains `.prizm-docs/` (architecture index) and platform memory files:
|
|
144
169
|
1. **Structural sync**: Use `git diff --cached --name-status` to locate changed modules, update KEY_FILES/INTERFACES/DEPENDENCIES/file counts in affected `.prizm-docs/` files
|
|
145
|
-
2. **
|
|
146
|
-
3.
|
|
170
|
+
2. **Architecture knowledge** (feature sessions only): Extract TRAPS/RULES from completed work into `.prizm-docs/`
|
|
171
|
+
3. **Memory sedimentation** (feature sessions only): Sediment DECISIONS and interface conventions to platform memory file (`CLAUDE.md` for Claude Code, BOTH `CODEBUDDY.md` AND `memory/MEMORY.md` for CodeBuddy)
|
|
172
|
+
4. Stage all doc changes: `git add .prizm-docs/`
|
|
147
173
|
|
|
148
174
|
Doc maintenance pass condition (pipeline-enforced): `.prizm-docs/` changed in the final commit.
|
|
149
175
|
|
|
150
|
-
### Phase 5: Commit
|
|
176
|
+
### Phase 5: Session Status + Commit
|
|
151
177
|
|
|
152
|
-
|
|
153
|
-
- MANDATORY: commit must be done via `/prizmkit-committer` skill. Do NOT run manual `git add`/`git commit` as a substitute.
|
|
154
|
-
- Do NOT run `update-feature-status.py` here — the pipeline runner handles feature-list.json updates automatically after session exit.
|
|
155
|
-
|
|
156
|
-
---
|
|
157
|
-
|
|
158
|
-
## Step 3: Write Session Status
|
|
178
|
+
**5a. Write preliminary session-status.json** (safety net — ensures pipeline sees a status file even if session terminates during commit):
|
|
159
179
|
|
|
160
180
|
Write to: `{{SESSION_STATUS_PATH}}`
|
|
161
181
|
|
|
@@ -165,8 +185,8 @@ Write to: `{{SESSION_STATUS_PATH}}`
|
|
|
165
185
|
"feature_id": "{{FEATURE_ID}}",
|
|
166
186
|
"feature_slug": "{{FEATURE_SLUG}}",
|
|
167
187
|
"exec_tier": 2,
|
|
168
|
-
"status": "
|
|
169
|
-
"completed_phases": [0, 1, 2, 3, 4
|
|
188
|
+
"status": "partial",
|
|
189
|
+
"completed_phases": [0, 1, 2, 3, 4],
|
|
170
190
|
"current_phase": 5,
|
|
171
191
|
"checkpoint_reached": "CP-2",
|
|
172
192
|
"tasks_completed": 0,
|
|
@@ -180,23 +200,31 @@ Write to: `{{SESSION_STATUS_PATH}}`
|
|
|
180
200
|
"context_snapshot_path": ".prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md",
|
|
181
201
|
"plan_path": ".prizmkit/specs/{{FEATURE_SLUG}}/plan.md"
|
|
182
202
|
},
|
|
183
|
-
"git_commit": "
|
|
184
|
-
"timestamp": "
|
|
203
|
+
"git_commit": "",
|
|
204
|
+
"timestamp": "<current ISO timestamp>"
|
|
185
205
|
}
|
|
186
206
|
```
|
|
187
207
|
|
|
188
|
-
|
|
208
|
+
**5b. Commit** — Run `/prizmkit-committer` → `feat({{FEATURE_ID}}): {{FEATURE_TITLE}}`, do NOT push
|
|
209
|
+
- MANDATORY: commit must be done via `/prizmkit-committer` skill. Do NOT run manual `git add`/`git commit` as a substitute.
|
|
210
|
+
- Do NOT run `update-feature-status.py` here — the pipeline runner handles feature-list.json updates automatically after session exit.
|
|
211
|
+
|
|
212
|
+
**5c. Update session-status.json to success** — After commit succeeds, update `{{SESSION_STATUS_PATH}}`:
|
|
213
|
+
- Set `"status": "success"`
|
|
214
|
+
- Set `"completed_phases": [0, 1, 2, 3, 4, 5]`
|
|
215
|
+
- Set `"git_commit": "<actual commit hash from git log -1 --format=%H>"`
|
|
216
|
+
- Set `"timestamp": "<current ISO timestamp>"`
|
|
189
217
|
|
|
190
|
-
|
|
218
|
+
**5d. Final Clean Check** — Verify repository is clean:
|
|
191
219
|
|
|
192
220
|
```bash
|
|
193
221
|
git status --short
|
|
194
222
|
```
|
|
195
223
|
|
|
196
|
-
If any files remain (
|
|
224
|
+
If any files remain, stage them **explicitly by name** (do NOT use `git add -A`) and create a follow-up commit:
|
|
197
225
|
|
|
198
226
|
```bash
|
|
199
|
-
git add -
|
|
227
|
+
git add <specific-file-1> <specific-file-2>
|
|
200
228
|
git commit -m "chore({{FEATURE_ID}}): include session artifacts"
|
|
201
229
|
```
|
|
202
230
|
|
|
@@ -218,7 +246,8 @@ Re-check `git status --short` and ensure it is empty before exiting.
|
|
|
218
246
|
- Tier 2: orchestrator builds context+plan, Dev implements, Reviewer reviews — use direct Agent spawn for agents
|
|
219
247
|
- Build context-snapshot.md FIRST; all subagents read it instead of re-reading source files
|
|
220
248
|
- Do NOT use `run_in_background=true` when spawning subagents
|
|
221
|
-
-
|
|
249
|
+
- Session-status.json is written BEFORE commit (as partial), then updated to success AFTER commit — this prevents pipeline from treating a terminated session as crashed
|
|
222
250
|
- `/prizmkit-committer` is mandatory, and must not be replaced with manual git commit commands
|
|
223
251
|
- Before exiting, `git status --short` must be empty
|
|
252
|
+
- When staging leftover files in the final clean check, always use explicit file names — NEVER use `git add -A`
|
|
224
253
|
- On timeout: check snapshot → model:lite → remaining steps only → max 2 retries → orchestrator fallback
|
|
@@ -85,13 +85,36 @@ LLM context is frozen at prompt time. Modifying a skill source file during this
|
|
|
85
85
|
|
|
86
86
|
If any agent times out:
|
|
87
87
|
1. `ls .prizmkit/specs/{{FEATURE_SLUG}}/` — check what exists
|
|
88
|
-
2. If `context-snapshot.md` exists: open recovery prompt with `"Read .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md for full context. Do NOT re-read individual source files."` + only remaining steps + `model: "lite"`
|
|
88
|
+
2. If `context-snapshot.md` exists: open recovery prompt with `"Read .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md for full context. Also read .prizmkit/specs/{{FEATURE_SLUG}}/agents/*.md for knowledge from previous agents. Do NOT re-read individual source files."` + only remaining steps + `model: "lite"`
|
|
89
89
|
3. Max 2 retries per phase. After 2 failures, orchestrator completes the work directly and appends a Recovery Note to context-snapshot.md.
|
|
90
90
|
|
|
91
91
|
---
|
|
92
92
|
|
|
93
93
|
## Execution
|
|
94
94
|
|
|
95
|
+
### Phase 0.5: Agent Knowledge Setup
|
|
96
|
+
|
|
97
|
+
Create the agent knowledge directory and initialize your own knowledge doc:
|
|
98
|
+
```bash
|
|
99
|
+
mkdir -p .prizmkit/specs/{{FEATURE_SLUG}}/agents
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Write `.prizmkit/specs/{{FEATURE_SLUG}}/agents/orchestrator.md`:
|
|
103
|
+
```markdown
|
|
104
|
+
# Orchestrator
|
|
105
|
+
|
|
106
|
+
## FINDINGS
|
|
107
|
+
|
|
108
|
+
## DECISIONS
|
|
109
|
+
|
|
110
|
+
## INTERFACES_DISCOVERED
|
|
111
|
+
|
|
112
|
+
## CONTEXT_BUILT
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
After each phase, append notable DECISIONS/FINDINGS to your `agents/orchestrator.md`.
|
|
116
|
+
When spawning multiple Dev agents, each writes its own `agents/dev-{N}.md` (e.g., `dev-1.md`, `dev-2.md`).
|
|
117
|
+
|
|
95
118
|
{{IF_INIT_NEEDED}}
|
|
96
119
|
### Phase 0: Project Bootstrap
|
|
97
120
|
- Run `/prizmkit-init` (invoke the prizmkit-init skill)
|
|
@@ -191,6 +214,7 @@ Prompt:
|
|
|
191
214
|
> 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST — all source files and project context are there. Do NOT re-read individual source files.
|
|
192
215
|
> 2. Run prizmkit-analyze: cross-check `spec.md` and `plan.md` (including Tasks section) for consistency.
|
|
193
216
|
> 3. Before flagging CRITICAL or HIGH issues, verify each against Section 4 of the snapshot. Do NOT report based on incomplete information.
|
|
217
|
+
> 4. **Agent Knowledge Doc**: Maintain `.prizmkit/specs/{{FEATURE_SLUG}}/agents/reviewer.md`. Write FINDINGS/DECISIONS after analysis (e.g., consistency issues found, ambiguities identified).
|
|
194
218
|
> Report: CRITICAL, HIGH, MEDIUM issues found (or 'No issues found')."
|
|
195
219
|
|
|
196
220
|
Wait for Reviewer to return.
|
|
@@ -228,9 +252,10 @@ Prompt:
|
|
|
228
252
|
> 2. Read `plan.md` (including Tasks section) from `.prizmkit/specs/{{FEATURE_SLUG}}/`.
|
|
229
253
|
> 3. Implement task-by-task. Mark each `[x]` in plan.md Tasks section **immediately** after completion (do NOT batch).
|
|
230
254
|
> 4. Use `TEST_CMD=<TEST_CMD>` to run tests — do NOT explore alternative test commands.
|
|
231
|
-
> 5. After
|
|
232
|
-
> 6.
|
|
233
|
-
> 7.
|
|
255
|
+
> 5. **Agent Knowledge Doc**: Maintain `.prizmkit/specs/{{FEATURE_SLUG}}/agents/dev-1.md`. After each task, append FINDINGS/DECISIONS/INTERFACES_DISCOVERED if you discovered anything notable. If context-snapshot.md was MISSING, read `agents/*.md` from other agents first, then scan source files and write CONTEXT_BUILT entries.
|
|
256
|
+
> 6. After ALL tasks done, append 'Implementation Log' to context-snapshot.md: files changed/created, key decisions, deviations from plan.
|
|
257
|
+
> 7. Do NOT execute any git commands (no git add/commit/reset/push).
|
|
258
|
+
> 8. If `<TEST_CMD>` shows failures, check against BASELINE_FAILURES=`<BASELINE_FAILURES>`. Failures present in the baseline are pre-existing — list them explicitly in your COMPLETION_SIGNAL.
|
|
234
259
|
> Do NOT exit until all tasks are [x] and the Implementation Log is written."
|
|
235
260
|
|
|
236
261
|
Wait for Dev to return. **If Dev times out before all tasks are `[x]`**:
|
|
@@ -238,10 +263,12 @@ Wait for Dev to return. **If Dev times out before all tasks are `[x]`**:
|
|
|
238
263
|
2. If any tasks remain: re-spawn Dev with this recovery prompt:
|
|
239
264
|
> "Read {{DEV_SUBAGENT_PATH}}. You are resuming implementation of feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}).
|
|
240
265
|
> 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` — Section 4 has original source, 'Implementation Log' (if present) has what was already done. Do NOT re-read individual source files.
|
|
241
|
-
> 2. Read
|
|
242
|
-
> 3.
|
|
243
|
-
> 4.
|
|
244
|
-
> 5.
|
|
266
|
+
> 2. Read `.prizmkit/specs/{{FEATURE_SLUG}}/agents/*.md` — knowledge from previous agents (context, decisions, interfaces).
|
|
267
|
+
> 3. Read plan.md Tasks section — complete ONLY the remaining `[ ]` tasks. Do NOT redo completed `[x]` tasks.
|
|
268
|
+
> 4. Use `TEST_CMD=<TEST_CMD>` to run tests.
|
|
269
|
+
> 5. Maintain `.prizmkit/specs/{{FEATURE_SLUG}}/agents/dev-1.md` — append FINDINGS/DECISIONS as you work.
|
|
270
|
+
> 6. Append progress to 'Implementation Log' in context-snapshot.md.
|
|
271
|
+
> 7. Do NOT execute any git commands."
|
|
245
272
|
3. Max 2 recovery retries. After 2 failures, orchestrator implements remaining tasks directly.
|
|
246
273
|
|
|
247
274
|
All tasks `[x]`, tests pass.
|
|
@@ -267,19 +294,23 @@ Prompt:
|
|
|
267
294
|
> **IMPORTANT**: Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST.
|
|
268
295
|
> This file contains ALL source code and context. Do NOT re-read individual source files.
|
|
269
296
|
> 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` — Section 4 has original source files, 'Implementation Log' section lists exactly what Dev changed. Do NOT re-read source files that are NOT mentioned in the Implementation Log.
|
|
270
|
-
> 2.
|
|
271
|
-
> 3.
|
|
272
|
-
> 4.
|
|
297
|
+
> 2. Read `.prizmkit/specs/{{FEATURE_SLUG}}/agents/dev-*.md` (if exists) — understand Dev's implementation decisions, trade-offs, and discovered interfaces.
|
|
298
|
+
> 3. Run prizmkit-code-review: spec compliance (against spec.md), code quality, correctness. Read ONLY files listed in Implementation Log.
|
|
299
|
+
> 4. Write and execute integration tests covering all user stories from spec.md. Use `TEST_CMD=<TEST_CMD>` — do NOT try alternative test commands.
|
|
300
|
+
> 5. Append 'Review Notes' to context-snapshot.md: issues (severity), test results, final verdict.
|
|
301
|
+
> 6. **Agent Knowledge Doc**: Maintain `.prizmkit/specs/{{FEATURE_SLUG}}/agents/reviewer.md`. Write FINDINGS/DECISIONS after review (e.g., quality patterns, architectural observations).
|
|
273
302
|
> Report verdict: PASS, PASS_WITH_WARNINGS, or NEEDS_FIXES."
|
|
274
303
|
|
|
275
304
|
Wait for Reviewer to return.
|
|
276
305
|
- If NEEDS_FIXES: spawn Dev to fix with this prompt:
|
|
277
306
|
> "Read {{DEV_SUBAGENT_PATH}}. Fix NEEDS_FIXES issues for feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}).
|
|
278
307
|
> 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` — 'Review Notes' section lists the exact issues to fix. Do NOT re-read source files not mentioned there.
|
|
279
|
-
> 2.
|
|
280
|
-
> 3.
|
|
281
|
-
> 4.
|
|
282
|
-
> 5.
|
|
308
|
+
> 2. Read `.prizmkit/specs/{{FEATURE_SLUG}}/agents/reviewer.md` (if exists) — understand reviewer's findings and rationale.
|
|
309
|
+
> 3. Fix ONLY the issues listed in 'Review Notes'. Do NOT refactor unrelated code.
|
|
310
|
+
> 4. Use `TEST_CMD=<TEST_CMD>` to verify fixes.
|
|
311
|
+
> 5. Append fix summary to 'Implementation Log' in context-snapshot.md.
|
|
312
|
+
> 6. Update `.prizmkit/specs/{{FEATURE_SLUG}}/agents/dev-1.md` with any new FINDINGS/DECISIONS from the fix.
|
|
313
|
+
> 7. Do NOT execute any git commands."
|
|
283
314
|
Then re-run Review (max 3 rounds).
|
|
284
315
|
|
|
285
316
|
**CP-3**: Integration tests pass, verdict is not NEEDS_FIXES.
|
|
@@ -317,21 +348,14 @@ git log --oneline | grep "{{FEATURE_ID}}" | head -3
|
|
|
317
348
|
- If a commit for `{{FEATURE_ID}}` already exists → **skip 7c** (do NOT run /prizmkit-committer, do NOT run git reset, do NOT stage or unstage anything). Proceed directly to Step 3.
|
|
318
349
|
- If no existing commit → proceed normally with 7a–7c.
|
|
319
350
|
|
|
320
|
-
**7b.** Run `/prizmkit-retrospective` (**before commit**,
|
|
351
|
+
**7b.** Run `/prizmkit-retrospective` (**before commit**, maintains `.prizm-docs/` architecture index and platform memory files):
|
|
321
352
|
- **Structural sync**: update KEY_FILES/INTERFACES/DEPENDENCIES/file counts for changed modules
|
|
322
|
-
- **
|
|
353
|
+
- **Architecture knowledge** (feature sessions only): extract TRAPS, RULES from completed work into `.prizm-docs/`
|
|
354
|
+
- **Memory sedimentation** (feature sessions only): sediment DECISIONS and interface conventions to platform memory file (`CLAUDE.md` for Claude Code, BOTH `CODEBUDDY.md` AND `memory/MEMORY.md` for CodeBuddy)
|
|
323
355
|
- Stage all doc changes: `git add .prizm-docs/`
|
|
324
|
-
- **For bug-fix sessions**: structural sync only, skip knowledge injection unless a genuinely new pitfall was discovered
|
|
325
|
-
|
|
326
|
-
**7c.** Run `/prizmkit-committer` → `feat({{FEATURE_ID}}): {{FEATURE_TITLE}}`, do NOT push
|
|
327
|
-
|
|
328
|
-
**7d.** MANDATORY: commit must be done via `/prizmkit-committer` skill. Do NOT run manual `git add`/`git commit` as a substitute.
|
|
356
|
+
- **For bug-fix sessions**: structural sync only, skip knowledge injection and memory sedimentation unless a genuinely new pitfall was discovered
|
|
329
357
|
|
|
330
|
-
**
|
|
331
|
-
|
|
332
|
-
---
|
|
333
|
-
|
|
334
|
-
## Step 3: Write Session Status
|
|
358
|
+
**7b-safety.** Write preliminary session-status.json (safety net — ensures pipeline sees a status file even if session terminates during commit):
|
|
335
359
|
|
|
336
360
|
Write to: `{{SESSION_STATUS_PATH}}`
|
|
337
361
|
|
|
@@ -341,8 +365,8 @@ Write to: `{{SESSION_STATUS_PATH}}`
|
|
|
341
365
|
"feature_id": "{{FEATURE_ID}}",
|
|
342
366
|
"feature_slug": "{{FEATURE_SLUG}}",
|
|
343
367
|
"exec_tier": 3,
|
|
344
|
-
"status": "
|
|
345
|
-
"completed_phases": [0, 1, 2, 3, 4, 5
|
|
368
|
+
"status": "partial",
|
|
369
|
+
"completed_phases": [0, 1, 2, 3, 4, 5],
|
|
346
370
|
"current_phase": 6,
|
|
347
371
|
"checkpoint_reached": "CP-3",
|
|
348
372
|
"tasks_completed": 0,
|
|
@@ -357,23 +381,43 @@ Write to: `{{SESSION_STATUS_PATH}}`
|
|
|
357
381
|
"spec_path": ".prizmkit/specs/{{FEATURE_SLUG}}/spec.md",
|
|
358
382
|
"plan_path": ".prizmkit/specs/{{FEATURE_SLUG}}/plan.md"
|
|
359
383
|
},
|
|
360
|
-
"git_commit": "
|
|
361
|
-
"timestamp": "
|
|
384
|
+
"git_commit": "",
|
|
385
|
+
"timestamp": "<current ISO timestamp>"
|
|
362
386
|
}
|
|
363
387
|
```
|
|
364
388
|
|
|
389
|
+
**7c.** Run `/prizmkit-committer` → `feat({{FEATURE_ID}}): {{FEATURE_TITLE}}`, do NOT push
|
|
390
|
+
|
|
391
|
+
**7d.** MANDATORY: commit must be done via `/prizmkit-committer` skill. Do NOT run manual `git add`/`git commit` as a substitute.
|
|
392
|
+
|
|
393
|
+
**7e.** Do NOT run `update-feature-status.py` here — the pipeline runner handles feature-list.json updates automatically after session exit.
|
|
394
|
+
|
|
395
|
+
---
|
|
396
|
+
|
|
397
|
+
## Step 3: Commit & Finalize Session Status
|
|
398
|
+
|
|
399
|
+
**3a. Commit** — The commit was handled in Phase 6 (7c) above via `/prizmkit-committer`.
|
|
400
|
+
|
|
401
|
+
**3b. Update session-status.json to success** — After commit succeeds, update `{{SESSION_STATUS_PATH}}`:
|
|
402
|
+
|
|
403
|
+
Update the file to reflect final success:
|
|
404
|
+
- Set `"status": "success"`
|
|
405
|
+
- Set `"completed_phases": [0, 1, 2, 3, 4, 5, 6]`
|
|
406
|
+
- Set `"git_commit": "<actual commit hash from git log -1 --format=%H>"`
|
|
407
|
+
- Set `"timestamp": "<current ISO timestamp>"`
|
|
408
|
+
|
|
365
409
|
### Step 3.1: Final Clean Check (before exit)
|
|
366
410
|
|
|
367
|
-
After
|
|
411
|
+
After updating `session-status.json`, verify repository is clean:
|
|
368
412
|
|
|
369
413
|
```bash
|
|
370
414
|
git status --short
|
|
371
415
|
```
|
|
372
416
|
|
|
373
|
-
If any files remain (
|
|
417
|
+
If any files remain, stage them **explicitly by name** (do NOT use `git add -A`) and create a follow-up commit:
|
|
374
418
|
|
|
375
419
|
```bash
|
|
376
|
-
git add -
|
|
420
|
+
git add <specific-file-1> <specific-file-2>
|
|
377
421
|
git commit -m "chore({{FEATURE_ID}}): include session artifacts"
|
|
378
422
|
```
|
|
379
423
|
|
|
@@ -397,7 +441,8 @@ Re-check `git status --short` and ensure it is empty before exiting.
|
|
|
397
441
|
- Tier 3: full team — Dev (implementation) → Reviewer (review) — spawn agents directly via Agent tool
|
|
398
442
|
- context-snapshot.md is the team knowledge base: orchestrator writes it once, all agents read it
|
|
399
443
|
- Do NOT use `run_in_background=true` when spawning agents
|
|
400
|
-
- ALWAYS write session-status.json
|
|
444
|
+
- ALWAYS write preliminary session-status.json BEFORE commit (as partial), then update to success AFTER commit — this prevents pipeline from treating a terminated session as crashed
|
|
401
445
|
- Commit phase must use `/prizmkit-committer`; do NOT replace with manual git commit commands
|
|
402
446
|
- Before exiting, `git status --short` must be empty
|
|
447
|
+
- When staging leftover files in the final clean check, always use explicit file names — NEVER use `git add -A`
|
|
403
448
|
- On timeout: check snapshot → model:lite → remaining steps only → max 2 retries → orchestrator fallback
|
|
@@ -86,7 +86,7 @@ Reference `{{TEAM_CONFIG_PATH}}` for agent definitions:
|
|
|
86
86
|
|
|
87
87
|
### Step 2: Pipeline Phases
|
|
88
88
|
|
|
89
|
-
#### Phase 1: Triage —
|
|
89
|
+
#### Phase 1: Triage — Classification
|
|
90
90
|
|
|
91
91
|
**Goal**: Classify the bug, identify scope and severity, check known issues, produce fix-plan.md.
|
|
92
92
|
|
|
@@ -123,7 +123,7 @@ Reference `{{TEAM_CONFIG_PATH}}` for agent definitions:
|
|
|
123
123
|
|
|
124
124
|
---
|
|
125
125
|
|
|
126
|
-
#### Phase 2: Reproduce —
|
|
126
|
+
#### Phase 2: Reproduce — Reproduction Confirmation
|
|
127
127
|
|
|
128
128
|
**Goal**: Create an automated reproduction that proves the bug exists.
|
|
129
129
|
|
|
@@ -145,7 +145,7 @@ Reference `{{TEAM_CONFIG_PATH}}` for agent definitions:
|
|
|
145
145
|
|
|
146
146
|
---
|
|
147
147
|
|
|
148
|
-
#### Phase 3: Fix —
|
|
148
|
+
#### Phase 3: Fix — Implementation
|
|
149
149
|
|
|
150
150
|
**Goal**: Implement the fix. The reproduction test goes from red to green.
|
|
151
151
|
|
|
@@ -167,7 +167,7 @@ Reference `{{TEAM_CONFIG_PATH}}` for agent definitions:
|
|
|
167
167
|
|
|
168
168
|
---
|
|
169
169
|
|
|
170
|
-
#### Phase 4: Verify —
|
|
170
|
+
#### Phase 4: Verify — Code Review & Regression Verification
|
|
171
171
|
|
|
172
172
|
**Goal**: Ensure fix correctness and no regressions.
|
|
173
173
|
|
|
@@ -196,7 +196,7 @@ Reference `{{TEAM_CONFIG_PATH}}` for agent definitions:
|
|
|
196
196
|
|
|
197
197
|
---
|
|
198
198
|
|
|
199
|
-
#### Phase 5: Commit & Learn —
|
|
199
|
+
#### Phase 5: Commit & Learn — Commit & Knowledge Capture
|
|
200
200
|
|
|
201
201
|
**Goal**: Commit the fix, update TRAPS, generate fix-report.md.
|
|
202
202
|
|