prizmkit 1.1.1 → 1.1.4

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 (119) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/adapters/claude/agent-adapter.js +18 -0
  3. package/bundled/adapters/claude/command-adapter.js +1 -27
  4. package/bundled/agents/prizm-dev-team-critic.md +2 -0
  5. package/bundled/agents/prizm-dev-team-dev.md +2 -0
  6. package/bundled/agents/prizm-dev-team-reviewer.md +2 -0
  7. package/bundled/dev-pipeline/README.md +63 -63
  8. package/bundled/dev-pipeline/assets/feature-list-example.json +1 -1
  9. package/bundled/dev-pipeline/assets/prizm-dev-team-integration.md +1 -1
  10. package/bundled/dev-pipeline/{launch-daemon.sh → launch-feature-daemon.sh} +33 -33
  11. package/bundled/dev-pipeline/launch-refactor-daemon.sh +454 -0
  12. package/bundled/dev-pipeline/lib/branch.sh +1 -1
  13. package/bundled/dev-pipeline/reset-feature.sh +3 -3
  14. package/bundled/dev-pipeline/reset-refactor.sh +312 -0
  15. package/bundled/dev-pipeline/{retry-bug.sh → retry-bugfix.sh} +47 -59
  16. package/bundled/dev-pipeline/retry-feature.sh +41 -54
  17. package/bundled/dev-pipeline/retry-refactor.sh +358 -0
  18. package/bundled/dev-pipeline/run-bugfix.sh +41 -0
  19. package/bundled/dev-pipeline/{run.sh → run-feature.sh} +64 -31
  20. package/bundled/dev-pipeline/run-refactor.sh +787 -0
  21. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +398 -10
  22. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +124 -0
  23. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +419 -0
  24. package/bundled/dev-pipeline/scripts/init-refactor-pipeline.py +393 -0
  25. package/bundled/dev-pipeline/scripts/update-refactor-status.py +726 -0
  26. package/bundled/dev-pipeline/templates/agent-prompts/critic-code-challenge.md +13 -0
  27. package/bundled/dev-pipeline/templates/agent-prompts/critic-plan-challenge.md +7 -0
  28. package/bundled/dev-pipeline/templates/agent-prompts/dev-fix.md +7 -0
  29. package/bundled/dev-pipeline/templates/agent-prompts/dev-implement.md +27 -0
  30. package/bundled/dev-pipeline/templates/agent-prompts/dev-resume.md +5 -0
  31. package/bundled/dev-pipeline/templates/agent-prompts/reviewer-analyze.md +5 -0
  32. package/bundled/dev-pipeline/templates/agent-prompts/reviewer-review.md +12 -0
  33. package/bundled/dev-pipeline/templates/bootstrap-tier1.md +33 -2
  34. package/bundled/dev-pipeline/templates/bootstrap-tier2.md +13 -9
  35. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +16 -12
  36. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +22 -4
  37. package/bundled/dev-pipeline/templates/feature-list-schema.json +1 -1
  38. package/bundled/dev-pipeline/templates/refactor-list-schema.json +159 -0
  39. package/bundled/dev-pipeline/templates/sections/ac-verification-checklist.md +13 -0
  40. package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +36 -0
  41. package/bundled/dev-pipeline/templates/sections/failure-log-check.md +2 -1
  42. package/bundled/dev-pipeline/templates/sections/feature-context.md +1 -1
  43. package/bundled/dev-pipeline/templates/sections/phase-analyze-agent.md +11 -7
  44. package/bundled/dev-pipeline/templates/sections/phase-analyze-full.md +11 -7
  45. package/bundled/dev-pipeline/templates/sections/phase-browser-verification.md +5 -1
  46. package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +3 -0
  47. package/bundled/dev-pipeline/templates/sections/phase-commit.md +3 -0
  48. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-agent-suffix.md +3 -0
  49. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-lite-suffix.md +3 -0
  50. package/bundled/dev-pipeline/templates/sections/phase-critic-code.md +11 -10
  51. package/bundled/dev-pipeline/templates/sections/phase-critic-plan-full.md +12 -10
  52. package/bundled/dev-pipeline/templates/sections/phase-critic-plan.md +11 -9
  53. package/bundled/dev-pipeline/templates/sections/phase-deploy-verification.md +3 -0
  54. package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +10 -10
  55. package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +12 -16
  56. package/bundled/dev-pipeline/templates/sections/phase-implement-lite.md +3 -0
  57. package/bundled/dev-pipeline/templates/sections/phase-plan-agent.md +3 -0
  58. package/bundled/dev-pipeline/templates/sections/phase-plan-lite.md +3 -0
  59. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +11 -13
  60. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +12 -20
  61. package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +3 -0
  62. package/bundled/dev-pipeline/templates/sections/phase0-init.md +3 -0
  63. package/bundled/dev-pipeline/templates/sections/phase0-test-baseline.md +3 -0
  64. package/bundled/dev-pipeline/templates/sections/resume-header.md +4 -1
  65. package/bundled/dev-pipeline/templates/sections/test-failure-recovery.md +75 -0
  66. package/bundled/rules/prizm/prizm-commit-workflow.md +1 -0
  67. package/bundled/rules/prizm/prizm-documentation.md +15 -15
  68. package/bundled/rules/prizm/prizm-progressive-loading.md +2 -1
  69. package/bundled/skills/_metadata.json +33 -6
  70. package/bundled/skills/app-planner/SKILL.md +105 -320
  71. package/bundled/skills/app-planner/assets/app-design-guide.md +101 -0
  72. package/bundled/skills/app-planner/references/frontend-design-guide.md +1 -1
  73. package/bundled/skills/app-planner/references/project-brief-guide.md +49 -80
  74. package/bundled/skills/bug-fix-workflow/SKILL.md +2 -2
  75. package/bundled/skills/bug-planner/SKILL.md +68 -5
  76. package/bundled/skills/bug-planner/scripts/validate-bug-list.py +3 -2
  77. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +19 -5
  78. package/bundled/skills/{dev-pipeline-launcher → feature-pipeline-launcher}/SKILL.md +32 -32
  79. package/bundled/skills/feature-planner/SKILL.md +337 -0
  80. package/bundled/skills/{app-planner → feature-planner}/assets/evaluation-guide.md +4 -4
  81. package/bundled/skills/{app-planner → feature-planner}/assets/planning-guide.md +3 -171
  82. package/bundled/skills/{app-planner → feature-planner}/references/browser-interaction.md +6 -5
  83. package/bundled/skills/feature-planner/references/decomposition-patterns.md +75 -0
  84. package/bundled/skills/{app-planner → feature-planner}/references/error-recovery.md +8 -8
  85. package/bundled/skills/{app-planner → feature-planner}/references/incremental-feature-planning.md +1 -1
  86. package/bundled/skills/{app-planner/references/new-app-planning.md → feature-planner/references/new-project-planning.md} +1 -1
  87. package/bundled/skills/{app-planner → feature-planner}/scripts/validate-and-generate.py +4 -4
  88. package/bundled/skills/feature-workflow/SKILL.md +23 -23
  89. package/bundled/skills/prizm-kit/SKILL.md +1 -3
  90. package/bundled/skills/prizm-kit/assets/project-memory-template.md +4 -2
  91. package/bundled/skills/prizmkit-analyze/SKILL.md +2 -5
  92. package/bundled/skills/prizmkit-code-review/SKILL.md +2 -2
  93. package/bundled/skills/prizmkit-committer/SKILL.md +32 -8
  94. package/bundled/skills/prizmkit-deploy/SKILL.md +1 -5
  95. package/bundled/skills/prizmkit-implement/SKILL.md +5 -51
  96. package/bundled/skills/prizmkit-init/SKILL.md +7 -78
  97. package/bundled/skills/prizmkit-plan/SKILL.md +1 -12
  98. package/bundled/skills/prizmkit-prizm-docs/SKILL.md +13 -28
  99. package/bundled/skills/prizmkit-prizm-docs/assets/PRIZM-SPEC.md +52 -1
  100. package/bundled/skills/prizmkit-retrospective/SKILL.md +12 -117
  101. package/bundled/skills/recovery-workflow/SKILL.md +168 -316
  102. package/bundled/skills/recovery-workflow/evals/evals.json +29 -13
  103. package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +232 -274
  104. package/bundled/skills/refactor-pipeline-launcher/SKILL.md +352 -0
  105. package/bundled/skills/refactor-planner/SKILL.md +436 -0
  106. package/bundled/skills/refactor-planner/assets/planning-guide.md +292 -0
  107. package/bundled/skills/refactor-planner/references/behavior-preservation.md +301 -0
  108. package/bundled/skills/refactor-planner/references/refactor-scoping-guide.md +221 -0
  109. package/bundled/skills/refactor-planner/scripts/validate-and-generate-refactor.py +786 -0
  110. package/bundled/skills/refactor-workflow/SKILL.md +299 -319
  111. package/bundled/team/prizm-dev-team.json +1 -1
  112. package/package.json +1 -1
  113. package/src/clean.js +3 -3
  114. package/src/scaffold.js +6 -6
  115. package/bundled/skills/prizmkit-plan/assets/spec-template.md +0 -56
  116. package/bundled/skills/prizmkit-plan/references/clarify-guide.md +0 -67
  117. package/src/config.js +0 -504
  118. package/src/prompts.js +0 -210
  119. /package/bundled/skills/{dev-pipeline-launcher → feature-pipeline-launcher}/scripts/preflight-check.py +0 -0
@@ -0,0 +1,36 @@
1
+ ## Workflow Checkpoint System
2
+
3
+ A checkpoint file tracks your progress through this workflow:
4
+
5
+ **Path**: `{{CHECKPOINT_PATH}}`
6
+
7
+ ### Rules
8
+
9
+ 1. **Before each skill**: Read `workflow-checkpoint.json`, verify the previous step has `status: "completed"` or `status: "skipped"`. If it is still `"pending"` or `"in_progress"`, you MUST complete it first before moving on.
10
+
11
+ 2. **Starting a skill**: Update the current step to `status: "in_progress"`.
12
+
13
+ 3. **After each skill completes**: Update the current step to `status: "completed"`. Then immediately re-read the file to verify the JSON is valid. If the read fails, re-write the file with correct JSON.
14
+
15
+ 4. **On failure**: Set the step to `status: "failed"` and continue to the next step if possible, or halt and write failure-log.md.
16
+
17
+ 5. **On session exit**: The checkpoint file reflects your actual progress. Do NOT manually set future steps to "completed".
18
+
19
+ ### Checkpoint Update Pattern
20
+
21
+ After completing each skill:
22
+
23
+ 1. Read `{{CHECKPOINT_PATH}}`
24
+ 2. Update the current step `"status": "completed"`
25
+ 3. Update the next step `"status": "in_progress"`
26
+ 4. Write the updated JSON back to `{{CHECKPOINT_PATH}}`
27
+ 5. Verify: `python3 -c "import json; json.load(open('{{CHECKPOINT_PATH}}'))"` — if this fails, re-write
28
+
29
+ ### Resume Behavior
30
+
31
+ **Checkpoint is the primary source of truth for resume.** On retry sessions:
32
+
33
+ 1. Read `workflow-checkpoint.json` — steps already `"completed"` or `"skipped"` are skipped
34
+ 2. Start from the first `"pending"` or `"in_progress"` step
35
+ 3. If `failure-log.md` exists, read it for diagnostic context (why the previous session failed, what approach to try differently) — but do NOT use it to determine which step to resume from
36
+ 4. If `workflow-checkpoint.json` is missing or corrupted, fall back to `failure-log.md` + the resume phase as the legacy mechanism
@@ -1,4 +1,4 @@
1
- **Check for previous failure log:**
1
+ **Check for previous failure log** (diagnostic context only — do NOT use to determine resume point):
2
2
  ```bash
3
3
  cat .prizmkit/specs/{{FEATURE_SLUG}}/failure-log.md 2>/dev/null || echo "NO_PREVIOUS_FAILURE"
4
4
  ```
@@ -6,3 +6,4 @@ If failure-log.md exists:
6
6
  - Read ROOT_CAUSE and SUGGESTION — adjust your approach accordingly
7
7
  - Read DISCOVERED_TRAPS — if any are genuine, inject into .prizm-docs/ during the commit phase retrospective
8
8
  - Do NOT delete failure-log.md until this session completes all phases and commits successfully
9
+ - **Note**: The resume point is determined by `workflow-checkpoint.json`, not by failure-log.md
@@ -9,7 +9,7 @@
9
9
 
10
10
  ### Project Brief
11
11
 
12
- > Distilled summary of the project's key requirements and design decisions, captured during planning. When your feature implementation touches any of these key points, ensure alignment.
12
+ > Product ideas checklist from planning. Lines marked [x] are already implemented. When your feature touches any [ ] item, ensure alignment. After implementation, mark relevant items [x] and append the key file/directory paths.
13
13
 
14
14
  {{PROJECT_BRIEF}}
15
15
 
@@ -1,15 +1,19 @@
1
1
  ### Analyze — Reviewer Subagent
2
2
 
3
- Spawn Reviewer agent (Agent tool, subagent_type="prizm-dev-team-reviewer", run_in_background=false).
3
+ **Spawn Agent**:
4
+ | Parameter | Value |
5
+ |-----------|-------|
6
+ | subagent_type | prizm-dev-team-reviewer |
7
+ | mode | plan |
8
+ | run_in_background | false |
4
9
 
5
- Prompt:
6
- > "Read {{REVIEWER_SUBAGENT_PATH}}. For feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}):
7
- > 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST — Section 3 has project context, Section 4 has file manifest.
8
- > 2. Run prizmkit-analyze: cross-check `plan.md` (including Tasks section) against feature description and acceptance criteria for consistency.
9
- > 3. Before flagging CRITICAL or HIGH issues, read the relevant source files listed in the File Manifest to verify.
10
- > Report: CRITICAL, HIGH, MEDIUM issues found (or 'No issues found')."
10
+ **Prompt**:
11
+ > {{AGENT_PROMPT_REVIEWER_ANALYZE}}
11
12
 
12
13
  Wait for Reviewer to return.
13
14
  - 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 plan.md. Then re-run analyze (max 1 round).
14
15
 
15
16
  **CP-2**: No CRITICAL issues.
17
+
18
+
19
+ **Checkpoint update**: Update `workflow-checkpoint.json` — set step `prizmkit-analyze` to `"completed"`.
@@ -1,15 +1,19 @@
1
1
  ### Analyze — Reviewer Agent
2
2
 
3
- Spawn Reviewer agent (Agent tool, subagent_type="prizm-dev-team-reviewer", run_in_background=false).
3
+ **Spawn Agent**:
4
+ | Parameter | Value |
5
+ |-----------|-------|
6
+ | subagent_type | prizm-dev-team-reviewer |
7
+ | mode | plan |
8
+ | run_in_background | false |
4
9
 
5
- Prompt:
6
- > "Read {{REVIEWER_SUBAGENT_PATH}}. For feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}):
7
- > 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST — Section 3 has project context, Section 4 has file manifest.
8
- > 2. Run prizmkit-analyze: cross-check `spec.md` and `plan.md` (including Tasks section) for consistency.
9
- > 3. Before flagging CRITICAL or HIGH issues, read the relevant source files listed in the File Manifest to verify.
10
- > Report: CRITICAL, HIGH, MEDIUM issues found (or 'No issues found')."
10
+ **Prompt**:
11
+ > {{AGENT_PROMPT_REVIEWER_ANALYZE}}
11
12
 
12
13
  Wait for Reviewer to return.
13
14
  - 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).
14
15
 
15
16
  **CP-2**: No CRITICAL issues.
17
+
18
+
19
+ **Checkpoint update**: Update `workflow-checkpoint.json` — set step `prizmkit-analyze` to `"completed"`.
@@ -9,8 +9,9 @@ You MUST execute this phase. Do NOT skip it. Do NOT mark it as completed without
9
9
  4. If the page requires authentication, use playwright-cli to register a test user and log in first
10
10
 
11
11
  **Verification**:
12
- 5. Use `playwright-cli` to open `{{BROWSER_URL}}`, then verify:
12
+ 5. Use `playwright-cli snapshot` on `{{BROWSER_URL}}` to discover actual element refs, then verify these goals:
13
13
  {{BROWSER_VERIFY_STEPS}}
14
+ Decide the concrete playwright-cli actions (click, fill, assert, etc.) yourself based on the snapshot output and your knowledge of the implemented code. The goals above describe WHAT to verify — you determine HOW.
14
15
  6. Take a final screenshot for evidence
15
16
 
16
17
  **Cleanup (REQUIRED — you started it, you stop it)**:
@@ -29,3 +30,6 @@ You MUST execute this phase. Do NOT skip it. Do NOT mark it as completed without
29
30
  ```
30
31
 
31
32
  If verification fails, log the failure details but continue to commit. Failures do NOT block the commit, but you MUST attempt verification and MUST clean up the dev server.
33
+
34
+
35
+ **Checkpoint update**: Update `workflow-checkpoint.json` — set step `browser-verification` to `"completed"`.
@@ -34,3 +34,6 @@ This single commit includes: feature code + tests + .prizm-docs/ updates. Do NOT
34
34
  git status --short
35
35
  ```
36
36
  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
+
38
+
39
+ **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"`.
@@ -24,3 +24,6 @@ This single commit includes: feature code + tests + .prizm-docs/ updates. Do NOT
24
24
  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
+
28
+
29
+ **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"`.
@@ -12,3 +12,6 @@
12
12
 
13
13
  ### Known TRAPS (from .prizm-docs/)
14
14
  - <trap entries extracted from L1/L2 docs>
15
+
16
+
17
+ **Checkpoint update**: Update `workflow-checkpoint.json` — set step `context-snapshot` to `"completed"`.
@@ -1,3 +1,6 @@
1
1
  - **Section 3 — Prizm Context**: content of root.prizm and relevant L1/L2 docs
2
2
  - **Section 4 — Existing Source Files**: **full verbatim content** of each related file in fenced code blocks (with `### path/to/file` heading and line count). Include ALL files needed for implementation and review — downstream phases read this section instead of re-reading individual source files
3
3
  - **Section 5 — Existing Tests**: full content of related test files as code block
4
+
5
+
6
+ **Checkpoint update**: Update `workflow-checkpoint.json` — set step `context-snapshot` to `"completed"`.
@@ -6,19 +6,20 @@ ls {{CRITIC_SUBAGENT_PATH}} 2>/dev/null && echo "CRITIC:READY" || echo "CRITIC:M
6
6
  ```
7
7
  If CRITIC:MISSING — skip this phase entirely and proceed. Log: "Critic agent not installed — skipping Code Challenge."
8
8
 
9
- Spawn Critic agent (Agent tool, subagent_type="prizm-dev-team-critic", run_in_background=false).
9
+ **Spawn Agent**:
10
+ | Parameter | Value |
11
+ |-----------|-------|
12
+ | subagent_type | prizm-dev-team-critic |
13
+ | mode | plan |
14
+ | run_in_background | false |
10
15
 
11
- Prompt:
12
- > "Read {{CRITIC_SUBAGENT_PATH}}. For feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}):
13
- > **MODE: Code Challenge**
14
- > 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` — Implementation Log section shows what Dev changed.
15
- > 2. Read `.prizm-docs/root.prizm` and relevant module docs for RULES/PATTERNS.
16
- > 3. Read the actual source files changed (from Implementation Log).
17
- > 4. Read comparable existing source files in the same module for style comparison.
18
- > 5. Challenge code integration quality: style fit, robustness, existing code cohesion, hidden impact.
19
- > Write `.prizmkit/specs/{{FEATURE_SLUG}}/challenge-report.md` (overwrite) with findings (or 'No significant challenges')."
16
+ **Prompt**:
17
+ > {{AGENT_PROMPT_CRITIC_CODE_CHALLENGE}}
20
18
 
21
19
  Wait for Critic to return.
22
20
  - Read challenge-report.md. For items marked CRITICAL/HIGH: spawn Dev to fix, then proceed to Review.
23
21
 
24
22
  **CP-3.5**: Code challenges reviewed and resolved.
23
+
24
+
25
+ **Checkpoint update**: Update `workflow-checkpoint.json` — set step `critic-code-review` to `"completed"`.
@@ -10,20 +10,19 @@ If CRITIC:MISSING — skip this phase entirely and proceed. Log: "Critic agent n
10
10
 
11
11
  **If {{CRITIC_COUNT}} = 1 → Single Critic** (skip to CP-2.5 after this):
12
12
 
13
- Spawn Critic agent (Agent tool, subagent_type="prizm-dev-team-critic", run_in_background=false).
13
+ **Spawn Agent**:
14
+ | Parameter | Value |
15
+ |-----------|-------|
16
+ | subagent_type | prizm-dev-team-critic |
17
+ | mode | plan |
18
+ | run_in_background | false |
14
19
 
15
- Prompt:
16
- > "Read {{CRITIC_SUBAGENT_PATH}}. For feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}):
17
- > **MODE: Plan Challenge**
18
- > 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST — Section 3 has project context, Section 4 has file manifest.
19
- > 2. Read `.prizm-docs/root.prizm` and relevant L1/L2 docs for affected modules.
20
- > 3. Read existing source files in the modules this plan touches.
21
- > 4. Challenge plan.md against the project's existing architecture, patterns, and style.
22
- > Write `.prizmkit/specs/{{FEATURE_SLUG}}/challenge-report.md` with findings (or 'No significant challenges')."
20
+ **Prompt**:
21
+ > {{AGENT_PROMPT_CRITIC_PLAN_CHALLENGE}}
23
22
 
24
23
  **If {{CRITIC_COUNT}} = 3 → Multi-Critic Voting** (skip Single Critic above):
25
24
 
26
- Spawn 3 Critic agents sequentially (each with run_in_background=false), each with a different focus lens:
25
+ Spawn 3 Critic agents sequentially (each with mode="plan", run_in_background=false), each with a different focus lens:
27
26
 
28
27
  Critic-A prompt (append to base prompt above):
29
28
  > "**Focus Lens: Architecture & Scalability.** Prioritize: architectural pattern fit, scalability implications, over-engineering risks, component boundary design.
@@ -43,3 +42,6 @@ After all critics return, read all 3 reports:
43
42
  - Max 1 plan revision round.
44
43
 
45
44
  **CP-2.5**: Plan challenges reviewed and resolved.
45
+
46
+
47
+ **Checkpoint update**: Update `workflow-checkpoint.json` — set step `critic-plan-review` to `"completed"`.
@@ -6,19 +6,21 @@ ls {{CRITIC_SUBAGENT_PATH}} 2>/dev/null && echo "CRITIC:READY" || echo "CRITIC:M
6
6
  ```
7
7
  If CRITIC:MISSING — skip this phase entirely and proceed. Log: "Critic agent not installed — skipping Plan Challenge."
8
8
 
9
- Spawn Critic agent (Agent tool, subagent_type="prizm-dev-team-critic", run_in_background=false).
9
+ **Spawn Agent**:
10
+ | Parameter | Value |
11
+ |-----------|-------|
12
+ | subagent_type | prizm-dev-team-critic |
13
+ | mode | plan |
14
+ | run_in_background | false |
10
15
 
11
- Prompt:
12
- > "Read {{CRITIC_SUBAGENT_PATH}}. For feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}):
13
- > **MODE: Plan Challenge**
14
- > 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST — Section 3 has project context, Section 4 has file manifest.
15
- > 2. Read `.prizm-docs/root.prizm` and relevant L1/L2 docs for affected modules.
16
- > 3. Read existing source files in the modules this plan touches.
17
- > 4. Challenge plan.md against the project's existing architecture, patterns, and style.
18
- > Write `.prizmkit/specs/{{FEATURE_SLUG}}/challenge-report.md` with findings (or 'No significant challenges')."
16
+ **Prompt**:
17
+ > {{AGENT_PROMPT_CRITIC_PLAN_CHALLENGE}}
19
18
 
20
19
  Wait for Critic to return.
21
20
  - Read challenge-report.md. For items marked CRITICAL/HIGH: decide whether to adjust plan.md or document why the plan stands.
22
21
  - Max 1 plan revision round.
23
22
 
24
23
  **CP-2.5**: Plan challenges reviewed and resolved.
24
+
25
+
26
+ **Checkpoint update**: Update `workflow-checkpoint.json` — set step `critic-plan-review` to `"completed"`.
@@ -34,3 +34,6 @@ Deploy verification does NOT block the commit, but you MUST attempt it.
34
34
  4. Record smoke test results in `## Deploy Verification` section
35
35
 
36
36
  If the project cannot be started locally (e.g., requires external services, databases, credentials), skip the smoke test and note why.
37
+
38
+
39
+ **Checkpoint update**: Update `workflow-checkpoint.json` — set step `deploy-verification` to `"completed"`.
@@ -2,17 +2,14 @@
2
2
 
3
3
  **Build artifacts rule** (passed to Dev): After any build/compile command (`go build`, `npm run build`, `tsc`, etc.), ensure the output binary or build directory is in `.gitignore`. Never commit compiled binaries, build output, or generated artifacts.
4
4
 
5
- Spawn Dev subagent (Agent tool, subagent_type="prizm-dev-team-dev", run_in_background=false).
5
+ **Spawn Agent**:
6
+ | Parameter | Value |
7
+ |-----------|-------|
8
+ | subagent_type | prizm-dev-team-dev |
9
+ | run_in_background | false |
6
10
 
7
- Prompt:
8
- > "Read {{DEV_SUBAGENT_PATH}}. Implement feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}).
9
- > **IMPORTANT**: Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST — Section 3 has Prizm Context (TRAPS/RULES), Section 4 has File Manifest with paths and interfaces.
10
- > ⚠️ DO NOT re-read source files already listed in Section 4 File Manifest unless you need implementation detail beyond the interface summary.
11
- > 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` for full context.
12
- > 2. Run `/prizmkit-implement` to execute the tasks in plan.md. Use `TEST_CMD=<TEST_CMD>` for testing. Baseline failures: `BASELINE_FAILURES=<BASELINE_FAILURES>`.
13
- > 3. After implement completes, verify the '## Implementation Log' section was written to context-snapshot.md.
14
- > 4. Do NOT execute any git commands (no git add/commit/reset/push).
15
- > Do NOT exit until all tasks are [x] and the '## Implementation Log' section is written in context-snapshot.md."
11
+ **Prompt**:
12
+ > {{AGENT_PROMPT_DEV_IMPLEMENT}}
16
13
 
17
14
  Wait for Dev to return. All tasks must be `[x]`, tests pass.
18
15
 
@@ -22,3 +19,6 @@ After Dev agent returns, verify the Implementation Log was written:
22
19
  grep -q "## Implementation Log" .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md && echo "GATE:PASS" || echo "GATE:MISSING"
23
20
  ```
24
21
  If GATE:MISSING — send message to Dev (re-spawn if needed): "Write the '## Implementation Log' section to context-snapshot.md before I can proceed to review. Include: files changed/created, key decisions, deviations from plan, notable discoveries."
22
+
23
+
24
+ **Checkpoint update**: Update `workflow-checkpoint.json` — set step `prizmkit-implement` to `"completed"`.
@@ -9,17 +9,14 @@ grep -c '^\- \[ \]' .prizmkit/specs/{{FEATURE_SLUG}}/plan.md 2>/dev/null || true
9
9
  - If result is `0` (all tasks already `[x]`) → **SKIP this phase**, go directly to Review. Do NOT spawn Dev.
10
10
  - If result is non-zero → spawn Dev agent below.
11
11
 
12
- Spawn Dev agent (Agent tool, subagent_type="prizm-dev-team-dev", run_in_background=false).
13
-
14
- Prompt:
15
- > "Read {{DEV_SUBAGENT_PATH}}. Implement feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}).
16
- > **IMPORTANT**: Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST — Section 3 has Prizm Context (TRAPS/RULES), Section 4 has File Manifest with paths and interfaces.
17
- > ⚠️ DO NOT re-read source files already listed in Section 4 File Manifest unless you need implementation detail beyond the interface summary.
18
- > 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` for full context.
19
- > 2. Run `/prizmkit-implement` to execute the tasks in plan.md. Use `TEST_CMD=<TEST_CMD>` for testing. Baseline failures: `BASELINE_FAILURES=<BASELINE_FAILURES>`.
20
- > 3. After implement completes, verify the '## Implementation Log' section was written to context-snapshot.md.
21
- > 4. Do NOT execute any git commands (no git add/commit/reset/push).
22
- > Do NOT exit until all tasks are [x] and the '## Implementation Log' section is written in context-snapshot.md."
12
+ **Spawn Agent**:
13
+ | Parameter | Value |
14
+ |-----------|-------|
15
+ | subagent_type | prizm-dev-team-dev |
16
+ | run_in_background | false |
17
+
18
+ **Prompt**:
19
+ > {{AGENT_PROMPT_DEV_IMPLEMENT}}
23
20
 
24
21
  **Gate Check — Implementation Log**:
25
22
  After Dev agent returns, verify the Implementation Log was written:
@@ -31,11 +28,10 @@ If GATE:MISSING — send message to Dev (re-spawn if needed): "Write the '## Imp
31
28
  Wait for Dev to return. **If Dev times out before all tasks are `[x]`**:
32
29
  1. Check progress: `grep -c '^\- \[ \]' .prizmkit/specs/{{FEATURE_SLUG}}/plan.md`
33
30
  2. If any tasks remain: re-spawn Dev with this recovery prompt:
34
- > "Read {{DEV_SUBAGENT_PATH}}. You are resuming implementation of feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}).
35
- > 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` — Section 4 has File Manifest, 'Implementation Log' (if present) shows what was already done.
36
- > 2. Run `git diff HEAD` to see actual code changes already made.
37
- > 3. Run `/prizmkit-implement` to complete the remaining `[ ]` tasks. Use `TEST_CMD=<TEST_CMD>` for testing.
38
- > 4. Do NOT execute any git commands."
31
+ > {{AGENT_PROMPT_DEV_RESUME}}
39
32
  3. Max 2 recovery retries. After 2 failures, orchestrator implements remaining tasks directly.
40
33
 
41
34
  All tasks `[x]`, tests pass.
35
+
36
+
37
+ **Checkpoint update**: Update `workflow-checkpoint.json` — set step `prizmkit-implement` to `"completed"`.
@@ -30,3 +30,6 @@ $TEST_CMD 2>&1 | tee /tmp/test-baseline.txt | tail -20
30
30
  4. If any criterion is not met, fix it now (max 2 fix rounds)
31
31
 
32
32
  **CP-2**: All acceptance criteria met, all tests pass.
33
+
34
+
35
+ **Checkpoint update**: Update `workflow-checkpoint.json` — set step `prizmkit-implement` to `"completed"`.
@@ -15,3 +15,6 @@ Before proceeding past CP-1, verify:
15
15
  4. If a DB design decision genuinely cannot be resolved from existing code alone, document the assumption made and flag it in the Implementation Log for user review.
16
16
 
17
17
  **CP-1**: plan.md exists with Tasks section.
18
+
19
+
20
+ **Checkpoint update**: Update `workflow-checkpoint.json` — set step `prizmkit-plan` to `"completed"`.
@@ -14,3 +14,6 @@ Before proceeding past CP-1:
14
14
  3. Resolve all uncertain DB design decisions before writing Tasks — document choices in plan.md
15
15
 
16
16
  **CP-1**: plan.md exists with Tasks section.
17
+
18
+
19
+ **Checkpoint update**: Update `workflow-checkpoint.json` — set step `prizmkit-plan` to `"completed"`.
@@ -1,18 +1,13 @@
1
1
  ### Review + Test — Reviewer Subagent
2
2
 
3
- Spawn Reviewer subagent (Agent tool, subagent_type="prizm-dev-team-reviewer", run_in_background=false).
4
-
5
- Prompt:
6
- > "Read {{REVIEWER_SUBAGENT_PATH}}. For feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}):
7
- > **IMPORTANT**: Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST.
8
- > 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md`:
9
- > - Section 3: Prizm Context (RULES, PATTERNS to check against)
10
- > - Section 4: File Manifest (original file structure)
11
- > - '## Implementation Log': what Dev changed, key decisions, discoveries
12
- > 2. Run prizmkit-code-review (both phases): Phase 1 diagnostic review (spec compliance, code quality, correctness), then Phase 2 fix strategy formulation for any findings. Read ONLY files listed in Implementation Log for diagnosis; MAY read additional files for impact analysis.
13
- > 3. Run the full test suite — **ONLY if the Implementation Log does not already confirm all tests passing**. If the log states tests passed, trust it and skip the re-run. When running: `$TEST_CMD 2>&1 | tee /tmp/review-test-out.txt | tail -20`, then grep the file for details — do NOT re-run the suite multiple times. Write and execute integration tests covering all user stories.
14
- > 4. Write structured '## Review Notes' to context-snapshot.md with Fix Instructions (Root Cause, Impact, Fix Strategy, Code Guidance, Verification for each finding) and Re-Review Expectations.
15
- > Report verdict: PASS, PASS_WITH_WARNINGS, or NEEDS_FIXES."
3
+ **Spawn Agent**:
4
+ | Parameter | Value |
5
+ |-----------|-------|
6
+ | subagent_type | prizm-dev-team-reviewer |
7
+ | run_in_background | false |
8
+
9
+ **Prompt**:
10
+ > {{AGENT_PROMPT_REVIEWER_REVIEW}}
16
11
 
17
12
  Wait for Reviewer to return.
18
13
 
@@ -26,3 +21,6 @@ If GATE:MISSING — send message to Reviewer (re-spawn if needed): "Write the '#
26
21
  - If NEEDS_FIXES: spawn Dev to fix (Dev reads Fix Instructions in snapshot), re-run Review (max 3 rounds)
27
22
 
28
23
  **CP-3**: Tests pass, verdict is not NEEDS_FIXES.
24
+
25
+
26
+ **Checkpoint update**: Update `workflow-checkpoint.json` — set step `prizmkit-code-review` to `"completed"`.
@@ -1,18 +1,13 @@
1
1
  ### Review + Test — Reviewer Agent
2
2
 
3
- Spawn Reviewer agent (Agent tool, subagent_type="prizm-dev-team-reviewer", run_in_background=false).
4
-
5
- Prompt:
6
- > "Read {{REVIEWER_SUBAGENT_PATH}}. For feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}):
7
- > **IMPORTANT**: Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST.
8
- > 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md`:
9
- > - Section 3: Prizm Context (RULES, PATTERNS to check against)
10
- > - Section 4: File Manifest (original file structure)
11
- > - '## Implementation Log': what Dev changed, key decisions, discoveries
12
- > 2. Run prizmkit-code-review (both phases): Phase 1 diagnostic review (spec compliance, code quality, correctness), then Phase 2 fix strategy formulation for any findings. Read ONLY files listed in Implementation Log for diagnosis; MAY read additional files for impact analysis.
13
- > 3. Run the full test suite using `TEST_CMD=<TEST_CMD>` — **ONLY if the Implementation Log does not already confirm all tests passing**. If Implementation Log states tests passed, trust it and skip the re-run. When running tests: `$TEST_CMD 2>&1 | tee /tmp/review-test-out.txt | tail -20`, then grep `/tmp/review-test-out.txt` for details — do NOT re-run the suite multiple times. Write and execute integration tests covering all user stories from spec.md.
14
- > 4. Write structured '## Review Notes' to context-snapshot.md with Fix Instructions (Root Cause, Impact, Fix Strategy, Code Guidance, Verification for each finding) and Re-Review Expectations.
15
- > Report verdict: PASS, PASS_WITH_WARNINGS, or NEEDS_FIXES."
3
+ **Spawn Agent**:
4
+ | Parameter | Value |
5
+ |-----------|-------|
6
+ | subagent_type | prizm-dev-team-reviewer |
7
+ | run_in_background | false |
8
+
9
+ **Prompt**:
10
+ > {{AGENT_PROMPT_REVIEWER_REVIEW}}
16
11
 
17
12
  Wait for Reviewer to return.
18
13
 
@@ -24,13 +19,10 @@ grep -q "## Review Notes" .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md &
24
19
  If GATE:MISSING — send message to Reviewer (re-spawn if needed): "Write the '## Review Notes' section to context-snapshot.md with structured Fix Instructions. Include: verdict, findings with Root Cause/Impact/Fix Strategy/Code Guidance/Verification, and Re-Review Expectations."
25
20
 
26
21
  - If NEEDS_FIXES: spawn Dev to fix with this prompt:
27
- > "Read {{DEV_SUBAGENT_PATH}}. Fix NEEDS_FIXES issues for feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}).
28
- > 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` — '## Review Notes' section contains structured Fix Instructions with exact steps.
29
- > 2. Follow Fix Instructions in order (respect Depends On / Blocks dependencies). Each FIX-N has: Root Cause, Fix Strategy, Code Guidance, and Verification criteria.
30
- > 3. After each fix, run the Verification command listed in that FIX-N to confirm it works.
31
- > 4. Use `TEST_CMD=<TEST_CMD>` to verify no regressions.
32
- > 5. Append fix summary to '## Implementation Log' in context-snapshot.md.
33
- > 6. Do NOT execute any git commands."
22
+ > {{AGENT_PROMPT_DEV_FIX}}
34
23
  Then re-run Review (max 3 rounds).
35
24
 
36
25
  **CP-3**: Integration tests pass, verdict is not NEEDS_FIXES.
26
+
27
+
28
+ **Checkpoint update**: Update `workflow-checkpoint.json` — set step `prizmkit-code-review` to `"completed"`.
@@ -80,3 +80,6 @@ Before proceeding past CP-1, verify:
80
80
  4. If a DB design decision genuinely cannot be resolved from existing code alone, document the assumption made and flag it in the Implementation Log for user review.
81
81
 
82
82
  **CP-1**: Both spec.md and plan.md exist.
83
+
84
+
85
+ **Checkpoint update**: Update `workflow-checkpoint.json` — set step `context-snapshot-and-plan` to `"completed"`.
@@ -2,3 +2,6 @@
2
2
  - Run `/prizmkit-init` (invoke the prizmkit-init skill)
3
3
  - Run `python3 {{INIT_SCRIPT_PATH}} --project-root {{PROJECT_ROOT}} --feature-id {{FEATURE_ID}} --feature-slug {{FEATURE_SLUG}}`
4
4
  - **CP-0**: Verify `.prizm-docs/root.prizm`, `.prizmkit/config.json` exist
5
+
6
+
7
+ **Checkpoint update**: Update `workflow-checkpoint.json` — set step `prizmkit-init` to `"completed"`.
@@ -10,3 +10,6 @@ $TEST_CMD 2>&1 | tee /tmp/test-baseline.txt | tail -20
10
10
  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.
11
11
 
12
12
  > **Test Output Rule**: Always capture test output to a temp file (`tee /tmp/test-out.txt`). Then grep the file instead of re-running the suite.
13
+
14
+
15
+ **Checkpoint update**: Update `workflow-checkpoint.json` — set step `test-baseline` to `"completed"`.
@@ -1,2 +1,5 @@
1
1
  ### Resume from Phase {{RESUME_PHASE}}
2
- Check `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` — if it exists, skip context building and use it directly.
2
+
3
+ **Primary**: Read `{{CHECKPOINT_PATH}}` — find the first step with `"pending"` or `"in_progress"` status and resume from there. Steps already `"completed"` or `"skipped"` must NOT be re-executed.
4
+
5
+ **Fallback**: If `workflow-checkpoint.json` is missing or corrupted, check `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` — if it exists, skip context building and use it directly.
@@ -0,0 +1,75 @@
1
+ ## Test Failure Recovery Protocol
2
+
3
+ When tests fail during implementation (Phase 3 / Phase 4):
4
+
5
+ ### Immediate Action — Recovery Attempt (Max 2 Rounds)
6
+
7
+ 1. **Analyze failure output**:
8
+ - Read the test failure message carefully
9
+ - Identify: root cause (code bug vs. test brittleness vs. environment issue)
10
+ - Check if baseline already recorded this failure (in BASELINE_FAILURES)
11
+
12
+ 2. **Categorize failure**:
13
+ - **Pre-existing baseline failure** (expected): Record as acceptable, do NOT fix
14
+ - **New regression**: Code introduced a bug, fix the code
15
+ - **Brittle test**: Test passes/fails inconsistently, fix the test or environment
16
+ - **Environment issue**: Missing dependency, wrong config, fix setup
17
+
18
+ 3. **Fix and re-run** (first round):
19
+ - Apply fix (code or test, not environment)
20
+ - Re-run `$TEST_CMD` to verify
21
+ - If now passing → continue to next task
22
+ - If still failing → **proceed to Round 2**
23
+
24
+ 4. **Second fix attempt** (second round only):
25
+ - Re-analyze the failure with fresh perspective
26
+ - Try alternate fix approach
27
+ - Re-run `$TEST_CMD`
28
+ - If still failing after Round 2 → **escalate** (see below)
29
+
30
+ ### Escalation Paths
31
+
32
+ **Tier 1 (Single Agent)**:
33
+ - After max 2 fix rounds with tests still failing
34
+ - Document failure in Implementation Log with root cause analysis
35
+ - Attempt one manual fix by re-reading related source code
36
+ - If unable to resolve: record PARTIAL status with known failure list
37
+ - **Do NOT block commit**; tests can fail during development (recovery may be deferred to next session)
38
+
39
+ **Tier 2/3 (Dev + Reviewer)**:
40
+ - After Dev completes max 2 fix rounds with tests still failing
41
+ - Dev appends failure details to Implementation Log
42
+ - Reviewer agent runs full test suite in Phase 5
43
+ - If Reviewer confirms NEW regressions (not in baseline): mark verdict as `NEEDS_FIXES`
44
+ - If Reviewer confirms only baseline failures remain: proceed with `PASS_WITH_WARNINGS`
45
+
46
+ ### Context-Aware Test Re-run (Performance Optimization)
47
+
48
+ **Skip redundant re-runs**:
49
+ - If Implementation Log section in context-snapshot.md already confirms "all tests passing"
50
+ - → Skip Phase 5 test suite re-run (Reviewer will verify baseline log instead)
51
+ - This avoids rebuilding/re-running tests when already verified
52
+
53
+ **When to re-run**:
54
+ - If Implementation Log is missing or incomplete
55
+ - If any new code was added after the last test run
56
+ - If Reviewer suspects brittleness or environment drift
57
+
58
+ ### Failure Capture Rules
59
+
60
+ If tests remain broken after recovery:
61
+
62
+ ```
63
+ ## Test Failures Encountered
64
+
65
+ - **Test**: [test name/path]
66
+ - Root Cause: [explanation]
67
+ - Category: [pre-existing baseline | new regression | brittle test | environment]
68
+ - Fix Attempted: [describe what was tried]
69
+ - Status: [still failing | requires next session | known limitation]
70
+
71
+ - **Impact on Feature**: [can AC be verified despite failure | blocks AC verification]
72
+ ```
73
+
74
+ **Rule**: If any AC cannot be verified due to test failure, the feature is incomplete. Document in failure-log.md for next session.
75
+
@@ -8,3 +8,4 @@ Before any git commit in this project:
8
8
  3. Bug fixes use `fix()` prefix, not `feat()`
9
9
  4. Bug fixes run retrospective with structural sync only (Job 1)
10
10
  5. Use `/prizmkit-committer` command for the pure commit workflow
11
+ 6. After commit, `/prizmkit-committer` generates `session-summary.md` (lightweight cross-session handoff, not committed to git)