prizmkit 1.1.154 → 1.1.156

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 (164) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/adapters/codex/skill-adapter.js +1 -1
  3. package/bundled/adapters/pi/skill-adapter.js +2 -1
  4. package/bundled/dev-pipeline/.env.example +2 -6
  5. package/bundled/dev-pipeline/README.md +21 -27
  6. package/bundled/dev-pipeline/prizmkit_runtime/checkpoint_state.py +341 -15
  7. package/bundled/dev-pipeline/prizmkit_runtime/cli.py +0 -3
  8. package/bundled/dev-pipeline/prizmkit_runtime/daemon.py +1 -15
  9. package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +48 -14
  10. package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +50 -2
  11. package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +0 -9
  12. package/bundled/dev-pipeline/prizmkit_runtime/runner_prompts.py +3 -3
  13. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +120 -22
  14. package/bundled/dev-pipeline/prizmkit_runtime/runtime_commit.py +482 -0
  15. package/bundled/dev-pipeline/prizmkit_runtime/test_result.py +64 -11
  16. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +145 -367
  17. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +91 -62
  18. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +105 -69
  19. package/bundled/dev-pipeline/scripts/prompt_framework.py +36 -41
  20. package/bundled/dev-pipeline/scripts/update-bug-status.py +1 -4
  21. package/bundled/dev-pipeline/scripts/update-checkpoint.py +61 -13
  22. package/bundled/dev-pipeline/scripts/update-feature-status.py +1 -4
  23. package/bundled/dev-pipeline/scripts/update-refactor-status.py +1 -4
  24. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +22 -27
  25. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +71 -104
  26. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +59 -111
  27. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +37 -72
  28. package/bundled/dev-pipeline/templates/sections/artifact-manifest.md +39 -0
  29. package/bundled/dev-pipeline/templates/sections/bugfix-critical-paths.md +3 -1
  30. package/bundled/dev-pipeline/templates/sections/bugfix-phase-commit-report.md +8 -25
  31. package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +3 -3
  32. package/bundled/dev-pipeline/templates/sections/bugfix-phase-implement.md +2 -2
  33. package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +3 -3
  34. package/bundled/dev-pipeline/templates/sections/bugfix-phase-test.md +2 -2
  35. package/bundled/dev-pipeline/templates/sections/bugfix-reminders.md +4 -4
  36. package/bundled/dev-pipeline/templates/sections/bugfix-session-context.md +0 -1
  37. package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +7 -4
  38. package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +14 -27
  39. package/bundled/dev-pipeline/templates/sections/feature-completion-summary.md +20 -0
  40. package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +8 -71
  41. package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +7 -7
  42. package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +3 -3
  43. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +4 -4
  44. package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +5 -17
  45. package/bundled/dev-pipeline/templates/sections/refactor-critical-paths.md +3 -1
  46. package/bundled/dev-pipeline/templates/sections/refactor-phase-commit-report.md +10 -23
  47. package/bundled/dev-pipeline/templates/sections/refactor-phase-implement.md +2 -2
  48. package/bundled/dev-pipeline/templates/sections/refactor-phase-plan.md +2 -2
  49. package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +3 -3
  50. package/bundled/dev-pipeline/templates/sections/refactor-phase-test.md +2 -2
  51. package/bundled/dev-pipeline/templates/sections/refactor-reminders.md +7 -7
  52. package/bundled/dev-pipeline/templates/sections/refactor-session-context.md +0 -1
  53. package/bundled/dev-pipeline/templates/sections/retrospective.md +12 -0
  54. package/bundled/dev-pipeline/templates/sections/runtime-commit-handoff.md +35 -0
  55. package/bundled/dev-pipeline/templates/session-status-schema.json +45 -62
  56. package/bundled/dev-pipeline/tests/test_checkpoint_state.py +469 -18
  57. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +262 -175
  58. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +62 -23
  59. package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +76 -28
  60. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +168 -18
  61. package/bundled/dev-pipeline/tests/test_recovery_workflow.py +111 -0
  62. package/bundled/dev-pipeline/tests/test_reset_preserve.py +0 -2
  63. package/bundled/dev-pipeline/tests/test_runtime_commit.py +608 -0
  64. package/bundled/dev-pipeline/tests/test_unified_cli.py +167 -25
  65. package/bundled/skills/_metadata.json +9 -9
  66. package/bundled/skills/app-planner/SKILL.md +3 -3
  67. package/bundled/skills/app-planner/references/generated-plan-review.md +2 -1
  68. package/bundled/skills/app-planner/references/rules/backend/derivation-rules.md +56 -64
  69. package/bundled/skills/app-planner/references/rules/backend/fixed-rules.md +85 -240
  70. package/bundled/skills/app-planner/references/rules/backend/question-bank.md +25 -25
  71. package/bundled/skills/app-planner/references/rules/backend/question-manifest.json +16 -7
  72. package/bundled/skills/app-planner/references/rules/backend/template.md +74 -92
  73. package/bundled/skills/app-planner/references/rules/database/derivation-rules.md +93 -93
  74. package/bundled/skills/app-planner/references/rules/database/fixed-rules.md +66 -173
  75. package/bundled/skills/app-planner/references/rules/database/question-bank.md +31 -26
  76. package/bundled/skills/app-planner/references/rules/database/question-manifest.json +13 -4
  77. package/bundled/skills/app-planner/references/rules/database/template.md +76 -98
  78. package/bundled/skills/app-planner/references/rules/frontend/derivation-rules.md +68 -95
  79. package/bundled/skills/app-planner/references/rules/frontend/fixed-rules.md +93 -166
  80. package/bundled/skills/app-planner/references/rules/frontend/question-bank.md +46 -36
  81. package/bundled/skills/app-planner/references/rules/frontend/question-manifest.json +11 -2
  82. package/bundled/skills/app-planner/references/rules/frontend/template.md +79 -257
  83. package/bundled/skills/app-planner/references/rules/mobile/derivation-rules.md +91 -99
  84. package/bundled/skills/app-planner/references/rules/mobile/fixed-rules.md +73 -246
  85. package/bundled/skills/app-planner/references/rules/mobile/question-bank.md +17 -17
  86. package/bundled/skills/app-planner/references/rules/mobile/question-manifest.json +17 -2
  87. package/bundled/skills/app-planner/references/rules/mobile/template.md +73 -85
  88. package/bundled/skills/app-planner/references/rules-configuration.md +133 -65
  89. package/bundled/skills/app-planner/scripts/validate-rules-configuration.py +291 -0
  90. package/bundled/skills/prizmkit/SKILL.md +17 -18
  91. package/bundled/skills/prizmkit/references/workflow-state-protocol.md +22 -18
  92. package/bundled/skills/prizmkit-code-review/SKILL.md +22 -58
  93. package/bundled/skills/prizmkit-code-review/references/independent-code-review.md +6 -6
  94. package/bundled/skills/prizmkit-code-review/references/review-report-template.md +2 -2
  95. package/bundled/skills/prizmkit-committer/SKILL.md +82 -132
  96. package/bundled/skills/prizmkit-deploy/SKILL.md +27 -11
  97. package/bundled/skills/prizmkit-deploy/assets/deploy-document-template.md +89 -0
  98. package/bundled/skills/prizmkit-deploy/references/ci-cd-workflows.md +44 -14
  99. package/bundled/skills/prizmkit-deploy/references/cloud-platform-deploy.md +19 -3
  100. package/bundled/skills/prizmkit-deploy/references/database-setup.md +22 -12
  101. package/bundled/skills/prizmkit-deploy/references/deploy-config-schema.md +3 -1
  102. package/bundled/skills/prizmkit-deploy/references/deploy-history-schema.md +22 -6
  103. package/bundled/skills/prizmkit-deploy/references/deploy-metadata-schema.json +49 -0
  104. package/bundled/skills/prizmkit-deploy/references/live-validation-notes.md +1 -1
  105. package/bundled/skills/prizmkit-deploy/references/pending-input-schema.json +164 -0
  106. package/bundled/skills/prizmkit-deploy/references/ssh-adapter-flow.md +9 -8
  107. package/bundled/skills/prizmkit-deploy/references/ssh-execution-flow.md +6 -6
  108. package/bundled/skills/prizmkit-implement/SKILL.md +30 -66
  109. package/bundled/skills/prizmkit-implement/references/implementation-subagent-procedure.md +4 -4
  110. package/bundled/skills/prizmkit-init/SKILL.md +4 -0
  111. package/bundled/skills/prizmkit-plan/SKILL.md +21 -64
  112. package/bundled/skills/prizmkit-plan/references/artifact-identity.md +38 -0
  113. package/bundled/skills/prizmkit-plan/references/independent-plan-review.md +4 -4
  114. package/bundled/skills/prizmkit-plan/references/review-plan-spec-loop.md +5 -5
  115. package/bundled/skills/prizmkit-prizm-docs/SKILL.md +75 -11
  116. package/bundled/skills/prizmkit-prizm-docs/assets/prizm-docs-format.md +191 -56
  117. package/bundled/skills/prizmkit-prizm-docs/references/op-init.md +18 -18
  118. package/bundled/skills/prizmkit-prizm-docs/references/op-rebuild.md +14 -8
  119. package/bundled/skills/prizmkit-prizm-docs/references/op-status.md +12 -5
  120. package/bundled/skills/prizmkit-prizm-docs/references/op-update.md +23 -12
  121. package/bundled/skills/prizmkit-prizm-docs/references/op-validate.md +13 -9
  122. package/bundled/skills/prizmkit-retrospective/SKILL.md +94 -97
  123. package/bundled/skills/prizmkit-retrospective/references/knowledge-injection-steps.md +79 -37
  124. package/bundled/skills/prizmkit-retrospective/references/retrospective-result-schema.json +138 -0
  125. package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +111 -54
  126. package/bundled/skills/prizmkit-test/SKILL.md +64 -51
  127. package/bundled/skills/prizmkit-test/references/boundary-contract-and-test-double-guidance.md +206 -0
  128. package/bundled/skills/prizmkit-test/references/independent-test-review.md +17 -9
  129. package/bundled/skills/prizmkit-test/references/test-coverage-model.md +45 -21
  130. package/bundled/skills/prizmkit-test/references/test-report-template.md +20 -13
  131. package/bundled/skills/prizmkit-workflow/SKILL.md +35 -37
  132. package/bundled/skills/prizmkit-workflow/references/artifact-identity.md +34 -0
  133. package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +22 -18
  134. package/bundled/skills/recovery-workflow/SKILL.md +2 -1
  135. package/bundled/skills/recovery-workflow/references/detection.md +4 -3
  136. package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +15 -5
  137. package/bundled/templates/hooks/validate-prizm-docs.py +124 -12
  138. package/package.json +1 -1
  139. package/src/scaffold.js +33 -22
  140. package/bundled/dev-pipeline/templates/sections/bugfix-artifacts.md +0 -16
  141. package/bundled/dev-pipeline/templates/sections/bugfix-session-status.md +0 -31
  142. package/bundled/dev-pipeline/templates/sections/critical-paths-agent.md +0 -7
  143. package/bundled/dev-pipeline/templates/sections/critical-paths-lite.md +0 -7
  144. package/bundled/dev-pipeline/templates/sections/directory-convention-agent.md +0 -9
  145. package/bundled/dev-pipeline/templates/sections/directory-convention-lite.md +0 -6
  146. package/bundled/dev-pipeline/templates/sections/headless-commit-authorization.md +0 -15
  147. package/bundled/dev-pipeline/templates/sections/phase-commit.md +0 -61
  148. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-agent-suffix.md +0 -24
  149. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-lite-suffix.md +0 -12
  150. package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +0 -44
  151. package/bundled/dev-pipeline/templates/sections/phase-implement-lite.md +0 -25
  152. package/bundled/dev-pipeline/templates/sections/phase-plan-agent.md +0 -20
  153. package/bundled/dev-pipeline/templates/sections/phase-plan-lite.md +0 -20
  154. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +0 -20
  155. package/bundled/dev-pipeline/templates/sections/refactor-artifacts.md +0 -17
  156. package/bundled/dev-pipeline/templates/sections/refactor-session-status.md +0 -28
  157. package/bundled/dev-pipeline/templates/sections/test-failure-recovery-agent.md +0 -52
  158. package/bundled/dev-pipeline/templates/sections/test-failure-recovery-lite.md +0 -52
  159. package/bundled/skills/prizmkit-code-review/references/workflow-state-protocol.md +0 -174
  160. package/bundled/skills/prizmkit-committer/references/workflow-state-protocol.md +0 -174
  161. package/bundled/skills/prizmkit-implement/references/workflow-state-protocol.md +0 -174
  162. package/bundled/skills/prizmkit-plan/references/workflow-state-protocol.md +0 -174
  163. package/bundled/skills/prizmkit-retrospective/references/workflow-state-protocol.md +0 -174
  164. package/bundled/skills/prizmkit-test/references/external-contract-mock-guidance.md +0 -119
package/src/scaffold.js CHANGED
@@ -13,7 +13,8 @@ import path from 'path';
13
13
  import { readFileSync } from 'fs';
14
14
  import { fileURLToPath, pathToFileURL } from 'url';
15
15
  import { dirname, join } from 'path';
16
- import { execSync } from 'child_process';
16
+ import { execFileSync, execSync } from 'child_process';
17
+ import os from 'os';
17
18
  import {
18
19
  loadMetadata,
19
20
  getTemplatesDir,
@@ -1373,6 +1374,19 @@ export async function installPlaywrightCli(projectRoot, dryRun) {
1373
1374
  // OpenCLI 安装
1374
1375
  // ============================================================
1375
1376
 
1377
+ /**
1378
+ * Side-effect-free OpenCLI presence check. Running OpenCLI itself is unsafe here:
1379
+ * browser-oriented commands such as `opencli doctor` create a live browser session.
1380
+ */
1381
+ function isOpenCliAvailable() {
1382
+ try {
1383
+ execFileSync(os.platform() === 'win32' ? 'where.exe' : 'which', ['opencli'], { stdio: 'ignore' });
1384
+ return true;
1385
+ } catch {
1386
+ return false;
1387
+ }
1388
+ }
1389
+
1376
1390
  /**
1377
1391
  * 安装 opencli(全局 npm 包)
1378
1392
  * 用于浏览器交互验证,复用 Chrome 已登录会话(OAuth/SSO/第三方集成)
@@ -1383,12 +1397,11 @@ export async function installOpenCli(projectRoot, dryRun, autoDownload = true) {
1383
1397
  return;
1384
1398
  }
1385
1399
 
1386
- // Check if already installed
1387
- try {
1388
- execSync('opencli --version', { stdio: 'pipe' });
1400
+ // Detect the executable without running it. This keeps repeated PrizmKit
1401
+ // installs/upgrades idempotent and avoids starting an OpenCLI browser session.
1402
+ if (isOpenCliAvailable()) {
1389
1403
  console.log(chalk.green(' ✓ opencli (already installed)'));
1390
- } catch {
1391
- // Not installed, install it
1404
+ } else {
1392
1405
  try {
1393
1406
  console.log(chalk.blue(' ⏳ Installing @jackwener/opencli globally...'));
1394
1407
  execSync('npm install -g @jackwener/opencli@latest', { stdio: 'pipe', timeout: 120000 });
@@ -1400,22 +1413,20 @@ export async function installOpenCli(projectRoot, dryRun, autoDownload = true) {
1400
1413
  }
1401
1414
  }
1402
1415
 
1403
- // Verify opencli connectivity Chrome Browser Bridge extension is a manual install
1404
- try {
1405
- const doctorOutput = execSync('opencli doctor 2>&1', { stdio: 'pipe', timeout: 15000 }).toString();
1406
- if (doctorOutput.includes('[MISSING] Extension') || doctorOutput.includes('[FAIL] Connectivity')) {
1407
- console.log(chalk.yellow(' ⚠ Chrome Browser Bridge extension is NOT connected'));
1408
-
1409
- if (autoDownload) {
1410
- await downloadOpenCliExtension();
1411
- } else {
1412
- printOpenCliManualSteps();
1413
- }
1414
- } else {
1415
- console.log(chalk.green(' ✓ opencli connectivity verified'));
1416
- }
1417
- } catch {
1418
- // doctor command itself failed — already warned about install issues
1416
+ // Check only PrizmKit's downloaded extension files. Connectivity checks are
1417
+ // intentionally user-initiated because `opencli doctor` opens a browser tab.
1418
+ const extensionManifest = path.join(
1419
+ process.env.HOME || process.env.USERPROFILE || '.',
1420
+ '.opencli',
1421
+ 'extension',
1422
+ 'manifest.json',
1423
+ );
1424
+ if (fs.pathExistsSync(extensionManifest)) {
1425
+ console.log(chalk.green(' ✓ OpenCLI extension files (already downloaded)'));
1426
+ } else if (autoDownload) {
1427
+ await downloadOpenCliExtension();
1428
+ } else {
1429
+ printOpenCliManualSteps();
1419
1430
  }
1420
1431
  }
1421
1432
 
@@ -1,16 +0,0 @@
1
- ## Bug Fix Artifacts Directory
2
-
3
- Use only this durable artifact directory for this bug fix:
4
-
5
- ```text
6
- .prizmkit/bugfix/{{BUG_ID}}/
7
- ├── spec.md
8
- ├── plan.md
9
- ├── context-snapshot.md
10
- ├── review-report.md
11
- ├── fix-report.md
12
- ├── failure-log.md
13
- └── workflow-checkpoint.json
14
- ```
15
-
16
- Do not write bugfix artifacts under feature or refactor artifact directories.
@@ -1,31 +0,0 @@
1
- ### Step 3: Report Session Status
2
-
3
- Before exiting, write the session status file:
4
-
5
- `{{SESSION_STATUS_PATH}}`
6
-
7
- ```json
8
- {
9
- "session_id": "{{SESSION_ID}}",
10
- "bug_id": "{{BUG_ID}}",
11
- "status": "<success|partial|failed>",
12
- "completed_phases": [1, 2, 3, 4],
13
- "current_phase": 4,
14
- "checkpoint_reached": "<current checkpoint step>",
15
- "fast_path": false,
16
- "errors": [],
17
- "can_resume": false,
18
- "resume_from_phase": null,
19
- "artifacts": {
20
- "spec_path": ".prizmkit/bugfix/{{BUG_ID}}/spec.md",
21
- "plan_path": ".prizmkit/bugfix/{{BUG_ID}}/plan.md",
22
- "fix_report_path": ".prizmkit/bugfix/{{BUG_ID}}/fix-report.md"
23
- },
24
- "git_commit": "<commit hash or null>",
25
- "traps_updated": false,
26
- "manual_verification_policy": "{{MANUAL_VERIFICATION_POLICY}}",
27
- "timestamp": "{{TIMESTAMP}}"
28
- }
29
- ```
30
-
31
- For manual/hybrid verification, record the selected automated verification method and evidence in `manual_verification_policy`; never use a partial stop solely because the plan labels verification as manual or hybrid.
@@ -1,7 +0,0 @@
1
- ## Critical Paths
2
-
3
- | Resource | Path |
4
- |----------|------|
5
- | Feature Artifacts Dir | `.prizmkit/specs/{{FEATURE_SLUG}}/` |
6
- | Context Snapshot | `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` |
7
- | Project Root | {{PROJECT_ROOT}} |
@@ -1,7 +0,0 @@
1
- ## Critical Paths
2
-
3
- | Resource | Path |
4
- |----------|------|
5
- | Feature Artifacts Dir | `.prizmkit/specs/{{FEATURE_SLUG}}/` |
6
- | Context Snapshot | `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` |
7
- | Project Root | {{PROJECT_ROOT}} |
@@ -1,9 +0,0 @@
1
- ## PrizmKit Directory Convention
2
-
3
- ```
4
- .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md ← Main Agent writes Sections 1-4 + Implementation Log
5
- .prizmkit/specs/{{FEATURE_SLUG}}/plan.md ← includes Tasks section
6
- .prizmkit/specs/{{FEATURE_SLUG}}/review-report.md ← Main Agent writes Code Review progress and Final Result
7
- ```
8
-
9
- **`context-snapshot.md`** is the implementation knowledge base and remains append-only after initial creation. Code Review writes only `review-report.md`; it does not append separate Review Notes to the context snapshot.
@@ -1,6 +0,0 @@
1
- ## PrizmKit Directory Convention
2
-
3
- ```
4
- .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md
5
- .prizmkit/specs/{{FEATURE_SLUG}}/plan.md ← includes Tasks section
6
- ```
@@ -1,15 +0,0 @@
1
- ### Headless Commit Authorization
2
-
3
- This pipeline session is non-interactive. Do not ask questions, wait for user input, or request commit confirmation.
4
-
5
- The pipeline launch has already authorized local commits for this task. Invoke `/prizmkit-committer` with the pipeline-managed execution context:
6
-
7
- ```json
8
- {
9
- "mode": "l4-headless",
10
- "owner": "prizmkit-l4",
11
- "local_commit_authorized": true
12
- }
13
- ```
14
-
15
- The committer must still verify every lifecycle gate, inspect the intended diff, generate a Conventional Commit message, stage only intended files, create the local commit, and verify it. Remote publication is controlled by the runtime after the local commit; do not make a publication decision in this session. If the execution context is absent or invalid, mark the task blocked and exit; do not ask the user.
@@ -1,61 +0,0 @@
1
- ### Architecture Sync & Commit (SINGLE COMMIT)
2
-
3
- **a.** Run `/prizmkit-retrospective` — maintains `.prizmkit/prizm-docs/` (architecture index):
4
- 1. **Structural sync**: Use `git diff --cached --name-status` to locate changed modules, update KEY_FILES/INTERFACES/DEPENDENCIES/file counts in affected `.prizmkit/prizm-docs/` files
5
- 2. **Architecture knowledge** (feature sessions only): Extract TRAPS/RULES/DECISIONS from completed work into `.prizmkit/prizm-docs/`
6
- 3. **Detail-doc coverage check**: For any module/sub-module with source files created or significantly modified in this session but no detail `.prizm` doc — evaluate whether one is warranted and create it when needed. The current session has the best context for accurate KEY_FILES, TRAPS, and DECISIONS.
7
- 4. Stage doc changes: `git add .prizmkit/prizm-docs/`
8
- ⚠️ Do NOT commit here. Only stage.
9
-
10
- **b.** Stage all feature code explicitly (NEVER use `git add -A` or `git add .`):
11
- ```bash
12
- git add <specific-files-created-or-modified>
13
- git add .prizmkit/prizm-docs/
14
- ```
15
-
16
- **c.** Run `/prizmkit-committer` → THE ONLY commit for this feature:
17
- `feat({{FEATURE_ID}}): {{FEATURE_TITLE}}`
18
- This single commit includes: feature code + tests + .prizmkit/prizm-docs/ updates.
19
- - MANDATORY: commit must be done via `/prizmkit-committer` skill. Do NOT run manual `git add`/`git commit` as a substitute.
20
- - Do NOT run `update-feature-status.py` here — the pipeline runner handles feature-list.json updates automatically after session exit.
21
-
22
- **d.** Final verification:
23
- ```bash
24
- git status --short
25
- ```
26
- Working tree MUST be clean after this step. If any feature-related files remain, stage them explicitly and amend the SAME commit with `git commit --amend --no-edit`; do NOT create a separate commit.
27
-
28
- **e.** Write completion summary for downstream dependency context:
29
-
30
- Write `.prizmkit/specs/{{FEATURE_SLUG}}/completion-summary.json` with the key changes from this session. This file is NOT committed to git — the pipeline runner reads it to propagate context to dependent features.
31
-
32
- ```json
33
- {
34
- "completion_notes": [
35
- "<each item: one key change, API, model, or integration point that downstream features may need>",
36
- "Example: Added User model (id, email, password_hash, display_name) in prisma/schema.prisma",
37
- "Example: POST /api/auth/register and POST /api/auth/login endpoints in src/api/auth.ts",
38
- "Example: Auth middleware in src/middleware/auth.ts — validates JWT on protected routes"
39
- ]
40
- }
41
- ```
42
-
43
- Rules for writing completion notes:
44
- - Focus on **what downstream features need to know**: new APIs, models, exported functions, key file paths
45
- - Each note should be self-contained and concise (one line, under 120 characters preferred)
46
- - Include 3-8 notes covering the most important changes
47
- - Do NOT include test files, config changes, or internal implementation details unless they affect other features
48
- - If this feature has no downstream dependents, still write the summary (it serves as documentation)
49
-
50
-
51
-
52
- ### TERMINAL STOP — Commit Completed
53
-
54
- After all of the following are true, the session is **TERMINAL**:
55
-
56
- - `/prizmkit-committer` has completed
57
- - `git status --short` is clean (except ignored/local-only pipeline artifacts)
58
- - `.prizmkit/specs/{{FEATURE_SLUG}}/completion-summary.json` is written
59
- - the `prizmkit-committer` checkpoint is marked `completed`
60
-
61
- At that point, stop immediately. Do **not** process delayed normal-work results, edit files, amend the commit, or start any new tool calls. Code Review must end its optional Reviewer lifecycle before Final Result, so no independent-review response remains pending. Any normal-work result that arrives after S09 is completed is follow-up work for a later session, not part of this feature commit.
@@ -1,24 +0,0 @@
1
- - **Section 3 — Key TRAPS & RULES**: extract only relevant TRAPS/RULES from the loaded Prizm docs. Do NOT copy complete documentation files — the orchestrator already loaded them.
2
- - **Section 4 — File Manifest**: For each file, list: path, why needed, and a **key-content summary** so you do NOT need to re-read the file. Format depends on file type:
3
- - **Code files** (JS/TS/Python/Go): function signatures. Example: `config` (Zod object), `loadConfig(path)→Config`.
4
- - **Shell scripts** (`.sh`): command-line args, key behavior branches, sourced libs, critical line ranges. Example: `args: --feature-id; sources lib/common.sh; lines 120-180 worktree logic`.
5
- - **Config/manifest** (`package.json`, `tsconfig.json`, `.env`): key scripts/fields/deps/env vars. Example: `scripts:{dev,test}, deps:{vitest}, env:USE_WORKTREE`.
6
- - **Docs/README**: section headings + 2-3 relevant sections only.
7
- - **Test files**: test names + what each tests (1 line each).
8
- Format:
9
- ### Files to Modify
10
- | File | Why Needed | Key Content Summary |
11
- |------|-----------|---------------------|
12
- | `<src>/config.js` | Add config layer | `config`, `configSchema`, `loadConfig(p)→Config` |
13
- | `dev-pipeline/run-feature.sh` | Remove shell entry | args:--feature-id; lines 120-180 worktree |
14
-
15
- ### Files for Reference
16
- | File | Why Needed | Key Content Summary |
17
- |------|-----------|---------------------|
18
- | `<src>/permission-guard.js` | Perm check | `checkPermission(uid,cmd)→bool` |
19
- | `package.json` | Test cmd+deps | scripts:{test:vitest}, deps:{vitest} |
20
-
21
- ### Known TRAPS (from .prizmkit/prizm-docs/)
22
- - <trap entries extracted from the loaded Prizm docs>
23
-
24
-
@@ -1,12 +0,0 @@
1
- - **Section 3 — Key TRAPS & RULES**: extract only relevant TRAPS/RULES from the loaded Prizm docs that apply to files in this scope. Do NOT copy complete documentation files.
2
- - **Section 4 — File Manifest**: For each relevant file, list path, why needed, key interface signatures. Use table format:
3
-
4
- ### Files to Modify
5
- | File | Why Needed | Key Interfaces |
6
- |------|-----------|----------------|
7
-
8
- ### Files for Reference
9
- | File | Why Needed | Key Interfaces |
10
- |------|-----------|----------------|
11
-
12
-
@@ -1,44 +0,0 @@
1
- ### Implement — Plan Execution
2
-
3
- Execute the reviewed plan through the active implementation skill. The skill and runtime determine the execution topology; preserve the shared artifact directory, active checkout, and task checkpoints.
4
-
5
- Before starting, check plan.md Tasks:
6
- ```bash
7
- {{RUNTIME_HELPER_CMD}} text count .prizmkit/specs/{{FEATURE_SLUG}}/plan.md --pattern "- [ ]"
8
- ```
9
- - If result is `0` (all tasks already `[x]`) → **SKIP to Review**.
10
- - If non-zero → execute the remaining tasks below.
11
-
12
- **Build artifacts rule**: After any build/compile command, ensure output is in `.gitignore`. Never commit binaries/build output.
13
-
14
- **3a.** Run `/prizmkit-implement` directly:
15
- - Continue from the `spec.md` / `plan.md` / `context-snapshot.md` content you created in Phase 1-2; do not re-read self-authored artifacts just because implementation starts
16
- - Re-read `plan.md` or `context-snapshot.md` only when resuming/continuing, when current context was compacted or lost, or when task checkbox state may have changed outside this session
17
- - Follow the implementation skill's current execution and delegation contract
18
- - Use context-snapshot.md Section 4 File Manifest for targeted source reads; avoid re-reading source files already summarized there unless they changed after the snapshot
19
- - Implements task-by-task, marking each `[x]` immediately
20
- - Remember to update checkpoints after finishing a series of tasks
21
-
22
- **3b. Focused checks only (no test gate here)**:
23
- - During implementation, do not run mandatory periodic or full-suite tests.
24
- - If a tiny targeted check is needed to understand a local failure, run only the smallest relevant command and capture output to `/tmp/test-out.txt`.
25
- - The scoped feature test gate runs after code review; do not declare implementation success based on an early full-suite run.
26
-
27
- **3c. Verification Gate Self-Check (BLOCKING — before declaring implement done)**:
28
- For each Verification Gate from the Task Contract, write one evidence line to Implementation Log:
29
- ```
30
- ### Gate Evidence
31
- - [x] G1: <gate text> — Evidence: <test name / file:line / fixture path>
32
- - [ ] G3: <gate text> — BLOCKED: <reason> ← no evidence = BLOCKED, not success
33
- ```
34
-
35
- **3d.** Append `## Implementation Log` (with Gate Evidence) to `context-snapshot.md`:
36
- - files changed/created
37
- - key decisions
38
- - deviations from plan
39
- - test results
40
- - Gate Evidence section
41
- - unresolved blockers
42
-
43
- **CP-2**: All tasks `[x]`, Implementation Log written with Gate Evidence, and blocked gates documented in `failure-log.md`. Test execution is deferred until after code review.
44
-
@@ -1,25 +0,0 @@
1
- ### Implement
2
-
3
- **Protocol references**:
4
- - Follow Context Budget Rules §8 for scaffold/generated files.
5
- - Follow Context Budget Rules §9 before package install/build commands that resolve dependencies.
6
- - Follow Context Budget Rules §10 after build/compile commands.
7
-
8
- **3a.** Run `/prizmkit-implement` — this handles the implementation cycle:
9
- - Continue from the plan/context you just created; do not re-read self-authored artifacts just because implementation starts
10
- - Re-read plan.md or `context-snapshot.md` only when resuming/continuing, when current context was compacted or lost, or when task checkbox state may have changed outside this session
11
- - If implementation is delegated to a subagent, the subagent must read `plan.md` and `context-snapshot.md` before editing
12
- - Uses context from `context-snapshot.md` (Prizm docs, TRAPS, file manifest) for targeted source reads; avoid re-reading source files already summarized there unless they changed after the snapshot
13
- - Implements task-by-task, marking each `[x]` immediately
14
- - Creates/updates detail `.prizm` docs when creating new modules or significantly modifying existing ones — AI selectively decides which modules warrant detail documentation based on complexity and importance
15
- - Does not run the scoped/full test gate; testing happens after code review in the PrizmKit Test phase
16
- - Writes '## Implementation Log' to `context-snapshot.md`
17
-
18
- **3b.** After implement completes, verify:
19
- 1. All tasks in plan.md are `[x]`
20
- 2. Verify each Verification Gate from the Task Contract using code/file evidence already in context — do NOT re-read files you already wrote
21
- 3. If any gate is unmet or blocked, write `failure-log.md` and stop for recovery
22
-
23
- **CP-2**: Implementation may proceed only when all tasks are `[x]` and blocked gates are documented in `failure-log.md`. Test execution is deferred until after code review.
24
-
25
-
@@ -1,20 +0,0 @@
1
- ### Plan & Tasks
2
-
3
- ```bash
4
- {{RUNTIME_HELPER_CMD}} artifact exists .prizmkit/specs/{{FEATURE_SLUG}}/plan.md
5
- ```
6
-
7
- If missing, run `/prizmkit-plan` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` to generate `plan.md`:
8
- - The plan.md should include: architecture — components, interfaces, data flow, files to create/modify, testing approach, and a Tasks section with `[ ]` checkboxes ordered by dependency.
9
- - Resolve uncertain requirements from the feature description, existing code, and conservative existing-project patterns.
10
-
11
- **Database Design Gate** (if feature involves data persistence — new tables, schema changes, new entities):
12
- Before proceeding past CP-1, verify:
13
- 1. Plan.md Data Model section references existing schema/model files (scan for `*.prisma`, `*.sql`, `migrations/`, `models/`, `*.entity.*` files; read them if not already in context-snapshot)
14
- 2. All new tables/fields follow existing naming conventions, ID strategy, timestamp patterns, and constraint style
15
- 3. No unresolved data model uncertainty remains in the Data Model section — resolve by reading existing code and making a conservative choice that matches existing patterns. Document the resolution in plan.md.
16
- 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.
17
-
18
- **CP-1**: plan.md exists with Tasks section.
19
-
20
-
@@ -1,20 +0,0 @@
1
- ### Plan & Tasks
2
-
3
- ```bash
4
- {{RUNTIME_HELPER_CMD}} artifact exists .prizmkit/specs/{{FEATURE_SLUG}}
5
- ```
6
-
7
- If plan.md missing, run `/prizmkit-plan` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`:
8
- - Pass the Objective and Verification Gates from the Task Contract as input
9
- - The plan.md should include: key components, data flow, files to create/modify, and a Tasks section with `[ ]` checkboxes (each task = one implementable unit). Keep under 80 lines.
10
- - Resolve uncertain requirements from the feature description, existing code, and conservative existing-project patterns.
11
-
12
- **Database Design Gate** (if feature involves data persistence — new tables, schema changes, new entities):
13
- Before proceeding past CP-1:
14
- 1. Scan for existing schema files (`*.prisma`, `*.sql`, `migrations/`, `models/`, `*.entity.*`) and read them
15
- 2. Ensure new tables/fields follow existing naming conventions and constraint patterns
16
- 3. Resolve all uncertain DB design decisions before writing Tasks — document choices in plan.md
17
-
18
- **CP-1**: plan.md exists with Tasks section.
19
-
20
-
@@ -1,20 +0,0 @@
1
- ### Review — Code Review
2
-
3
- Review the completed implementation before the scoped feature test gate runs. Use `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` so `/prizmkit-code-review` can read the spec, plan, context snapshot, implementation log, and current diff. Follow the skill's current review contract for review execution, repairs, verification, evidence, and handoff. Do not invoke another review skill or add a second review path outside that contract.
4
-
5
- Missing required evidence, an unsafe repair, a failed verification, or failure to converge by the contract's review limit produces `NEEDS_FIXES`.
6
-
7
- **Gate Check — Final Review Result**:
8
-
9
- ```bash
10
- {{RUNTIME_HELPER_CMD}} text final-verdict .prizmkit/specs/{{FEATURE_SLUG}}/review-report.md
11
- ```
12
-
13
- Handle the marker:
14
-
15
- - `REVIEW_PASS` → proceed to next phase.
16
- - `REVIEW_NEEDS_FIXES` → log unresolved findings and follow the task failure policy; do not externally restart the review loop.
17
- - `REVIEW_INCOMPLETE` or `REVIEW_INVALID` → inspect the append-only progress once, write `failure-log.md`, and stop. Do not treat an old or incidental verdict as completion and do not synthesize a passing result outside the skill.
18
-
19
- **CP-3**: Review has a valid Final Result and `review-report.md` preserves this execution's progress.
20
-
@@ -1,17 +0,0 @@
1
- ## Refactor Artifacts Directory
2
-
3
- Use only this durable artifact directory for this refactor:
4
-
5
- ```text
6
- .prizmkit/refactor/{{REFACTOR_ID}}/
7
- ├── spec.md
8
- ├── plan.md
9
- ├── context-snapshot.md
10
- ├── review-report.md
11
- ├── refactor-report.md
12
- ├── completion-summary.json
13
- ├── failure-log.md
14
- └── workflow-checkpoint.json
15
- ```
16
-
17
- Do not write refactor artifacts under feature or bugfix artifact directories.
@@ -1,28 +0,0 @@
1
- ### Step 3: Report Session Status
2
-
3
- Before exiting, write the session status file:
4
-
5
- `{{SESSION_STATUS_PATH}}`
6
-
7
- ```json
8
- {
9
- "session_id": "{{SESSION_ID}}",
10
- "refactor_id": "{{REFACTOR_ID}}",
11
- "status": "<success|partial|failed>",
12
- "completed_phases": [1, 2, 3, 4],
13
- "current_phase": 4,
14
- "checkpoint_reached": "<current checkpoint step>",
15
- "errors": [],
16
- "can_resume": false,
17
- "resume_from_phase": null,
18
- "artifacts": {
19
- "spec_path": ".prizmkit/refactor/{{REFACTOR_ID}}/spec.md",
20
- "plan_path": ".prizmkit/refactor/{{REFACTOR_ID}}/plan.md",
21
- "report_path": ".prizmkit/refactor/{{REFACTOR_ID}}/refactor-report.md",
22
- "completion_summary_path": ".prizmkit/refactor/{{REFACTOR_ID}}/completion-summary.json"
23
- },
24
- "git_commit": "<commit hash>",
25
- "behavior_preserved": true,
26
- "timestamp": "{{TIMESTAMP}}"
27
- }
28
- ```
@@ -1,52 +0,0 @@
1
- ## Test Failure Recovery Protocol
2
-
3
- Use this protocol whenever the post-review PrizmKit Test gate fails. Its purpose is to distinguish tolerated pre-existing failures from blockers introduced by this session.
4
-
5
- ### Failure Classes
6
-
7
- | Class | Meaning | Required Action | May Continue? |
8
- |-------|---------|-----------------|---------------|
9
- | Baseline failure | Existed before this session | Document in the Implementation Log or `failure-log.md` | Yes |
10
- | New regression | Introduced by this session | Fix before reporting success | No |
11
- | Brittle test | Test expectation/setup is wrong for the intended behavior | Fix the test or environment setup, then rerun | Only after fixed or documented as blocked |
12
- | Environment/tooling failure | External tool, network, install, or local environment prevents verification | Document in `failure-log.md` with impact on gates | Only if no Verification Gate is blocked |
13
-
14
- ### Recovery Loop
15
-
16
- 1. Run tests and record: failing test names, failure count, and class for each failure.
17
- 2. Compare with `BASELINE_FAILURES`; never blame baseline failures on this feature.
18
- 3. Fix new regressions and brittle tests while progress is being made.
19
- 4. Stop after a plateau: same failure count and same failing tests for 3 consecutive rounds.
20
- 5. If failures decrease, reset the plateau counter.
21
-
22
- ### Hard Round Cap (BLOCKING)
23
-
24
- After **6 total test-fix rounds**, STOP trial-and-error. Write failure-log listing all hypotheses tried. Switch to: locate an anchor with `{{RUNTIME_HELPER_CMD}} text search <file> --pattern "<anchor>" --json`, read one bounded relevant source section with the platform file-reading tool (never full Read), understand control flow, rewrite failing block in one shot. Do NOT exceed 7 total rounds.
25
-
26
- ### Success Rule
27
-
28
- Proceed to retrospective/commit only when:
29
-
30
- 1. all new regressions are fixed;
31
- 2. baseline failures are documented;
32
- 3. every Verification Gate is verified.
33
-
34
- Blocked gates are not success. If any gate cannot be verified, follow the Blocked Rule.
35
-
36
- ### Blocked Rule
37
-
38
- If a remaining failure prevents any Verification Gate from being verified, the feature is incomplete. Write `failure-log.md` and do not report success.
39
-
40
- ### Failure Capture Format
41
-
42
- ```markdown
43
- ## Test Failures Encountered
44
-
45
- - **Test**: [test name/path]
46
- - Root Cause: [explanation]
47
- - Category: [baseline failure | new regression | brittle test | environment/tooling]
48
- - Rounds Attempted: [N rounds, plateau at round M]
49
- - Status: [fixed | still failing | blocked]
50
-
51
- - **Impact on Verification Gates**: [verified | not affected | blocked + reason]
52
- ```
@@ -1,52 +0,0 @@
1
- ## Test Failure Recovery Protocol
2
-
3
- Use this protocol whenever the post-review PrizmKit Test gate fails. Its purpose is to distinguish tolerated pre-existing failures from blockers introduced by this session.
4
-
5
- ### Failure Classes
6
-
7
- | Class | Meaning | Required Action | May Continue? |
8
- |-------|---------|-----------------|---------------|
9
- | Baseline failure | Existed before this session | Document in Implementation Log | Yes |
10
- | New regression | Introduced by this session | Fix before reporting success | No |
11
- | Brittle test | Test expectation/setup is wrong for the intended behavior | Fix the test or environment setup, then rerun | Only after fixed or documented as blocked |
12
- | Environment/tooling failure | External tool, network, install, or local environment prevents verification | Document in `failure-log.md` with impact on gates | Only if no Verification Gate is blocked |
13
-
14
- ### Recovery Loop
15
-
16
- 1. Run tests and record: failing test names, failure count, and class for each failure.
17
- 2. Compare with `BASELINE_FAILURES`; never blame baseline failures on this feature.
18
- 3. Fix new regressions and brittle tests while progress is being made.
19
- 4. Stop after a plateau: same failure count and same failing tests for 3 consecutive rounds.
20
- 5. If failures decrease, reset the plateau counter.
21
-
22
- ### Hard Round Cap (BLOCKING)
23
-
24
- After **6 total test-fix rounds**, STOP trial-and-error. Write failure-log listing all hypotheses tried. Switch to: locate an anchor with `{{RUNTIME_HELPER_CMD}} text search <file> --pattern "<anchor>" --json`, read one bounded relevant source section with the platform file-reading tool (never full Read), understand control flow, rewrite failing block in one shot. Do NOT exceed 7 total rounds.
25
-
26
- ### Success Rule
27
-
28
- Proceed only when:
29
-
30
- 1. all new regressions are fixed;
31
- 2. baseline failures are documented;
32
- 3. every Verification Gate is verified.
33
-
34
- Blocked gates are not success. If any gate cannot be verified, follow the Blocked Rule.
35
-
36
- ### Blocked Rule
37
-
38
- If a remaining failure prevents any Verification Gate from being verified, the feature is incomplete. Write `failure-log.md` and do not report success.
39
-
40
- ### Failure Capture Format
41
-
42
- ```markdown
43
- ## Test Failures Encountered
44
-
45
- - **Test**: [test name/path]
46
- - Root Cause: [explanation]
47
- - Category: [baseline failure | new regression | brittle test | environment/tooling]
48
- - Rounds Attempted: [N rounds, plateau at round M]
49
- - Status: [fixed | still failing | blocked]
50
-
51
- - **Impact on Verification Gates**: [verified | not affected | blocked + reason]
52
- ```