prizmkit 1.1.129 → 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 +398 -6
- package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +61 -3
- package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +64 -4
- package/bundled/dev-pipeline/scripts/prompt_framework.py +156 -7
- 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 +404 -24
- 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
|
@@ -1,139 +1,175 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "prizmkit"
|
|
3
|
-
description: "
|
|
3
|
+
description: "PrizmKit framework introduction and lifecycle navigator. Explains the independent project-init, formal requirement lifecycle, documentation, and deployment skills. Use when users ask what PrizmKit is, which skill to use, how to start, or how the lifecycle works. (project)"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# PrizmKit —
|
|
6
|
+
# PrizmKit — Framework Introduction and Navigator
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
- User asks "which command?", "help", "how do I start a feature", "get started", "what tools"
|
|
10
|
-
- User wants to understand the PrizmKit development lifecycle
|
|
11
|
-
- User invokes "/prizmkit" or asks about dev workflow
|
|
12
|
-
- User is new to the project and needs orientation
|
|
13
|
-
- User says an ambiguous phrase such as "ship it" and intent could mean commit or deploy
|
|
8
|
+
`/prizmkit` explains the PrizmKit toolkit and directs the user to the appropriate independent skill. It does not execute a requirement lifecycle itself.
|
|
14
9
|
|
|
15
|
-
|
|
16
|
-
- User already knows which specific skill to use — invoke that skill directly
|
|
17
|
-
- Mid-implementation — use the specific skill needed (`/prizmkit-implement`, `/prizmkit-code-review`, etc.)
|
|
18
|
-
- User wants to execute immediately without orientation — route to the correct specific skill
|
|
10
|
+
## When to Use
|
|
19
11
|
|
|
20
|
-
|
|
12
|
+
- User asks what PrizmKit is or which skill to use.
|
|
13
|
+
- User asks how to start a project or a formal requirement.
|
|
14
|
+
- User asks about the development lifecycle or available tools.
|
|
15
|
+
- User invokes `/prizmkit`.
|
|
16
|
+
- User uses an ambiguous phrase such as "ship it" and the intent could mean commit or deploy.
|
|
21
17
|
|
|
22
|
-
|
|
18
|
+
## When NOT to Use
|
|
23
19
|
|
|
24
|
-
|
|
20
|
+
- User already knows the required skill; invoke that skill directly.
|
|
21
|
+
- A formal requirement is already in progress; continue from its workflow state and current stage.
|
|
22
|
+
- User wants an immediate low-risk direct edit; perform the edit and its specific verification.
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
- `.prizmkit/prizm-docs/root.prizm` — L0 project architecture index
|
|
28
|
-
- `.prizmkit/plans/project-brief.md` — product vision generated during project initialization
|
|
29
|
-
- `.prizmkit/config.json` — tech stack and runtime config
|
|
24
|
+
## Responsibility Map
|
|
30
25
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
```text
|
|
27
|
+
PrizmKit Toolkit
|
|
28
|
+
├── prizmkit
|
|
29
|
+
│ └── Framework introduction and navigation
|
|
30
|
+
├── prizmkit-workflow
|
|
31
|
+
│ └── One-entry orchestration for the formal requirement lifecycle
|
|
32
|
+
├── prizmkit-init
|
|
33
|
+
│ └── Recommended one-time project initialization
|
|
34
|
+
├── Formal requirement lifecycle
|
|
35
|
+
│ ├── prizmkit-plan
|
|
36
|
+
│ ├── prizmkit-implement
|
|
37
|
+
│ ├── prizmkit-code-review
|
|
38
|
+
│ ├── prizmkit-test
|
|
39
|
+
│ ├── prizmkit-retrospective
|
|
40
|
+
│ └── prizmkit-committer
|
|
41
|
+
├── prizmkit-prizm-docs
|
|
42
|
+
│ └── Independent Prizm documentation management
|
|
43
|
+
└── prizmkit-deploy
|
|
44
|
+
└── Independent deployment and operations entry point
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Formal Requirement Lifecycle
|
|
48
|
+
|
|
49
|
+
Every formal requirement follows all six stages in this order:
|
|
50
|
+
|
|
51
|
+
```text
|
|
52
|
+
prizmkit-plan
|
|
53
|
+
→ prizmkit-implement
|
|
54
|
+
→ prizmkit-code-review
|
|
55
|
+
→ prizmkit-test
|
|
56
|
+
→ prizmkit-retrospective
|
|
57
|
+
→ prizmkit-committer
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The lifecycle starts at `/prizmkit-plan`. For a one-entry experience, invoke `/prizmkit-workflow` with the requirement; it coordinates the same stages without replacing their responsibilities. When the host supports skill-to-skill handoff, the stages continue automatically. Otherwise, each stage writes the next semantic skill and the workflow state provides the deterministic resume context.
|
|
61
|
+
|
|
62
|
+
All six stages are required for a formal requirement. A stage may choose a verification depth appropriate to the change, but it may not be silently skipped.
|
|
63
|
+
|
|
64
|
+
### Direct Edit
|
|
65
|
+
|
|
66
|
+
Typos, pure formatting, small documentation edits, and other explicitly low-risk non-requirement changes may use a direct edit. Direct edit is not the formal requirement lifecycle.
|
|
67
|
+
|
|
68
|
+
### Stage Responsibilities
|
|
69
|
+
|
|
70
|
+
| Stage | Responsibility | Success handoff |
|
|
71
|
+
|---|---|---|
|
|
72
|
+
| `prizmkit-plan` | Clarify the requirement and create/review `spec.md` and `plan.md`. | `PLAN_READY` → `prizmkit-implement` |
|
|
73
|
+
| `prizmkit-implement` | Execute the plan tasks and record completion. | `IMPLEMENTED` → `prizmkit-code-review` |
|
|
74
|
+
| `prizmkit-code-review` | Main Agent reviews, repairs, verifies, and loops until convergence. | `REVIEW_PASS` → `prizmkit-test` |
|
|
75
|
+
| `prizmkit-test` | Validate the final reviewed workspace with project-native evidence. | `TEST_PASS` → `prizmkit-retrospective` |
|
|
76
|
+
| `prizmkit-retrospective` | Synchronize durable project documentation or record no documentation change. | `RETRO_COMPLETE` → `prizmkit-committer` |
|
|
77
|
+
| `prizmkit-committer` | Verify gates, request commit confirmation, and create the local commit. | `COMMITTED` |
|
|
35
78
|
|
|
36
|
-
|
|
79
|
+
### `prizmkit-workflow`
|
|
37
80
|
|
|
38
|
-
|
|
81
|
+
Use for a one-entry formal requirement workflow. It coordinates all six lifecycle skills, preserves one `artifact_dir`, routes failures, and stops for commit confirmation. It handles exactly one requirement per invocation.
|
|
39
82
|
|
|
40
|
-
###
|
|
83
|
+
### `prizmkit-init`
|
|
41
84
|
|
|
42
|
-
|
|
85
|
+
`/prizmkit-init` is recommended the first time PrizmKit enters a project. It can create project context, configuration, a project brief, and Prizm documentation.
|
|
43
86
|
|
|
44
|
-
|
|
45
|
-
- Typo or wording fixes
|
|
46
|
-
- Pure formatting
|
|
47
|
-
- Small documentation edits
|
|
48
|
-
- Tiny config tweaks with no behavior change
|
|
87
|
+
Initialization is a soft prerequisite, not a hard dependency:
|
|
49
88
|
|
|
50
|
-
|
|
89
|
+
- If project initialization is missing, `/prizmkit-plan` recommends `/prizmkit-init`.
|
|
90
|
+
- The user may continue without initialization.
|
|
91
|
+
- Planning then reads the source tree, README, manifests, and available project rules as fallback context.
|
|
92
|
+
- Later documentation synchronization reports when the Prizm documentation system is not initialized instead of pretending that synchronization completed.
|
|
51
93
|
|
|
52
|
-
|
|
94
|
+
## Independent Skills
|
|
53
95
|
|
|
54
|
-
|
|
96
|
+
### `prizmkit-prizm-docs`
|
|
55
97
|
|
|
56
|
-
|
|
98
|
+
Use for Prizm documentation initialization, status, validation, migration, repair, and rebuild. It is not an additional stage required for every formal requirement.
|
|
99
|
+
|
|
100
|
+
### `prizmkit-deploy`
|
|
101
|
+
|
|
102
|
+
Use independently after development when deployment or operations work is needed. It is not a seventh requirement stage and does not replace the six development gates.
|
|
103
|
+
|
|
104
|
+
## Failure and Repair Routing
|
|
57
105
|
|
|
58
106
|
```text
|
|
59
|
-
|
|
107
|
+
REVIEW_NEEDS_FIXES
|
|
108
|
+
→ prizmkit-implement
|
|
109
|
+
→ prizmkit-code-review
|
|
110
|
+
|
|
111
|
+
TEST_FAIL affecting only tests, fixtures, or test-runner configuration
|
|
112
|
+
→ prizmkit-implement
|
|
113
|
+
→ prizmkit-test
|
|
114
|
+
|
|
115
|
+
TEST_FAIL affecting production code, runtime configuration, schema,
|
|
116
|
+
dependencies, or public interfaces
|
|
117
|
+
→ prizmkit-implement
|
|
118
|
+
→ prizmkit-code-review
|
|
119
|
+
→ prizmkit-test
|
|
120
|
+
|
|
121
|
+
TEST_BLOCKED
|
|
122
|
+
→ pause without speculative code changes
|
|
123
|
+
→ resume from prizmkit-test when the environment is available
|
|
60
124
|
```
|
|
61
125
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
- Run `/prizmkit-test` only when the change hits the risk-triggered testing criteria.
|
|
66
|
-
- Run `/prizmkit-retrospective` only when structure, interfaces, dependencies, behavior, or durable project knowledge changed.
|
|
126
|
+
Automatic outer repair is limited to three rounds. The workflow stops with a resumable blocked result when the limit is reached or a gate cannot be safely completed.
|
|
127
|
+
|
|
128
|
+
## Commit and Deployment Boundary
|
|
67
129
|
|
|
68
|
-
|
|
130
|
+
`prizmkit-committer` must not create a commit until the preceding five formal stages have succeeded. Before creating the local commit, it presents the intended files, diff summary, and Conventional Commit message and waits for user confirmation.
|
|
69
131
|
|
|
70
|
-
|
|
132
|
+
Pushing to a remote is a separate explicit action. Deployment is always a separate invocation of `/prizmkit-deploy`.
|
|
71
133
|
|
|
72
|
-
|
|
134
|
+
## Workflow State
|
|
135
|
+
|
|
136
|
+
An active requirement may use:
|
|
73
137
|
|
|
74
138
|
```text
|
|
75
|
-
|
|
139
|
+
.prizmkit/state/workflows/<requirement-slug>.json
|
|
76
140
|
```
|
|
77
141
|
|
|
78
|
-
|
|
79
|
-
- `/prizmkit-plan` produces a full `spec.md` and `plan.md`.
|
|
80
|
-
- `/prizmkit-code-review` is the default quality gate.
|
|
81
|
-
- `/prizmkit-retrospective` is the normal development writer for `.prizmkit/prizm-docs/`.
|
|
82
|
-
- `/prizmkit-test` is risk-triggered rather than always mandatory.
|
|
142
|
+
This runtime state records the current stage, terminal status, repair scope, repair round, and resume entry. The skill set does not prescribe whether the target project commits, ignores, or shares this file.
|
|
83
143
|
|
|
84
|
-
|
|
144
|
+
Read `${SKILL_DIR}/references/workflow-state-protocol.md` for the state protocol. If the state file is missing or stale, use `spec.md`, `plan.md`, review evidence, and test evidence to reconstruct the safest recoverable stage and report that reconstruction.
|
|
85
145
|
|
|
86
|
-
|
|
87
|
-
- Observable behavior
|
|
88
|
-
- Public interfaces or API contracts
|
|
89
|
-
- Data models, migrations, or schema
|
|
90
|
-
- Security, permissions, authentication, billing, payments, or entitlements
|
|
91
|
-
- Deployment readiness or user-requested quality verification
|
|
146
|
+
## Quick Start
|
|
92
147
|
|
|
93
|
-
|
|
148
|
+
Install the skills through the host's skills installer, for example:
|
|
94
149
|
|
|
95
|
-
|
|
150
|
+
```bash
|
|
151
|
+
npx skills add <repository>
|
|
152
|
+
```
|
|
96
153
|
|
|
97
|
-
|
|
154
|
+
Then:
|
|
98
155
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
156
|
+
```text
|
|
157
|
+
1. Optionally run /prizmkit-init when entering a project for the first time.
|
|
158
|
+
2. Start a formal requirement with /prizmkit-plan.
|
|
159
|
+
3. Continue through implement → code-review → test → retrospective → committer.
|
|
160
|
+
4. Confirm the local commit when /prizmkit-committer presents it.
|
|
161
|
+
5. Invoke /prizmkit-deploy separately when deployment or operations work is needed.
|
|
162
|
+
```
|
|
104
163
|
|
|
105
|
-
##
|
|
164
|
+
## Scope Boundary
|
|
106
165
|
|
|
107
|
-
|
|
108
|
-
|-------|---------|-----------------|
|
|
109
|
-
| `/prizmkit-init` | Project bootstrap entry point: use before planning in a newly installed/taken-over project; scans codebase, generates `.prizmkit/prizm-docs/`, config, and project brief. | "init", "initialize", "take over this project", "bootstrap" |
|
|
110
|
-
| `/prizmkit-plan` | First implementation planning step: run ahead of `/prizmkit-implement` to turn natural language into `spec.md` + `plan.md` with executable tasks. | "specify", "plan", "new task", "architect", "break it down" |
|
|
111
|
-
| `/prizmkit-implement` | Implementation step: use after `/prizmkit-plan` to execute `plan.md` tasks with TDD where applicable, task order, and checkpoints. | "implement", "build", "code it", "start coding" |
|
|
112
|
-
| `/prizmkit-test` | Risk-triggered quality gate: run after implementation when behavior, interfaces, data, security, or deploy risk requires tests and boundary coverage. | "test", "run tests", "verify", "quality check", "boundary tests" |
|
|
113
|
-
| `/prizmkit-code-review` | Full path quality gate: the current Main Agent reviews and repairs the complete change in the active checkout without direct or indirect review delegation. | "review", "check code", "code review", "is it ready to commit" |
|
|
114
|
-
| `/prizmkit-retrospective` | Docs maintenance step: run after review/implementation when structure, interfaces, dependencies, behavior, or durable knowledge changed. | "retrospective", "retro", "update docs", "sync docs", "wrap up" |
|
|
115
|
-
| `/prizmkit-committer` | Final lifecycle commit step: use after required gates are satisfied; safely stages and creates a Conventional Commit without changing changelog by default. | "commit", "submit", "finish", "done" |
|
|
116
|
-
| `/prizmkit-prizm-docs` | Documentation system entry point: use for init/status/rebuild/validate/migrate or out-of-band repair, not normal development sync. | "initialize docs", "check docs", "rebuild docs", "validate docs", "docs drifted" |
|
|
117
|
-
| `/prizmkit-deploy` | Deployment lifecycle entry point: use after code is ready to release or for existing deployment operations. | "deploy", "go live", "take live", "release", "rollback", "deploy status" |
|
|
166
|
+
This toolkit is self-contained: its skills describe only this toolkit's lifecycle and independent entry points. External systems may integrate through the published skill inputs, outputs, state, and authorization contracts, but their internal architecture and names are outside this toolkit's protocol.
|
|
118
167
|
|
|
119
|
-
|
|
168
|
+
The toolkit does not promise universal automatic handoff, universal deployment automation, automatic remote push, or access beyond the host platform's permissions and environment.
|
|
120
169
|
|
|
121
170
|
If the user says only "ship it", ask whether they mean:
|
|
122
171
|
|
|
123
172
|
1. Commit the current changes with `/prizmkit-committer`.
|
|
124
|
-
2. Deploy or
|
|
125
|
-
|
|
126
|
-
Do not route ambiguous "ship it" directly to commit or deploy without clarification.
|
|
127
|
-
|
|
128
|
-
## Quick Start
|
|
129
|
-
|
|
130
|
-
1. `npx prizmkit install .` — install skills, rules, hooks, and platform scaffolding
|
|
131
|
-
2. `/prizmkit-init` — scan project, generate docs/config/brief
|
|
132
|
-
3. `/prizmkit-plan` — create a change artifact for the first non-trivial task
|
|
133
|
-
4. `/prizmkit-implement` — implement plan tasks
|
|
134
|
-
5. Run `/prizmkit-test` if risk-triggered
|
|
135
|
-
6. Run `/prizmkit-code-review` for Full path or when requested/risk-triggered
|
|
136
|
-
7. Run `/prizmkit-retrospective` if docs or durable knowledge changed
|
|
137
|
-
8. `/prizmkit-committer` — safe Conventional Commit
|
|
173
|
+
2. Deploy or operate the project with `/prizmkit-deploy`.
|
|
138
174
|
|
|
139
|
-
|
|
175
|
+
Do not route an ambiguous "ship it" directly to either action.
|
|
@@ -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.
|