prizmkit 1.1.130 → 1.1.131
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/VERSION.json +3 -3
- package/bundled/dev-pipeline/.env.example +1 -1
- package/bundled/dev-pipeline/prizmkit_runtime/checkpoint_state.py +445 -8
- package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +87 -66
- package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +53 -3
- package/bundled/dev-pipeline/prizmkit_runtime/runner_recovery.py +55 -25
- package/bundled/dev-pipeline/prizmkit_runtime/runner_status.py +4 -0
- package/bundled/dev-pipeline/prizmkit_runtime/runners.py +15 -1
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +396 -4
- package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +54 -1
- package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +54 -1
- package/bundled/dev-pipeline/scripts/prompt_framework.py +152 -1
- package/bundled/dev-pipeline/scripts/update-bug-status.py +53 -0
- package/bundled/dev-pipeline/scripts/update-checkpoint.py +294 -69
- package/bundled/dev-pipeline/scripts/update-feature-status.py +57 -0
- package/bundled/dev-pipeline/scripts/update-refactor-status.py +53 -0
- package/bundled/dev-pipeline/templates/bootstrap-prompt.md +2 -2
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +20 -14
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +21 -4
- package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +18 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +1 -1
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +5 -15
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-test.md +21 -0
- package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +10 -10
- package/bundled/dev-pipeline/templates/sections/headless-commit-authorization.md +16 -0
- package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +26 -23
- package/bundled/dev-pipeline/templates/sections/phase-review-full.md +12 -8
- package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +1 -1
- package/bundled/dev-pipeline/templates/sections/refactor-phase-test.md +21 -0
- package/bundled/dev-pipeline/tests/test_checkpoint_state.py +362 -3
- package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +310 -22
- package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +132 -0
- package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +91 -0
- package/bundled/dev-pipeline/tests/test_python_runner_parity.py +411 -18
- package/bundled/dev-pipeline/tests/test_unified_cli.py +3 -3
- package/bundled/skills/_metadata.json +62 -25
- package/bundled/skills/app-planner/SKILL.md +4 -3
- package/bundled/skills/bug-fix-workflow/SKILL.md +89 -180
- package/bundled/skills/bug-planner/SKILL.md +12 -27
- package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +131 -220
- package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +36 -90
- package/bundled/skills/feature-pipeline-launcher/SKILL.md +129 -271
- package/bundled/skills/feature-pipeline-launcher/references/configuration.md +35 -76
- package/bundled/skills/feature-planner/SKILL.md +27 -22
- package/bundled/skills/feature-planner/assets/planning-guide.md +4 -4
- package/bundled/skills/feature-workflow/SKILL.md +94 -121
- package/bundled/skills/prizmkit/SKILL.md +130 -94
- package/bundled/skills/prizmkit/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/prizmkit-code-review/SKILL.md +114 -84
- package/bundled/skills/prizmkit-code-review/references/review-report-template.md +1 -1
- package/bundled/skills/prizmkit-code-review/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/prizmkit-committer/SKILL.md +131 -47
- package/bundled/skills/prizmkit-committer/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/prizmkit-implement/SKILL.md +99 -73
- package/bundled/skills/prizmkit-implement/references/implementation-subagent-procedure.md +1 -1
- package/bundled/skills/prizmkit-implement/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/prizmkit-init/SKILL.md +5 -5
- package/bundled/skills/prizmkit-plan/SKILL.md +132 -105
- package/bundled/skills/prizmkit-plan/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/prizmkit-retrospective/SKILL.md +111 -53
- package/bundled/skills/prizmkit-retrospective/references/knowledge-injection-steps.md +7 -6
- package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +5 -4
- package/bundled/skills/prizmkit-retrospective/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/prizmkit-test/SKILL.md +28 -6
- package/bundled/skills/prizmkit-test/references/examples.md +1 -1
- package/bundled/skills/prizmkit-test/references/test-report-template.md +1 -1
- package/bundled/skills/prizmkit-test/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/prizmkit-workflow/SKILL.md +266 -0
- package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/recovery-workflow/SKILL.md +62 -241
- package/bundled/skills/recovery-workflow/evals/evals.json +17 -33
- package/bundled/skills/recovery-workflow/references/detection.md +28 -52
- package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +105 -439
- package/bundled/skills/refactor-pipeline-launcher/SKILL.md +136 -275
- package/bundled/skills/refactor-pipeline-launcher/references/configuration.md +53 -88
- package/bundled/skills/refactor-planner/SKILL.md +12 -57
- package/bundled/skills/refactor-planner/references/behavior-preservation.md +111 -230
- package/bundled/skills/refactor-planner/references/error-recovery.md +37 -0
- package/bundled/skills/refactor-planner/references/planning-phases.md +11 -17
- package/bundled/skills/refactor-planner/scripts/validate-and-generate-refactor.py +1 -1
- package/bundled/skills/refactor-workflow/SKILL.md +98 -139
- package/bundled/templates/project-memory-template.md +4 -4
- package/package.json +1 -1
- package/src/index.js +4 -0
- package/src/prompts.js +10 -3
- package/src/scaffold.js +1 -1
- package/bundled/dev-pipeline/tests/test-deploy-safety.sh +0 -223
- package/bundled/skills/feature-pipeline-launcher/scripts/preflight-check.py +0 -462
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# PrizmKit Workflow State Protocol
|
|
2
|
+
|
|
3
|
+
`workflow-state.json` is lifecycle runtime metadata for one formal requirement. It preserves stage handoff, repair routing, orchestrator ownership, and resume information without replacing authoritative artifacts or any host-owned execution checkpoint.
|
|
4
|
+
|
|
5
|
+
## Location and Identity
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
.prizmkit/state/workflows/<requirement-slug>.json
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The state file is created only when a lifecycle runs. The active `artifact_dir` is the generic requirement artifact root and must be preserved exactly across every stage:
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
.prizmkit/specs/<requirement-slug>/
|
|
15
|
+
.prizmkit/bugfix/<bug-id>/
|
|
16
|
+
.prizmkit/refactor/<refactor-id>/
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Never select a different most-recent plan when resuming or handing off. Any execution checkpoint maintained by an external host remains separate from this lifecycle state. Never merge, substitute, or infer one schema from the other. The target project controls whether generated `.prizmkit/` files are committed, ignored, or shared.
|
|
20
|
+
|
|
21
|
+
## Authority
|
|
22
|
+
|
|
23
|
+
The state file is an index, not the authority for stage completion:
|
|
24
|
+
|
|
25
|
+
| Information | Authority |
|
|
26
|
+
|---|---|
|
|
27
|
+
| Requirement goals and acceptance criteria | `{artifact_dir}/spec.md` |
|
|
28
|
+
| Implementation tasks and completion | `{artifact_dir}/plan.md` plus current workspace |
|
|
29
|
+
| Review findings and verdict | `{artifact_dir}/review-report.md` final result |
|
|
30
|
+
| Test execution, verdict, and repair scope | Validated evidence package and authoritative `verdict.json` |
|
|
31
|
+
| Test report presentation | `{artifact_dir}/test-report.md` as a derived view only |
|
|
32
|
+
| Retrospective completion and result | `{artifact_dir}/retrospective-result.json` |
|
|
33
|
+
| Durable architecture knowledge | `.prizmkit/prizm-docs/` |
|
|
34
|
+
| Local commit | Git history and confirmed or authorized commit identity |
|
|
35
|
+
| Current stage, orchestrator, and resume entry | Workflow state |
|
|
36
|
+
| External orchestration progress | The external host's own checkpoint, never this state |
|
|
37
|
+
|
|
38
|
+
Every consumer compares workflow state with authoritative artifacts and the current workspace. Missing or stale state is reconstructed from those sources and is never accepted as success by itself.
|
|
39
|
+
|
|
40
|
+
## Schema
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"schema_version": 1,
|
|
45
|
+
"artifact_dir": ".prizmkit/specs/example",
|
|
46
|
+
"orchestrator": "prizmkit-workflow",
|
|
47
|
+
"stage": "test",
|
|
48
|
+
"status": "TEST_PASS",
|
|
49
|
+
"stage_result": "TEST_PASS",
|
|
50
|
+
"completed_stages": ["plan", "implement", "code-review", "test"],
|
|
51
|
+
"repair_scope": null,
|
|
52
|
+
"repair_round": 0,
|
|
53
|
+
"next_stage": "retrospective",
|
|
54
|
+
"resume_from": "prizmkit-retrospective"
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Fields
|
|
59
|
+
|
|
60
|
+
| Field | Meaning |
|
|
61
|
+
|---|---|
|
|
62
|
+
| `schema_version` | State schema version. Current value is `1`. |
|
|
63
|
+
| `artifact_dir` | The single generic requirement artifact root reused by every stage. |
|
|
64
|
+
| `orchestrator` | `prizmkit-workflow`, another semantic coordinator identifier, or `null` for direct stage use. |
|
|
65
|
+
| `stage` | The stage that most recently wrote state. |
|
|
66
|
+
| `status` | Lifecycle progression status, distinct from the domain `stage_result`. |
|
|
67
|
+
| `stage_result` | Domain result such as `PASS`, `NEEDS_FIXES`, `TEST_*`, `DOCS_UPDATED`, or `NO_DOC_CHANGE`. |
|
|
68
|
+
| `completed_stages` | Ordered stages completed for this requirement. |
|
|
69
|
+
| `repair_scope` | `null`, `test-infrastructure`, `production`, `runtime`, `schema`, `dependency`, `public-interface`, or `unknown`. |
|
|
70
|
+
| `repair_round` | Outer cross-stage repair round, from `0` through `3`. |
|
|
71
|
+
| `next_stage` | Next semantic stage, or `null` after commit. |
|
|
72
|
+
| `resume_from` | Exact atomic skill that can resume, or `null` after commit. |
|
|
73
|
+
|
|
74
|
+
## Lifecycle and Verdict Mappings
|
|
75
|
+
|
|
76
|
+
The mandatory formal lifecycle is:
|
|
77
|
+
|
|
78
|
+
```text
|
|
79
|
+
PLAN_READY
|
|
80
|
+
→ IMPLEMENTED
|
|
81
|
+
→ REVIEW_PASS
|
|
82
|
+
→ TEST_PASS
|
|
83
|
+
→ RETRO_COMPLETE
|
|
84
|
+
→ COMMIT_PENDING
|
|
85
|
+
→ COMMITTED
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
No formal stage is silently optional. Domain evidence maps as follows:
|
|
89
|
+
|
|
90
|
+
```text
|
|
91
|
+
review-report final PASS → status=REVIEW_PASS, stage_result=PASS
|
|
92
|
+
review-report final NEEDS_FIXES → status=REVIEW_NEEDS_FIXES, stage_result=NEEDS_FIXES
|
|
93
|
+
validated verdict TEST_PASS → status=TEST_PASS, stage_result=TEST_PASS
|
|
94
|
+
validated verdict TEST_FAIL → status=TEST_FAIL, stage_result=TEST_FAIL
|
|
95
|
+
validated verdict TEST_BLOCKED → status=TEST_BLOCKED, stage_result=TEST_BLOCKED
|
|
96
|
+
retrospective result DOCS_UPDATED → status=RETRO_COMPLETE, stage_result=DOCS_UPDATED
|
|
97
|
+
retrospective result NO_DOC_CHANGE → status=RETRO_COMPLETE, stage_result=NO_DOC_CHANGE
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
`RETRO_COMPLETE` is the stable completion status. `DOCS_UPDATED` and `NO_DOC_CHANGE` are mutually exclusive retrospective results, not substitute statuses. A derived Markdown test report never establishes a `TEST_*` status without validated authoritative evidence.
|
|
101
|
+
|
|
102
|
+
## Repair Routing
|
|
103
|
+
|
|
104
|
+
```text
|
|
105
|
+
REVIEW_NEEDS_FIXES
|
|
106
|
+
→ implement
|
|
107
|
+
→ code-review
|
|
108
|
+
→ test
|
|
109
|
+
|
|
110
|
+
TEST_FAIL with repair_scope=test-infrastructure
|
|
111
|
+
→ implement
|
|
112
|
+
→ test
|
|
113
|
+
|
|
114
|
+
TEST_FAIL with repair_scope=production|runtime|schema|dependency|public-interface
|
|
115
|
+
→ implement
|
|
116
|
+
→ code-review
|
|
117
|
+
→ test
|
|
118
|
+
|
|
119
|
+
TEST_FAIL with repair_scope=unknown
|
|
120
|
+
→ conservative production route only when safe
|
|
121
|
+
→ otherwise WORKFLOW_BLOCKED
|
|
122
|
+
|
|
123
|
+
TEST_BLOCKED
|
|
124
|
+
→ never make speculative production edits
|
|
125
|
+
→ interactive execution stops with a prizmkit-test resume entry
|
|
126
|
+
→ a trusted headless host may perform bounded environment recovery, then records WORKFLOW_BLOCKED if unresolved
|
|
127
|
+
|
|
128
|
+
RETRO_BLOCKED
|
|
129
|
+
→ WORKFLOW_BLOCKED
|
|
130
|
+
WORKFLOW_BLOCKED
|
|
131
|
+
→ resume only after the recorded blocker is resolved
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
The outer workflow permits at most three automatic repair rounds. These are cross-stage rounds (`repair_round` `0` through `3`). The code-review internal loop permits at most ten completed review rounds and is separate; review-internal repairs do not increment the outer counter.
|
|
135
|
+
|
|
136
|
+
## Orchestrator Ownership and Handoff
|
|
137
|
+
|
|
138
|
+
1. An atomic stage performs only its own stage, writes the truthful terminal result and `next_stage`, and returns control.
|
|
139
|
+
2. When `orchestrator` is non-null, only that orchestrator invokes the next skill. The atomic stage must not auto-invoke it again.
|
|
140
|
+
3. Direct stage use may report one deterministic next invocation but does not claim the next stage ran.
|
|
141
|
+
4. Every handoff preserves the same `artifact_dir`.
|
|
142
|
+
5. External automation invokes atomic stages directly and does not invoke `prizmkit-workflow` as a nested coordinator.
|
|
143
|
+
6. Workflow state never replaces or absorbs an external host's checkpoint.
|
|
144
|
+
|
|
145
|
+
## Commit Authorization
|
|
146
|
+
|
|
147
|
+
Interactive execution:
|
|
148
|
+
|
|
149
|
+
```text
|
|
150
|
+
committer previews intended files and message
|
|
151
|
+
→ waits for explicit confirmation from the current user
|
|
152
|
+
→ creates the local commit
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Trusted headless execution:
|
|
156
|
+
|
|
157
|
+
```text
|
|
158
|
+
a trusted host explicitly authorizes the current local task commit
|
|
159
|
+
→ host injects mode=<host-defined-headless-mode>, owner=<trusted-host-identifier>,
|
|
160
|
+
local_commit_authorized=true, push_authorized=false
|
|
161
|
+
→ committer verifies gates and commits automatically
|
|
162
|
+
→ no question, wait, or push is permitted
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
A self-declared or otherwise untrusted headless context does not authorize a commit. Push is never implied by either mode.
|
|
166
|
+
|
|
167
|
+
## Recovery
|
|
168
|
+
|
|
169
|
+
When state is missing, stale, or inconsistent:
|
|
170
|
+
|
|
171
|
+
1. Read `spec.md` and `plan.md` from `artifact_dir` only when they are not already available in current context.
|
|
172
|
+
2. Inspect task markers and the current workspace.
|
|
173
|
+
3. Read the latest review report and final result when needed to establish review authority.
|
|
174
|
+
4. Validate authoritative test evidence and `repair_scope`.
|
|
175
|
+
5. Validate `retrospective-result.json` when retrospective is claimed complete.
|
|
176
|
+
6. Verify the commit when commit is claimed complete.
|
|
177
|
+
7. When an external host is active, let that host validate its own checkpoint independently; never merge the schemas.
|
|
178
|
+
8. Reconstruct the latest safe predecessor and report the reconstruction.
|
|
179
|
+
9. Continue only from the first incomplete or invalid stage.
|
|
180
|
+
|
|
181
|
+
Stale state never bypasses review, testing, retrospective, commit authorization, or external host checkpoint enforcement.
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "prizmkit-init"
|
|
3
|
-
description: "
|
|
3
|
+
description: "Recommended one-time project initialization for PrizmKit. Scans greenfield or brownfield projects, generates Prizm docs and a project brief, and prepares optional context for the formal requirement lifecycle. Use for initialize, bootstrap, take over this project, or first-time setup requests. (project)"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# PrizmKit Init
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Recommended project initialization skill. Scans any brownfield or greenfield project, generates Prizm documentation and a project brief, and adapts to the current AI coding host when platform-specific instruction files are present.
|
|
9
9
|
|
|
10
10
|
### When to Use
|
|
11
11
|
- Taking over a new project (brownfield or greenfield)
|
|
12
12
|
- User says "initialize PrizmKit", "set up PrizmKit", "take over this project"
|
|
13
13
|
- First time using PrizmKit on a project
|
|
14
|
-
- After `npx
|
|
14
|
+
- After the PrizmKit skills are installed (for example with `npx skills add`) when the project has no `.prizmkit/prizm-docs/`
|
|
15
15
|
|
|
16
16
|
### When NOT to Use
|
|
17
17
|
- All artifacts exist and are up to date → skip init; use `/prizmkit-prizm-docs` Status/Validate for health checks
|
|
@@ -26,7 +26,7 @@ Project takeover and bootstrap skill. Scans any project (brownfield or greenfiel
|
|
|
26
26
|
## Execution Steps
|
|
27
27
|
|
|
28
28
|
**Phase 1: Platform Detection**
|
|
29
|
-
1. Detect
|
|
29
|
+
1. Detect the current AI coding host through available environment signals. Platform-specific files such as `AGENTS.md`, `CLAUDE.md`, or `CODEBUDDY.md` are non-exhaustive examples, not protocol identifiers.
|
|
30
30
|
2. Hold detected platform value in memory — written to disk in Phase 6 along with other config fields.
|
|
31
31
|
|
|
32
32
|
**Phase 2: Mode Detection**
|
|
@@ -140,7 +140,7 @@ Detect database and deployment signals, then ask 1-2 brief questions. This phase
|
|
|
140
140
|
- If "SaaS platform": follow up with platform selection (Vercel / Railway / Fly.io / Cloudflare / AWS / Other)
|
|
141
141
|
|
|
142
142
|
3. **Write results**:
|
|
143
|
-
- Append `### Infrastructure`
|
|
143
|
+
- Append `### Infrastructure` to the detected host's main instruction file when that file exists. Use the host's conventional main instruction file; examples include `AGENTS.md`, `CLAUDE.md`, and `CODEBUDDY.md`. Do not write Infrastructure to private instruction files reserved for framework protocol imports. Format:
|
|
144
144
|
```markdown
|
|
145
145
|
### Infrastructure
|
|
146
146
|
|
|
@@ -1,131 +1,158 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "prizmkit-plan"
|
|
3
|
-
description: "
|
|
3
|
+
description: "Start the formal PrizmKit requirement lifecycle by turning a natural-language change into reviewed spec.md and plan.md artifacts, initializing workflow state, and handing off to prizmkit-implement. Works for features, bug fixes, refactors, migrations, tests, and other formal requirements. (project)"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# PrizmKit Plan
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
`/prizmkit-plan` is the entry point for one formal requirement. It converts a natural-language change into a reviewed change artifact: `spec.md` defines WHAT and WHY; `plan.md` defines HOW and executable tasks.
|
|
9
9
|
|
|
10
|
-
A change artifact
|
|
10
|
+
A change artifact can describe a feature, bug fix, refactor, migration, test improvement, or another scoped requirement.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
- Any non-trivial development task that benefits from written scope and task breakdown
|
|
14
|
-
- Before `/prizmkit-implement` when no suitable `plan.md` exists
|
|
15
|
-
- Fast path changes that still need a simplified plan and resumable Tasks section
|
|
16
|
-
- Full path changes involving multiple files/modules, public interfaces, data models, architecture, security, or unclear requirements
|
|
17
|
-
- User says "specify", "plan", "new task", "I want to add...", "architect", "design", or "break it down"
|
|
12
|
+
## When to Use
|
|
18
13
|
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
14
|
+
- Starting any formal software requirement.
|
|
15
|
+
- A non-trivial change benefits from written scope, acceptance criteria, and task breakdown.
|
|
16
|
+
- No adequate current `spec.md` and `plan.md` exist for the requested work.
|
|
17
|
+
- User says "specify", "plan", "new task", "I want to add...", "architect", "design", or "break it down".
|
|
23
18
|
|
|
24
|
-
##
|
|
19
|
+
## When NOT to Use
|
|
25
20
|
|
|
26
|
-
|
|
21
|
+
- Direct edit: typo, pure formatting, small documentation edit, or another explicitly low-risk non-requirement change.
|
|
22
|
+
- The active artifact directory already has an adequate reviewed `spec.md` and `plan.md`; resume from the workflow state instead.
|
|
27
23
|
|
|
28
|
-
|
|
29
|
-
|---|---|
|
|
30
|
-
| Direct edit | Skip `/prizmkit-plan`; edit directly and verify the specific change. |
|
|
31
|
-
| Fast path | Create a concise `spec.md` and simplified `plan.md` with a Tasks section. |
|
|
32
|
-
| Full path | Create full `spec.md` and `plan.md` with architecture, risks, tests, and executable tasks. |
|
|
24
|
+
## Formal Lifecycle
|
|
33
25
|
|
|
34
|
-
|
|
26
|
+
A successful plan starts this fixed lifecycle:
|
|
27
|
+
|
|
28
|
+
```text
|
|
29
|
+
plan → implement → code-review → test → retrospective → committer
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Planning depth may be concise or comprehensive, but no later formal lifecycle stage may be silently skipped.
|
|
35
33
|
|
|
36
34
|
## Input
|
|
37
35
|
|
|
38
36
|
| Parameter | Required | Description |
|
|
39
|
-
|
|
40
|
-
| `description` | Yes | Natural-language description of the
|
|
41
|
-
| `artifact_dir` | No | Directory
|
|
42
|
-
|
|
43
|
-
##
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
-
|
|
85
|
-
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
37
|
+
|---|---|---|
|
|
38
|
+
| `description` | Yes | Natural-language description of the requirement. |
|
|
39
|
+
| `artifact_dir` | No | Directory for the change artifact. If omitted, create a numbered slug under `.prizmkit/specs/`. |
|
|
40
|
+
|
|
41
|
+
## Atomic Stage Boundary
|
|
42
|
+
|
|
43
|
+
`prizmkit-plan` owns only specification, plan, task generation, and planning-quality review. It writes its truthful terminal result and `next_stage`, then returns control. It must not invoke `prizmkit-implement` itself, including when an external orchestrator is active. The active orchestrator owns the next-stage invocation.
|
|
44
|
+
|
|
45
|
+
## Phase 0: Initialization Check and Context
|
|
46
|
+
|
|
47
|
+
1. Check whether project context such as `.prizmkit/prizm-docs/root.prizm`, `.prizmkit/config.json`, or a project brief exists.
|
|
48
|
+
2. If initialization context is missing:
|
|
49
|
+
- recommend `/prizmkit-init` and explain that it improves project context and cross-session continuity;
|
|
50
|
+
- do not block planning;
|
|
51
|
+
- if the user continues, load the README, manifests, project instruction files, source structure, and relevant source files as fallback.
|
|
52
|
+
3. If Prizm docs exist, read `root.prizm`, relevant L1 docs, relevant L2 docs when present, and source fallback when L2 is absent.
|
|
53
|
+
4. Resolve `artifact_dir` once and reuse it for every later lifecycle handoff. Do not re-detect another artifact during the same requirement.
|
|
54
|
+
|
|
55
|
+
## Phase 1: Specify (`spec.md`)
|
|
56
|
+
|
|
57
|
+
Skip regeneration when `spec.md` already exists and still matches the requested requirement.
|
|
58
|
+
|
|
59
|
+
1. Gather the requirement description. If it is missing in an interactive run, ask the user; otherwise return a clear blocked result.
|
|
60
|
+
2. Determine the artifact directory:
|
|
61
|
+
- use the caller-provided `artifact_dir` when present;
|
|
62
|
+
- otherwise scan `.prizmkit/specs/` for existing numbered directories and create `.prizmkit/specs/###-task-slug/`.
|
|
63
|
+
3. Generate `spec.md` from `${SKILL_DIR}/assets/spec-template.md`:
|
|
64
|
+
- focus on WHAT and WHY, not HOW;
|
|
65
|
+
- include only relevant sections;
|
|
66
|
+
- give every goal acceptance criteria;
|
|
67
|
+
- mark genuine ambiguity with `[NEEDS CLARIFICATION]`.
|
|
68
|
+
4. For persistence changes, inspect existing schemas and add a Data Model section using project conventions.
|
|
69
|
+
5. Resolve clarification markers:
|
|
70
|
+
- interactive: use `${SKILL_DIR}/references/clarify-guide.md` and ask targeted questions;
|
|
71
|
+
- non-interactive: choose conservative defaults, annotate them, and block when a safe default is impossible.
|
|
72
|
+
|
|
73
|
+
Internal ID hygiene: PrizmKit IDs, task/session/run IDs, branch names, absolute worktree paths, and internal artifact paths may exist in change artifacts but must not leak into `.prizmkit/prizm-docs/`, product UI copy, API responses, emails, notifications, or expected user-visible test strings.
|
|
74
|
+
|
|
75
|
+
## Phase 2: Design (`plan.md`)
|
|
76
|
+
|
|
77
|
+
Precondition: `spec.md` exists with no unresolved blocker.
|
|
78
|
+
|
|
79
|
+
1. Read `spec.md` and relevant project context.
|
|
80
|
+
2. Resolve remaining clarification markers.
|
|
81
|
+
3. Choose a planning depth appropriate to the requirement:
|
|
82
|
+
- concise for small, well-scoped formal requirements;
|
|
83
|
+
- comprehensive for multi-module, public API, data model, security, permission, payment, deployment-impacting, or ambiguous requirements.
|
|
84
|
+
4. Generate `plan.md` from `${SKILL_DIR}/assets/plan-template.md` with:
|
|
85
|
+
- change approach;
|
|
86
|
+
- component and file changes;
|
|
87
|
+
- data migration approach when relevant;
|
|
88
|
+
- interface/API contract design when relevant;
|
|
89
|
+
- test strategy for the mandatory `/prizmkit-test` stage;
|
|
90
|
+
- risks and mitigations;
|
|
91
|
+
- behavior-preservation strategy for refactors.
|
|
92
|
+
5. Cross-check every spec goal against the plan.
|
|
93
|
+
6. Check alignment with project rules and available Prizm documentation.
|
|
94
|
+
|
|
95
|
+
## Phase 3: Task Generation
|
|
96
|
+
|
|
97
|
+
1. Choose an MVP-first, incremental, or safe parallel task strategy.
|
|
98
|
+
2. Append `## Tasks` to `plan.md` using `${SKILL_DIR}/assets/plan-template.md`.
|
|
99
|
+
3. Include setup, foundation, core, polish, and checkpoint tasks only when applicable.
|
|
100
|
+
4. Mark `[P]` only for tasks that can safely execute independently.
|
|
101
|
+
5. Include implementation-local verification where useful, while preserving the later full code-review and test stages.
|
|
102
|
+
6. Run `${SKILL_DIR}/references/verification-checklist.md` and repair plan defects.
|
|
103
|
+
|
|
104
|
+
## Phase 4: Plan/Spec Review Loop
|
|
105
|
+
|
|
106
|
+
Run every time `spec.md` or `plan.md` is created or changed.
|
|
107
|
+
|
|
108
|
+
1. Read `${SKILL_DIR}/references/review-plan-spec-loop.md`.
|
|
109
|
+
2. Review the current artifacts against the requirement and project context.
|
|
110
|
+
3. Apply all resolvable `BLOCKER` fixes and accepted `SHOULD_FIX` fixes.
|
|
108
111
|
4. Treat `OPTIONAL` findings as non-blocking.
|
|
109
|
-
5. Rerun
|
|
110
|
-
6. If
|
|
111
|
-
7.
|
|
112
|
+
5. Rerun once when fixes were applied, with a maximum of two planning-review rounds.
|
|
113
|
+
6. If a `BLOCKER` remains, ask targeted questions in interactive mode; otherwise record `PLAN_BLOCKED` and stop.
|
|
114
|
+
7. Continue only when no unresolved blocker remains.
|
|
115
|
+
|
|
116
|
+
The planning review must not implement code, run the full test stage, or launch external orchestration.
|
|
117
|
+
|
|
118
|
+
## Phase 5: Workflow State and Handoff
|
|
119
|
+
|
|
120
|
+
Read `${SKILL_DIR}/references/workflow-state-protocol.md` and create or update:
|
|
121
|
+
|
|
122
|
+
```text
|
|
123
|
+
.prizmkit/state/workflows/<requirement-slug>.json
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Follow the bundled protocol. At minimum record:
|
|
127
|
+
|
|
128
|
+
```json
|
|
129
|
+
{
|
|
130
|
+
"schema_version": 1,
|
|
131
|
+
"artifact_dir": ".prizmkit/specs/001-example",
|
|
132
|
+
"stage": "plan",
|
|
133
|
+
"status": "PLAN_READY",
|
|
134
|
+
"completed_stages": ["plan"],
|
|
135
|
+
"repair_round": 0,
|
|
136
|
+
"repair_scope": null,
|
|
137
|
+
"next_stage": "implement",
|
|
138
|
+
"resume_from": "prizmkit-implement"
|
|
139
|
+
}
|
|
140
|
+
```
|
|
112
141
|
|
|
113
|
-
The
|
|
142
|
+
The state file is runtime metadata. Do not change the target project's Git or ignore policy.
|
|
114
143
|
|
|
115
144
|
## Output
|
|
116
145
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
146
|
+
- `spec.md` and `plan.md` in the resolved artifact directory.
|
|
147
|
+
- Workflow state with `PLAN_READY` or a truthful blocked result.
|
|
148
|
+
- Planning depth, key decisions, task count, and checkpoint summary.
|
|
149
|
+
- The same `artifact_dir` for every downstream stage.
|
|
120
150
|
|
|
121
|
-
|
|
122
|
-
- artifact directory
|
|
123
|
-
- chosen path: Fast path or Full path
|
|
124
|
-
- key decisions
|
|
125
|
-
- task count and checkpoint summary
|
|
151
|
+
## Handoff
|
|
126
152
|
|
|
127
|
-
|
|
153
|
+
On `PLAN_READY`:
|
|
128
154
|
|
|
129
|
-
|
|
155
|
+
1. If workflow state names an active `orchestrator`, return `PLAN_READY`, `stage_result=PLAN_READY`, `next_stage=implement`, the state path, and the same `artifact_dir` to that orchestrator; do not invoke the next stage independently.
|
|
156
|
+
2. For direct stage use with no active orchestrator, report exactly one deterministic next action: `/prizmkit-implement`, with `stage_result=PLAN_READY`, the state-file path, and `artifact_dir`; a host may perform that semantic handoff on the user's behalf.
|
|
130
157
|
|
|
131
|
-
Read `${SKILL_DIR}/references/examples.md`
|
|
158
|
+
Read `${SKILL_DIR}/references/examples.md` only when a worked planning example is needed.
|