prizmkit 1.1.111 → 1.1.113
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/adapters/codex/skill-adapter.js +4 -0
- package/bundled/agents/prizm-dev-team-reviewer.md +12 -1
- package/bundled/dev-pipeline/SCHEMA_ANALYSIS.md +10 -10
- package/bundled/dev-pipeline/prizmkit_runtime/interoperability.py +1 -0
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +20 -73
- package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +290 -421
- package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +1 -1
- package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +259 -481
- package/bundled/dev-pipeline/scripts/init-bugfix-pipeline.py +34 -0
- package/bundled/dev-pipeline/scripts/init-pipeline.py +12 -0
- package/bundled/dev-pipeline/scripts/init-refactor-pipeline.py +24 -1
- package/bundled/dev-pipeline/scripts/prompt_framework.py +312 -0
- package/bundled/dev-pipeline/scripts/update-bug-status.py +87 -20
- package/bundled/dev-pipeline/scripts/update-feature-status.py +82 -16
- package/bundled/dev-pipeline/scripts/update-refactor-status.py +68 -28
- package/bundled/dev-pipeline/scripts/utils.py +171 -0
- package/bundled/dev-pipeline/templates/bootstrap-prompt.md +1 -1
- package/bundled/dev-pipeline/templates/bootstrap-tier1.md +7 -1
- package/bundled/dev-pipeline/templates/bootstrap-tier2.md +17 -19
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +21 -26
- package/bundled/dev-pipeline/templates/bug-fix-list-schema.json +9 -1
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +11 -8
- package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +122 -182
- package/bundled/dev-pipeline/templates/sections/bugfix-artifacts.md +16 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-critical-paths.md +12 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-mission.md +9 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-commit-report.md +31 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-critic.md +22 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +23 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-implement.md +20 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-init.md +9 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-manual-verification.md +15 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +29 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-reminders.md +11 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-session-context.md +7 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-session-status.md +31 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-task-contract.md +40 -0
- package/bundled/dev-pipeline/templates/sections/failure-capture.md +2 -2
- package/bundled/dev-pipeline/templates/sections/phase-browser-verification-auto.md +8 -2
- package/bundled/dev-pipeline/templates/sections/phase-browser-verification-opencli.md +7 -1
- package/bundled/dev-pipeline/templates/sections/phase-browser-verification.md +7 -1
- package/bundled/dev-pipeline/templates/sections/refactor-artifacts.md +17 -0
- package/bundled/dev-pipeline/templates/sections/refactor-critical-paths.md +13 -0
- package/bundled/dev-pipeline/templates/sections/refactor-mission.md +9 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-commit-report.md +37 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-critic.md +22 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-implement.md +16 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-init.md +9 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-plan.md +22 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +19 -0
- package/bundled/dev-pipeline/templates/sections/refactor-reminders.md +11 -0
- package/bundled/dev-pipeline/templates/sections/refactor-session-context.md +7 -0
- package/bundled/dev-pipeline/templates/sections/refactor-session-status.md +28 -0
- package/bundled/dev-pipeline/templates/sections/refactor-task-contract.md +52 -0
- package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +104 -26
- package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +14 -0
- package/bundled/dev-pipeline/tests/test_python_runner_parity.py +239 -0
- package/bundled/dev-pipeline/tests/test_unified_cli.py +6 -2
- package/bundled/dev-pipeline/tests/test_utils.py +66 -1
- package/bundled/skills/_metadata.json +1 -1
- package/bundled/skills/app-planner/SKILL.md +8 -7
- package/bundled/skills/app-planner/references/project-brief-guide.md +2 -2
- package/bundled/skills/app-planner/references/rules/backend/derivation-rules.md +1 -1
- package/bundled/skills/app-planner/references/rules/frontend/derivation-rules.md +1 -1
- package/bundled/skills/app-planner/references/rules-configuration.md +53 -26
- package/bundled/skills/bug-fix-workflow/SKILL.md +191 -336
- package/bundled/skills/bug-planner/SKILL.md +6 -5
- package/bundled/skills/bug-planner/references/critic-and-verification.md +3 -3
- package/bundled/skills/bug-planner/references/schema-validation.md +2 -1
- package/bundled/skills/bug-planner/scripts/validate-bug-list.py +70 -1
- package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +21 -21
- package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +2 -2
- package/bundled/skills/feature-pipeline-launcher/SKILL.md +25 -26
- package/bundled/skills/feature-planner/SKILL.md +9 -11
- package/bundled/skills/feature-planner/assets/planning-guide.md +1 -1
- package/bundled/skills/feature-planner/references/decomposition-patterns.md +1 -1
- package/bundled/skills/feature-planner/references/error-recovery.md +2 -1
- package/bundled/skills/feature-planner/references/incremental-feature-planning.md +2 -2
- package/bundled/skills/feature-planner/references/new-project-planning.md +35 -39
- package/bundled/skills/feature-planner/scripts/validate-and-generate.py +1 -1
- package/bundled/skills/feature-workflow/SKILL.md +170 -298
- package/bundled/skills/prizmkit/SKILL.md +103 -57
- package/bundled/skills/prizmkit-code-review/SKILL.md +97 -116
- package/bundled/skills/prizmkit-code-review/references/review-report-template.md +1 -0
- package/bundled/skills/prizmkit-code-review/references/reviewer-agent-prompt.md +14 -3
- package/bundled/skills/prizmkit-committer/SKILL.md +59 -47
- package/bundled/skills/prizmkit-deploy/SKILL.md +162 -381
- package/bundled/skills/prizmkit-deploy/references/database-setup.md +12 -3
- package/bundled/skills/prizmkit-deploy/references/ssh-adapter-flow.md +220 -0
- package/bundled/skills/prizmkit-implement/SKILL.md +51 -40
- package/bundled/skills/prizmkit-init/SKILL.md +4 -3
- package/bundled/skills/prizmkit-plan/SKILL.md +85 -70
- package/bundled/skills/prizmkit-prizm-docs/SKILL.md +94 -73
- package/bundled/skills/prizmkit-prizm-docs/assets/prizm-docs-format.md +20 -18
- package/bundled/skills/prizmkit-prizm-docs/references/op-init.md +11 -13
- package/bundled/skills/prizmkit-prizm-docs/references/op-update.md +18 -14
- package/bundled/skills/prizmkit-retrospective/SKILL.md +56 -48
- package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +79 -27
- package/bundled/skills/prizmkit-test/SKILL.md +138 -141
- package/bundled/skills/prizmkit-test/references/boundary-coverage-protocol.md +1 -1
- package/bundled/skills/prizmkit-test/references/examples.md +11 -9
- package/bundled/skills/prizmkit-test/references/test-generation-steps.md +1 -1
- package/bundled/skills/prizmkit-test/references/test-report-template.md +2 -2
- package/bundled/skills/recovery-workflow/SKILL.md +195 -256
- package/bundled/skills/recovery-workflow/evals/evals.json +21 -13
- package/bundled/skills/recovery-workflow/references/detection.md +48 -39
- package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +258 -322
- package/bundled/skills/refactor-pipeline-launcher/SKILL.md +32 -13
- package/bundled/skills/refactor-planner/SKILL.md +2 -2
- package/bundled/skills/refactor-planner/references/behavior-preservation.md +24 -19
- package/bundled/skills/refactor-planner/references/fast-path.md +2 -4
- package/bundled/skills/refactor-planner/references/planning-phases.md +2 -2
- package/bundled/skills/refactor-workflow/SKILL.md +174 -307
- package/package.json +1 -1
- package/src/scaffold.js +5 -0
- package/bundled/dev-pipeline/templates/agent-prompts/reviewer-review.md +0 -6
- package/bundled/skills/feature-workflow/references/brainstorm-guide.md +0 -137
- package/bundled/skills/refactor-workflow/references/brainstorm-guide.md +0 -116
|
@@ -10,7 +10,14 @@ During Discovery Step 1 (Project Detection), database drivers were already scann
|
|
|
10
10
|
> - **Yes** → proceed with database installation
|
|
11
11
|
> - **No** → skip, record in deploy.md with note "database must be configured by user"
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Secrets file safety
|
|
14
|
+
|
|
15
|
+
Before writing `.prizmkit/deploy/secrets.local.json`:
|
|
16
|
+
|
|
17
|
+
1. Verify `.gitignore` or an equivalent ignore rule covers `.prizmkit/deploy/secrets.local.json` and any `.prizmkit/deploy/*.local.json` pattern used by the project.
|
|
18
|
+
2. If the ignore rule is missing, pause and add or request the ignore rule before writing secrets.
|
|
19
|
+
3. Set the secrets file permissions to current-user read/write only, for example `chmod 600 .prizmkit/deploy/secrets.local.json` on POSIX systems.
|
|
20
|
+
4. Record only presence metadata in deploy config, docs, reports, and history. Never copy raw passwords, connection strings, passphrases, decryption keys, unsalted hashes, or full env var values into committed files.
|
|
14
21
|
|
|
15
22
|
```
|
|
16
23
|
apt-get install -y postgresql postgresql-contrib
|
|
@@ -21,7 +28,8 @@ sudo -u postgres psql -c "GRANT ALL ON DATABASE <project> TO <project>;"
|
|
|
21
28
|
|
|
22
29
|
- Generate a secure random password (32 chars, alphanumeric + symbols).
|
|
23
30
|
- Write the connection string to `.prizmkit/deploy/secrets.local.json`: `DATABASE_URL=postgresql://<project>:<password>@localhost:5432/<project>`.
|
|
24
|
-
-
|
|
31
|
+
- Set `.prizmkit/deploy/secrets.local.json` permissions to current-user read/write only after writing.
|
|
32
|
+
- In deploy.md, write: "PostgreSQL installed, connection info recorded in `.prizmkit/deploy/secrets.local.json` (gitignored; raw value not committed)".
|
|
25
33
|
|
|
26
34
|
## MySQL setup (future)
|
|
27
35
|
|
|
@@ -37,10 +45,11 @@ redis-cli CONFIG REWRITE
|
|
|
37
45
|
|
|
38
46
|
- Bind to localhost only (modify `/etc/redis/redis.conf` if needed).
|
|
39
47
|
- Write `REDIS_URL=redis://:<password>@localhost:6379` to `.prizmkit/deploy/secrets.local.json`.
|
|
48
|
+
- Set `.prizmkit/deploy/secrets.local.json` permissions to current-user read/write only after writing.
|
|
40
49
|
|
|
41
50
|
## Security notes
|
|
42
51
|
|
|
43
52
|
- Never write database passwords to deploy.md, because deploy.md may be committed to git and passwords would leak.
|
|
44
|
-
- Passwords stored in `.prizmkit/deploy/secrets.local.json`
|
|
53
|
+
- Passwords stored in `.prizmkit/deploy/secrets.local.json` only after verifying the file is ignored by git and locked down to current-user read/write permissions.
|
|
45
54
|
- Default: database binds to localhost, no external access, because most indie projects only need local connections.
|
|
46
55
|
- Record a `"database-setup"` event in deploy history (presence metadata only, no passwords).
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
# SSH Adapter Flow
|
|
2
|
+
|
|
3
|
+
Read this file when Discovery routes `/prizmkit-deploy` to SSH Linux full automation.
|
|
4
|
+
|
|
5
|
+
The SSH adapter supports Node.js projects using PM2 + Nginx blue/green deployment.
|
|
6
|
+
|
|
7
|
+
## 1. Deployment Mode Selection
|
|
8
|
+
|
|
9
|
+
Before entering the configuration wizard, ask how the user wants to deploy:
|
|
10
|
+
|
|
11
|
+
1. **Direct Upload** — build locally, transfer artifacts to the server, start with PM2. Best for first deployment and low-spec servers.
|
|
12
|
+
2. **CI/CD Auto-Deploy** — configure GitHub Actions so pushes deploy automatically.
|
|
13
|
+
|
|
14
|
+
If the user chooses CI/CD, ask which mode:
|
|
15
|
+
|
|
16
|
+
- **Push mode** — GitHub Actions builds and SCPs artifacts to server. Low server load.
|
|
17
|
+
- **Pull mode** — server pulls code and builds itself. Simpler workflow but requires a deploy key and build tools on the server.
|
|
18
|
+
|
|
19
|
+
Read `references/deployment-modes.md` when the user needs the full comparison.
|
|
20
|
+
|
|
21
|
+
Config field: `deployStrategy` in `deploy.config.json` is `direct-upload`, `ci-cd-push`, or `ci-cd-pull`. Existing configs without this field default to `ci-cd-pull` for backward compatibility.
|
|
22
|
+
|
|
23
|
+
## 2. Server Model
|
|
24
|
+
|
|
25
|
+
A valid SSH target:
|
|
26
|
+
|
|
27
|
+
- Is reachable over SSH.
|
|
28
|
+
- Provides a Linux shell.
|
|
29
|
+
- Can install or already has Node.js, npm, PM2, Nginx, and Git.
|
|
30
|
+
- Can access the configured repository when using CI/CD Pull mode.
|
|
31
|
+
|
|
32
|
+
Roles:
|
|
33
|
+
|
|
34
|
+
- `bootstrapUser`: usually root; installs packages and creates users/directories.
|
|
35
|
+
- `runtimeUser`: default `deploy`; app processes run as this user and never as root.
|
|
36
|
+
|
|
37
|
+
Server-side layout:
|
|
38
|
+
|
|
39
|
+
```text
|
|
40
|
+
/var/www/<project>/
|
|
41
|
+
releases/
|
|
42
|
+
<release-id>/
|
|
43
|
+
shared/
|
|
44
|
+
.env.production
|
|
45
|
+
deploy-metadata.json
|
|
46
|
+
current -> releases/<release-id>
|
|
47
|
+
deploy-logs/
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`shared/.env.production` must be mode `600` and owned by the runtime user.
|
|
51
|
+
|
|
52
|
+
## 3. First-Run Configuration Wizard
|
|
53
|
+
|
|
54
|
+
Flow: deployment mode → collect → validate → confirm → persist.
|
|
55
|
+
|
|
56
|
+
Collect:
|
|
57
|
+
|
|
58
|
+
1. SSH server host/port, bootstrap user, runtime user, auth method.
|
|
59
|
+
2. Repository access only for `ci-cd-pull`: Git URL, branch, deploy-key or other auth.
|
|
60
|
+
3. App configuration: app id, path, package manager, install/build/start commands, blue/green port pair, health checks.
|
|
61
|
+
4. Environment variables: scan source for env references, ask for values or storage strategy.
|
|
62
|
+
5. Persist `deploy.config.json` and `deploy.md`.
|
|
63
|
+
|
|
64
|
+
Validate SSH immediately with a harmless connectivity command before collecting deeper config. If SSH fails, stop and fix connectivity first.
|
|
65
|
+
|
|
66
|
+
## 4. Bootstrap
|
|
67
|
+
|
|
68
|
+
Before privileged bootstrap, present an action plan listing:
|
|
69
|
+
|
|
70
|
+
- packages to install
|
|
71
|
+
- users/groups to create
|
|
72
|
+
- SSH keys to generate
|
|
73
|
+
- Nginx config files to create/update
|
|
74
|
+
- directories and permissions
|
|
75
|
+
- services that may restart
|
|
76
|
+
|
|
77
|
+
Rules:
|
|
78
|
+
|
|
79
|
+
- User gives one explicit approval for the bootstrap plan.
|
|
80
|
+
- If the plan changes during execution, pause and ask again.
|
|
81
|
+
- Bootstrap operations must be idempotent.
|
|
82
|
+
- Existing config files must be backed up before modification.
|
|
83
|
+
- Failed bootstrap stops before deployment and provides recovery instructions.
|
|
84
|
+
|
|
85
|
+
Read `references/ssh-bootstrap-flow.md` for the detailed bootstrap procedure. It routes to `references/firewall-setup.md` and `references/database-setup.md` when those branches are selected.
|
|
86
|
+
|
|
87
|
+
## 5. Strategy-Specific Setup
|
|
88
|
+
|
|
89
|
+
Direct upload:
|
|
90
|
+
- Build locally and transfer artifacts.
|
|
91
|
+
- No Git operation is required on the server.
|
|
92
|
+
- Read `references/direct-upload.md`.
|
|
93
|
+
|
|
94
|
+
CI/CD push or pull:
|
|
95
|
+
- Generate `.github/workflows/deploy.yml` from `references/ci-cd-workflows.md`.
|
|
96
|
+
- Verify the first push to the configured branch will trigger deployment.
|
|
97
|
+
- Pull mode requires a deploy key on the server; show the public key and wait for the user to add it to GitHub Deploy Keys before verifying clone access.
|
|
98
|
+
|
|
99
|
+
After a successful direct-upload deployment, offer CI/CD setup so future `git push` can deploy automatically.
|
|
100
|
+
|
|
101
|
+
## 6. DNS and SSL
|
|
102
|
+
|
|
103
|
+
Before SSL, ask whether the user has a domain for the project.
|
|
104
|
+
|
|
105
|
+
- If no domain, skip DNS + SSL and note it in `deploy.md`.
|
|
106
|
+
- If a domain exists, check DNS before SSL.
|
|
107
|
+
- Read `references/dns-setup.md` for DNS instructions.
|
|
108
|
+
- Read `references/ssl-setup.md` for Let's Encrypt / certificate guidance.
|
|
109
|
+
|
|
110
|
+
Always verify certificate renewal when Let's Encrypt is configured.
|
|
111
|
+
|
|
112
|
+
## 7. Deployment Execution
|
|
113
|
+
|
|
114
|
+
Read `references/ssh-execution-flow.md` for the full pipeline.
|
|
115
|
+
|
|
116
|
+
Core sequence:
|
|
117
|
+
|
|
118
|
+
1. Pre-flight and prepare release.
|
|
119
|
+
2. Fetch/build or receive artifact.
|
|
120
|
+
3. Stage new process on inactive blue/green port.
|
|
121
|
+
4. Health-check inactive port.
|
|
122
|
+
5. Switch Nginx upstream only after staged health checks pass.
|
|
123
|
+
6. Verify public endpoint.
|
|
124
|
+
7. Stop old process, cleanup old releases, record history.
|
|
125
|
+
|
|
126
|
+
Failure rules:
|
|
127
|
+
|
|
128
|
+
- If any step before traffic switch fails, stop and leave the live version unchanged.
|
|
129
|
+
- If a public health check fails after traffic switch, rollback immediately.
|
|
130
|
+
- Do not delete failed release logs; preserve them for debugging.
|
|
131
|
+
|
|
132
|
+
## 8. Blue/Green PM2 + Nginx Invariants
|
|
133
|
+
|
|
134
|
+
- Default ports: blue `3101`, green `3102`.
|
|
135
|
+
- Active color is persisted in `shared/deploy-metadata.json`.
|
|
136
|
+
- PM2 process name: `<project>-<app>-<color>`.
|
|
137
|
+
- Nginx managed blocks include `# PrizmKit Managed: <project> — DO NOT EDIT MANUALLY`.
|
|
138
|
+
- First creation or modification of non-PrizmKit Nginx config requires user confirmation.
|
|
139
|
+
- Always run `nginx -t` before reload.
|
|
140
|
+
|
|
141
|
+
Read `references/nginx-blue-green.md` for config templates and traffic switch details.
|
|
142
|
+
|
|
143
|
+
## 9. Rollback
|
|
144
|
+
|
|
145
|
+
Rollback can be automatic or manual.
|
|
146
|
+
|
|
147
|
+
Manual command:
|
|
148
|
+
|
|
149
|
+
```text
|
|
150
|
+
/prizmkit-deploy rollback --app <id> [--to <releaseId>]
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Steps:
|
|
154
|
+
|
|
155
|
+
1. Identify target release.
|
|
156
|
+
2. Verify build artifacts exist.
|
|
157
|
+
3. Start PM2 on the target release/port.
|
|
158
|
+
4. Update Nginx upstream.
|
|
159
|
+
5. Run `nginx -t` and reload.
|
|
160
|
+
6. Run health checks.
|
|
161
|
+
7. Write rollback event.
|
|
162
|
+
|
|
163
|
+
If no previous release exists, state clearly that rollback is not possible.
|
|
164
|
+
|
|
165
|
+
## 10. Operations Commands
|
|
166
|
+
|
|
167
|
+
- `status`: PM2 list, active release, active color/port, last deploy.
|
|
168
|
+
- `logs --app <id>`: recent PM2 logs for active process.
|
|
169
|
+
- `restart --app <id>`: restart active PM2 process and run health checks.
|
|
170
|
+
- `health --app <id>`: run configured health checks.
|
|
171
|
+
- `history`: list deploy history events chronologically.
|
|
172
|
+
|
|
173
|
+
Run app commands as `runtimeUser`.
|
|
174
|
+
|
|
175
|
+
## 11. Secrets Management
|
|
176
|
+
|
|
177
|
+
Supported storage modes:
|
|
178
|
+
|
|
179
|
+
- `ask-every-time`
|
|
180
|
+
- `encrypted-local`
|
|
181
|
+
- `plaintext-local`
|
|
182
|
+
- `user-managed-on-server-only`
|
|
183
|
+
|
|
184
|
+
Rules:
|
|
185
|
+
|
|
186
|
+
- `plaintext-local` must be gitignored; stop if tracked by git.
|
|
187
|
+
- Server runtime secrets live in `shared/.env.production` with mode `600`.
|
|
188
|
+
- Deploy history records secret presence metadata only.
|
|
189
|
+
- Never record raw secret values, passphrases, decryption keys, or unsalted hashes.
|
|
190
|
+
|
|
191
|
+
## 12. Existing Deployment Takeover
|
|
192
|
+
|
|
193
|
+
When the target server already has deployment assets, read `references/ssh-takeover.md`.
|
|
194
|
+
|
|
195
|
+
Record takeover decisions and validation results in config and history.
|
|
196
|
+
|
|
197
|
+
Before modifying non-PrizmKit-managed Nginx config, ask for confirmation.
|
|
198
|
+
|
|
199
|
+
## 13. Multi-App Coordination
|
|
200
|
+
|
|
201
|
+
An all-app deploy creates one release group.
|
|
202
|
+
|
|
203
|
+
Rules:
|
|
204
|
+
|
|
205
|
+
- Pre-traffic phases must complete for all selected apps before any app switches traffic.
|
|
206
|
+
- If any app fails before traffic switch, no app switches traffic.
|
|
207
|
+
- If any app fails after traffic switch, default to group rollback.
|
|
208
|
+
- Single-app deploys do not affect unrelated apps.
|
|
209
|
+
|
|
210
|
+
## 14. History and Validation
|
|
211
|
+
|
|
212
|
+
Write a deploy-history record for every deploy, rollback, takeover, validation, user-abort, failed deploy, or adapter gap.
|
|
213
|
+
|
|
214
|
+
Read:
|
|
215
|
+
|
|
216
|
+
- `references/deploy-history-schema.md`
|
|
217
|
+
- `references/deploy-config-schema.md`
|
|
218
|
+
- `references/live-validation-notes.md` when troubleshooting bootstrap or deploy failures
|
|
219
|
+
|
|
220
|
+
Validation is mandatory before production deploy.
|
|
@@ -1,71 +1,82 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "prizmkit-implement"
|
|
3
|
-
description: "Execute plan.md tasks with TDD approach. Respects task ordering and dependencies. Use after /prizmkit-plan. Trigger on: 'implement', 'build', 'code it', 'start coding', 'execute', 'write the code'. (project)"
|
|
3
|
+
description: "Execute plan.md tasks with a TDD-oriented approach. Respects task ordering, checkpoints, and dependencies for Fast path or Full path change artifacts. Reads Prizm docs before editing; when relevant L2 docs are missing, falls back to target source files and lets /prizmkit-retrospective create L2 later if needed. Use after /prizmkit-plan. Trigger on: 'implement', 'build', 'code it', 'start coding', 'execute', 'write the code'. (project)"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# PrizmKit Implement
|
|
7
7
|
|
|
8
8
|
### When to Use
|
|
9
9
|
- After `/prizmkit-plan` when ready to write code
|
|
10
|
-
-
|
|
11
|
-
-
|
|
10
|
+
- Fast path or Full path has a `plan.md` with unchecked tasks
|
|
11
|
+
- User says "implement", "build", "code it", "start coding", "develop", or "execute"
|
|
12
12
|
|
|
13
13
|
### When NOT to Use
|
|
14
|
-
- No plan.md exists — run
|
|
15
|
-
- All tasks in plan.md are
|
|
16
|
-
-
|
|
17
|
-
-
|
|
14
|
+
- No `plan.md` exists and the task is not a Direct edit — run `/prizmkit-plan` first
|
|
15
|
+
- All tasks in `plan.md` are checked off
|
|
16
|
+
- Direct edit: typo, pure formatting, small docs edit, or tiny config tweak with no behavior impact
|
|
17
|
+
- User is still asking for design/planning rather than implementation
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
## Preconditions
|
|
20
20
|
|
|
21
21
|
| Required Artifact | Check | If Missing |
|
|
22
22
|
|---|---|---|
|
|
23
|
-
| `plan.md` with Tasks section | File exists
|
|
24
|
-
| `spec.md` | File exists in same directory
|
|
23
|
+
| `plan.md` with Tasks section | File exists and has unchecked tasks | Run `/prizmkit-plan` |
|
|
24
|
+
| `spec.md` | File exists in same artifact directory | Run `/prizmkit-plan` |
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
## Input
|
|
29
|
-
|
|
30
|
-
| Parameter | Required | Description |
|
|
31
|
-
|-----------|----------|-------------|
|
|
32
|
-
| `artifact_dir` | No | Directory containing spec.md + plan.md. If omitted, auto-detect per precondition above. |
|
|
26
|
+
Artifact directory: accept `artifact_dir` from caller. If not provided, scan `.prizmkit/` subdirectories for the most recently modified `plan.md` with unchecked tasks. When invoked as a handoff step, reuse the previous skill's `artifact_dir`; re-detection can select the wrong change artifact in a multi-task workspace.
|
|
33
27
|
|
|
34
28
|
## Context Loading
|
|
35
29
|
|
|
36
30
|
Before implementation, load context once:
|
|
37
31
|
|
|
38
|
-
1. **Task context**:
|
|
39
|
-
2. **Architecture context**:
|
|
40
|
-
|
|
32
|
+
1. **Task context**: read `plan.md` and `spec.md`. If companion documents exist in the artifact directory, read only those relevant to the change.
|
|
33
|
+
2. **Architecture context**:
|
|
34
|
+
- Read `.prizmkit/prizm-docs/root.prizm`.
|
|
35
|
+
- Read relevant L1 docs for affected modules.
|
|
36
|
+
- Read relevant L2 docs when they exist, especially INTERFACES, TRAPS, and DECISIONS.
|
|
37
|
+
- If a relevant L2 doc does not exist, read the target source files as fallback and note that no L2 was available. Do not stop implementation only because L2 is missing; `/prizmkit-retrospective` can create L2 after the change if durable detail exists.
|
|
38
|
+
3. **Dev rules**: if root Prizm docs reference `.prizmkit/rules/<layer>-rules.md`, read the relevant rule files. If a referenced rule file is missing, skip it and continue.
|
|
41
39
|
|
|
42
|
-
|
|
40
|
+
If a dev rule conflicts with `plan.md`, call out the conflict and ask the user unless the plan clearly supersedes the rule.
|
|
43
41
|
|
|
44
42
|
## Execution
|
|
45
43
|
|
|
46
|
-
For each unchecked task in plan.md
|
|
47
|
-
|
|
48
|
-
1.
|
|
49
|
-
2. Apply TDD where applicable:
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
44
|
+
For each unchecked task in `plan.md`, in order:
|
|
45
|
+
|
|
46
|
+
1. Confirm relevant context for the target files is loaded: L1, L2 when present, or source fallback when L2 is absent.
|
|
47
|
+
2. Apply TDD where applicable:
|
|
48
|
+
- Write or update a failing test first for behavior changes.
|
|
49
|
+
- For UI-only, docs, configuration, or mechanical refactors where test-first does not apply, use the smallest meaningful verification instead.
|
|
50
|
+
3. Follow internal ID hygiene: do not place PrizmKit feature/bug/refactor IDs, task IDs, session/run IDs, branch names, absolute worktree paths, or `.prizmkit/specs` / `.prizmkit/dev-pipeline` artifact paths in `.prizmkit/prizm-docs/`, user-visible UI text, API responses, emails, notifications, or tests that assert visible product copy.
|
|
51
|
+
4. Cover relevant paths for changed logic:
|
|
52
|
+
- happy path
|
|
53
|
+
- domain-specific edge cases
|
|
54
|
+
- error conditions
|
|
55
|
+
Do not force meaningless edge/error tests when the function has none.
|
|
56
|
+
5. Avoid redundant tests. Check existing coverage before adding a new test; each new test should exercise a distinct behavior or boundary.
|
|
57
|
+
6. Test your own code and integration points, not framework internals, third-party library internals, or language built-ins.
|
|
58
|
+
7. Mark the task as `[x]` immediately after completion. Immediate marking makes interrupted sessions resumable.
|
|
59
|
+
8. Respect task semantics:
|
|
60
|
+
- Sequential tasks stop on failure when later tasks depend on them.
|
|
61
|
+
- `[P]` tasks may run in parallel within the same safe group.
|
|
62
|
+
- `CP:` checkpoint tasks require build/tests/verification specified by the plan before continuing.
|
|
63
|
+
9. After all tasks complete, run the verification appropriate to the chosen path and risk. Full test orchestration via `/prizmkit-test` is risk-triggered, not mandatory for every change.
|
|
58
64
|
|
|
59
65
|
## Recovery
|
|
60
66
|
|
|
61
|
-
If a session is interrupted
|
|
62
|
-
- Completed tasks are already marked `[x]` in plan.md (because we mark immediately)
|
|
63
|
-
- Resume by re-running `/prizmkit-implement` — it picks up from the first unchecked `[ ]` task
|
|
67
|
+
If a session is interrupted:
|
|
64
68
|
|
|
65
|
-
|
|
69
|
+
- Completed tasks should already be marked `[x]`.
|
|
70
|
+
- Re-run `/prizmkit-implement`; it resumes from the first unchecked task.
|
|
71
|
+
- If partially edited files exist without a completed task marker, inspect the diff and either finish the task or revert incomplete work before continuing.
|
|
66
72
|
|
|
67
73
|
## Output
|
|
68
74
|
|
|
69
|
-
- Code files created/modified as specified in plan.md
|
|
70
|
-
- `plan.md` Tasks section updated with
|
|
71
|
-
- Implementation summary
|
|
75
|
+
- Code files created/modified as specified in `plan.md`
|
|
76
|
+
- `plan.md` Tasks section updated with `[x]` markers
|
|
77
|
+
- Implementation summary
|
|
78
|
+
- Suggested next step:
|
|
79
|
+
- Full path or review-triggered risk: `/prizmkit-code-review`
|
|
80
|
+
- Risk-triggered testing: `/prizmkit-test`
|
|
81
|
+
- Docs/durable knowledge changed: `/prizmkit-retrospective`
|
|
82
|
+
- Otherwise: `/prizmkit-committer`
|
|
@@ -14,8 +14,9 @@ Project takeover and bootstrap skill. Scans any project (brownfield or greenfiel
|
|
|
14
14
|
- After `npx prizmkit install` when project has no `.prizmkit/prizm-docs/`
|
|
15
15
|
|
|
16
16
|
### When NOT to Use
|
|
17
|
-
- All artifacts exist and are up to date → use `/prizmkit-prizm-docs`
|
|
18
|
-
-
|
|
17
|
+
- All artifacts exist and are up to date → skip init; use `/prizmkit-prizm-docs` Status/Validate for health checks
|
|
18
|
+
- Docs drifted outside the normal development loop (manual edits, merge, branch switch) → use `/prizmkit-prizm-docs` Update/Rebuild for repair
|
|
19
|
+
- Normal development just finished and docs need syncing → use `/prizmkit-retrospective`, not init
|
|
19
20
|
- User wants to start a feature on an already-initialized project → skip init, go to `/prizmkit-plan`
|
|
20
21
|
|
|
21
22
|
### Error Handling
|
|
@@ -182,7 +183,7 @@ Invoke prizmkit-prizm-docs (Init operation), passing the two-tier module structu
|
|
|
182
183
|
- Generate `root.prizm` (L0) with project meta and MODULE_INDEX listing only top-level modules. If module count > 15, use MODULE_GROUPS format instead (group by functional domain).
|
|
183
184
|
- For each module entry in MODULE_INDEX/MODULE_GROUPS, include keyword tags extracted from the module's source files — scan for: exported symbols, imported packages, domain terms in file/directory names. Format: `- module-name [tag1, tag2, tag3]: ...`. Tags help AI match user intent to relevant modules.
|
|
184
185
|
- Generate L1 docs for top-level modules at `.prizmkit/prizm-docs/<M>.prizm` and for sub-modules at `.prizmkit/prizm-docs/<M>/<S>.prizm`
|
|
185
|
-
- Skip L2 (lazy generation) — L2 is
|
|
186
|
+
- Skip L2 (lazy generation) — L2 is created later by `/prizmkit-retrospective` when a changed module has meaningful behavior or durable knowledge. During implementation, if an affected L2 is missing, `/prizmkit-implement` reads the target source files as fallback instead of blocking.
|
|
186
187
|
- Do not create auxiliary `changelog.prizm`, CHANGELOG sections/files, UPDATED/date metadata, feature/bug/refactor/task/session/run/pipeline/workflow IDs, branch names, absolute worktree paths, or `.prizmkit/specs` / `.prizmkit/dev-pipeline` artifact paths; git history is the source of change history
|
|
187
188
|
|
|
188
189
|
**Phase 6: Workspace Initialization**
|
|
@@ -1,102 +1,117 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "prizmkit-plan"
|
|
3
|
-
description: "Specify and plan tasks: natural language → spec.md
|
|
3
|
+
description: "Specify and plan development tasks: natural language → change artifact with spec.md and plan.md. Works for features, bug fixes, refactors, migrations, and other non-trivial changes. Use before /prizmkit-implement when the task needs written scope, design, or executable tasks; use simplified planning for Fast path changes and full planning for high-risk or multi-module work. Trigger on: 'specify', 'plan', 'new task', 'I want to add/build...', 'architect', 'design', 'break it down', 'create tasks'. (project)"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# PrizmKit Plan
|
|
7
7
|
|
|
8
|
-
A universal spec + plan generator.
|
|
8
|
+
A universal spec + plan generator. It turns a natural-language development task into a **change artifact**: `spec.md` (WHAT/WHY) and `plan.md` (HOW + Tasks).
|
|
9
|
+
|
|
10
|
+
A change artifact is not feature-only. It can describe a feature, bug fix, refactor, migration, test improvement, or other scoped change.
|
|
9
11
|
|
|
10
12
|
### When to Use
|
|
11
|
-
- Any non-trivial development task that benefits from written
|
|
12
|
-
- Before `/prizmkit-implement`
|
|
13
|
-
-
|
|
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"
|
|
14
18
|
|
|
15
19
|
### When NOT to Use
|
|
16
|
-
-
|
|
17
|
-
-
|
|
20
|
+
- Direct edit: typo, pure formatting, small docs edit, or tiny config tweak with no behavior impact
|
|
21
|
+
- User explicitly asks for a one-off direct edit and the risk is low
|
|
22
|
+
- A current artifact directory already has an adequate `spec.md` + `plan.md` for the requested work
|
|
23
|
+
|
|
24
|
+
## Path Selection
|
|
25
|
+
|
|
26
|
+
Choose the lightest planning depth that protects correctness:
|
|
27
|
+
|
|
28
|
+
| Path | Planning behavior |
|
|
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. |
|
|
33
|
+
|
|
34
|
+
Use Full path for high-risk, multi-module, public API, data model, security, permission, payment, deployment-impacting, or ambiguous work. Use Fast path for small scoped behavior changes. Explain the chosen path briefly.
|
|
18
35
|
|
|
19
36
|
## Input
|
|
20
37
|
|
|
21
38
|
| Parameter | Required | Description |
|
|
22
39
|
|-----------|----------|-------------|
|
|
23
40
|
| `description` | Yes | Natural-language description of the task |
|
|
24
|
-
| `artifact_dir` | No | Directory to write
|
|
41
|
+
| `artifact_dir` | No | Directory to write the change artifact into. If omitted, auto-generates under `.prizmkit/specs/` using a numbered slug. |
|
|
25
42
|
|
|
26
43
|
## Execution
|
|
27
44
|
|
|
28
|
-
### Phase 0: Specify (
|
|
45
|
+
### Phase 0: Specify (`spec.md`)
|
|
29
46
|
|
|
30
|
-
|
|
47
|
+
Skip this phase if `spec.md` already exists in the artifact directory and still matches the requested change.
|
|
31
48
|
|
|
32
|
-
|
|
49
|
+
Steps:
|
|
33
50
|
|
|
34
|
-
1. Gather
|
|
51
|
+
1. Gather the task description. If missing and interactive, ask the user; otherwise abort with a clear error.
|
|
35
52
|
2. Determine artifact directory:
|
|
36
|
-
- If `artifact_dir` is provided
|
|
37
|
-
- If
|
|
38
|
-
-
|
|
39
|
-
3. Load project context: read `.prizmkit/prizm-docs/root.prizm` and relevant L1/L2 docs
|
|
40
|
-
4. Generate `spec.md` from
|
|
41
|
-
-
|
|
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
|
-
- Interface design (API endpoints, request/response formats)
|
|
68
|
-
- Testing strategy
|
|
53
|
+
- If `artifact_dir` is provided, use it directly.
|
|
54
|
+
- If omitted, scan `.prizmkit/specs/` for existing numbered directories and create `.prizmkit/specs/###-task-slug/`.
|
|
55
|
+
- The `.prizmkit/specs/` path is a generic change-artifact location; it is not limited to features.
|
|
56
|
+
3. Load project context: read `.prizmkit/prizm-docs/root.prizm` and relevant L1/L2 docs. If L2 is missing for an affected module, use relevant source files as fallback context.
|
|
57
|
+
4. Generate `spec.md` from `${SKILL_DIR}/assets/spec-template.md`:
|
|
58
|
+
- Focus on WHAT and WHY, not HOW.
|
|
59
|
+
- Include only relevant sections.
|
|
60
|
+
- Every goal needs acceptance criteria.
|
|
61
|
+
- Mark genuine ambiguity with `[NEEDS CLARIFICATION]`.
|
|
62
|
+
5. If changes involve persistence, add a Data Model section. Read existing schema files to learn naming conventions, ID strategy, constraints, and migration patterns.
|
|
63
|
+
6. Resolve `[NEEDS CLARIFICATION]` markers:
|
|
64
|
+
- Interactive: ask targeted questions using `${SKILL_DIR}/references/clarify-guide.md`.
|
|
65
|
+
- Non-interactive: choose conservative defaults and annotate the decision.
|
|
66
|
+
|
|
67
|
+
Internal ID hygiene: PrizmKit IDs, task IDs, session/run IDs, branch names, absolute worktree paths, and `.prizmkit/specs` / `.prizmkit/dev-pipeline` artifact paths are internal metadata. They may appear in change artifacts, but do not write them into `.prizmkit/prizm-docs/`, product UI copy, API responses, emails, notifications, or expected user-visible test strings.
|
|
68
|
+
|
|
69
|
+
### Phase 1: Design (`plan.md`)
|
|
70
|
+
|
|
71
|
+
Precondition: `spec.md` exists.
|
|
72
|
+
|
|
73
|
+
Steps:
|
|
74
|
+
|
|
75
|
+
1. Read `spec.md`.
|
|
76
|
+
2. Load project context if not already loaded: root Prizm doc, relevant L1/L2 docs, and source fallback for missing L2 docs.
|
|
77
|
+
3. Resolve any remaining clarification markers.
|
|
78
|
+
4. Generate `plan.md` from `${SKILL_DIR}/assets/plan-template.md`:
|
|
79
|
+
- Change approach
|
|
80
|
+
- Component/file changes
|
|
81
|
+
- Data model changes and migration approach when relevant
|
|
82
|
+
- Interface/API contract design when relevant
|
|
83
|
+
- Testing strategy, using risk-triggered `/prizmkit-test` criteria
|
|
69
84
|
- Risk assessment
|
|
70
|
-
- Behavior preservation strategy
|
|
71
|
-
5. Cross-check
|
|
72
|
-
6. Check alignment with `.prizmkit/prizm-docs/root.prizm` RULES
|
|
85
|
+
- Behavior preservation strategy for refactors or behavior-adjacent changes
|
|
86
|
+
5. Cross-check every spec goal maps to a plan component.
|
|
87
|
+
6. Check alignment with `.prizmkit/prizm-docs/root.prizm` RULES.
|
|
88
|
+
|
|
89
|
+
### Phase 2: Task Generation
|
|
90
|
+
|
|
91
|
+
1. Choose task strategy: MVP-first, incremental, or parallel. Ask in interactive mode when the choice affects execution; otherwise infer from risk and dependencies.
|
|
92
|
+
2. Append `## Tasks` to `plan.md` using `${SKILL_DIR}/assets/plan-template.md`:
|
|
93
|
+
- Setup tasks
|
|
94
|
+
- Foundation tasks
|
|
95
|
+
- Core tasks mapped to goals or logical units
|
|
96
|
+
- Polish tasks when needed
|
|
97
|
+
- Checkpoint tasks between phases when integration risk exists
|
|
98
|
+
3. Mark parallel tasks with `[P]` only when they can safely run independently.
|
|
99
|
+
4. Run the verification checklist from `${SKILL_DIR}/references/verification-checklist.md` and fix issues before output.
|
|
73
100
|
|
|
74
|
-
|
|
101
|
+
## Output
|
|
75
102
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
103
|
+
| Directory | Files |
|
|
104
|
+
|---|---|
|
|
105
|
+
| `artifact_dir` or auto-generated `.prizmkit/specs/###-slug/` | `spec.md` + `plan.md` |
|
|
106
|
+
|
|
107
|
+
Report:
|
|
108
|
+
- artifact directory
|
|
109
|
+
- chosen path: Fast path or Full path
|
|
110
|
+
- key decisions
|
|
111
|
+
- task count and checkpoint summary
|
|
84
112
|
|
|
85
113
|
**HANDOFF:** `/prizmkit-implement`
|
|
86
114
|
|
|
87
115
|
## Examples
|
|
88
116
|
|
|
89
117
|
Read `${SKILL_DIR}/references/examples.md` for worked examples of feature, refactoring, and bug fix planning.
|
|
90
|
-
|
|
91
|
-
## References
|
|
92
|
-
|
|
93
|
-
- Spec template: `${SKILL_DIR}/assets/spec-template.md`
|
|
94
|
-
- Plan template: `${SKILL_DIR}/assets/plan-template.md`
|
|
95
|
-
- Clarification guide: `${SKILL_DIR}/references/clarify-guide.md`
|
|
96
|
-
- Verification checklist: `${SKILL_DIR}/references/verification-checklist.md`
|
|
97
|
-
|
|
98
|
-
## Output
|
|
99
|
-
|
|
100
|
-
| Directory | Files |
|
|
101
|
-
|---|---|
|
|
102
|
-
| `artifact_dir` (provided or auto-generated `.prizmkit/specs/###-slug/`) | `spec.md` + `plan.md` |
|