prizmkit 1.0.35 → 1.0.58

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 (74) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/adapters/claude/agent-adapter.js +2 -1
  3. package/bundled/adapters/claude/command-adapter.js +4 -3
  4. package/bundled/agents/prizm-dev-team-dev.md +12 -12
  5. package/bundled/agents/prizm-dev-team-reviewer.md +10 -10
  6. package/bundled/dev-pipeline/README.md +15 -19
  7. package/bundled/dev-pipeline/assets/prizm-dev-team-integration.md +16 -23
  8. package/bundled/dev-pipeline/launch-bugfix-daemon.sh +8 -0
  9. package/bundled/dev-pipeline/launch-daemon.sh +2 -0
  10. package/bundled/dev-pipeline/lib/branch.sh +76 -0
  11. package/bundled/dev-pipeline/retry-bug.sh +5 -2
  12. package/bundled/dev-pipeline/retry-feature.sh +5 -2
  13. package/bundled/dev-pipeline/run-bugfix.sh +74 -0
  14. package/bundled/dev-pipeline/run.sh +76 -2
  15. package/bundled/dev-pipeline/scripts/check-session-status.py +3 -1
  16. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +0 -8
  17. package/bundled/dev-pipeline/scripts/parse-stream-progress.py +1 -1
  18. package/bundled/dev-pipeline/scripts/update-bug-status.py +24 -1
  19. package/bundled/dev-pipeline/scripts/update-feature-status.py +3 -2
  20. package/bundled/dev-pipeline/templates/bootstrap-tier1.md +11 -25
  21. package/bundled/dev-pipeline/templates/bootstrap-tier2.md +12 -26
  22. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +54 -65
  23. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +7 -7
  24. package/bundled/dev-pipeline/templates/session-status-schema.json +1 -1
  25. package/bundled/dev-pipeline/tests/conftest.py +19 -131
  26. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +207 -0
  27. package/bundled/dev-pipeline/tests/test_utils.py +51 -110
  28. package/bundled/rules/prizm/prizm-commit-workflow.md +3 -3
  29. package/bundled/skills/_metadata.json +15 -16
  30. package/bundled/skills/app-planner/SKILL.md +8 -7
  31. package/bundled/skills/bug-fix-workflow/SKILL.md +174 -0
  32. package/bundled/skills/bug-planner/SKILL.md +20 -32
  33. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +3 -5
  34. package/bundled/skills/dev-pipeline-launcher/SKILL.md +4 -6
  35. package/bundled/skills/feature-workflow/SKILL.md +25 -42
  36. package/bundled/skills/prizm-kit/SKILL.md +57 -21
  37. package/bundled/skills/prizm-kit/assets/{claude-md-template.md → project-memory-template.md} +2 -2
  38. package/bundled/skills/prizmkit-analyze/SKILL.md +41 -29
  39. package/bundled/skills/prizmkit-clarify/SKILL.md +40 -30
  40. package/bundled/skills/prizmkit-code-review/SKILL.md +48 -43
  41. package/bundled/skills/prizmkit-committer/SKILL.md +30 -68
  42. package/bundled/skills/prizmkit-implement/SKILL.md +48 -24
  43. package/bundled/skills/prizmkit-init/SKILL.md +57 -66
  44. package/bundled/skills/prizmkit-plan/SKILL.md +46 -20
  45. package/bundled/skills/prizmkit-prizm-docs/SKILL.md +60 -19
  46. package/bundled/skills/prizmkit-prizm-docs/assets/PRIZM-SPEC.md +23 -23
  47. package/bundled/skills/prizmkit-retrospective/SKILL.md +142 -65
  48. package/bundled/skills/prizmkit-retrospective/assets/retrospective-template.md +13 -0
  49. package/bundled/skills/prizmkit-specify/SKILL.md +63 -13
  50. package/bundled/skills/refactor-workflow/SKILL.md +105 -49
  51. package/bundled/team/prizm-dev-team.json +5 -19
  52. package/package.json +1 -1
  53. package/src/clean.js +0 -2
  54. package/src/manifest.js +8 -4
  55. package/src/scaffold.js +72 -6
  56. package/src/upgrade.js +32 -5
  57. package/bundled/agents/prizm-dev-team-coordinator.md +0 -141
  58. package/bundled/agents/prizm-dev-team-pm.md +0 -126
  59. package/bundled/dev-pipeline/tests/__init__.py +0 -0
  60. package/bundled/dev-pipeline/tests/test_check_session.py +0 -127
  61. package/bundled/dev-pipeline/tests/test_cleanup_logs.py +0 -119
  62. package/bundled/dev-pipeline/tests/test_detect_stuck.py +0 -207
  63. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +0 -181
  64. package/bundled/dev-pipeline/tests/test_generate_prompt.py +0 -190
  65. package/bundled/dev-pipeline/tests/test_init_bugfix_pipeline.py +0 -153
  66. package/bundled/dev-pipeline/tests/test_init_pipeline.py +0 -241
  67. package/bundled/dev-pipeline/tests/test_update_bug_status.py +0 -142
  68. package/bundled/dev-pipeline/tests/test_update_feature_status.py +0 -268
  69. package/bundled/skills/prizm-kit/assets/codebuddy-md-template.md +0 -35
  70. package/bundled/skills/prizm-kit/assets/hooks/prizm-commit-hook.json +0 -15
  71. package/bundled/skills/prizmkit-summarize/SKILL.md +0 -51
  72. package/bundled/skills/prizmkit-summarize/assets/registry-template.md +0 -18
  73. package/bundled/templates/hooks/commit-intent-claude.json +0 -26
  74. /package/bundled/templates/hooks/{commit-intent-codebuddy.json → commit-intent.json} +0 -0
@@ -28,6 +28,8 @@ set -euo pipefail
28
28
  # LOG_RETENTION_DAYS Delete logs older than N days (default: 14)
29
29
  # LOG_MAX_TOTAL_MB Keep total logs under N MB via oldest-first cleanup (default: 1024)
30
30
  # PIPELINE_MODE Override mode for all features: lite|standard|full|self-evolve (used by daemon)
31
+ # DEV_BRANCH Custom dev branch name (default: auto-generated dev/pipeline-{run_id})
32
+ # AUTO_PUSH Auto-push to remote after successful feature (default: 0). Set to 1 to enable.
31
33
  # ============================================================
32
34
 
33
35
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@@ -44,6 +46,8 @@ LOG_RETENTION_DAYS=${LOG_RETENTION_DAYS:-14}
44
46
  LOG_MAX_TOTAL_MB=${LOG_MAX_TOTAL_MB:-1024}
45
47
  VERBOSE=${VERBOSE:-0}
46
48
  MODEL=${MODEL:-""}
49
+ DEV_BRANCH=${DEV_BRANCH:-""}
50
+ AUTO_PUSH=${AUTO_PUSH:-0}
47
51
 
48
52
  # Source shared common helpers (CLI/platform detection + logs + deps)
49
53
  source "$SCRIPT_DIR/lib/common.sh"
@@ -52,12 +56,19 @@ prizm_detect_cli_and_platform
52
56
  # Source shared heartbeat library
53
57
  source "$SCRIPT_DIR/lib/heartbeat.sh"
54
58
 
59
+ # Source shared branch library
60
+ source "$SCRIPT_DIR/lib/branch.sh"
61
+
55
62
  # Detect stream-json support
56
63
  detect_stream_json_support "$CLI_CMD"
57
64
 
58
65
  # Feature list path (set in main, used by cleanup trap)
59
66
  FEATURE_LIST=""
60
67
 
68
+ # Branch tracking (for cleanup on interrupt)
69
+ _ORIGINAL_BRANCH=""
70
+ _DEV_BRANCH_NAME=""
71
+
61
72
  # ============================================================
62
73
  # Shared: Spawn an AI CLI session and wait for result
63
74
  # ============================================================
@@ -203,9 +214,9 @@ spawn_and_wait_session() {
203
214
  else
204
215
  local docs_changed=""
205
216
  docs_changed=$(git -C "$project_root" log --name-only --format="" -1 2>/dev/null \
206
- | grep -E '(\.prizm-docs/|\.prizmkit/specs/REGISTRY\.md)' | head -1 || true)
217
+ | grep -E '\.prizm-docs/' | head -1 || true)
207
218
  if [[ -z "$docs_changed" ]]; then
208
- log_warn "Session committed but no .prizm-docs or REGISTRY.md changes detected."
219
+ log_warn "Session committed but no .prizm-docs changes detected."
209
220
  session_status="docs_missing"
210
221
  fi
211
222
  fi
@@ -254,6 +265,12 @@ cleanup() {
254
265
  # Kill all child processes (claude-internal, heartbeat, progress parser, etc.)
255
266
  kill 0 2>/dev/null || true
256
267
 
268
+ # Log current branch info for recovery
269
+ if [[ -n "$_DEV_BRANCH_NAME" ]]; then
270
+ log_info "Development was on branch: $_DEV_BRANCH_NAME"
271
+ log_info "Original branch was: $_ORIGINAL_BRANCH"
272
+ fi
273
+
257
274
  if [[ -n "$FEATURE_LIST" && -f "$FEATURE_LIST" ]]; then
258
275
  python3 "$SCRIPTS_DIR/update-feature-status.py" \
259
276
  --feature-list "$FEATURE_LIST" \
@@ -588,17 +605,44 @@ sys.exit(1)
588
605
  log_warn "Interrupted. Killing session..."
589
606
  # Kill all child processes
590
607
  kill 0 2>/dev/null || true
608
+ # Log current branch info
609
+ if [[ -n "$_DEV_BRANCH_NAME" ]]; then
610
+ log_info "Development was on branch: $_DEV_BRANCH_NAME"
611
+ fi
591
612
  log_info "Session log: $session_dir/logs/session.log"
592
613
  exit 130
593
614
  }
594
615
  trap cleanup_single_feature SIGINT SIGTERM
595
616
 
596
617
  _SPAWN_RESULT=""
618
+
619
+ # Branch lifecycle: create and checkout feature branch
620
+ local _proj_root
621
+ _proj_root="$(cd "$SCRIPT_DIR/.." && pwd)"
622
+ local _source_branch
623
+ _source_branch=$(git -C "$_proj_root" rev-parse --abbrev-ref HEAD 2>/dev/null || echo "main")
624
+ _ORIGINAL_BRANCH="$_source_branch"
625
+
626
+ local _branch_name="${DEV_BRANCH:-dev/${feature_id}-$(date +%s)}"
627
+ if branch_create "$_proj_root" "$_branch_name" "$_source_branch"; then
628
+ _DEV_BRANCH_NAME="$_branch_name"
629
+ else
630
+ log_warn "Failed to create branch; running session on current branch"
631
+ fi
632
+
597
633
  spawn_and_wait_session \
598
634
  "$feature_id" "$feature_list" "$session_id" \
599
635
  "$bootstrap_prompt" "$session_dir" 999
600
636
  local session_status="$_SPAWN_RESULT"
601
637
 
638
+ # Auto-push after successful session
639
+ if [[ "$session_status" == "success" && "$AUTO_PUSH" == "1" ]]; then
640
+ local _proj_root
641
+ _proj_root="$(cd "$SCRIPT_DIR/.." && pwd)"
642
+ log_info "AUTO_PUSH enabled; pushing to remote..."
643
+ git -C "$_proj_root" push -u origin "$_DEV_BRANCH_NAME" 2>/dev/null || log_warn "Auto-push failed"
644
+ fi
645
+
602
646
  echo ""
603
647
  if [[ "$session_status" == "success" ]]; then
604
648
  # Self-evolve mode: run framework validation after successful session
@@ -708,6 +752,23 @@ main() {
708
752
  echo -e "${BOLD}════════════════════════════════════════════════════${NC}"
709
753
  echo ""
710
754
 
755
+ # Branch lifecycle: create dev branch for this pipeline run
756
+ local _proj_root
757
+ _proj_root="$(cd "$SCRIPT_DIR/.." && pwd)"
758
+ local _source_branch
759
+ _source_branch=$(git -C "$_proj_root" rev-parse --abbrev-ref HEAD 2>/dev/null || echo "main")
760
+ _ORIGINAL_BRANCH="$_source_branch"
761
+
762
+ local run_id_for_branch
763
+ run_id_for_branch=$(jq -r '.run_id' "$STATE_DIR/pipeline.json" 2>/dev/null || echo "$$")
764
+ local _branch_name="${DEV_BRANCH:-dev/pipeline-${run_id_for_branch}}"
765
+ if branch_create "$_proj_root" "$_branch_name" "$_source_branch"; then
766
+ _DEV_BRANCH_NAME="$_branch_name"
767
+ log_info "Dev branch: $_branch_name"
768
+ else
769
+ log_warn "Failed to create dev branch; running on current branch: $_source_branch"
770
+ fi
771
+
711
772
  # Main processing loop
712
773
  local session_count=0
713
774
 
@@ -746,6 +807,10 @@ for f in data.get('stuck_features', []):
746
807
  log_success "════════════════════════════════════════════════════"
747
808
  log_success " All features completed! Pipeline finished."
748
809
  log_success " Total sessions: $session_count"
810
+ if [[ -n "$_DEV_BRANCH_NAME" ]]; then
811
+ log_success " Dev branch: $_DEV_BRANCH_NAME"
812
+ log_success " Merge with: git checkout $_ORIGINAL_BRANCH && git merge $_DEV_BRANCH_NAME"
813
+ fi
749
814
  log_success "════════════════════════════════════════════════════"
750
815
  rm -f "$STATE_DIR/current-session.json"
751
816
  break
@@ -842,11 +907,20 @@ os.replace(tmp, target)
842
907
  # Spawn session and wait
843
908
  log_info "Spawning AI CLI session: $session_id"
844
909
  _SPAWN_RESULT=""
910
+
845
911
  spawn_and_wait_session \
846
912
  "$feature_id" "$feature_list" "$session_id" \
847
913
  "$bootstrap_prompt" "$session_dir" "$MAX_RETRIES"
848
914
  local session_status="$_SPAWN_RESULT"
849
915
 
916
+ # Auto-push after successful session
917
+ if [[ "$session_status" == "success" && "$AUTO_PUSH" == "1" ]]; then
918
+ local _proj_root
919
+ _proj_root="$(cd "$SCRIPT_DIR/.." && pwd)"
920
+ log_info "AUTO_PUSH enabled; pushing to remote..."
921
+ git -C "$_proj_root" push 2>/dev/null || log_warn "Auto-push failed"
922
+ fi
923
+
850
924
  session_count=$((session_count + 1))
851
925
 
852
926
  # Brief pause before next iteration
@@ -66,7 +66,7 @@ def determine_status(data):
66
66
  """Determine the single-line status string from the parsed data.
67
67
 
68
68
  Returns one of: success, partial_resumable, partial_not_resumable,
69
- failed, commit_missing, docs_missing.
69
+ failed, commit_missing, docs_missing, merge_conflict.
70
70
  """
71
71
  status = data.get("status", "")
72
72
 
@@ -84,6 +84,8 @@ def determine_status(data):
84
84
  return "commit_missing"
85
85
  elif status == "docs_missing":
86
86
  return "docs_missing"
87
+ elif status == "merge_conflict":
88
+ return "merge_conflict"
87
89
  else:
88
90
  # Unknown status value — treat as crashed
89
91
  return "crashed"
@@ -408,12 +408,6 @@ def build_replacements(args, feature, features, global_context, script_dir):
408
408
  )
409
409
 
410
410
  # Agent definitions are .md files in the platform-specific agents dir
411
- coordinator_subagent = os.path.join(
412
- agents_dir, "prizm-dev-team-coordinator.md",
413
- )
414
- pm_subagent = os.path.join(
415
- agents_dir, "prizm-dev-team-pm.md",
416
- )
417
411
  dev_subagent = os.path.join(
418
412
  agents_dir, "prizm-dev-team-dev.md",
419
413
  )
@@ -475,8 +469,6 @@ def build_replacements(args, feature, features, global_context, script_dir):
475
469
  ),
476
470
  "{{GLOBAL_CONTEXT}}": format_global_context(global_context),
477
471
  "{{TEAM_CONFIG_PATH}}": team_config_path,
478
- "{{COORDINATOR_SUBAGENT_PATH}}": coordinator_subagent,
479
- "{{PM_SUBAGENT_PATH}}": pm_subagent,
480
472
  "{{DEV_SUBAGENT_PATH}}": dev_subagent,
481
473
  "{{REVIEWER_SUBAGENT_PATH}}": reviewer_subagent,
482
474
  "{{VALIDATOR_SCRIPTS_DIR}}": validator_scripts_dir,
@@ -32,7 +32,7 @@ PHASE_KEYWORDS = {
32
32
  "analyze": ["prizmkit-analyze", "cross-check", "consistency", "analyzing"],
33
33
  "implement": ["prizmkit-implement", "implement", "TDD", "coding", "writing code"],
34
34
  "code-review": ["prizmkit-code-review", "code review", "review verdict", "reviewing"],
35
- "summarize": ["prizmkit-summarize", "REGISTRY.md", "summarize", "summary"],
35
+ "retrospective": ["prizmkit-retrospective", "retrospective", "knowledge distillation", "TRAPS", ".prizm-docs/ sync", "structural sync"],
36
36
  "commit": ["prizmkit-committer", "git commit", "feat(", "fix(", "committing"],
37
37
  }
38
38
 
@@ -39,6 +39,7 @@ SESSION_STATUS_VALUES = [
39
39
  "failed",
40
40
  "crashed",
41
41
  "timed_out",
42
+ "merge_conflict",
42
43
  ]
43
44
 
44
45
  TERMINAL_STATUSES = {"completed", "failed", "skipped", "needs_info"}
@@ -237,6 +238,25 @@ def action_update(args, bug_list_path, state_dir):
237
238
  if err:
238
239
  error_out("Failed to update bug-fix-list.json: {}".format(err))
239
240
  return
241
+ elif session_status == "merge_conflict":
242
+ # Degraded outcome: keep artifacts for retry (branch preserves work)
243
+ bs["retry_count"] = bs.get("retry_count", 0) + 1
244
+
245
+ if bs["retry_count"] >= max_retries:
246
+ bs["status"] = "failed"
247
+ target_status = "failed"
248
+ else:
249
+ bs["status"] = "merge_conflict"
250
+ target_status = "merge_conflict"
251
+
252
+ bs["resume_from_phase"] = None
253
+ bs["sessions"] = []
254
+ bs["last_session_id"] = None
255
+
256
+ err = update_bug_in_list(bug_list_path, bug_id, target_status)
257
+ if err:
258
+ error_out("Failed to update bug-fix-list.json: {}".format(err))
259
+ return
240
260
  else:
241
261
  bs["retry_count"] = bs.get("retry_count", 0) + 1
242
262
 
@@ -285,7 +305,10 @@ def action_update(args, bug_list_path, state_dir):
285
305
  "resume_from_phase": bs.get("resume_from_phase"),
286
306
  "updated_at": bs["updated_at"],
287
307
  }
288
- if session_status != "success":
308
+ if session_status == "merge_conflict":
309
+ summary["degraded_reason"] = "merge_conflict"
310
+ summary["restart_policy"] = "finalization_retry"
311
+ elif session_status != "success":
289
312
  summary["restart_policy"] = "full_restart"
290
313
  summary["cleanup_performed"] = cleaned
291
314
 
@@ -44,6 +44,7 @@ SESSION_STATUS_VALUES = [
44
44
  "timed_out",
45
45
  "commit_missing",
46
46
  "docs_missing",
47
+ "merge_conflict",
47
48
  ]
48
49
 
49
50
  TERMINAL_STATUSES = {"completed", "failed", "skipped"}
@@ -441,7 +442,7 @@ def action_update(args, feature_list_path, state_dir):
441
442
  if err:
442
443
  error_out("Failed to update feature-list.json: {}".format(err))
443
444
  return
444
- elif session_status in ("commit_missing", "docs_missing"):
445
+ elif session_status in ("commit_missing", "docs_missing", "merge_conflict"):
445
446
  # Degraded outcome: keep artifacts for retry and expose specific status.
446
447
  fs["retry_count"] = fs.get("retry_count", 0) + 1
447
448
 
@@ -509,7 +510,7 @@ def action_update(args, feature_list_path, state_dir):
509
510
  "resume_from_phase": fs.get("resume_from_phase"),
510
511
  "updated_at": fs["updated_at"],
511
512
  }
512
- if session_status in ("commit_missing", "docs_missing"):
513
+ if session_status in ("commit_missing", "docs_missing", "merge_conflict"):
513
514
  summary["degraded_reason"] = session_status
514
515
  summary["restart_policy"] = "finalization_retry"
515
516
  elif session_status != "success":
@@ -37,7 +37,6 @@ You are the **session orchestrator**. Implement Feature {{FEATURE_ID}}: "{{FEATU
37
37
  .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md
38
38
  .prizmkit/specs/{{FEATURE_SLUG}}/plan.md
39
39
  .prizmkit/specs/{{FEATURE_SLUG}}/tasks.md
40
- .prizmkit/specs/REGISTRY.md
41
40
  ```
42
41
 
43
42
  ---
@@ -72,7 +71,7 @@ If MISSING — build it now:
72
71
  - **Section 1 — Feature Brief**: feature description + acceptance criteria (copy from above)
73
72
  - **Section 2 — Project Structure**: output of relevant `ls src/` calls
74
73
  - **Section 3 — Prizm Context**: content of root.prizm and relevant L1/L2 docs
75
- - **Section 4 — Existing Source Files**: full content of each related file as code block
74
+ - **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
76
75
  - **Section 5 — Existing Tests**: full content of related test files as code block
77
76
 
78
77
  ### Phase 2: Plan & Tasks
@@ -81,7 +80,7 @@ If MISSING — build it now:
81
80
  ls .prizmkit/specs/{{FEATURE_SLUG}}/ 2>/dev/null
82
81
  ```
83
82
 
84
- If plan.md or tasks.md missing, write them directly (no PM needed):
83
+ If plan.md or tasks.md missing, write them directly:
85
84
  - `plan.md`: key components, data flow, files to create/modify (under 80 lines)
86
85
  - `tasks.md`: checklist with `[ ]` checkboxes, each task = one implementable unit
87
86
 
@@ -111,33 +110,20 @@ Key decisions: [list]
111
110
 
112
111
  **CP-2**: All acceptance criteria met, tests pass.
113
112
 
114
- ### Phase 4.5: Prizm Doc Update (mandatory for feature sessions)
113
+ ### Phase 4.5: Memory Maintenance (mandatory before commit)
115
114
 
116
- Run `/prizmkit-prizm-docs` and sync project docs before commit:
117
- 1. Use `git diff --cached --name-status` (fallback: `git diff --name-status`) to locate changed modules
118
- 2. Update affected `.prizm-docs/` files (L1/L2, changelog.prizm)
119
- 3. Stage documentation updates (`git add .prizm-docs/`) if changed
115
+ Run `/prizmkit-retrospective` the **sole maintainer** of `.prizm-docs/`:
116
+ 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
117
+ 2. **Knowledge injection** (feature sessions only): Extract TRAPS/RULES/DECISIONS from completed work into `.prizm-docs/`
118
+ 3. Stage all doc changes: `git add .prizm-docs/`
120
119
 
121
- Doc maintenance pass condition (pipeline-enforced): `REGISTRY.md` **or** `.prizm-docs/` changed in the final commit.
122
-
123
- ### Phase 4.7: Retrospective (feature sessions only, before commit)
124
-
125
- If this session is a feature (not a bug-fix-only commit), run `/prizmkit-retrospective` now — **before committing**.
126
- Retrospective must update relevant `.prizm-docs/` sections (TRAPS/RULES/DECISIONS) when applicable, so those changes are included in the feature commit.
127
- Stage any `.prizm-docs/` changes produced: `git add .prizm-docs/`
120
+ Doc maintenance pass condition (pipeline-enforced): `.prizm-docs/` changed in the final commit.
128
121
 
129
122
  ### Phase 5: Commit
130
123
 
131
- - Run `/prizmkit-summarize` → archive to REGISTRY.md
132
- - Mark feature complete:
133
- ```bash
134
- python3 {{VALIDATOR_SCRIPTS_DIR}}/update-feature-status.py \
135
- --feature-list "{{FEATURE_LIST_PATH}}" \
136
- --state-dir "{{PROJECT_ROOT}}/dev-pipeline/state" \
137
- --feature-id "{{FEATURE_ID}}" --session-id "{{SESSION_ID}}" --action complete
138
- ```
139
124
  - Run `/prizmkit-committer` → `feat({{FEATURE_ID}}): {{FEATURE_TITLE}}`, do NOT push
140
125
  - MANDATORY: commit must be done via `/prizmkit-committer` skill. Do NOT run manual `git add`/`git commit` as a substitute.
126
+ - Do NOT run `update-feature-status.py` here — the pipeline runner handles feature-list.json updates automatically after session exit.
141
127
 
142
128
  ---
143
129
 
@@ -180,11 +166,11 @@ After writing `session-status.json`, verify repository is clean:
180
166
  git status --short
181
167
  ```
182
168
 
183
- If any files remain, include them in the last commit:
169
+ If any files remain (e.g. session-status.json), stage and create a follow-up commit:
184
170
 
185
171
  ```bash
186
172
  git add -A
187
- git commit --amend --no-edit
173
+ git commit -m "chore({{FEATURE_ID}}): include session artifacts"
188
174
  ```
189
175
 
190
176
  Re-check `git status --short` and ensure it is empty before exiting.
@@ -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).
15
15
 
16
- **Tier 2 — Dual Agent**: You handle context + planning directly. Then spawn Dev and Reviewer subagents. No TeamCreate required.
16
+ **Tier 2 — Dual Agent**: You handle context + planning directly. Then spawn Dev and Reviewer subagents. You may spawn agents directly via the Task tool or use TeamCreate for coordination — choose based on the situation.
17
17
 
18
18
  ### Feature Description
19
19
 
@@ -37,7 +37,6 @@ You are the **session orchestrator**. Implement Feature {{FEATURE_ID}}: "{{FEATU
37
37
  .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md ← written by you, read by Dev + Reviewer
38
38
  .prizmkit/specs/{{FEATURE_SLUG}}/plan.md
39
39
  .prizmkit/specs/{{FEATURE_SLUG}}/tasks.md
40
- .prizmkit/specs/REGISTRY.md
41
40
  ```
42
41
 
43
42
  **`context-snapshot.md`** is the shared knowledge base. You write it once; Dev and Reviewer read it instead of re-scanning individual files.
@@ -83,7 +82,7 @@ If MISSING — build it now:
83
82
  - **Section 1 — Feature Brief**: feature description + acceptance criteria (copy from above)
84
83
  - **Section 2 — Project Structure**: relevant `ls src/` output
85
84
  - **Section 3 — Prizm Context**: full content of root.prizm and relevant L1/L2 docs
86
- - **Section 4 — Existing Source Files**: full content of each related file as code block
85
+ - **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 subagents read this section instead of re-reading individual source files
87
86
  - **Section 5 — Existing Tests**: full content of related test files as code blocks
88
87
 
89
88
  ### Phase 2: Plan & Tasks (you, the orchestrator)
@@ -138,33 +137,20 @@ Wait for Reviewer to return.
138
137
 
139
138
  **CP-2**: Tests pass, verdict is not NEEDS_FIXES.
140
139
 
141
- ### Phase 4.5: Prizm Doc Update (mandatory for feature sessions)
140
+ ### Phase 4.5: Memory Maintenance (mandatory before commit)
142
141
 
143
- Run `/prizmkit-prizm-docs` and sync project docs before commit:
144
- 1. Use `git diff --cached --name-status` (fallback: `git diff --name-status`) to locate changed modules
145
- 2. Update affected `.prizm-docs/` files (L1/L2, changelog.prizm)
146
- 3. Stage documentation updates (`git add .prizm-docs/`) if changed
142
+ Run `/prizmkit-retrospective` the **sole maintainer** of `.prizm-docs/`:
143
+ 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
144
+ 2. **Knowledge injection** (feature sessions only): Extract TRAPS/RULES/DECISIONS from completed work into `.prizm-docs/`
145
+ 3. Stage all doc changes: `git add .prizm-docs/`
147
146
 
148
- Doc maintenance pass condition (pipeline-enforced): `REGISTRY.md` **or** `.prizm-docs/` changed in the final commit.
149
-
150
- ### Phase 4.7: Retrospective (feature sessions only, before commit)
151
-
152
- If this session is a feature (not a bug-fix-only commit), run `/prizmkit-retrospective` now — **before committing**.
153
- Retrospective must update relevant `.prizm-docs/` sections (TRAPS/RULES/DECISIONS) when applicable, so those changes are included in the feature commit.
154
- Stage any `.prizm-docs/` changes produced: `git add .prizm-docs/`
147
+ Doc maintenance pass condition (pipeline-enforced): `.prizm-docs/` changed in the final commit.
155
148
 
156
149
  ### Phase 5: Commit
157
150
 
158
- - Run `/prizmkit-summarize` → archive to REGISTRY.md
159
- - Mark feature complete:
160
- ```bash
161
- python3 {{VALIDATOR_SCRIPTS_DIR}}/update-feature-status.py \
162
- --feature-list "{{FEATURE_LIST_PATH}}" \
163
- --state-dir "{{PROJECT_ROOT}}/dev-pipeline/state" \
164
- --feature-id "{{FEATURE_ID}}" --session-id "{{SESSION_ID}}" --action complete
165
- ```
166
151
  - Run `/prizmkit-committer` → `feat({{FEATURE_ID}}): {{FEATURE_TITLE}}`, do NOT push
167
152
  - MANDATORY: commit must be done via `/prizmkit-committer` skill. Do NOT run manual `git add`/`git commit` as a substitute.
153
+ - Do NOT run `update-feature-status.py` here — the pipeline runner handles feature-list.json updates automatically after session exit.
168
154
 
169
155
  ---
170
156
 
@@ -207,11 +193,11 @@ After writing `session-status.json`, verify repository is clean:
207
193
  git status --short
208
194
  ```
209
195
 
210
- If any files remain, include them in the last commit:
196
+ If any files remain (e.g. session-status.json), stage and create a follow-up commit:
211
197
 
212
198
  ```bash
213
199
  git add -A
214
- git commit --amend --no-edit
200
+ git commit -m "chore({{FEATURE_ID}}): include session artifacts"
215
201
  ```
216
202
 
217
203
  Re-check `git status --short` and ensure it is empty before exiting.
@@ -229,7 +215,7 @@ Re-check `git status --short` and ensure it is empty before exiting.
229
215
 
230
216
  ## Reminders
231
217
 
232
- - Tier 2: orchestrator builds context+plan, Dev implements, Reviewer reviews — no TeamCreate
218
+ - Tier 2: orchestrator builds context+plan, Dev implements, Reviewer reviews — use direct Task spawn or TeamCreate as appropriate
233
219
  - Build context-snapshot.md FIRST; all subagents read it instead of re-reading source files
234
220
  - Do NOT use `run_in_background=true` when spawning subagents
235
221
  - ALWAYS write session-status.json before exiting