prizmkit 1.1.119 → 1.1.121

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 (91) hide show
  1. package/bin/create-prizmkit.js +1 -5
  2. package/bundled/VERSION.json +3 -3
  3. package/bundled/dev-pipeline/README.md +41 -38
  4. package/bundled/dev-pipeline/assets/skill-subagent-integration.md +76 -0
  5. package/bundled/dev-pipeline/prizmkit_runtime/config.py +2 -8
  6. package/bundled/dev-pipeline/prizmkit_runtime/interoperability.py +1 -1
  7. package/bundled/dev-pipeline/prizmkit_runtime/platform_detection.py +3 -3
  8. package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +23 -25
  9. package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +8 -2
  10. package/bundled/dev-pipeline/prizmkit_runtime/runner_prompts.py +10 -1
  11. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +88 -32
  12. package/bundled/dev-pipeline/prizmkit_runtime/sessions.py +28 -6
  13. package/bundled/dev-pipeline/scripts/continuation.py +51 -6
  14. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +60 -102
  15. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +1 -19
  16. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +1 -19
  17. package/bundled/dev-pipeline/scripts/{init-dev-team.py → init-change-artifact.py} +6 -16
  18. package/bundled/dev-pipeline/scripts/parse-stream-progress.py +364 -76
  19. package/bundled/dev-pipeline/scripts/update-bug-status.py +57 -14
  20. package/bundled/dev-pipeline/scripts/update-feature-status.py +54 -5
  21. package/bundled/dev-pipeline/scripts/update-refactor-status.py +57 -14
  22. package/bundled/dev-pipeline/scripts/utils.py +1 -1
  23. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +2 -2
  24. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +9 -11
  25. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +2 -1
  26. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +2 -2
  27. package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +3 -3
  28. package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +1 -1
  29. package/bundled/dev-pipeline/templates/sections/critical-paths-agent.md +0 -1
  30. package/bundled/dev-pipeline/templates/sections/critical-paths-full.md +0 -2
  31. package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +8 -1
  32. package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +6 -7
  33. package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +6 -7
  34. package/bundled/dev-pipeline/templates/sections/phase-implement-lite.md +4 -2
  35. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +3 -3
  36. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +5 -3
  37. package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +20 -0
  38. package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +3 -3
  39. package/bundled/dev-pipeline/tests/test_auto_skip.py +5 -5
  40. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +214 -144
  41. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +25 -12
  42. package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +11 -14
  43. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +235 -32
  44. package/bundled/dev-pipeline/tests/test_unified_cli.py +219 -16
  45. package/bundled/skills/_metadata.json +4 -4
  46. package/bundled/skills/app-planner/SKILL.md +2 -2
  47. package/bundled/skills/app-planner/references/architecture-decisions.md +1 -3
  48. package/bundled/skills/prizmkit-code-review/SKILL.md +50 -47
  49. package/bundled/skills/prizmkit-code-review/references/review-report-template.md +13 -8
  50. package/bundled/skills/prizmkit-code-review/references/reviewer-agent-prompt.md +47 -33
  51. package/bundled/skills/prizmkit-code-review/references/reviewer-workspace-protocol.md +90 -0
  52. package/bundled/skills/prizmkit-implement/SKILL.md +21 -1
  53. package/bundled/skills/prizmkit-implement/references/implementation-subagent-procedure.md +67 -0
  54. package/bundled/skills/prizmkit-test/SKILL.md +159 -155
  55. package/bundled/skills/prizmkit-test/assets/authoritative-records.schema.json +420 -0
  56. package/bundled/skills/prizmkit-test/assets/behavior-risk-matrix.schema.json +116 -0
  57. package/bundled/skills/prizmkit-test/assets/evidence-manifest.schema.json +112 -0
  58. package/bundled/skills/prizmkit-test/assets/evidence-package-template.json +97 -0
  59. package/bundled/skills/prizmkit-test/references/boundary-coverage-protocol.md +76 -192
  60. package/bundled/skills/prizmkit-test/references/contract-mock-protocol.md +65 -0
  61. package/bundled/skills/prizmkit-test/references/evidence-protocol.md +194 -0
  62. package/bundled/skills/prizmkit-test/references/evidence-request-protocol.md +78 -0
  63. package/bundled/skills/prizmkit-test/references/examples.md +65 -108
  64. package/bundled/skills/prizmkit-test/references/service-boundary-test-catalog.md +10 -7
  65. package/bundled/skills/prizmkit-test/references/test-generation-steps.md +90 -82
  66. package/bundled/skills/prizmkit-test/references/test-report-template.md +77 -98
  67. package/bundled/skills/prizmkit-test/references/trusted-evidence-execution.md +97 -0
  68. package/bundled/skills/prizmkit-test/scripts/build_test_evidence.py +723 -0
  69. package/bundled/skills/prizmkit-test/scripts/validate_test_evidence.py +1426 -0
  70. package/package.json +1 -1
  71. package/src/clean.js +12 -8
  72. package/src/config.js +24 -42
  73. package/src/index.js +1 -10
  74. package/src/manifest.js +3 -9
  75. package/src/metadata.js +0 -26
  76. package/src/prompts.js +0 -13
  77. package/src/scaffold.js +76 -201
  78. package/src/upgrade.js +16 -33
  79. package/bundled/adapters/claude/agent-adapter.js +0 -96
  80. package/bundled/adapters/claude/team-adapter.js +0 -183
  81. package/bundled/adapters/codebuddy/agent-adapter.js +0 -42
  82. package/bundled/adapters/codebuddy/team-adapter.js +0 -46
  83. package/bundled/adapters/codex/agent-adapter.js +0 -38
  84. package/bundled/adapters/codex/team-adapter.js +0 -37
  85. package/bundled/agents/prizm-dev-team-dev.md +0 -123
  86. package/bundled/agents/prizm-dev-team-reviewer.md +0 -113
  87. package/bundled/dev-pipeline/assets/prizm-dev-team-integration.md +0 -65
  88. package/bundled/dev-pipeline/templates/bootstrap-tier1.md +0 -436
  89. package/bundled/dev-pipeline/templates/bootstrap-tier2.md +0 -510
  90. package/bundled/skills/prizmkit-test/scripts/validate_boundary_report.py +0 -347
  91. package/bundled/team/prizm-dev-team.json +0 -27
@@ -1,9 +1,9 @@
1
- # Reviewer Agent Prompt Template
1
+ # Reviewer Subagent Prompt Template
2
2
 
3
- Used in Phase 1 Step 1 of `/prizmkit-code-review`. The orchestrator fills `{goals}`, `{plan decisions}`, `{scoped test report}`, `{workspace context}`, `{dev rules}`, `{round N}`, and `{round_context}` before spawning the dedicated `prizm-dev-team-reviewer` agent.
3
+ Used in Phase 1 Step 1 of `/prizmkit-code-review`. The orchestrator fills the placeholders before spawning an independent read-only Reviewer under `${SKILL_DIR}/references/reviewer-workspace-protocol.md`.
4
4
 
5
5
  ```
6
- You are the dedicated PrizmKit Reviewer agent (`prizm-dev-team-reviewer`). Review workspace changes against the spec goals, plan decisions, scoped test evidence, and per-layer dev rules. Do not modify files and do not apply fixes; the Main Agent will filter findings and apply accepted fixes directly.
6
+ You are the independent read-only Reviewer for `/prizmkit-code-review`. Review the verified workspace snapshot against the spec goals, plan decisions, scoped test evidence, and dev rules. Do not modify files or apply fixes; the Main Agent will filter findings and apply accepted fixes.
7
7
 
8
8
  ## Spec Goals
9
9
  {goals and acceptance criteria from spec.md}
@@ -12,53 +12,67 @@ You are the dedicated PrizmKit Reviewer agent (`prizm-dev-team-reviewer`). Revie
12
12
  {architecture decisions and task list from plan.md}
13
13
 
14
14
  ## Scoped Test Report
15
- {summary from artifact_dir/test-report-path.txt and test-report.md, including Scope, Generated / Updated Tests, In-Scope Failures, Baseline Failures, Out of Scope Gaps, Boundary Matrix / Boundary Completion Gate if present, and Verdict. If no scoped report exists for a change artifact, write "No scoped /prizmkit-test report found (expected for pre-test review)." Treat that absence as informational unless the calling workflow explicitly requires a prior test report.}
15
+ {summary from artifact_dir/test-report-path.txt and test-report.md, including Scope, Generated / Updated Tests, In-Scope Failures, Baseline Failures, Out of Scope Gaps, Boundary Matrix / Boundary Completion Gate if present, and Verdict. If no scoped report exists, write "No scoped /prizmkit-test report found (expected for pre-test review)." Treat that absence as informational unless the calling workflow requires a prior report.}
16
16
 
17
- ## Workspace Context
18
- {git status, unstaged diff summary, staged diff summary, current working directory, expected active checkout git top-level, and new-file paths captured by the Main Agent in Phase 0 from the active checkout. This is your primary review scope — use this context to understand what changed. Request targeted file reads only when you need specific line-level detail for a finding, not to re-discover or re-index the repository. Do not read files that are not in the workspace context unless you need them to verify impact (callers, dependents, shared patterns). Do not switch to a separate worktree or repository copy — the Main Agent has provided everything needed to understand the change set.}
17
+ ## Workspace Manifest
18
+ {repository and baseline identity, review-round identity, changed path inventory and statuses, staged/unstaged composition, untracked content entries, delete markers, rename pairs, and stable content identities captured by the Main Agent}
19
19
 
20
- ## Active Checkout Guard
21
- The orchestrator must provide the expected active checkout git top-level in Workspace Context. Before reviewing, verify that your current git top-level matches that expected active checkout.
20
+ ## Review Payload
21
+ {the reviewable representation of every manifest entry, plus clearly identified unchanged context needed to evaluate callers, dependents, or shared patterns}
22
22
 
23
- If your current checkout is different, or appears to be under `.claude/worktrees/`, `.prizmkit/state/worktrees/`, a remote checkout, or any copied/temporary checkout:
24
- - Stop immediately.
25
- - Do not review files.
26
- - Do not produce normal findings.
27
- - Report `WRONG_CHECKOUT` and state that `/prizmkit-code-review` cannot continue because the reviewer subagent was not started in the active checkout/no-worktree mode required by this skill.
23
+ ## Reviewer Strategy
24
+ {concise description of how the current platform made the snapshot available. This is diagnostic context, not a required parameter contract.}
28
25
 
29
- Worktree review is not supported by `/prizmkit-code-review`; do not continue from a worktree even if the files appear similar.
26
+ ## Workspace Equivalence Guard
27
+ Validate the supplied manifest and payload according to the Reviewer Workspace Protocol before normal review:
28
+ - Every manifest path and state must be represented.
29
+ - Staged, unstaged, untracked, deleted, and renamed changes must not be silently lost.
30
+ - Changed content identities and review-round identity must match.
31
+ - Unexplained changed paths, stale content, or unverifiable entries are mismatches.
30
32
 
31
- ## Dev Rules (per-layer conventions)
33
+ Do not reject a snapshot merely because its physical path, checkout layout, branch label, host, or transport differs from the Main Agent's environment. Content equivalence is the invariant.
34
+
35
+ If equivalence cannot be proven:
36
+ - Stop before normal review.
37
+ - Do not produce ordinary findings.
38
+ - Return `WORKSPACE_MISMATCH` with concrete mismatch evidence and required corrective action.
39
+
40
+ ## Dev Rules
32
41
  {rules from .prizmkit/rules/<layer>-rules.md, or "No custom dev rules configured — use general best practices."}
33
42
 
34
43
  ## Review Round
35
44
  Round {N}. {round_context}
36
45
 
37
46
  ## What to Review
38
- Use the orchestrator-provided workspace context as the source of truth for changed files:
39
- - For new files listed in workspace status, read their full content.
40
- - For modified files, read enough surrounding context to understand the change.
41
- - Do not edit files, stage changes, run test suites, or spawn other agents.
42
- - Do not request or create worktrees — you are reviewing the active checkout's changes. The orchestrator has already captured the full diff and status context; re-discovering the whole repository is wasteful and unnecessary.
47
+ Use the verified workspace snapshot as the primary review scope:
48
+ - Read the full content of new files.
49
+ - For modified files, read enough surrounding context to understand behavior and impact.
50
+ - Read unchanged callers, dependents, or shared patterns only when needed to verify a potential finding.
51
+ - Do not edit files, stage changes, run tools that modify the review view, spawn other agents, or apply fixes.
52
+ - Do not broadly re-index the repository when the supplied snapshot and targeted reads are sufficient.
43
53
 
44
54
  ## Review Dimensions
45
- Evaluate the changes across these dimensions (focus on what's relevant):
55
+ Evaluate the relevant dimensions:
46
56
 
47
- 1. **Goal alignment**: Do the changes accomplish all goals from spec.md? Anything missing or off-target?
48
- 2. **Defects**: Logic bugs, missing error handling, boundary condition issues, incorrect behavior.
49
- 3. **Completeness**: Files that should have been changed but weren't? Missing tests, types, imports, exports?
50
- 4. **Consistency**: Do changes follow the project's existing patterns, naming conventions, and code style?
51
- 5. **Security**: Hardcoded secrets, injection vulnerabilities, unsafe operations.
52
- 6. **Test quality**: If a scoped `/prizmkit-test` report is present, verify the report scope is `this-change`, the artifact dir matches the reviewed change, generated/updated tests assert real behavior rather than mock success or empty assertions, in-scope failures are not mislabeled as baseline failures, baseline failures are genuinely unrelated or pre-existing, out-of-scope gaps were not turned into unrelated test changes, and the report verdict is compatible with proceeding.
53
- 7. **Rules compliance**: (Skip this dimension if no dev rules were provided.) Do changes follow the per-layer dev rules? Flag violations of framework conventions, naming patterns, state management, or other rules defined for that layer.
57
+ 1. **Goal alignment**: Do the changes accomplish the spec goals and acceptance criteria?
58
+ 2. **Defects**: Are there logic bugs, boundary failures, or missing error handling?
59
+ 3. **Completeness**: Are required files, tests, types, imports, or exports missing?
60
+ 4. **Consistency**: Do the changes follow existing project patterns, naming, and style?
61
+ 5. **Security**: Do the changes introduce secrets, injection paths, or unsafe operations?
62
+ 6. **Test quality**: When a scoped report exists, verify its scope and artifact identity, meaningful assertions, failure classification, boundary evidence, and verdict compatibility.
63
+ 7. **Rules compliance**: When dev rules exist, verify the relevant layer conventions.
54
64
 
55
65
  ## Output Format
56
- Respond with EXACTLY this format:
66
+ Respond with exactly this structure:
67
+
68
+ ### Result: PASS | NEEDS_FIXES | WORKSPACE_MISMATCH
57
69
 
58
- ### Result: PASS | NEEDS_FIXES
70
+ ### Snapshot Verification
71
+ - Status: VERIFIED | FAILED
72
+ - Identity: <manifest identity or mismatch summary>
59
73
 
60
74
  ### Findings
61
- (If PASS, write "No issues found.")
75
+ (If PASS, write "No issues found." If WORKSPACE_MISMATCH, include only mismatch evidence and required action.)
62
76
 
63
77
  #### Finding N
64
78
  - **Severity**: high | medium | low
@@ -69,10 +83,10 @@ Respond with EXACTLY this format:
69
83
  - **Verification**: How to confirm the fix is correct
70
84
 
71
85
  ### Summary
72
- One to two sentences about the overall state of the changes.
86
+ One to two sentences about the snapshot and overall state of the changes.
73
87
  ```
74
88
 
75
89
  ## Round Context
76
90
 
77
91
  - Round 1: "This is the first review. Examine all changes comprehensively."
78
- - Round 2+: "Previous round found issues that were fixed. Focus on: (1) whether previous fixes are correct, (2) whether fixes introduced new problems, (3) any remaining issues. Do not re-report issues that have already been fixed."
92
+ - Round 2+: "Previous findings were filtered and accepted fixes were applied. Verify those fixes, check for regressions, and identify remaining issues without re-reporting resolved findings."
@@ -0,0 +1,90 @@
1
+ # Reviewer Workspace Protocol
2
+
3
+ Use this protocol whenever `/prizmkit-code-review` delegates review to an independent Reviewer. The protocol defines observable guarantees, not Agent API parameters, so the Main Agent can adapt to the capabilities of the current platform.
4
+
5
+ ## Protocol Invariants
6
+
7
+ 1. **Independence**: A subagent separate from the Main Agent performs review judgment. The Main Agent may prepare the snapshot, filter findings, and apply fixes, but does not substitute its own review when delegation fails.
8
+ 2. **Completeness**: The review snapshot represents every in-scope staged, unstaged, untracked, deleted, and renamed change captured for the round.
9
+ 3. **Currency**: Each review round uses a snapshot captured after the previous round's fixes. Never reuse a prior-round snapshot as evidence of current state.
10
+ 4. **Equivalence**: The Reviewer's view must be content-equivalent to the captured Main-Agent workspace. Physical path, checkout layout, branch label, host, and transport may differ without violating equivalence.
11
+ 5. **Verifiability**: The Reviewer validates the supplied manifest before normal review. Missing, extra, stale, or mixed content produces `WORKSPACE_MISMATCH`, not code findings.
12
+ 6. **Read-only review**: The Reviewer does not modify files or apply fixes. This keeps review evidence stable and preserves clear fix ownership.
13
+
14
+ ## Strategy Selection
15
+
16
+ Choose a platform-supported strategy that can satisfy all protocol invariants. The strategy may use a shared workspace, an isolated workspace populated with the captured change, a remote environment supplied with equivalent content, a materialized snapshot, or another mechanism the platform supports.
17
+
18
+ Do not encode a particular Agent type, model, isolation value, branch convention, directory prefix, or transport command into the skill contract. Those details are implementation choices and may change across platforms or sessions.
19
+
20
+ Prefer the least elaborate strategy that can prove equivalence. If a candidate strategy cannot carry or expose all workspace states, choose another strategy rather than weakening the protocol.
21
+
22
+ ## Workspace Manifest
23
+
24
+ Create a manifest for each round containing enough information to detect an incomplete or stale review view:
25
+
26
+ - repository identity and baseline revision
27
+ - round number or equivalent monotonic round identity
28
+ - changed path inventory and each path's status
29
+ - staged and unstaged composition when both exist for a path
30
+ - untracked file content required for review
31
+ - deleted-path markers
32
+ - rename source and destination pairs
33
+ - stable content identities for changed content and any review-critical context
34
+ - relevant spec, plan, dev-rule, and scoped-test evidence identities or embedded content
35
+
36
+ The exact encoding is implementation-defined. Use hashes when available, but another deterministic content identity is acceptable when the environment lacks a hashing utility. A prose summary alone is insufficient when it cannot detect omitted or stale content.
37
+
38
+ ## Review Payload
39
+
40
+ Provide the Reviewer with both:
41
+
42
+ 1. The manifest used for verification.
43
+ 2. A reviewable representation of every manifest entry.
44
+
45
+ A reviewable representation may be workspace files, complete file content, patches plus required base content, or an equivalent materialization. Diff summaries alone are insufficient for new files or when surrounding code is necessary to evaluate behavior.
46
+
47
+ Supply targeted dependency or caller context when required to verify impact. Keep that context distinguishable from changed content so the Reviewer does not mistake unchanged files for part of the patch.
48
+
49
+ ## Reviewer Verification
50
+
51
+ Before normal review, the Reviewer checks:
52
+
53
+ 1. Repository and baseline identity are consistent with the supplied snapshot.
54
+ 2. Every changed path in the manifest is available in the review payload.
55
+ 3. No unexplained changed path appears outside the manifest.
56
+ 4. Staged, unstaged, untracked, deleted, and renamed states are represented without silent loss.
57
+ 5. Content identities match the manifest.
58
+ 6. The snapshot belongs to the current review round.
59
+
60
+ When all checks pass, report snapshot verification as `VERIFIED` and proceed with review.
61
+
62
+ When a check cannot be completed or fails, stop normal review and return:
63
+
64
+ ```text
65
+ ### Result: WORKSPACE_MISMATCH
66
+
67
+ ### Snapshot Verification
68
+ - Status: FAILED
69
+ - Mismatch: <missing, extra, stale, or unverifiable manifest entries>
70
+ - Required action: <what the Main Agent must re-capture, transport, or verify>
71
+ ```
72
+
73
+ Do not emit ordinary code findings after `WORKSPACE_MISMATCH`, because findings from an unverified snapshot could misrepresent the current change.
74
+
75
+ ## Round Refresh
76
+
77
+ After accepted fixes are applied:
78
+
79
+ 1. Discard the previous manifest as current evidence.
80
+ 2. Capture a new manifest and review payload from the Main Agent's updated workspace.
81
+ 3. Establish a fresh independent Reviewer view using any valid strategy.
82
+ 4. Repeat Reviewer verification before the next review.
83
+
84
+ A platform may reuse an existing Reviewer session only when the refreshed payload replaces stale state and equivalence is verified again.
85
+
86
+ ## Failure Boundary
87
+
88
+ Retry or change strategy when the mismatch is repairable. Stop when the platform cannot provide an independent Reviewer with a verifiable equivalent snapshot.
89
+
90
+ Record the failure as an unresolved review blocker with verdict `NEEDS_FIXES`, snapshot verification `FAILED`, and the mismatch evidence. Do not downgrade to Main-Agent self-review, because doing so would satisfy neither the independence invariant nor the user's expectation of an independent quality gate.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: "prizmkit-implement"
3
- description: "Execute plan.md tasks with a TDD-oriented approach. Respects task ordering, checkpoints, and dependencies for Fast path or Full path change artifacts. Reads Prizm docs before editing; when relevant L2 docs are missing, falls back to target source files and lets /prizmkit-retrospective create L2 later if needed. Use after /prizmkit-plan. Trigger on: 'implement', 'build', 'code it', 'start coding', 'execute', 'write the code'. (project)"
3
+ description: "Execute plan.md tasks with a TDD-oriented approach. Respects task ordering, checkpoints, and dependencies for Fast path or Full path change artifacts. Reads Prizm docs before editing; optional inline implementation subagent delegation uses this skill's references and active-checkout/no-worktree constraints. Use after /prizmkit-plan. Trigger on: 'implement', 'build', 'code it', 'start coding', 'execute', 'write the code'. (project)"
4
4
  ---
5
5
 
6
6
  # PrizmKit Implement
@@ -39,6 +39,26 @@ Before implementation, load context once:
39
39
 
40
40
  If a dev rule conflicts with `plan.md`, call out the conflict and ask the user unless the plan clearly supersedes the rule.
41
41
 
42
+ ## Optional Inline Implementation Subagent Delegation
43
+
44
+ The default execution mode is direct Main Agent implementation. If delegation is useful for a narrow implementation slice, use only this skill's local reference:
45
+
46
+ ```yaml
47
+ prompt_reference: ${SKILL_DIR}/references/implementation-subagent-procedure.md
48
+ isolation: current-workspace / active-checkout / no-worktree
49
+ subagent_kind: inline implementation prompt, not a platform-installed named agent
50
+ ```
51
+
52
+ Delegation rules:
53
+ - Read `${SKILL_DIR}/references/implementation-subagent-procedure.md` before preparing the subagent prompt.
54
+ - Pass the expected active checkout git top-level and the exact delegated task/file scope.
55
+ - Do not use worktree isolation, copied checkouts, remote isolated checkouts, branch switching, or a platform-installed named implementation agent.
56
+ - If active-checkout/no-worktree launch cannot be satisfied, stop with:
57
+
58
+ ```text
59
+ Cannot delegate /prizmkit-implement because this platform cannot start an inline implementation subagent in the active checkout without worktree, copy, remote, or branch isolation.
60
+ ```
61
+
42
62
  ## Execution
43
63
 
44
64
  For each unchecked task in `plan.md`, in order:
@@ -0,0 +1,67 @@
1
+ # Implementation Subagent Procedure
2
+
3
+ Use this reference only when `/prizmkit-implement` deliberately delegates implementation work to an inline implementation subagent. The default path remains direct Main Agent implementation. Delegation is allowed only when the active-checkout/no-worktree contract below can be satisfied.
4
+
5
+ ## Launch Contract
6
+
7
+ The Main Agent must provide:
8
+ - Artifact directory containing `spec.md`, `plan.md`, and `context-snapshot.md` when available.
9
+ - Expected active checkout git top-level from the Main Agent's workspace.
10
+ - The exact plan tasks or files delegated.
11
+ - Any loaded Prizm docs traps/rules relevant to the delegated files.
12
+
13
+ The implementation subagent must run in the same active checkout as the Main Agent.
14
+
15
+ ## Active Checkout Guard
16
+
17
+ Before reading or editing files, verify your current git top-level matches the expected active checkout git top-level provided by the Main Agent.
18
+
19
+ Stop immediately and report `WRONG_CHECKOUT` if any of these are true:
20
+ - You are running from a git worktree, tool-created worktree, `.claude/worktrees/`, `.prizmkit/state/worktrees/`, copied repository checkout, remote isolated checkout, or temporary clone.
21
+ - Your current git top-level differs from the expected active checkout git top-level.
22
+ - You are on a different branch because the launch path switched branches.
23
+ - You would need to create or enter another checkout to complete the work.
24
+
25
+ Do not create worktrees, copied repositories, remote checkouts, or branch switches. Do not continue from the wrong checkout even if files appear identical.
26
+
27
+ ## Context Loading
28
+
29
+ 1. Read `context-snapshot.md` first when it exists.
30
+ 2. Use Section 3 for relevant Prizm rules/traps and Section 4 File Manifest for file summaries.
31
+ 3. Do not re-read files already summarized in the File Manifest unless a specific implementation detail is missing.
32
+ 4. If no context snapshot exists, read `.prizmkit/prizm-docs/root.prizm`, relevant L1/L2 docs, then targeted source files.
33
+ 5. If a relevant L2 doc is missing, use source fallback and note that retrospective may create or update docs later.
34
+
35
+ ## Implementation Rules
36
+
37
+ - Implement only the tasks delegated by the Main Agent and follow `plan.md` task order.
38
+ - Use TDD where meaningful: update/write the smallest relevant test first for behavior changes, then implement, then run the smallest useful check.
39
+ - For docs/config/mechanical refactors where test-first is not meaningful, use the smallest verification that proves the change.
40
+ - Mark delegated `plan.md` tasks `[x]` immediately after completion when the Main Agent explicitly authorizes task marking; otherwise report completed task IDs to the Main Agent for marking.
41
+ - Do not execute git `add`, `commit`, `reset`, `push`, branch checkout, rebase, merge, or stash operations.
42
+ - Do not spawn further agents.
43
+ - Do not perform broad repository rediscovery. Read only delegated files and targeted dependencies needed for correctness.
44
+ - Do not write PrizmKit feature/bug/refactor/task/session/run IDs, pipeline IDs, workflow IDs, branch names, absolute worktree paths, or `.prizmkit/specs` / `.prizmkit/dev-pipeline` artifact paths into `.prizmkit/prizm-docs/`, user-visible UI text, API responses, emails, notifications, or expected product-copy tests.
45
+ - If creating a new sub-module, note the durable facts needed for retrospective; do not overwrite existing `.prizmkit/prizm-docs/` files in full.
46
+
47
+ ## Output Format
48
+
49
+ Report exactly:
50
+
51
+ ```text
52
+ ### Result: COMPLETED | BLOCKED | WRONG_CHECKOUT
53
+
54
+ ### Completed Tasks
55
+ - [task id or description]
56
+
57
+ ### Files Changed
58
+ - path: summary
59
+
60
+ ### Verification
61
+ - command/check: result
62
+
63
+ ### Notes for Main Agent
64
+ - durable decisions, missing L2 docs, or blockers
65
+ ```
66
+
67
+ For `WRONG_CHECKOUT`, include only the checkout mismatch evidence and do not include normal implementation findings.