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
|
@@ -15,9 +15,20 @@ Choose project-semantic parameters from the target project: framework, commands,
|
|
|
15
15
|
|
|
16
16
|
Fix only the protocol mechanisms needed for safe, replayable evidence: project/evidence/request locators, schema-shaped requests, path confinement, real process execution, complete raw capture, runner-generated chained receipts, hash binding, append-only history, differential isolation/cleanup, and resume invalidation. Read `${SKILL_DIR}/references/trusted-evidence-execution.md` before inventory, execution, differential proof, resume, or replay; it defines the trust boundary and builder commands. Read `${SKILL_DIR}/references/evidence-request-protocol.md` when authoring any request or authoritative JSON record; it defines request ownership, structured N/A, and the schema map.
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## Formal Lifecycle Position
|
|
19
|
+
|
|
20
|
+
For a formal requirement, `/prizmkit-test` runs after the Main-Agent code-review stage reaches `PASS` and before retrospective:
|
|
21
|
+
|
|
22
|
+
```text
|
|
23
|
+
plan → implement → code-review → test → retrospective → committer
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Read `${SKILL_DIR}/references/workflow-state-protocol.md` before reading or updating lifecycle state. Reuse the caller's `artifact_dir`; do not select another recent plan. When an active `orchestrator` is recorded, return the testing result and next-stage metadata to it instead of invoking another skill independently.
|
|
27
|
+
|
|
28
|
+
## Atomic Stage Boundary
|
|
29
|
+
|
|
30
|
+
`prizmkit-test` owns only auditable test evidence generation, validation, and the testing-domain verdict. It writes the authoritative `TEST_*` result and `next_stage`, then returns control. When an external orchestrator is active, it must not invoke retrospective or implementation itself. The active orchestrator owns the next-stage invocation and repair routing.
|
|
19
31
|
|
|
20
|
-
Use for:
|
|
21
32
|
|
|
22
33
|
- behavior-changing source code;
|
|
23
34
|
- runtime configuration, schema, migration, generated-runtime, lockfile, or dependency changes;
|
|
@@ -35,6 +46,7 @@ Documentation, comment, and formatting-only scopes use deterministic lightweight
|
|
|
35
46
|
3. Preserve complete command/environment/output values as requested. Mark the package `sensitivity=project-controlled`; the project owns access control, retention, and upload policy.
|
|
36
47
|
4. Treat code-level dependencies as mock-first. Real deployed test-environment validation is a separate authorized activity.
|
|
37
48
|
5. Never delete existing tests.
|
|
49
|
+
6. For `TEST_FAIL`, classify and persist an evidence-backed `repair_scope` of `test-infrastructure`, `production`, `runtime`, `schema`, `dependency`, `public-interface`, or `unknown`. Test-infrastructure scope routes to implement then test; production-family scope routes to implement, code-review, then test. If evidence cannot support a safe classification, return `TEST_BLOCKED`.
|
|
38
50
|
|
|
39
51
|
If test infrastructure is missing, the infrastructure preparation state establishes only the necessary project-native infrastructure autonomously. Do not ask the user to install routine test dependencies in a headless run; verify dependency versions before editing manifests.
|
|
40
52
|
|
|
@@ -171,7 +183,7 @@ Create `.prizmkit/test/evidence/<evidence-id>/` from the package template with:
|
|
|
171
183
|
- `contracts/` snapshots
|
|
172
184
|
- derived `test-report.md`
|
|
173
185
|
|
|
174
|
-
Hash baseline, diff, the stable source snapshot, inventoried source/tests/contracts/lockfiles, environment, plan, and every evidence file. Runtime state, evidence output, linked Agent worktrees, Git metadata, and bytecode caches are outside source identity; evidence files remain independently content-addressed through `manifest.json`. Set `environment_claim=mocked-code-level-only
|
|
186
|
+
Hash baseline, diff, the stable source snapshot, inventoried source/tests/contracts/lockfiles, environment, plan, and every evidence file. Runtime state, evidence output, linked Agent worktrees, Git metadata, and bytecode caches are outside source identity; evidence files remain independently content-addressed through `manifest.json`. Set `environment_claim=mocked-code-level-only`.
|
|
175
187
|
|
|
176
188
|
### 9. EVIDENCE_VALIDATE
|
|
177
189
|
|
|
@@ -203,11 +215,17 @@ For a large module or bounded budget, persist matrix/checkpoint progress and ret
|
|
|
203
215
|
Only these testing-domain outcomes are valid:
|
|
204
216
|
|
|
205
217
|
- `TEST_PASS`: every required module behavior/risk and Regression Ring check is proven, required executions pass reliably, cleanup succeeds, no verdict-capable unresolved edge remains, and deterministic validation passes.
|
|
206
|
-
- `TEST_FAIL`: a valid reliable test reproduces an implementation or resolved-contract failure.
|
|
218
|
+
- `TEST_FAIL`: a valid reliable test reproduces an implementation or resolved-contract failure. The authoritative verdict record must include `repair_scope` and enough evidence for the next stage to route safely.
|
|
207
219
|
- `TEST_BLOCKED`: unknown scope, conflicting truth, unavailable/unreliable/flaky necessary execution, incomplete evidence, unproven tests, failed cleanup, budget truncation, or deterministic validation failure.
|
|
208
220
|
|
|
209
221
|
No conditional pass exists.
|
|
210
222
|
|
|
223
|
+
## Workflow State and Handoff
|
|
224
|
+
|
|
225
|
+
Before writing state, read `${SKILL_DIR}/references/workflow-state-protocol.md`.
|
|
226
|
+
|
|
227
|
+
On `TEST_PASS`, update the active workflow state with `status=TEST_PASS`, `stage_result=TEST_PASS`, and `next_stage=retrospective`. On `TEST_FAIL`, persist the evidence-backed `repair_scope`, set `status=TEST_FAIL` and `stage_result=TEST_FAIL`, and return to implementation; test-infrastructure scope selects `next_stage=implement` with a direct test resume, while production-family scope selects `next_stage=implement` and requires code review before testing again. On `TEST_BLOCKED`, preserve the blocker, do not modify production code speculatively, and return a blocked result. The authoritative verdict is the validated evidence record; the derived Markdown report is only a compatibility view. If an active orchestrator exists, return the terminal result and `next_stage` to it; do not invoke the next skill independently.
|
|
228
|
+
|
|
211
229
|
## Derived Report and Handoff
|
|
212
230
|
|
|
213
231
|
Generate `test-report.md` from structured evidence using `${SKILL_DIR}/references/test-report-template.md`. It is a replaceable view, not the source of truth. Report only:
|
|
@@ -216,9 +234,13 @@ Generate `test-report.md` from structured evidence using `${SKILL_DIR}/reference
|
|
|
216
234
|
- evidence directory and ID;
|
|
217
235
|
- validator result and key execution pointers;
|
|
218
236
|
- sensitivity and mocked-versus-real warning;
|
|
219
|
-
-
|
|
237
|
+
- authoritative evidence pointers for external automation and interactive consumers.
|
|
238
|
+
|
|
239
|
+
Do not embed an independent AI reviewer, decide overall code quality, claim broad Spec compliance, repair a validly detected business defect, authorize commit/release, or perform deployed test/production validation. The derived report is a view; `verdict.json`, validation records, and the evidence manifest remain authoritative.
|
|
240
|
+
|
|
241
|
+
## Compatibility
|
|
220
242
|
|
|
221
|
-
|
|
243
|
+
Consumers must read authoritative `TEST_*` evidence. During migration, a legacy Markdown report may be used only as a compatibility view after the authoritative verdict has passed validation.
|
|
222
244
|
|
|
223
245
|
Existing Pipeline and Skill consumers are not migrated by this protocol. Temporary post-install incompatibility with callers expecting the legacy report is accepted and must be stated, not hidden.
|
|
224
246
|
|
|
@@ -99,4 +99,4 @@ A comments-only diff is deterministically classified and parser/format/generated
|
|
|
99
99
|
|
|
100
100
|
## Compatibility Notice
|
|
101
101
|
|
|
102
|
-
The
|
|
102
|
+
The testing-domain verdict remains `TEST_PASS | TEST_FAIL | TEST_BLOCKED`. Consumers must use validated authoritative evidence and may use `test-report.md` only as a derived compatibility view. The formal lifecycle does not reinterpret a testing result as a review or commit verdict.
|
|
@@ -78,7 +78,7 @@ Verdict: TEST_PASS | TEST_FAIL | TEST_BLOCKED
|
|
|
78
78
|
- Real deployed environment validated: no
|
|
79
79
|
|
|
80
80
|
## Compatibility
|
|
81
|
-
The
|
|
81
|
+
The formal lifecycle consumes validated authoritative `TEST_*` evidence through workflow state and structured evidence pointers. `test-report.md` is a derived compatibility view and must not be interpreted as a review, retrospective, commit, or release verdict.
|
|
82
82
|
```
|
|
83
83
|
|
|
84
84
|
## Verdict Rendering Rules
|
|
@@ -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.
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "prizmkit-workflow"
|
|
3
|
+
description: "Coordinate one explicitly requested formal software requirement through the complete PrizmKit lifecycle from plan to confirmed commit. Use when the user invokes prizmkit-workflow or explicitly asks for the full six-stage lifecycle, a plan-to-commit workflow, or one formal requirement completed end to end. Do not trigger on generic build, implement, feature, bug, or refactor requests; those belong to the applicable individual skill or an external integration. (project)"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# PrizmKit Workflow
|
|
7
|
+
|
|
8
|
+
`/prizmkit-workflow` is the optional composite entry point for one interactive formal software requirement. The user describes the requirement once; this skill coordinates the six atomic lifecycle skills in order and preserves the same requirement context throughout. It does not replace or reimplement any atomic stage.
|
|
9
|
+
|
|
10
|
+
```text
|
|
11
|
+
prizmkit-plan
|
|
12
|
+
→ prizmkit-implement
|
|
13
|
+
→ prizmkit-code-review
|
|
14
|
+
→ prizmkit-test
|
|
15
|
+
→ prizmkit-retrospective
|
|
16
|
+
→ prizmkit-committer
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The six stages are mandatory for a formal requirement. The order is not a suggestion and no stage is silently optional.
|
|
20
|
+
|
|
21
|
+
## When to Use
|
|
22
|
+
|
|
23
|
+
Use this composite entry point when the user:
|
|
24
|
+
|
|
25
|
+
- explicitly invokes `/prizmkit-workflow`;
|
|
26
|
+
- explicitly asks for the full six-stage PrizmKit lifecycle;
|
|
27
|
+
- asks for one formal requirement to be coordinated from plan through commit;
|
|
28
|
+
- asks for a plan-to-commit or single-requirement full lifecycle;
|
|
29
|
+
- wants the workflow to continue automatically after each successful stage.
|
|
30
|
+
|
|
31
|
+
Generic "implement", "build", "add feature", "fix bug", or "refactor" requests do not select this workflow by themselves. Use the applicable individual skill unless the user explicitly asks for this complete lifecycle; external integrations may also invoke individual skills through their published contracts.
|
|
32
|
+
|
|
33
|
+
Use an individual atomic stage skill when the user explicitly wants only planning, implementation, review, testing, documentation maintenance, or committing.
|
|
34
|
+
|
|
35
|
+
Do not use this skill for:
|
|
36
|
+
|
|
37
|
+
- a typo, pure formatting change, or explicitly low-risk direct edit;
|
|
38
|
+
- first-time project initialization only; recommend `/prizmkit-init`;
|
|
39
|
+
- standalone Prizm documentation repair; use `/prizmkit-prizm-docs`;
|
|
40
|
+
- deployment or operations; use `/prizmkit-deploy` separately;
|
|
41
|
+
- multiple requirements in one invocation; this composite handles one requirement only.
|
|
42
|
+
|
|
43
|
+
## Inputs
|
|
44
|
+
|
|
45
|
+
Accept:
|
|
46
|
+
|
|
47
|
+
- `description`: the natural-language formal requirement;
|
|
48
|
+
- `artifact_dir`: optional explicit requirement artifact root;
|
|
49
|
+
- `execution_mode`: `interactive` by default; headless only when a trusted host explicitly authorizes it;
|
|
50
|
+
- `resume`: optional workflow state path or requirement slug for recovery.
|
|
51
|
+
|
|
52
|
+
If `description` is missing and no resumable workflow is supplied, ask for the requirement before invoking `prizmkit-plan`. External automation must invoke atomic stages directly with its own execution checkpoint rather than nesting this composite workflow.
|
|
53
|
+
|
|
54
|
+
## Core Orchestration Rules
|
|
55
|
+
|
|
56
|
+
### 1. Start with Plan
|
|
57
|
+
|
|
58
|
+
Invoke `/prizmkit-plan` with the requirement and any explicit `artifact_dir`. Do not write a second plan in this orchestrator.
|
|
59
|
+
|
|
60
|
+
If initialization context is missing, allow `prizmkit-plan` to recommend initialization and continue with source fallback when the user chooses to proceed. Initialization is a soft prerequisite, not a hidden lifecycle stage.
|
|
61
|
+
|
|
62
|
+
### 2. Preserve Requirement Identity
|
|
63
|
+
|
|
64
|
+
Once `prizmkit-plan` resolves an `artifact_dir`, capture it and pass the exact same value to every later stage. The artifact root is generic and is not restricted to one directory family:
|
|
65
|
+
|
|
66
|
+
```text
|
|
67
|
+
.prizmkit/specs/<requirement-slug>/
|
|
68
|
+
.prizmkit/bugfix/<bug-id>/
|
|
69
|
+
.prizmkit/refactor/<refactor-id>/
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Never select a different most-recent plan when resuming or handing off. The workflow state path is:
|
|
73
|
+
|
|
74
|
+
```text
|
|
75
|
+
.prizmkit/state/workflows/<requirement-slug>.json
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Read `${SKILL_DIR}/references/workflow-state-protocol.md` for the shared state contract. This workflow state remains distinct from any external host execution checkpoint. The target project controls whether generated `.prizmkit/` files are committed, ignored, or shared; do not modify its Git policy.
|
|
79
|
+
|
|
80
|
+
### 3. Advance Only on Truthful Success
|
|
81
|
+
|
|
82
|
+
After each atomic stage:
|
|
83
|
+
|
|
84
|
+
1. Read the stage's actual output and terminal status.
|
|
85
|
+
2. Validate the expected authoritative artifact or evidence and workflow-state transition.
|
|
86
|
+
3. Preserve the same `artifact_dir`.
|
|
87
|
+
4. Continue only on the permitted success status.
|
|
88
|
+
5. Because this composite is the active orchestrator, atomic skills return terminal state and `next_stage` to it; they must not invoke the next stage recursively.
|
|
89
|
+
6. If the host cannot invoke another skill automatically, stop with exactly one deterministic next skill, its `artifact_dir`, and the workflow-state path.
|
|
90
|
+
|
|
91
|
+
Expected transitions:
|
|
92
|
+
|
|
93
|
+
| Stage | Required success | Next stage |
|
|
94
|
+
|---|---|---|
|
|
95
|
+
| `prizmkit-plan` | `PLAN_READY` | `prizmkit-implement` |
|
|
96
|
+
| `prizmkit-implement` | `IMPLEMENTED` | `prizmkit-code-review` |
|
|
97
|
+
| `prizmkit-code-review` | `REVIEW_PASS` | `prizmkit-test` |
|
|
98
|
+
| `prizmkit-test` | `TEST_PASS` | `prizmkit-retrospective` |
|
|
99
|
+
| `prizmkit-retrospective` | `status=RETRO_COMPLETE` with result `DOCS_UPDATED` or `NO_DOC_CHANGE` | `prizmkit-committer` |
|
|
100
|
+
| `prizmkit-committer` | explicit interactive confirmation, then `COMMITTED` | end |
|
|
101
|
+
|
|
102
|
+
`TEST_NOT_APPLICABLE` is not a valid lifecycle success. Lightweight changes must execute deterministic verification and return `TEST_PASS`.
|
|
103
|
+
|
|
104
|
+
### 4. Do Not Duplicate Stage Responsibilities
|
|
105
|
+
|
|
106
|
+
The composite must not:
|
|
107
|
+
|
|
108
|
+
- reinterpret a plan as implementation;
|
|
109
|
+
- repair production code outside `prizmkit-implement` or the Main-Agent review loop;
|
|
110
|
+
- claim tests passed without validated authoritative test evidence;
|
|
111
|
+
- treat a derived Markdown report as the test source of truth;
|
|
112
|
+
- perform retrospective documentation changes itself;
|
|
113
|
+
- stage or commit before `prizmkit-committer` applies the current execution's authorization boundary;
|
|
114
|
+
- invoke `prizmkit-deploy` as a hidden seventh stage.
|
|
115
|
+
|
|
116
|
+
## Failure and Repair Routing
|
|
117
|
+
|
|
118
|
+
Use the shared workflow state and authoritative stage evidence to determine routing. Do not blindly retry every failure.
|
|
119
|
+
|
|
120
|
+
### Review Failure
|
|
121
|
+
|
|
122
|
+
`REVIEW_NEEDS_FIXES` maps from the final review report result `NEEDS_FIXES`. Route to:
|
|
123
|
+
|
|
124
|
+
```text
|
|
125
|
+
prizmkit-implement
|
|
126
|
+
→ prizmkit-code-review
|
|
127
|
+
→ prizmkit-test
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
The Main-Agent review skill owns its internal review repairs and its internal ten-round limit before returning its terminal result. The outer workflow repair counter is separate.
|
|
131
|
+
|
|
132
|
+
### Test Failure
|
|
133
|
+
|
|
134
|
+
`TEST_FAIL` must come from the validated authoritative evidence verdict and include `repair_scope`:
|
|
135
|
+
|
|
136
|
+
TEST_FAIL affecting only tests, fixtures, test-runner configuration, or evidence infrastructure uses `repair_scope=test-infrastructure`:
|
|
137
|
+
|
|
138
|
+
```text
|
|
139
|
+
TEST_FAIL with repair_scope=test-infrastructure
|
|
140
|
+
→ prizmkit-implement
|
|
141
|
+
→ prizmkit-test
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Test infrastructure includes tests, fixtures, test-runner configuration, and evidence infrastructure only.
|
|
145
|
+
|
|
146
|
+
TEST_FAIL affecting production code, runtime configuration, schema, dependencies, or public interfaces uses the matching production-family scope:
|
|
147
|
+
|
|
148
|
+
```text
|
|
149
|
+
TEST_FAIL with repair_scope=production | runtime | schema | dependency | public-interface
|
|
150
|
+
→ prizmkit-implement
|
|
151
|
+
→ prizmkit-code-review
|
|
152
|
+
→ prizmkit-test
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Production-affecting repair after `REVIEW_PASS` must receive another review. A test-infrastructure-only repair may return directly to testing. Unknown scope uses the conservative production route only when safe; otherwise the workflow is blocked.
|
|
156
|
+
|
|
157
|
+
### Environment Block
|
|
158
|
+
|
|
159
|
+
`TEST_BLOCKED` means trustworthy evidence is unavailable because of environment, permission, dependency, external-service, scope, evidence, reliability, cleanup, or budget problems.
|
|
160
|
+
|
|
161
|
+
Interactive behavior:
|
|
162
|
+
|
|
163
|
+
```text
|
|
164
|
+
TEST_BLOCKED
|
|
165
|
+
→ persist the blocker
|
|
166
|
+
→ do not make speculative production edits
|
|
167
|
+
→ stop with a deterministic prizmkit-test resume entry
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
A trusted headless host performs its own bounded automatic environment recovery when invoking atomic stages. It does not invoke this composite workflow or silently turn a blocked result into success.
|
|
171
|
+
|
|
172
|
+
### Repair Limit
|
|
173
|
+
|
|
174
|
+
The outer orchestrator allows at most three automatic repair rounds. These are cross-stage rounds: one repair route from `implement` through all gates required by the repair scope.
|
|
175
|
+
|
|
176
|
+
```text
|
|
177
|
+
repair_round: 0 → 1 → 2 → 3
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
When the limit is reached:
|
|
181
|
+
|
|
182
|
+
- set workflow status to `WORKFLOW_BLOCKED`;
|
|
183
|
+
- preserve the latest authoritative failure evidence;
|
|
184
|
+
- report completed rounds and unresolved cause;
|
|
185
|
+
- report the exact skill, `artifact_dir`, and state path from which a user may resume after resolving the cause or explicitly authorizing another attempt;
|
|
186
|
+
- do not claim the requirement is complete.
|
|
187
|
+
|
|
188
|
+
The internal `prizmkit-code-review` limit of ten completed review rounds remains separate and does not increment `repair_round`.
|
|
189
|
+
|
|
190
|
+
## Commit Authorization Boundary
|
|
191
|
+
|
|
192
|
+
The composite may automatically reach `/prizmkit-committer`, but it must not silently create a Git commit.
|
|
193
|
+
|
|
194
|
+
Interactive execution requires the committer to:
|
|
195
|
+
|
|
196
|
+
1. verify all five preceding stage results for the same `artifact_dir`;
|
|
197
|
+
2. inspect the final workspace;
|
|
198
|
+
3. present intended files, diff summary, sensitive-file warnings, and the proposed Conventional Commit message;
|
|
199
|
+
4. wait for explicit user confirmation from the current user;
|
|
200
|
+
5. create and verify the local commit only after confirmation.
|
|
201
|
+
|
|
202
|
+
Trusted headless execution is a separate atomic-stage path. It requires a host-defined non-interactive `mode`, a trusted `owner` identifier, `local_commit_authorized=true`, and `push_authorized=false`; it does not ask or wait and never pushes. Unknown headless contexts are blocked. Remote push is never part of this composite workflow's automatic path.
|
|
203
|
+
|
|
204
|
+
## Automatic Handoff and Manual Fallback
|
|
205
|
+
|
|
206
|
+
When the host supports semantic skill-to-skill invocation, the active composite invokes the next atomic stage after each permitted success transition.
|
|
207
|
+
|
|
208
|
+
When it does not:
|
|
209
|
+
|
|
210
|
+
1. update or verify workflow state;
|
|
211
|
+
2. stop without claiming the next stage ran;
|
|
212
|
+
3. print one exact recovery instruction:
|
|
213
|
+
|
|
214
|
+
```text
|
|
215
|
+
Next stage: /prizmkit-<skill>
|
|
216
|
+
artifact_dir: <same resolved artifact_dir>
|
|
217
|
+
workflow_state: .prizmkit/state/workflows/<requirement-slug>.json
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
The user can invoke that one atomic skill and this composite can resume with `resume` later.
|
|
221
|
+
|
|
222
|
+
## Resume Protocol
|
|
223
|
+
|
|
224
|
+
On resume:
|
|
225
|
+
|
|
226
|
+
1. Read the workflow state specified by `resume` or discover the target project's active workflow state.
|
|
227
|
+
2. Read `${SKILL_DIR}/references/workflow-state-protocol.md`.
|
|
228
|
+
3. Verify `spec.md`, `plan.md`, review report, authoritative test evidence, retrospective result, and current workspace against state.
|
|
229
|
+
4. If state is missing or stale, reconstruct the safest recoverable predecessor and report the reconstruction.
|
|
230
|
+
5. Continue from the first incomplete stage; never bypass a required gate based only on stale state.
|
|
231
|
+
6. Preserve the same `artifact_dir` and repair-round count.
|
|
232
|
+
7. When an external host is involved, let it validate its own checkpoint independently; never merge that checkpoint into workflow state.
|
|
233
|
+
|
|
234
|
+
## Completion Report
|
|
235
|
+
|
|
236
|
+
At successful completion, report:
|
|
237
|
+
|
|
238
|
+
```text
|
|
239
|
+
WORKFLOW_COMPLETE
|
|
240
|
+
artifact_dir: <path>
|
|
241
|
+
stages:
|
|
242
|
+
- PLAN_READY
|
|
243
|
+
- IMPLEMENTED
|
|
244
|
+
- REVIEW_PASS
|
|
245
|
+
- TEST_PASS
|
|
246
|
+
- RETRO_COMPLETE (DOCS_UPDATED | NO_DOC_CHANGE)
|
|
247
|
+
- COMMITTED
|
|
248
|
+
commit: <hash>
|
|
249
|
+
push: not performed automatically
|
|
250
|
+
next_action: invoke /prizmkit-deploy separately if deployment is needed
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
If the user declines interactive commit confirmation, report `COMMIT_PENDING` rather than `WORKFLOW_COMPLETE` and provide the exact `/prizmkit-committer` resume entry.
|
|
254
|
+
|
|
255
|
+
If blocked, report:
|
|
256
|
+
|
|
257
|
+
```text
|
|
258
|
+
WORKFLOW_BLOCKED
|
|
259
|
+
stage: <stage>
|
|
260
|
+
reason: <evidence-backed reason>
|
|
261
|
+
repair_round: <0..3>
|
|
262
|
+
resume_from: <skill>
|
|
263
|
+
artifact_dir: <same path>
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
Never report success for a stage that did not produce its required terminal result.
|