prizmkit 1.0.45 → 1.0.66
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/adapters/claude/agent-adapter.js +2 -1
- package/bundled/adapters/claude/command-adapter.js +3 -3
- package/bundled/agents/prizm-dev-team-dev.md +1 -1
- package/bundled/dev-pipeline/README.md +6 -8
- package/bundled/dev-pipeline/assets/prizm-dev-team-integration.md +24 -19
- package/bundled/dev-pipeline/launch-bugfix-daemon.sh +2 -2
- package/bundled/dev-pipeline/launch-daemon.sh +2 -2
- package/bundled/dev-pipeline/lib/branch.sh +76 -0
- package/bundled/dev-pipeline/run-bugfix.sh +58 -149
- package/bundled/dev-pipeline/run.sh +60 -153
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +17 -4
- package/bundled/dev-pipeline/scripts/parse-stream-progress.py +2 -2
- package/bundled/dev-pipeline/templates/bootstrap-tier1.md +16 -27
- package/bundled/dev-pipeline/templates/bootstrap-tier2.md +20 -32
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +32 -53
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +29 -41
- package/bundled/dev-pipeline/templates/session-status-schema.json +1 -1
- package/bundled/dev-pipeline/tests/conftest.py +19 -126
- package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +207 -0
- package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +128 -141
- package/bundled/dev-pipeline/tests/test_utils.py +51 -110
- package/bundled/rules/prizm/prizm-commit-workflow.md +3 -3
- package/bundled/skills/_metadata.json +15 -16
- package/bundled/skills/app-planner/SKILL.md +8 -7
- package/bundled/skills/bug-fix-workflow/SKILL.md +171 -0
- package/bundled/skills/bug-planner/SKILL.md +25 -33
- package/bundled/skills/bug-planner/scripts/validate-bug-list.py +156 -0
- package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +5 -7
- package/bundled/skills/dev-pipeline-launcher/SKILL.md +4 -6
- package/bundled/skills/feature-workflow/SKILL.md +25 -42
- package/bundled/skills/prizm-kit/SKILL.md +61 -23
- package/bundled/skills/prizm-kit/assets/{claude-md-template.md → project-memory-template.md} +3 -3
- package/bundled/skills/prizmkit-analyze/SKILL.md +44 -33
- package/bundled/skills/prizmkit-clarify/SKILL.md +40 -30
- package/bundled/skills/prizmkit-code-review/SKILL.md +58 -45
- package/bundled/skills/prizmkit-committer/SKILL.md +30 -68
- package/bundled/skills/prizmkit-implement/SKILL.md +60 -28
- package/bundled/skills/prizmkit-init/SKILL.md +57 -66
- package/bundled/skills/prizmkit-plan/SKILL.md +60 -23
- package/bundled/skills/prizmkit-prizm-docs/SKILL.md +74 -19
- package/bundled/skills/prizmkit-prizm-docs/assets/PRIZM-SPEC.md +23 -23
- package/bundled/skills/prizmkit-retrospective/SKILL.md +142 -65
- package/bundled/skills/prizmkit-retrospective/assets/retrospective-template.md +13 -0
- package/bundled/skills/prizmkit-specify/SKILL.md +69 -15
- package/bundled/skills/refactor-workflow/SKILL.md +116 -52
- package/bundled/team/prizm-dev-team.json +2 -2
- package/package.json +1 -1
- package/src/scaffold.js +4 -4
- package/bundled/dev-pipeline/lib/worktree.sh +0 -164
- package/bundled/dev-pipeline/tests/__init__.py +0 -0
- package/bundled/dev-pipeline/tests/test_check_session.py +0 -131
- package/bundled/dev-pipeline/tests/test_cleanup_logs.py +0 -119
- package/bundled/dev-pipeline/tests/test_detect_stuck.py +0 -207
- package/bundled/dev-pipeline/tests/test_generate_prompt.py +0 -190
- package/bundled/dev-pipeline/tests/test_init_bugfix_pipeline.py +0 -153
- package/bundled/dev-pipeline/tests/test_init_pipeline.py +0 -241
- package/bundled/dev-pipeline/tests/test_update_bug_status.py +0 -142
- package/bundled/dev-pipeline/tests/test_update_feature_status.py +0 -338
- package/bundled/dev-pipeline/tests/test_worktree.py +0 -236
- package/bundled/dev-pipeline/tests/test_worktree_integration.py +0 -796
- package/bundled/skills/prizm-kit/assets/codebuddy-md-template.md +0 -35
- package/bundled/skills/prizm-kit/assets/hooks/prizm-commit-hook.json +0 -15
- package/bundled/skills/prizmkit-summarize/SKILL.md +0 -51
- package/bundled/skills/prizmkit-summarize/assets/registry-template.md +0 -18
- package/bundled/templates/hooks/commit-intent-claude.json +0 -26
- /package/bundled/templates/hooks/{commit-intent-codebuddy.json → commit-intent.json} +0 -0
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
- **Feature ID**: {{FEATURE_ID}} | **Session**: {{SESSION_ID}} | **Run**: {{RUN_ID}}
|
|
6
6
|
- **Complexity**: {{COMPLEXITY}} | **Retry**: {{RETRY_COUNT}} / {{MAX_RETRIES}}
|
|
7
7
|
- **Previous Status**: {{PREV_SESSION_STATUS}} | **Resume From**: {{RESUME_PHASE}}
|
|
8
|
-
- **Init**: {{INIT_DONE}} | Artifacts: spec={{HAS_SPEC}} plan={{HAS_PLAN}}
|
|
8
|
+
- **Init**: {{INIT_DONE}} | Artifacts: spec={{HAS_SPEC}} plan={{HAS_PLAN}}
|
|
9
9
|
|
|
10
10
|
## Your Mission
|
|
11
11
|
|
|
@@ -13,7 +13,7 @@ You are the **session orchestrator**. Implement Feature {{FEATURE_ID}}: "{{FEATU
|
|
|
13
13
|
|
|
14
14
|
**CRITICAL**: You MUST NOT exit until ALL work is complete and session-status.json is written. When you spawn subagents, wait for each to finish (run_in_background=false). Do NOT spawn agents in background and exit — that kills the session.
|
|
15
15
|
|
|
16
|
-
**Tier 3 — Full Team**: Dev + Reviewer agents spawned
|
|
16
|
+
**Tier 3 — Full Team**: For complex features, use the full pipeline (Phase 0–6) with Dev + Reviewer agents spawned via the Agent tool.
|
|
17
17
|
|
|
18
18
|
### Feature Description
|
|
19
19
|
|
|
@@ -71,7 +71,6 @@ LLM context is frozen at prompt time. Modifying a skill source file during this
|
|
|
71
71
|
.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md ← orchestrator writes, all subagents read
|
|
72
72
|
.prizmkit/specs/{{FEATURE_SLUG}}/spec.md
|
|
73
73
|
.prizmkit/specs/{{FEATURE_SLUG}}/plan.md ← includes Tasks section
|
|
74
|
-
.prizmkit/specs/REGISTRY.md
|
|
75
74
|
```
|
|
76
75
|
|
|
77
76
|
**`context-snapshot.md`** is the shared knowledge base. Orchestrator writes it once; Dev and Reviewer read it instead of re-scanning source files. This eliminates redundant I/O across all agents.
|
|
@@ -117,9 +116,7 @@ $TEST_CMD 2>&1 | tail -20
|
|
|
117
116
|
Save the list of **pre-existing failing tests** (if any) as `BASELINE_FAILURES`. These are known failures that existed before this session — Dev must NOT be blamed for them, but must list them in COMPLETION_SIGNAL.
|
|
118
117
|
{{END_IF_INIT_DONE}}
|
|
119
118
|
|
|
120
|
-
### Step 1:
|
|
121
|
-
|
|
122
|
-
No TeamCreate required. Agents are spawned directly via the `Task` tool using `subagent_type`.
|
|
119
|
+
### Step 1: Initialize
|
|
123
120
|
|
|
124
121
|
1. Run init script:
|
|
125
122
|
`python3 {{INIT_SCRIPT_PATH}} --project-root {{PROJECT_ROOT}} --feature-id {{FEATURE_ID}} --feature-slug {{FEATURE_SLUG}}`
|
|
@@ -127,10 +124,6 @@ No TeamCreate required. Agents are spawned directly via the `Task` tool using `s
|
|
|
127
124
|
2. Check for existing artifacts:
|
|
128
125
|
`ls .prizmkit/specs/{{FEATURE_SLUG}}/ 2>/dev/null`
|
|
129
126
|
|
|
130
|
-
Agent files are at:
|
|
131
|
-
- Dev: `{{DEV_SUBAGENT_PATH}}`
|
|
132
|
-
- Reviewer: `{{REVIEWER_SUBAGENT_PATH}}`
|
|
133
|
-
|
|
134
127
|
{{IF_FRESH_START}}
|
|
135
128
|
```bash
|
|
136
129
|
python3 {{INIT_SCRIPT_PATH}} --project-root {{PROJECT_ROOT}} --feature-id {{FEATURE_ID}} --feature-slug {{FEATURE_SLUG}}
|
|
@@ -189,32 +182,32 @@ ls .prizmkit/specs/{{FEATURE_SLUG}}/spec.md .prizmkit/specs/{{FEATURE_SLUG}}/pla
|
|
|
189
182
|
|
|
190
183
|
**CP-1**: Both spec.md and plan.md exist.
|
|
191
184
|
|
|
192
|
-
### Phase
|
|
185
|
+
### Phase 3: Analyze — Reviewer Agent
|
|
193
186
|
|
|
194
|
-
Spawn Reviewer agent (
|
|
187
|
+
Spawn Reviewer agent (Agent tool, subagent_type="prizm-dev-team-reviewer", run_in_background=false).
|
|
195
188
|
|
|
196
189
|
Prompt:
|
|
197
190
|
> "Read {{REVIEWER_SUBAGENT_PATH}}. For feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}):
|
|
198
191
|
> 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.
|
|
199
|
-
> 2. Run prizmkit-analyze: cross-check `spec.md
|
|
192
|
+
> 2. Run prizmkit-analyze: cross-check `spec.md` and `plan.md` (including Tasks section) for consistency.
|
|
200
193
|
> 3. Before flagging CRITICAL or HIGH issues, verify each against Section 4 of the snapshot. Do NOT report based on incomplete information.
|
|
201
194
|
> Report: CRITICAL, HIGH, MEDIUM issues found (or 'No issues found')."
|
|
202
195
|
|
|
203
196
|
Wait for Reviewer to return.
|
|
204
|
-
- If CRITICAL issues found: fix them yourself — read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` for full project context. Fix ONLY the listed CRITICAL issues in spec.md/plan.md
|
|
197
|
+
- If CRITICAL issues found: fix them yourself — read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` for full project context. Fix ONLY the listed CRITICAL issues in spec.md/plan.md. Then re-run analyze (max 1 round).
|
|
205
198
|
|
|
206
199
|
**CP-2**: No CRITICAL issues.
|
|
207
200
|
|
|
208
|
-
### Phase
|
|
201
|
+
### Phase 4: Implement — Dev Agent
|
|
209
202
|
|
|
210
|
-
Before spawning Dev, check
|
|
203
|
+
Before spawning Dev, check plan.md Tasks section:
|
|
211
204
|
```bash
|
|
212
|
-
grep -c '^\- \[ \]' .prizmkit/specs/{{FEATURE_SLUG}}/
|
|
205
|
+
grep -c '^\- \[ \]' .prizmkit/specs/{{FEATURE_SLUG}}/plan.md 2>/dev/null || echo 0
|
|
213
206
|
```
|
|
214
|
-
- If result is `0` (all tasks already `[x]`) → **SKIP Phase
|
|
207
|
+
- If result is `0` (all tasks already `[x]`) → **SKIP Phase 4**, go directly to Phase 5. Do NOT spawn Dev.
|
|
215
208
|
- If result is non-zero → spawn Dev agent below.
|
|
216
209
|
|
|
217
|
-
Spawn Dev agent (
|
|
210
|
+
Spawn Dev agent (Agent tool, subagent_type="prizm-dev-team-dev", run_in_background=false).
|
|
218
211
|
|
|
219
212
|
{{IF_MODE_SELF_EVOLVE}}
|
|
220
213
|
**Framework Self-Evolve — Dev Extra Instructions**:
|
|
@@ -230,8 +223,8 @@ Append the following to the Dev agent prompt:
|
|
|
230
223
|
Prompt:
|
|
231
224
|
> "Read {{DEV_SUBAGENT_PATH}}. Implement feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}) using TDD.
|
|
232
225
|
> 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST — all source files and context are there. Do NOT re-read individual source files.
|
|
233
|
-
> 2. Read `plan.md`
|
|
234
|
-
> 3. Implement task-by-task. Mark each `[x]` in
|
|
226
|
+
> 2. Read `plan.md` (including Tasks section) from `.prizmkit/specs/{{FEATURE_SLUG}}/`.
|
|
227
|
+
> 3. Implement task-by-task. Mark each `[x]` in plan.md Tasks section **immediately** after completion (do NOT batch).
|
|
235
228
|
> 4. Use `TEST_CMD=<TEST_CMD>` to run tests — do NOT explore alternative test commands.
|
|
236
229
|
> 5. After ALL tasks done, append 'Implementation Log' to context-snapshot.md: files changed/created, key decisions, deviations from plan.
|
|
237
230
|
> 6. Do NOT execute any git commands (no git add/commit/reset/push).
|
|
@@ -239,11 +232,11 @@ Prompt:
|
|
|
239
232
|
> Do NOT exit until all tasks are [x] and the Implementation Log is written."
|
|
240
233
|
|
|
241
234
|
Wait for Dev to return. **If Dev times out before all tasks are `[x]`**:
|
|
242
|
-
1. Check progress: `grep -c '^\- \[ \]' .prizmkit/specs/{{FEATURE_SLUG}}/
|
|
235
|
+
1. Check progress: `grep -c '^\- \[ \]' .prizmkit/specs/{{FEATURE_SLUG}}/plan.md`
|
|
243
236
|
2. If any tasks remain: re-spawn Dev with this recovery prompt:
|
|
244
237
|
> "Read {{DEV_SUBAGENT_PATH}}. You are resuming implementation of feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}).
|
|
245
238
|
> 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.
|
|
246
|
-
> 2. Read
|
|
239
|
+
> 2. Read plan.md Tasks section — complete ONLY the remaining `[ ]` tasks. Do NOT redo completed `[x]` tasks.
|
|
247
240
|
> 3. Use `TEST_CMD=<TEST_CMD>` to run tests.
|
|
248
241
|
> 4. Append progress to 'Implementation Log' in context-snapshot.md.
|
|
249
242
|
> 5. Do NOT execute any git commands."
|
|
@@ -251,9 +244,9 @@ Wait for Dev to return. **If Dev times out before all tasks are `[x]`**:
|
|
|
251
244
|
|
|
252
245
|
All tasks `[x]`, tests pass.
|
|
253
246
|
|
|
254
|
-
### Phase
|
|
247
|
+
### Phase 5: Review — Reviewer Agent
|
|
255
248
|
|
|
256
|
-
Spawn Reviewer agent (
|
|
249
|
+
Spawn Reviewer agent (Agent tool, subagent_type="prizm-dev-team-reviewer", run_in_background=false).
|
|
257
250
|
|
|
258
251
|
{{IF_MODE_SELF_EVOLVE}}
|
|
259
252
|
**Framework Self-Evolve — Reviewer Extra Instructions**:
|
|
@@ -287,7 +280,8 @@ Wait for Reviewer to return.
|
|
|
287
280
|
|
|
288
281
|
**CP-3**: Integration tests pass, verdict is not NEEDS_FIXES.
|
|
289
282
|
|
|
290
|
-
|
|
283
|
+
|
|
284
|
+
### Phase 6: Retrospective & Commit — DO NOT SKIP
|
|
291
285
|
|
|
292
286
|
{{IF_MODE_SELF_EVOLVE}}
|
|
293
287
|
**Framework Validation Gate (self-evolve mode)**:
|
|
@@ -310,7 +304,7 @@ bash {{VALIDATOR_SCRIPTS_DIR}}/validate-framework.sh
|
|
|
310
304
|
Then set `"reload_needed": true` in session-status.json.
|
|
311
305
|
{{END_IF_MODE_SELF_EVOLVE}}
|
|
312
306
|
|
|
313
|
-
**For bug fixes**:
|
|
307
|
+
**For bug fixes**: run `/prizmkit-retrospective` for structural sync only (skip knowledge injection unless a new TRAPS was discovered). Use `fix(<scope>):` commit prefix.
|
|
314
308
|
|
|
315
309
|
**7a.** Check if feature already committed:
|
|
316
310
|
```bash
|
|
@@ -319,21 +313,11 @@ git log --oneline | grep "{{FEATURE_ID}}" | head -3
|
|
|
319
313
|
- 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.
|
|
320
314
|
- If no existing commit → proceed normally with 7a–7c.
|
|
321
315
|
|
|
322
|
-
**7b.** Run `/prizmkit-
|
|
323
|
-
|
|
324
|
-
**
|
|
325
|
-
-
|
|
326
|
-
- For
|
|
327
|
-
- Update `.prizm-docs/changelog.prizm`: append one-line entry `- feat({{FEATURE_ID}}): {{FEATURE_TITLE}}`
|
|
328
|
-
- Stage all modified prizm-docs: `git add .prizm-docs/`
|
|
329
|
-
- Pipeline docs pass condition is `REGISTRY.md` OR `.prizm-docs/` changed in final commit
|
|
330
|
-
|
|
331
|
-
**7b.6.** Run `/prizmkit-retrospective` (feature sessions only, **before commit**):
|
|
332
|
-
- Extract lessons from completed feature — compare spec/plan/tasks vs actual
|
|
333
|
-
- Update relevant `.prizm-docs/` sections: TRAPS, RULES, DECISIONS
|
|
334
|
-
- Write `.prizmkit/specs/{{FEATURE_SLUG}}/retrospective.md`
|
|
335
|
-
- Stage any `.prizm-docs/` changes: `git add .prizm-docs/`
|
|
336
|
-
- **Skip if this session is bug-fix-only**
|
|
316
|
+
**7b.** Run `/prizmkit-retrospective` (**before commit**, the sole maintainer of `.prizm-docs/`):
|
|
317
|
+
- **Structural sync**: update KEY_FILES/INTERFACES/DEPENDENCIES/file counts for changed modules
|
|
318
|
+
- **Knowledge injection** (feature sessions only): extract TRAPS, RULES, DECISIONS from completed work
|
|
319
|
+
- Stage all doc changes: `git add .prizm-docs/`
|
|
320
|
+
- **For bug-fix sessions**: structural sync only, skip knowledge injection unless a genuinely new pitfall was discovered
|
|
337
321
|
|
|
338
322
|
**7c.** Run `/prizmkit-committer` → `feat({{FEATURE_ID}}): {{FEATURE_TITLE}}`, do NOT push
|
|
339
323
|
|
|
@@ -354,8 +338,8 @@ Write to: `{{SESSION_STATUS_PATH}}`
|
|
|
354
338
|
"feature_slug": "{{FEATURE_SLUG}}",
|
|
355
339
|
"exec_tier": 3,
|
|
356
340
|
"status": "<success|partial|failed|commit_missing|docs_missing>",
|
|
357
|
-
"completed_phases": [0, 1, 2, 3, 4, 5, 6
|
|
358
|
-
"current_phase":
|
|
341
|
+
"completed_phases": [0, 1, 2, 3, 4, 5, 6],
|
|
342
|
+
"current_phase": 6,
|
|
359
343
|
"checkpoint_reached": "CP-3",
|
|
360
344
|
"tasks_completed": 0,
|
|
361
345
|
"tasks_total": 0,
|
|
@@ -367,8 +351,7 @@ Write to: `{{SESSION_STATUS_PATH}}`
|
|
|
367
351
|
"artifacts": {
|
|
368
352
|
"context_snapshot_path": ".prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md",
|
|
369
353
|
"spec_path": ".prizmkit/specs/{{FEATURE_SLUG}}/spec.md",
|
|
370
|
-
"plan_path": ".prizmkit/specs/{{FEATURE_SLUG}}/plan.md"
|
|
371
|
-
"tasks_path": ".prizmkit/specs/{{FEATURE_SLUG}}/tasks.md"
|
|
354
|
+
"plan_path": ".prizmkit/specs/{{FEATURE_SLUG}}/plan.md"
|
|
372
355
|
},
|
|
373
356
|
"git_commit": "<commit hash>",
|
|
374
357
|
"timestamp": "2026-03-04T10:00:00Z"
|
|
@@ -383,19 +366,15 @@ After writing `session-status.json`, verify repository is clean:
|
|
|
383
366
|
git status --short
|
|
384
367
|
```
|
|
385
368
|
|
|
386
|
-
If any files remain,
|
|
369
|
+
If any files remain (e.g. session-status.json), stage and create a follow-up commit:
|
|
387
370
|
|
|
388
371
|
```bash
|
|
389
372
|
git add -A
|
|
390
|
-
git commit
|
|
373
|
+
git commit -m "chore({{FEATURE_ID}}): include session artifacts"
|
|
391
374
|
```
|
|
392
375
|
|
|
393
376
|
Re-check `git status --short` and ensure it is empty before exiting.
|
|
394
377
|
|
|
395
|
-
## Step 4: Team Cleanup
|
|
396
|
-
|
|
397
|
-
No team cleanup needed — agents were spawned directly without TeamCreate.
|
|
398
|
-
|
|
399
378
|
## Critical Paths
|
|
400
379
|
|
|
401
380
|
| Resource | Path |
|
|
@@ -411,7 +390,7 @@ No team cleanup needed — agents were spawned directly without TeamCreate.
|
|
|
411
390
|
|
|
412
391
|
## Reminders
|
|
413
392
|
|
|
414
|
-
- Tier 3: full team — Dev (implementation) → Reviewer (review) — agents
|
|
393
|
+
- Tier 3: full team — Dev (implementation) → Reviewer (review) — spawn agents directly via Agent tool
|
|
415
394
|
- context-snapshot.md is the team knowledge base: orchestrator writes it once, all agents read it
|
|
416
395
|
- Do NOT use `run_in_background=true` when spawning agents
|
|
417
396
|
- ALWAYS write session-status.json before exiting
|
|
@@ -18,18 +18,17 @@ You are the **bug fix session orchestrator**. Fix Bug {{BUG_ID}}: "{{BUG_TITLE}}
|
|
|
18
18
|
|
|
19
19
|
**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.
|
|
20
20
|
|
|
21
|
-
**MANDATORY TEAM REQUIREMENT**: You MUST use the `prizm-dev-team`
|
|
21
|
+
**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.
|
|
22
22
|
|
|
23
23
|
**BUG FIX DOCUMENTATION POLICY**: Bug fixes MUST NOT be recorded as new documentation entries:
|
|
24
|
-
-
|
|
24
|
+
- Run `/prizmkit-retrospective` with structural sync only (Job 1) — skip knowledge injection unless a genuinely new TRAP was discovered
|
|
25
25
|
- Do NOT create spec/plan/tasks under `.prizmkit/specs/`
|
|
26
26
|
- Do NOT update `.prizm-docs/` module docs for pure bug fixes (unless TRAPS update is needed)
|
|
27
27
|
- Commit with `fix(<scope>):` prefix, NOT `feat:`
|
|
28
28
|
|
|
29
29
|
### Team Definition Reference
|
|
30
30
|
|
|
31
|
-
- **
|
|
32
|
-
- **Installed team config**: `{{TEAM_CONFIG_PATH}}`
|
|
31
|
+
- **Team config**: `{{TEAM_CONFIG_PATH}}`
|
|
33
32
|
|
|
34
33
|
### Bug Description
|
|
35
34
|
|
|
@@ -74,16 +73,11 @@ You are the **bug fix session orchestrator**. Fix Bug {{BUG_ID}}: "{{BUG_TITLE}}
|
|
|
74
73
|
|
|
75
74
|
### Step 1: Initialize
|
|
76
75
|
|
|
77
|
-
####
|
|
76
|
+
#### Agent Setup
|
|
78
77
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
2. **If no reusable team**, create a new one:
|
|
84
|
-
- Reference `core/team/prizm-dev-team.json`
|
|
85
|
-
- Call `TeamCreate` with `team_name="prizm-dev-team-{{BUG_ID}}"` and `description="Fixing {{BUG_TITLE}}"`
|
|
86
|
-
- Set `TEAM_REUSED=false`
|
|
78
|
+
Reference `{{TEAM_CONFIG_PATH}}` for agent definitions:
|
|
79
|
+
- Dev: `{{DEV_SUBAGENT_PATH}}`
|
|
80
|
+
- Reviewer: `{{REVIEWER_SUBAGENT_PATH}}`
|
|
87
81
|
|
|
88
82
|
3. Create bug fix artifacts directory:
|
|
89
83
|
```bash
|
|
@@ -96,7 +90,7 @@ You are the **bug fix session orchestrator**. Fix Bug {{BUG_ID}}: "{{BUG_TITLE}}
|
|
|
96
90
|
|
|
97
91
|
**Goal**: Classify the bug, identify scope and severity, check known issues, produce fix-plan.md.
|
|
98
92
|
|
|
99
|
-
- Spawn Dev agent (
|
|
93
|
+
- Spawn Dev agent (Agent tool, subagent_type="prizm-dev-team-dev", run_in_background=false)
|
|
100
94
|
Prompt: "Read {{DEV_SUBAGENT_PATH}}. For bug {{BUG_ID}} ('{{BUG_TITLE}}'):
|
|
101
95
|
1. Run `/prizmkit-tool-error-triage` with the bug description and error source
|
|
102
96
|
2. Check `.prizm-docs/` TRAPS sections for matching known issues
|
|
@@ -133,7 +127,7 @@ You are the **bug fix session orchestrator**. Fix Bug {{BUG_ID}}: "{{BUG_TITLE}}
|
|
|
133
127
|
|
|
134
128
|
**Goal**: Create an automated reproduction that proves the bug exists.
|
|
135
129
|
|
|
136
|
-
- Spawn Dev agent (
|
|
130
|
+
- Spawn Dev agent (Agent tool, subagent_type="prizm-dev-team-dev", run_in_background=false)
|
|
137
131
|
Prompt: "Read {{DEV_SUBAGENT_PATH}}. For bug {{BUG_ID}}:
|
|
138
132
|
1. Read the fix plan from `.prizmkit/bugfix/{{BUG_ID}}/fix-plan.md`
|
|
139
133
|
2. Run `/prizmkit-tool-bug-reproducer` with the bug description and triage results
|
|
@@ -155,7 +149,7 @@ You are the **bug fix session orchestrator**. Fix Bug {{BUG_ID}}: "{{BUG_TITLE}}
|
|
|
155
149
|
|
|
156
150
|
**Goal**: Implement the fix. The reproduction test goes from red to green.
|
|
157
151
|
|
|
158
|
-
- Spawn Dev agent (
|
|
152
|
+
- Spawn Dev agent (Agent tool, subagent_type="prizm-dev-team-dev", run_in_background=false)
|
|
159
153
|
Prompt: "Read {{DEV_SUBAGENT_PATH}}. For bug {{BUG_ID}}:
|
|
160
154
|
1. Read the fix plan from `.prizmkit/bugfix/{{BUG_ID}}/fix-plan.md`
|
|
161
155
|
2. Read `.prizm-docs/` for affected modules (TRAPS, RULES, PATTERNS)
|
|
@@ -177,7 +171,7 @@ You are the **bug fix session orchestrator**. Fix Bug {{BUG_ID}}: "{{BUG_TITLE}}
|
|
|
177
171
|
|
|
178
172
|
**Goal**: Ensure fix correctness and no regressions.
|
|
179
173
|
|
|
180
|
-
- Spawn Reviewer agent (
|
|
174
|
+
- Spawn Reviewer agent (Agent tool, subagent_type="prizm-dev-team-reviewer", run_in_background=false)
|
|
181
175
|
Prompt: "Read {{REVIEWER_SUBAGENT_PATH}}. For bug {{BUG_ID}}:
|
|
182
176
|
1. Run `/prizmkit-code-review` scoped to CHANGED FILES ONLY
|
|
183
177
|
2. Review dimensions (adjusted for bug fix):
|
|
@@ -206,17 +200,19 @@ You are the **bug fix session orchestrator**. Fix Bug {{BUG_ID}}: "{{BUG_TITLE}}
|
|
|
206
200
|
|
|
207
201
|
**Goal**: Commit the fix, update TRAPS, generate fix-report.md.
|
|
208
202
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
203
|
+
**This phase is executed by YOU (the orchestrator), NOT a subagent.**
|
|
204
|
+
|
|
205
|
+
1. If a new pitfall was discovered (not previously in TRAPS):
|
|
206
|
+
- Update the affected module's TRAPS section in `.prizm-docs/`
|
|
207
|
+
- Format: `- TRAP: <description> | FIX: <solution> | DATE: YYYY-MM-DD`
|
|
208
|
+
|
|
209
|
+
2. Run `/prizmkit-committer` with:
|
|
210
|
+
- Commit message: `fix({{FIX_SCOPE}}): {{BUG_TITLE}}`
|
|
211
|
+
- Include both fix code and reproduction test
|
|
212
|
+
- Do NOT run `/prizmkit-retrospective` with REGISTRY archiving
|
|
213
|
+
- Do NOT push (user will push manually)
|
|
214
|
+
|
|
215
|
+
3. Write the complete fix report to `.prizmkit/bugfix/{{BUG_ID}}/fix-report.md`
|
|
220
216
|
|
|
221
217
|
The fix-report.md MUST contain these sections:
|
|
222
218
|
- Bug Resolution Summary (ID, title, status, phases completed, duration)
|
|
@@ -224,8 +220,7 @@ You are the **bug fix session orchestrator**. Fix Bug {{BUG_ID}}: "{{BUG_TITLE}}
|
|
|
224
220
|
- Verification Results (reproduction test before/after, regression tests, review verdict)
|
|
225
221
|
- Knowledge Captured (TRAPS updated, prevention recommendation)
|
|
226
222
|
- Acceptance Criteria Verification (checklist with pass/fail for each criterion)
|
|
227
|
-
|
|
228
|
-
- **Wait for Dev to return**
|
|
223
|
+
|
|
229
224
|
- **CP-BF-5**: Commit recorded, fix-report.md written, TRAPS updated (if applicable)
|
|
230
225
|
|
|
231
226
|
### Step 3: Report Session Status
|
|
@@ -258,17 +253,11 @@ Write to: `{{SESSION_STATUS_PATH}}`
|
|
|
258
253
|
|
|
259
254
|
**Status values**: `success` (all phases done) | `partial` (can resume) | `failed` (unrecoverable)
|
|
260
255
|
|
|
261
|
-
### Step 4: Team Cleanup (conditional)
|
|
262
|
-
|
|
263
|
-
**Only if you CREATED the team** (`TEAM_REUSED=false`), clean up with `TeamDelete`.
|
|
264
|
-
**If you REUSED an existing team** (`TEAM_REUSED=true`), do NOT call `TeamDelete`.
|
|
265
|
-
|
|
266
256
|
## Critical Paths
|
|
267
257
|
|
|
268
258
|
| Resource | Path |
|
|
269
259
|
|----------|------|
|
|
270
|
-
| Team Definition (source of truth) | `
|
|
271
|
-
| Team Config (installed) | `{{TEAM_CONFIG_PATH}}` |
|
|
260
|
+
| Team Definition (source of truth) | `{{TEAM_CONFIG_PATH}}` |
|
|
272
261
|
| Bug Fix Artifacts Dir | `.prizmkit/bugfix/{{BUG_ID}}/` |
|
|
273
262
|
| Fix Plan | `.prizmkit/bugfix/{{BUG_ID}}/fix-plan.md` |
|
|
274
263
|
| Fix Report | `.prizmkit/bugfix/{{BUG_ID}}/fix-report.md` |
|
|
@@ -279,13 +268,12 @@ Write to: `{{SESSION_STATUS_PATH}}`
|
|
|
279
268
|
|
|
280
269
|
## Reminders
|
|
281
270
|
|
|
282
|
-
- **MANDATORY**: Use `prizm-dev-team` — single-agent execution is FORBIDDEN
|
|
271
|
+
- **MANDATORY**: Use `prizm-dev-team` agents — single-agent execution is FORBIDDEN
|
|
283
272
|
- **Only 2 artifact files per bug**: fix-plan.md + fix-report.md — NEVER more
|
|
284
|
-
- **Do NOT create** spec.md
|
|
285
|
-
- **Do NOT run** `/prizmkit-
|
|
273
|
+
- **Do NOT create** spec.md or plan.md for bug fixes
|
|
274
|
+
- **Do NOT run** `/prizmkit-retrospective` knowledge injection for bugs (structural sync only, unless genuinely new TRAP discovered)
|
|
286
275
|
- **Commit with** `fix(<scope>):` prefix, NOT `feat:`
|
|
287
276
|
- **Update TRAPS** in `.prizm-docs/` only if a genuinely new pitfall was discovered
|
|
288
277
|
- Dev agents use TDD approach: reproduction test goes from RED → GREEN
|
|
289
278
|
- ALWAYS write session-status.json before exiting
|
|
290
279
|
- Do NOT use `run_in_background=true` when spawning agents
|
|
291
|
-
- Only call `TeamDelete` if you created the team
|
|
@@ -1,133 +1,26 @@
|
|
|
1
|
-
"""Shared fixtures for dev-pipeline tests."""
|
|
1
|
+
"""Shared fixtures and import helpers for dev-pipeline tests."""
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import importlib
|
|
4
4
|
import os
|
|
5
|
-
import
|
|
5
|
+
import sys
|
|
6
6
|
|
|
7
|
+
# Add dev-pipeline/scripts to the import path so tests can import modules
|
|
8
|
+
# without requiring package installation.
|
|
9
|
+
_scripts_dir = os.path.join(os.path.dirname(__file__), "..", "scripts")
|
|
10
|
+
sys.path.insert(0, _scripts_dir)
|
|
7
11
|
|
|
8
|
-
@pytest.fixture
|
|
9
|
-
def sample_feature_list():
|
|
10
|
-
"""A valid feature-list.json structure."""
|
|
11
|
-
return {
|
|
12
|
-
"$schema": "dev-pipeline-feature-list-v1",
|
|
13
|
-
"app_name": "TestApp",
|
|
14
|
-
"global_context": {
|
|
15
|
-
"language": "Python",
|
|
16
|
-
"framework": "FastAPI",
|
|
17
|
-
},
|
|
18
|
-
"features": [
|
|
19
|
-
{
|
|
20
|
-
"id": "F-001",
|
|
21
|
-
"title": "Project Infrastructure Setup",
|
|
22
|
-
"description": "Set up the project structure.",
|
|
23
|
-
"priority": 1,
|
|
24
|
-
"estimated_complexity": "low",
|
|
25
|
-
"dependencies": [],
|
|
26
|
-
"acceptance_criteria": ["Has package.json", "Has README.md"],
|
|
27
|
-
"status": "pending",
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"id": "F-002",
|
|
31
|
-
"title": "User Authentication",
|
|
32
|
-
"description": "Implement user login and registration.",
|
|
33
|
-
"priority": 2,
|
|
34
|
-
"estimated_complexity": "high",
|
|
35
|
-
"dependencies": ["F-001"],
|
|
36
|
-
"acceptance_criteria": ["Login works", "Registration works"],
|
|
37
|
-
"status": "pending",
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"id": "F-003",
|
|
41
|
-
"title": "Dashboard View",
|
|
42
|
-
"description": "Create main dashboard.",
|
|
43
|
-
"priority": 3,
|
|
44
|
-
"estimated_complexity": "medium",
|
|
45
|
-
"dependencies": ["F-001", "F-002"],
|
|
46
|
-
"acceptance_criteria": ["Dashboard renders"],
|
|
47
|
-
"status": "pending",
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
}
|
|
51
12
|
|
|
13
|
+
def _load_hyphenated_module(module_name, filename):
|
|
14
|
+
"""Load a hyphenated .py file and register it as an importable module."""
|
|
15
|
+
spec = importlib.util.spec_from_file_location(
|
|
16
|
+
module_name,
|
|
17
|
+
os.path.join(_scripts_dir, filename),
|
|
18
|
+
)
|
|
19
|
+
mod = importlib.util.module_from_spec(spec)
|
|
20
|
+
sys.modules[module_name] = mod
|
|
21
|
+
spec.loader.exec_module(mod)
|
|
52
22
|
|
|
53
|
-
@pytest.fixture
|
|
54
|
-
def sample_bug_list():
|
|
55
|
-
"""A valid bug-fix-list.json structure."""
|
|
56
|
-
return {
|
|
57
|
-
"$schema": "dev-pipeline-bug-fix-list-v1",
|
|
58
|
-
"project_name": "TestProject",
|
|
59
|
-
"global_context": {
|
|
60
|
-
"language": "Python",
|
|
61
|
-
},
|
|
62
|
-
"bugs": [
|
|
63
|
-
{
|
|
64
|
-
"id": "B-001",
|
|
65
|
-
"title": "Login crash on empty password",
|
|
66
|
-
"description": "App crashes when password is empty.",
|
|
67
|
-
"severity": "critical",
|
|
68
|
-
"priority": 1,
|
|
69
|
-
"error_source": {
|
|
70
|
-
"type": "stack_trace",
|
|
71
|
-
"stack_trace": "Traceback ... ValueError",
|
|
72
|
-
"error_message": "Password cannot be empty",
|
|
73
|
-
},
|
|
74
|
-
"verification_type": "automated",
|
|
75
|
-
"acceptance_criteria": ["No crash on empty password"],
|
|
76
|
-
"status": "pending",
|
|
77
|
-
"affected_feature": "F-002",
|
|
78
|
-
"affected_modules": ["auth"],
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
"id": "B-002",
|
|
82
|
-
"title": "Slow dashboard loading",
|
|
83
|
-
"description": "Dashboard takes 10s to load.",
|
|
84
|
-
"severity": "medium",
|
|
85
|
-
"priority": 2,
|
|
86
|
-
"error_source": {
|
|
87
|
-
"type": "user_report",
|
|
88
|
-
"reproduction_steps": ["Open dashboard", "Wait 10 seconds"],
|
|
89
|
-
},
|
|
90
|
-
"verification_type": "manual",
|
|
91
|
-
"acceptance_criteria": ["Dashboard loads in <2s"],
|
|
92
|
-
"status": "pending",
|
|
93
|
-
"affected_feature": "F-003",
|
|
94
|
-
"environment": {"os": "macOS", "browser": "Chrome"},
|
|
95
|
-
},
|
|
96
|
-
],
|
|
97
|
-
}
|
|
98
23
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
"""Write sample feature list to a temp file and return the path."""
|
|
103
|
-
path = tmp_path / "feature-list.json"
|
|
104
|
-
path.write_text(json.dumps(sample_feature_list, indent=2), encoding="utf-8")
|
|
105
|
-
return str(path)
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
@pytest.fixture
|
|
109
|
-
def bug_list_file(tmp_path, sample_bug_list):
|
|
110
|
-
"""Write sample bug list to a temp file and return the path."""
|
|
111
|
-
path = tmp_path / "bug-fix-list.json"
|
|
112
|
-
path.write_text(json.dumps(sample_bug_list, indent=2), encoding="utf-8")
|
|
113
|
-
return str(path)
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
@pytest.fixture
|
|
117
|
-
def state_dir(tmp_path):
|
|
118
|
-
"""Create and return a basic state directory."""
|
|
119
|
-
sd = tmp_path / "state"
|
|
120
|
-
sd.mkdir()
|
|
121
|
-
features_dir = sd / "features"
|
|
122
|
-
features_dir.mkdir()
|
|
123
|
-
return str(sd)
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
@pytest.fixture
|
|
127
|
-
def bugfix_state_dir(tmp_path):
|
|
128
|
-
"""Create and return a basic bugfix state directory."""
|
|
129
|
-
sd = tmp_path / "bugfix-state"
|
|
130
|
-
sd.mkdir()
|
|
131
|
-
bugs_dir = sd / "bugs"
|
|
132
|
-
bugs_dir.mkdir()
|
|
133
|
-
return str(sd)
|
|
24
|
+
# Register hyphenated script files so tests can import them with underscores.
|
|
25
|
+
_load_hyphenated_module("generate_bootstrap_prompt", "generate-bootstrap-prompt.py")
|
|
26
|
+
_load_hyphenated_module("generate_bugfix_prompt", "generate-bugfix-prompt.py")
|