prizmkit 1.0.152 → 1.1.0
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/bin/create-prizmkit.js +27 -2
- package/bundled/VERSION.json +3 -3
- package/bundled/adapters/claude/paths.js +1 -1
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +482 -57
- package/bundled/dev-pipeline/scripts/parse-stream-progress.py +2 -6
- package/bundled/dev-pipeline/templates/bootstrap-tier1.md +48 -8
- package/bundled/dev-pipeline/templates/bootstrap-tier2.md +54 -1
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +47 -10
- package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +11 -0
- package/bundled/dev-pipeline/templates/sections/critical-paths-agent.md +9 -0
- package/bundled/dev-pipeline/templates/sections/critical-paths-full.md +12 -0
- package/bundled/dev-pipeline/templates/sections/critical-paths-lite.md +7 -0
- package/bundled/dev-pipeline/templates/sections/directory-convention-agent.md +8 -0
- package/bundled/dev-pipeline/templates/sections/directory-convention-full.md +9 -0
- package/bundled/dev-pipeline/templates/sections/directory-convention-lite.md +6 -0
- package/bundled/dev-pipeline/templates/sections/failure-capture.md +21 -0
- package/bundled/dev-pipeline/templates/sections/failure-log-check.md +8 -0
- package/bundled/dev-pipeline/templates/sections/feature-context.md +23 -0
- package/bundled/dev-pipeline/templates/sections/phase-analyze-agent.md +15 -0
- package/bundled/dev-pipeline/templates/sections/phase-analyze-full.md +15 -0
- package/bundled/dev-pipeline/templates/sections/phase-browser-verification.md +31 -0
- package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +36 -0
- package/bundled/dev-pipeline/templates/sections/phase-commit.md +26 -0
- package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-agent-suffix.md +14 -0
- package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-base.md +20 -0
- package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-lite-suffix.md +3 -0
- package/bundled/dev-pipeline/templates/sections/phase-critic-code.md +24 -0
- package/bundled/dev-pipeline/templates/sections/phase-critic-plan-full.md +45 -0
- package/bundled/dev-pipeline/templates/sections/phase-critic-plan.md +24 -0
- package/bundled/dev-pipeline/templates/sections/phase-deploy-verification.md +36 -0
- package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +24 -0
- package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +41 -0
- package/bundled/dev-pipeline/templates/sections/phase-implement-lite.md +32 -0
- package/bundled/dev-pipeline/templates/sections/phase-plan-agent.md +17 -0
- package/bundled/dev-pipeline/templates/sections/phase-plan-lite.md +16 -0
- package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +28 -0
- package/bundled/dev-pipeline/templates/sections/phase-review-full.md +36 -0
- package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +82 -0
- package/bundled/dev-pipeline/templates/sections/phase0-init.md +4 -0
- package/bundled/dev-pipeline/templates/sections/phase0-test-baseline.md +12 -0
- package/bundled/dev-pipeline/templates/sections/resume-header.md +2 -0
- package/bundled/dev-pipeline/templates/sections/session-context.md +6 -0
- package/bundled/dev-pipeline/templates/sections/subagent-timeout-recovery.md +6 -0
- package/bundled/skills/_metadata.json +21 -177
- package/bundled/skills/app-planner/SKILL.md +22 -3
- package/bundled/skills/app-planner/references/project-brief-guide.md +110 -0
- package/bundled/skills/bug-fix-workflow/SKILL.md +4 -0
- package/bundled/skills/bug-planner/SKILL.md +2 -2
- package/bundled/skills/dev-pipeline-launcher/SKILL.md +1 -1
- package/bundled/skills/prizm-kit/SKILL.md +18 -47
- package/bundled/skills/prizm-kit/assets/project-memory-template.md +1 -1
- package/bundled/skills/prizmkit-analyze/SKILL.md +4 -4
- package/bundled/skills/prizmkit-init/SKILL.md +4 -4
- package/bundled/skills/prizmkit-plan/SKILL.md +126 -108
- package/bundled/skills/prizmkit-plan/assets/plan-template.md +1 -2
- package/bundled/skills/refactor-workflow/SKILL.md +142 -124
- package/bundled/team/prizm-dev-team.json +2 -8
- package/package.json +1 -1
- package/src/clean.js +8 -0
- package/src/gitignore-template.js +12 -0
- package/src/index.js +3 -22
- package/src/scaffold.js +20 -11
- package/src/upgrade.js +6 -31
- package/bundled/skills/prizmkit-clarify/SKILL.md +0 -93
- package/bundled/skills/prizmkit-specify/SKILL.md +0 -118
- package/bundled/skills/prizmkit-specify/assets/spec-template.md +0 -56
- package/bundled/skills/prizmkit-tool-adr-manager/SKILL.md +0 -67
- package/bundled/skills/prizmkit-tool-adr-manager/assets/adr-template.md +0 -26
- package/bundled/skills/prizmkit-tool-api-doc-generator/SKILL.md +0 -55
- package/bundled/skills/prizmkit-tool-bug-reproducer/SKILL.md +0 -61
- package/bundled/skills/prizmkit-tool-ci-cd-generator/SKILL.md +0 -53
- package/bundled/skills/prizmkit-tool-db-migration/SKILL.md +0 -64
- package/bundled/skills/prizmkit-tool-dependency-health/SKILL.md +0 -122
- package/bundled/skills/prizmkit-tool-deployment-strategy/SKILL.md +0 -57
- package/bundled/skills/prizmkit-tool-error-triage/SKILL.md +0 -54
- package/bundled/skills/prizmkit-tool-log-analyzer/SKILL.md +0 -54
- package/bundled/skills/prizmkit-tool-monitoring-setup/SKILL.md +0 -74
- package/bundled/skills/prizmkit-tool-onboarding-generator/SKILL.md +0 -69
- package/bundled/skills/prizmkit-tool-perf-profiler/SKILL.md +0 -54
- package/bundled/skills/prizmkit-tool-security-audit/SKILL.md +0 -129
- package/bundled/skills/prizmkit-tool-tech-debt-tracker/SKILL.md +0 -138
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
### Plan Challenge — Critic Agent(s)
|
|
2
|
+
|
|
3
|
+
**Guard**: Verify critic agent file exists before spawning:
|
|
4
|
+
```bash
|
|
5
|
+
ls {{CRITIC_SUBAGENT_PATH}} 2>/dev/null && echo "CRITIC:READY" || echo "CRITIC:MISSING"
|
|
6
|
+
```
|
|
7
|
+
If CRITIC:MISSING — skip this phase entirely and proceed. Log: "Critic agent not installed — skipping Plan Challenge."
|
|
8
|
+
|
|
9
|
+
**Choose ONE path based on `{{CRITIC_COUNT}}`:**
|
|
10
|
+
|
|
11
|
+
**If {{CRITIC_COUNT}} = 1 → Single Critic** (skip to CP-2.5 after this):
|
|
12
|
+
|
|
13
|
+
Spawn Critic agent (Agent tool, subagent_type="prizm-dev-team-critic", run_in_background=false).
|
|
14
|
+
|
|
15
|
+
Prompt:
|
|
16
|
+
> "Read {{CRITIC_SUBAGENT_PATH}}. For feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}):
|
|
17
|
+
> **MODE: Plan Challenge**
|
|
18
|
+
> 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST — Section 3 has project context, Section 4 has file manifest.
|
|
19
|
+
> 2. Read `.prizm-docs/root.prizm` and relevant L1/L2 docs for affected modules.
|
|
20
|
+
> 3. Read existing source files in the modules this plan touches.
|
|
21
|
+
> 4. Challenge plan.md against the project's existing architecture, patterns, and style.
|
|
22
|
+
> Write `.prizmkit/specs/{{FEATURE_SLUG}}/challenge-report.md` with findings (or 'No significant challenges')."
|
|
23
|
+
|
|
24
|
+
**If {{CRITIC_COUNT}} = 3 → Multi-Critic Voting** (skip Single Critic above):
|
|
25
|
+
|
|
26
|
+
Spawn 3 Critic agents sequentially (each with run_in_background=false), each with a different focus lens:
|
|
27
|
+
|
|
28
|
+
Critic-A prompt (append to base prompt above):
|
|
29
|
+
> "**Focus Lens: Architecture & Scalability.** Prioritize: architectural pattern fit, scalability implications, over-engineering risks, component boundary design.
|
|
30
|
+
> Write `.prizmkit/specs/{{FEATURE_SLUG}}/challenge-report-A.md`."
|
|
31
|
+
|
|
32
|
+
Critic-B prompt (append to base prompt above):
|
|
33
|
+
> "**Focus Lens: Data Model & Edge Cases.** Prioritize: data model design fit, entity relationships, edge cases in business logic, missing boundary conditions.
|
|
34
|
+
> Write `.prizmkit/specs/{{FEATURE_SLUG}}/challenge-report-B.md`."
|
|
35
|
+
|
|
36
|
+
Critic-C prompt (append to base prompt above):
|
|
37
|
+
> "**Focus Lens: Security & Performance.** Prioritize: security attack surface, authentication/authorization gaps, performance bottlenecks, resource leaks.
|
|
38
|
+
> Write `.prizmkit/specs/{{FEATURE_SLUG}}/challenge-report-C.md`."
|
|
39
|
+
|
|
40
|
+
After all critics return, read all 3 reports:
|
|
41
|
+
- Challenge raised by **2/3 or more** critics → **must respond** (adjust plan or justify why not)
|
|
42
|
+
- Challenge raised by **1/3 only** → logged in context-snapshot but not blocking
|
|
43
|
+
- Max 1 plan revision round.
|
|
44
|
+
|
|
45
|
+
**CP-2.5**: Plan challenges reviewed and resolved.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
### Plan Challenge — Critic Agent
|
|
2
|
+
|
|
3
|
+
**Guard**: Verify critic agent file exists before spawning:
|
|
4
|
+
```bash
|
|
5
|
+
ls {{CRITIC_SUBAGENT_PATH}} 2>/dev/null && echo "CRITIC:READY" || echo "CRITIC:MISSING"
|
|
6
|
+
```
|
|
7
|
+
If CRITIC:MISSING — skip this phase entirely and proceed. Log: "Critic agent not installed — skipping Plan Challenge."
|
|
8
|
+
|
|
9
|
+
Spawn Critic agent (Agent tool, subagent_type="prizm-dev-team-critic", run_in_background=false).
|
|
10
|
+
|
|
11
|
+
Prompt:
|
|
12
|
+
> "Read {{CRITIC_SUBAGENT_PATH}}. For feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}):
|
|
13
|
+
> **MODE: Plan Challenge**
|
|
14
|
+
> 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST — Section 3 has project context, Section 4 has file manifest.
|
|
15
|
+
> 2. Read `.prizm-docs/root.prizm` and relevant L1/L2 docs for affected modules.
|
|
16
|
+
> 3. Read existing source files in the modules this plan touches.
|
|
17
|
+
> 4. Challenge plan.md against the project's existing architecture, patterns, and style.
|
|
18
|
+
> Write `.prizmkit/specs/{{FEATURE_SLUG}}/challenge-report.md` with findings (or 'No significant challenges')."
|
|
19
|
+
|
|
20
|
+
Wait for Critic to return.
|
|
21
|
+
- Read challenge-report.md. For items marked CRITICAL/HIGH: decide whether to adjust plan.md or document why the plan stands.
|
|
22
|
+
- Max 1 plan revision round.
|
|
23
|
+
|
|
24
|
+
**CP-2.5**: Plan challenges reviewed and resolved.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
### Local Deploy Verification
|
|
2
|
+
|
|
3
|
+
You just implemented this feature — you know the project's tech stack and build tools.
|
|
4
|
+
|
|
5
|
+
1. **Build**: Run the project's build/compile commands. If a required tool is missing, install it first.
|
|
6
|
+
2. **Fix**: If build fails with code errors (type errors, missing imports, config issues), fix them (max 2 rounds), then re-verify.
|
|
7
|
+
3. **Assess and record** — append to context-snapshot.md:
|
|
8
|
+
- **ALL builds pass** → `## Deploy Verification: PASS` — proceed to commit
|
|
9
|
+
- **Some builds fail with fixable errors** → fix and re-verify (already handled in step 2)
|
|
10
|
+
- **Cannot build locally** (missing system-level deps you cannot install) → Generate `DEPLOY.md` with:
|
|
11
|
+
```
|
|
12
|
+
# Local Development Setup
|
|
13
|
+
|
|
14
|
+
## Prerequisites
|
|
15
|
+
- [tool]: [install instruction]
|
|
16
|
+
|
|
17
|
+
## Build Steps
|
|
18
|
+
1. [exact command]
|
|
19
|
+
|
|
20
|
+
## Run / Dev Mode
|
|
21
|
+
[exact command to start the app locally]
|
|
22
|
+
|
|
23
|
+
## Verify
|
|
24
|
+
[how to confirm the app is running correctly]
|
|
25
|
+
```
|
|
26
|
+
Record: `## Deploy Verification: PARTIAL — see DEPLOY.md for missing prerequisites`
|
|
27
|
+
|
|
28
|
+
Deploy verification does NOT block the commit, but you MUST attempt it.
|
|
29
|
+
|
|
30
|
+
**Smoke test** (only if build passed and project can be started):
|
|
31
|
+
1. Start the project locally (e.g., `make dev`, `npm start`, `go run .`, etc.)
|
|
32
|
+
2. Verify basic functionality: hit key endpoints, check health routes, confirm the UI loads
|
|
33
|
+
3. Stop the server process you started — do NOT leave it running
|
|
34
|
+
4. Record smoke test results in `## Deploy Verification` section
|
|
35
|
+
|
|
36
|
+
If the project cannot be started locally (e.g., requires external services, databases, credentials), skip the smoke test and note why.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
### Implement — Dev Subagent
|
|
2
|
+
|
|
3
|
+
**Build artifacts rule** (passed to Dev): After any build/compile command (`go build`, `npm run build`, `tsc`, etc.), ensure the output binary or build directory is in `.gitignore`. Never commit compiled binaries, build output, or generated artifacts.
|
|
4
|
+
|
|
5
|
+
Spawn Dev subagent (Agent tool, subagent_type="prizm-dev-team-dev", run_in_background=false).
|
|
6
|
+
|
|
7
|
+
Prompt:
|
|
8
|
+
> "Read {{DEV_SUBAGENT_PATH}}. Implement feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}).
|
|
9
|
+
> **IMPORTANT**: Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST — Section 3 has Prizm Context (TRAPS/RULES), Section 4 has File Manifest with paths and interfaces.
|
|
10
|
+
> ⚠️ DO NOT re-read source files already listed in Section 4 File Manifest unless you need implementation detail beyond the interface summary.
|
|
11
|
+
> 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` for full context.
|
|
12
|
+
> 2. Run `/prizmkit-implement` to execute the tasks in plan.md. Use `TEST_CMD=<TEST_CMD>` for testing. Baseline failures: `BASELINE_FAILURES=<BASELINE_FAILURES>`.
|
|
13
|
+
> 3. After implement completes, verify the '## Implementation Log' section was written to context-snapshot.md.
|
|
14
|
+
> 4. Do NOT execute any git commands (no git add/commit/reset/push).
|
|
15
|
+
> Do NOT exit until all tasks are [x] and the '## Implementation Log' section is written in context-snapshot.md."
|
|
16
|
+
|
|
17
|
+
Wait for Dev to return. All tasks must be `[x]`, tests pass.
|
|
18
|
+
|
|
19
|
+
**Gate Check — Implementation Log**:
|
|
20
|
+
After Dev agent returns, verify the Implementation Log was written:
|
|
21
|
+
```bash
|
|
22
|
+
grep -q "## Implementation Log" .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md && echo "GATE:PASS" || echo "GATE:MISSING"
|
|
23
|
+
```
|
|
24
|
+
If GATE:MISSING — send message to Dev (re-spawn if needed): "Write the '## Implementation Log' section to context-snapshot.md before I can proceed to review. Include: files changed/created, key decisions, deviations from plan, notable discoveries."
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
### Implement — Dev Agent
|
|
2
|
+
|
|
3
|
+
**Build artifacts rule** (passed to Dev): After any build/compile command (`go build`, `npm run build`, `tsc`, etc.), ensure the output binary or build directory is in `.gitignore`. Never commit compiled binaries, build output, or generated artifacts.
|
|
4
|
+
|
|
5
|
+
Before spawning Dev, check plan.md Tasks section:
|
|
6
|
+
```bash
|
|
7
|
+
grep -c '^\- \[ \]' .prizmkit/specs/{{FEATURE_SLUG}}/plan.md 2>/dev/null || true
|
|
8
|
+
```
|
|
9
|
+
- If result is `0` (all tasks already `[x]`) → **SKIP this phase**, go directly to Review. Do NOT spawn Dev.
|
|
10
|
+
- If result is non-zero → spawn Dev agent below.
|
|
11
|
+
|
|
12
|
+
Spawn Dev agent (Agent tool, subagent_type="prizm-dev-team-dev", run_in_background=false).
|
|
13
|
+
|
|
14
|
+
Prompt:
|
|
15
|
+
> "Read {{DEV_SUBAGENT_PATH}}. Implement feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}).
|
|
16
|
+
> **IMPORTANT**: Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST — Section 3 has Prizm Context (TRAPS/RULES), Section 4 has File Manifest with paths and interfaces.
|
|
17
|
+
> ⚠️ DO NOT re-read source files already listed in Section 4 File Manifest unless you need implementation detail beyond the interface summary.
|
|
18
|
+
> 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` for full context.
|
|
19
|
+
> 2. Run `/prizmkit-implement` to execute the tasks in plan.md. Use `TEST_CMD=<TEST_CMD>` for testing. Baseline failures: `BASELINE_FAILURES=<BASELINE_FAILURES>`.
|
|
20
|
+
> 3. After implement completes, verify the '## Implementation Log' section was written to context-snapshot.md.
|
|
21
|
+
> 4. Do NOT execute any git commands (no git add/commit/reset/push).
|
|
22
|
+
> Do NOT exit until all tasks are [x] and the '## Implementation Log' section is written in context-snapshot.md."
|
|
23
|
+
|
|
24
|
+
**Gate Check — Implementation Log**:
|
|
25
|
+
After Dev agent returns, verify the Implementation Log was written:
|
|
26
|
+
```bash
|
|
27
|
+
grep -q "## Implementation Log" .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md && echo "GATE:PASS" || echo "GATE:MISSING"
|
|
28
|
+
```
|
|
29
|
+
If GATE:MISSING — send message to Dev (re-spawn if needed): "Write the '## Implementation Log' section to context-snapshot.md before I can proceed to review. Include: files changed/created, key decisions, deviations from plan, notable discoveries."
|
|
30
|
+
|
|
31
|
+
Wait for Dev to return. **If Dev times out before all tasks are `[x]`**:
|
|
32
|
+
1. Check progress: `grep -c '^\- \[ \]' .prizmkit/specs/{{FEATURE_SLUG}}/plan.md`
|
|
33
|
+
2. If any tasks remain: re-spawn Dev with this recovery prompt:
|
|
34
|
+
> "Read {{DEV_SUBAGENT_PATH}}. You are resuming implementation of feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}).
|
|
35
|
+
> 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` — Section 4 has File Manifest, 'Implementation Log' (if present) shows what was already done.
|
|
36
|
+
> 2. Run `git diff HEAD` to see actual code changes already made.
|
|
37
|
+
> 3. Run `/prizmkit-implement` to complete the remaining `[ ]` tasks. Use `TEST_CMD=<TEST_CMD>` for testing.
|
|
38
|
+
> 4. Do NOT execute any git commands."
|
|
39
|
+
3. Max 2 recovery retries. After 2 failures, orchestrator implements remaining tasks directly.
|
|
40
|
+
|
|
41
|
+
All tasks `[x]`, tests pass.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
### Implement + Test
|
|
2
|
+
|
|
3
|
+
**Build artifacts**: After any build/compile command (`go build`, `npm run build`, `tsc`, etc.), ensure the output binary or build directory is in `.gitignore`:
|
|
4
|
+
```bash
|
|
5
|
+
# Example for Go
|
|
6
|
+
grep -q '^/binary-name$' .gitignore || echo '/binary-name' >> .gitignore
|
|
7
|
+
```
|
|
8
|
+
Never commit compiled binaries, build output, or generated artifacts.
|
|
9
|
+
|
|
10
|
+
**3a.** Detect test commands and record baseline:
|
|
11
|
+
|
|
12
|
+
You know this project's tech stack. Identify ALL test commands that apply (e.g., `go test ./...`, `npm test`, `cargo test`, `pytest`, `make test`, etc.). Record them as `TEST_CMDS`. Then record baseline:
|
|
13
|
+
```bash
|
|
14
|
+
# Run each test command, capture output
|
|
15
|
+
$TEST_CMD 2>&1 | tee /tmp/test-baseline.txt | tail -20
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**3b.** Run `/prizmkit-implement` — this handles the full implementation cycle:
|
|
19
|
+
- Reads plan.md Tasks section from `.prizmkit/specs/{{FEATURE_SLUG}}/`
|
|
20
|
+
- Reads context from `context-snapshot.md` (Prizm docs, TRAPS, file manifest)
|
|
21
|
+
- Implements task-by-task with TDD, marking each `[x]` immediately
|
|
22
|
+
- Creates/updates L2 `.prizm` docs when creating new modules or significantly modifying existing ones — AI selectively decides which modules warrant L2 based on complexity and importance
|
|
23
|
+
- Runs tests using `TEST_CMD` after each task
|
|
24
|
+
- Writes '## Implementation Log' to `context-snapshot.md`
|
|
25
|
+
|
|
26
|
+
**3c.** After implement completes, verify:
|
|
27
|
+
1. All tasks in plan.md are `[x]`
|
|
28
|
+
2. Run the full test suite to ensure nothing is broken
|
|
29
|
+
3. Verify each acceptance criterion from Section 1 of context-snapshot.md is met — check mentally, do NOT re-read files you already wrote
|
|
30
|
+
4. If any criterion is not met, fix it now (max 2 fix rounds)
|
|
31
|
+
|
|
32
|
+
**CP-2**: All acceptance criteria met, all tests pass.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
### Plan & Tasks
|
|
2
|
+
|
|
3
|
+
```bash
|
|
4
|
+
ls .prizmkit/specs/{{FEATURE_SLUG}}/plan.md 2>/dev/null
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
If missing, write it yourself:
|
|
8
|
+
- `plan.md`: architecture — components, interfaces, data flow, files to create/modify, testing approach, and a Tasks section with `[ ]` checkboxes ordered by dependency
|
|
9
|
+
|
|
10
|
+
**Database Design Gate** (if feature involves data persistence — new tables, schema changes, new entities):
|
|
11
|
+
Before proceeding past CP-1, verify:
|
|
12
|
+
1. Plan.md Data Model section references existing schema/model files (scan for `*.prisma`, `*.sql`, `migrations/`, `models/`, `*.entity.*` files; read them if not already in context-snapshot)
|
|
13
|
+
2. All new tables/fields follow existing naming conventions, ID strategy, timestamp patterns, and constraint style
|
|
14
|
+
3. No `[NEEDS CLARIFICATION]` remains in Data Model section — resolve by reading existing code and making a conservative choice that matches existing patterns. Document the resolution in plan.md.
|
|
15
|
+
4. If a DB design decision genuinely cannot be resolved from existing code alone, document the assumption made and flag it in the Implementation Log for user review.
|
|
16
|
+
|
|
17
|
+
**CP-1**: plan.md exists with Tasks section.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
### Plan & Tasks
|
|
2
|
+
|
|
3
|
+
```bash
|
|
4
|
+
ls .prizmkit/specs/{{FEATURE_SLUG}}/ 2>/dev/null
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
If plan.md missing, write it directly:
|
|
8
|
+
- `plan.md`: key components, data flow, files to create/modify, and a Tasks section with `[ ]` checkboxes (each task = one implementable unit). Keep under 80 lines.
|
|
9
|
+
|
|
10
|
+
**Database Design Gate** (if feature involves data persistence — new tables, schema changes, new entities):
|
|
11
|
+
Before proceeding past CP-1:
|
|
12
|
+
1. Scan for existing schema files (`*.prisma`, `*.sql`, `migrations/`, `models/`, `*.entity.*`) and read them
|
|
13
|
+
2. Ensure new tables/fields follow existing naming conventions and constraint patterns
|
|
14
|
+
3. Resolve all uncertain DB design decisions before writing Tasks — document choices in plan.md
|
|
15
|
+
|
|
16
|
+
**CP-1**: plan.md exists with Tasks section.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
### Review + Test — Reviewer Subagent
|
|
2
|
+
|
|
3
|
+
Spawn Reviewer subagent (Agent tool, subagent_type="prizm-dev-team-reviewer", run_in_background=false).
|
|
4
|
+
|
|
5
|
+
Prompt:
|
|
6
|
+
> "Read {{REVIEWER_SUBAGENT_PATH}}. For feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}):
|
|
7
|
+
> **IMPORTANT**: Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST.
|
|
8
|
+
> 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md`:
|
|
9
|
+
> - Section 3: Prizm Context (RULES, PATTERNS to check against)
|
|
10
|
+
> - Section 4: File Manifest (original file structure)
|
|
11
|
+
> - '## Implementation Log': what Dev changed, key decisions, discoveries
|
|
12
|
+
> 2. Run prizmkit-code-review (both phases): Phase 1 diagnostic review (spec compliance, code quality, correctness), then Phase 2 fix strategy formulation for any findings. Read ONLY files listed in Implementation Log for diagnosis; MAY read additional files for impact analysis.
|
|
13
|
+
> 3. Run the full test suite — **ONLY if the Implementation Log does not already confirm all tests passing**. If the log states tests passed, trust it and skip the re-run. When running: `$TEST_CMD 2>&1 | tee /tmp/review-test-out.txt | tail -20`, then grep the file for details — do NOT re-run the suite multiple times. Write and execute integration tests covering all user stories.
|
|
14
|
+
> 4. Write structured '## Review Notes' to context-snapshot.md with Fix Instructions (Root Cause, Impact, Fix Strategy, Code Guidance, Verification for each finding) and Re-Review Expectations.
|
|
15
|
+
> Report verdict: PASS, PASS_WITH_WARNINGS, or NEEDS_FIXES."
|
|
16
|
+
|
|
17
|
+
Wait for Reviewer to return.
|
|
18
|
+
|
|
19
|
+
**Gate Check — Review Notes**:
|
|
20
|
+
After Reviewer agent returns, verify the Review Notes were written:
|
|
21
|
+
```bash
|
|
22
|
+
grep -q "## Review Notes" .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md && echo "GATE:PASS" || echo "GATE:MISSING"
|
|
23
|
+
```
|
|
24
|
+
If GATE:MISSING — send message to Reviewer (re-spawn if needed): "Write the '## Review Notes' section to context-snapshot.md with structured Fix Instructions. Include: verdict, findings with Root Cause/Impact/Fix Strategy/Code Guidance/Verification, and Re-Review Expectations."
|
|
25
|
+
|
|
26
|
+
- If NEEDS_FIXES: spawn Dev to fix (Dev reads Fix Instructions in snapshot), re-run Review (max 3 rounds)
|
|
27
|
+
|
|
28
|
+
**CP-3**: Tests pass, verdict is not NEEDS_FIXES.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
### Review + Test — Reviewer Agent
|
|
2
|
+
|
|
3
|
+
Spawn Reviewer agent (Agent tool, subagent_type="prizm-dev-team-reviewer", run_in_background=false).
|
|
4
|
+
|
|
5
|
+
Prompt:
|
|
6
|
+
> "Read {{REVIEWER_SUBAGENT_PATH}}. For feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}):
|
|
7
|
+
> **IMPORTANT**: Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST.
|
|
8
|
+
> 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md`:
|
|
9
|
+
> - Section 3: Prizm Context (RULES, PATTERNS to check against)
|
|
10
|
+
> - Section 4: File Manifest (original file structure)
|
|
11
|
+
> - '## Implementation Log': what Dev changed, key decisions, discoveries
|
|
12
|
+
> 2. Run prizmkit-code-review (both phases): Phase 1 diagnostic review (spec compliance, code quality, correctness), then Phase 2 fix strategy formulation for any findings. Read ONLY files listed in Implementation Log for diagnosis; MAY read additional files for impact analysis.
|
|
13
|
+
> 3. Run the full test suite using `TEST_CMD=<TEST_CMD>` — **ONLY if the Implementation Log does not already confirm all tests passing**. If Implementation Log states tests passed, trust it and skip the re-run. When running tests: `$TEST_CMD 2>&1 | tee /tmp/review-test-out.txt | tail -20`, then grep `/tmp/review-test-out.txt` for details — do NOT re-run the suite multiple times. Write and execute integration tests covering all user stories from spec.md.
|
|
14
|
+
> 4. Write structured '## Review Notes' to context-snapshot.md with Fix Instructions (Root Cause, Impact, Fix Strategy, Code Guidance, Verification for each finding) and Re-Review Expectations.
|
|
15
|
+
> Report verdict: PASS, PASS_WITH_WARNINGS, or NEEDS_FIXES."
|
|
16
|
+
|
|
17
|
+
Wait for Reviewer to return.
|
|
18
|
+
|
|
19
|
+
**Gate Check — Review Notes**:
|
|
20
|
+
After Reviewer agent returns, verify the Review Notes were written:
|
|
21
|
+
```bash
|
|
22
|
+
grep -q "## Review Notes" .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md && echo "GATE:PASS" || echo "GATE:MISSING"
|
|
23
|
+
```
|
|
24
|
+
If GATE:MISSING — send message to Reviewer (re-spawn if needed): "Write the '## Review Notes' section to context-snapshot.md with structured Fix Instructions. Include: verdict, findings with Root Cause/Impact/Fix Strategy/Code Guidance/Verification, and Re-Review Expectations."
|
|
25
|
+
|
|
26
|
+
- If NEEDS_FIXES: spawn Dev to fix with this prompt:
|
|
27
|
+
> "Read {{DEV_SUBAGENT_PATH}}. Fix NEEDS_FIXES issues for feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}).
|
|
28
|
+
> 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` — '## Review Notes' section contains structured Fix Instructions with exact steps.
|
|
29
|
+
> 2. Follow Fix Instructions in order (respect Depends On / Blocks dependencies). Each FIX-N has: Root Cause, Fix Strategy, Code Guidance, and Verification criteria.
|
|
30
|
+
> 3. After each fix, run the Verification command listed in that FIX-N to confirm it works.
|
|
31
|
+
> 4. Use `TEST_CMD=<TEST_CMD>` to verify no regressions.
|
|
32
|
+
> 5. Append fix summary to '## Implementation Log' in context-snapshot.md.
|
|
33
|
+
> 6. Do NOT execute any git commands."
|
|
34
|
+
Then re-run Review (max 3 rounds).
|
|
35
|
+
|
|
36
|
+
**CP-3**: Integration tests pass, verdict is not NEEDS_FIXES.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
### Specify + Plan (Full Workflow)
|
|
2
|
+
|
|
3
|
+
**Check for previous failure log:**
|
|
4
|
+
```bash
|
|
5
|
+
cat .prizmkit/specs/{{FEATURE_SLUG}}/failure-log.md 2>/dev/null || echo "NO_PREVIOUS_FAILURE"
|
|
6
|
+
```
|
|
7
|
+
If failure-log.md exists:
|
|
8
|
+
- Read ROOT_CAUSE and SUGGESTION — adjust your approach accordingly
|
|
9
|
+
- Read DISCOVERED_TRAPS — if any are genuine, inject into .prizm-docs/ during Phase 6 retrospective
|
|
10
|
+
- Do NOT delete failure-log.md until this session completes all phases and commits successfully
|
|
11
|
+
|
|
12
|
+
Check existing artifacts first:
|
|
13
|
+
```bash
|
|
14
|
+
ls .prizmkit/specs/{{FEATURE_SLUG}}/ 2>/dev/null
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
- Both (spec.md, plan.md) exist → **SKIP to CP-1**
|
|
18
|
+
- `context-snapshot.md` exists → use it directly, skip context snapshot building
|
|
19
|
+
- Some missing → generate only missing files
|
|
20
|
+
|
|
21
|
+
Before planning, check whether feature code already exists in the project (search in source directories identified from `root.prizm` or the project tree scan):
|
|
22
|
+
```bash
|
|
23
|
+
grep -r "{{FEATURE_SLUG}}" . --include="*.js" --include="*.ts" --include="*.py" --include="*.go" --include="*.java" --include="*.rb" --include="*.rs" -l --exclude-dir=node_modules --exclude-dir=.git --exclude-dir=dist --exclude-dir=build --exclude-dir=vendor --exclude-dir=.prizmkit 2>/dev/null | head -20
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Record result as `EXISTING_CODE` (list of files, or empty).
|
|
27
|
+
|
|
28
|
+
If `EXISTING_CODE` is non-empty: your spec/plan/tasks must reflect this existing implementation — document what exists, identify gaps, do NOT re-implement what is already done.
|
|
29
|
+
|
|
30
|
+
**Step A — Build Context Snapshot** (skip if `context-snapshot.md` already exists):
|
|
31
|
+
|
|
32
|
+
1. Read `.prizm-docs/root.prizm` and relevant L1/L2 prizm docs
|
|
33
|
+
2. Detect source code directories: read KEY_FILES and STRUCTURE sections from `root.prizm` to identify where source code lives (e.g. `src/`, `app/`, `lib/`, `cmd/`, `packages/`, or project root). If `root.prizm` is missing, scan the project tree:
|
|
34
|
+
```bash
|
|
35
|
+
find . -maxdepth 2 -type f \( -name "*.js" -o -name "*.ts" -o -name "*.py" -o -name "*.go" -o -name "*.java" -o -name "*.rb" -o -name "*.rs" \) -not -path '*/node_modules/*' -not -path '*/.git/*' -not -path '*/dist/*' -not -path '*/build/*' -not -path '*/vendor/*' | head -30
|
|
36
|
+
```
|
|
37
|
+
Identify the top-level source directories from the results.
|
|
38
|
+
3. Scan the detected source directories for files related to this feature; read each one
|
|
39
|
+
4. Write `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md`:
|
|
40
|
+
- **Section 1 — Feature Brief**: feature description + acceptance criteria (copy from above)
|
|
41
|
+
- **Section 2 — Project Structure**: run the following to get a visual directory tree, then paste output:
|
|
42
|
+
```bash
|
|
43
|
+
find . -maxdepth 2 -type d -not -path '*/node_modules/*' -not -path '*/.git/*' -not -path '*/dist/*' -not -path '*/build/*' -not -path '*/__pycache__/*' -not -path '*/vendor/*' | sed -e 's;[^/]*/;|____;g;s;____|; |;g'
|
|
44
|
+
```
|
|
45
|
+
- **Section 3 — Prizm Context**: full content of root.prizm and relevant L1/L2 docs
|
|
46
|
+
- **Section 4 — File Manifest**: For each file relevant to this feature, list: file path, why it's needed (modify/reference/test), key interface signatures (function names + params + return types). Do NOT include full file content — agents read files on-demand. Format:
|
|
47
|
+
### Files to Modify
|
|
48
|
+
| File | Why Needed | Key Interfaces |
|
|
49
|
+
|------|-----------|----------------|
|
|
50
|
+
| `<source-dir>/config.js` | Add runtime config layer | `config` (Zod object), `configSchema` |
|
|
51
|
+
|
|
52
|
+
### Files for Reference
|
|
53
|
+
| File | Why Needed | Key Interfaces |
|
|
54
|
+
|------|-----------|----------------|
|
|
55
|
+
| `<source-dir>/security/permission-guard.js` | Permission check integration | `checkCommandPermission(userId, cmd)` |
|
|
56
|
+
|
|
57
|
+
### Known TRAPS (from .prizm-docs/)
|
|
58
|
+
- <trap entries extracted from L1/L2 docs>
|
|
59
|
+
- **Section 5 — Existing Tests**: full content of related test files as code blocks
|
|
60
|
+
5. Confirm: `ls .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md`
|
|
61
|
+
|
|
62
|
+
**After Step A**: Use context-snapshot.md Section 4 File Manifest to guide targeted file reads. Do NOT scan directories or read unrelated files.
|
|
63
|
+
|
|
64
|
+
**Step B — Planning Artifacts** (generate only missing files):
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
ls .prizmkit/specs/{{FEATURE_SLUG}}/spec.md .prizmkit/specs/{{FEATURE_SLUG}}/plan.md 2>/dev/null
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
- spec.md missing: Run `/prizmkit-plan` → generate spec.md. Resolve any `[NEEDS CLARIFICATION]` markers using the feature description — do NOT pause for interactive input.
|
|
71
|
+
- plan.md missing: Run `/prizmkit-plan` → generate plan.md (architecture, components, interface design, data model, testing strategy, risk assessment, and Tasks section with `[ ]` checkboxes)
|
|
72
|
+
|
|
73
|
+
> All files go under `.prizmkit/specs/{{FEATURE_SLUG}}/`. Confirm each with `ls` after writing.
|
|
74
|
+
|
|
75
|
+
**Database Design Gate** (if feature involves data persistence — new tables, schema changes, new entities):
|
|
76
|
+
Before proceeding past CP-1, verify:
|
|
77
|
+
1. Plan.md Data Model section references existing schema/model files (scan for `*.prisma`, `*.sql`, `migrations/`, `models/`, `*.entity.*` files; read them if not already in context-snapshot)
|
|
78
|
+
2. All new tables/fields follow existing naming conventions, ID strategy, timestamp patterns, and constraint style
|
|
79
|
+
3. No `[NEEDS CLARIFICATION]` remains in Data Model section — resolve by reading existing code and making a conservative choice that matches existing patterns. Document the resolution in plan.md.
|
|
80
|
+
4. If a DB design decision genuinely cannot be resolved from existing code alone, document the assumption made and flag it in the Implementation Log for user review.
|
|
81
|
+
|
|
82
|
+
**CP-1**: Both spec.md and plan.md exist.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
### Phase 0: Project Bootstrap
|
|
2
|
+
- Run `/prizmkit-init` (invoke the prizmkit-init skill)
|
|
3
|
+
- Run `python3 {{INIT_SCRIPT_PATH}} --project-root {{PROJECT_ROOT}} --feature-id {{FEATURE_ID}} --feature-slug {{FEATURE_SLUG}}`
|
|
4
|
+
- **CP-0**: Verify `.prizm-docs/root.prizm`, `.prizmkit/config.json` exist
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
### Phase 0: Record Test Baseline & Detect Test Commands
|
|
2
|
+
|
|
3
|
+
**Step 1 — Detect test commands**: You know this project's tech stack. Identify ALL test commands that apply (e.g., `go test ./...`, `npm test`, `cargo test`, `pytest`, `make test`, etc.). Record them as `TEST_CMDS`.
|
|
4
|
+
|
|
5
|
+
**Step 2 — Record pre-existing failure baseline**:
|
|
6
|
+
```bash
|
|
7
|
+
# Run each test command, capture output
|
|
8
|
+
$TEST_CMD 2>&1 | tee /tmp/test-baseline.txt | tail -20
|
|
9
|
+
```
|
|
10
|
+
Save the list of **pre-existing failing tests** (if any) as `BASELINE_FAILURES`. These are known failures that existed before this session — Dev must NOT be blamed for them, but must list them in COMPLETION_SIGNAL.
|
|
11
|
+
|
|
12
|
+
> **Test Output Rule**: Always capture test output to a temp file (`tee /tmp/test-out.txt`). Then grep the file instead of re-running the suite.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
## Session Context
|
|
2
|
+
|
|
3
|
+
- **Feature ID**: {{FEATURE_ID}} | **Session**: {{SESSION_ID}} | **Run**: {{RUN_ID}}
|
|
4
|
+
- **Complexity**: {{COMPLEXITY}} | **Retry**: {{RETRY_COUNT}} / {{MAX_RETRIES}}
|
|
5
|
+
- **Previous Status**: {{PREV_SESSION_STATUS}} | **Resume From**: {{RESUME_PHASE}}
|
|
6
|
+
- **Init**: {{INIT_DONE}} | Artifacts: spec={{HAS_SPEC}} plan={{HAS_PLAN}}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
## Subagent Timeout Recovery
|
|
2
|
+
|
|
3
|
+
If any agent times out:
|
|
4
|
+
1. `ls .prizmkit/specs/{{FEATURE_SLUG}}/` — check what exists
|
|
5
|
+
2. If `context-snapshot.md` exists: open recovery prompt with `"Read .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md for project context and any Implementation Log/Review Notes from previous agents. Run git diff HEAD to see actual code changes already made. Do NOT re-read individual source files unless the File Manifest directs you to."` + only remaining steps + `model: "lite"`
|
|
6
|
+
3. Max 2 retries per phase. After 2 failures, orchestrator completes the work directly and appends a Recovery Note to context-snapshot.md.
|