prizmkit 1.1.3 → 1.1.5
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/run-bugfix.sh +35 -0
- package/bundled/dev-pipeline/run-feature.sh +33 -0
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +221 -0
- package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +124 -0
- package/bundled/dev-pipeline/templates/agent-prompts/dev-implement.md +2 -1
- package/bundled/dev-pipeline/templates/bootstrap-tier1.md +4 -0
- package/bundled/dev-pipeline/templates/bootstrap-tier2.md +5 -2
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +5 -2
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +20 -1
- package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +36 -0
- package/bundled/dev-pipeline/templates/sections/failure-log-check.md +2 -1
- package/bundled/dev-pipeline/templates/sections/phase-analyze-agent.md +3 -0
- package/bundled/dev-pipeline/templates/sections/phase-analyze-full.md +3 -0
- package/bundled/dev-pipeline/templates/sections/phase-browser-verification.md +3 -0
- package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +3 -0
- package/bundled/dev-pipeline/templates/sections/phase-commit.md +3 -0
- package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-agent-suffix.md +3 -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 +3 -0
- package/bundled/dev-pipeline/templates/sections/phase-critic-plan-full.md +3 -0
- package/bundled/dev-pipeline/templates/sections/phase-critic-plan.md +3 -0
- package/bundled/dev-pipeline/templates/sections/phase-deploy-verification.md +3 -0
- package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +3 -0
- package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +3 -0
- package/bundled/dev-pipeline/templates/sections/phase-implement-lite.md +3 -0
- package/bundled/dev-pipeline/templates/sections/phase-plan-agent.md +3 -0
- package/bundled/dev-pipeline/templates/sections/phase-plan-lite.md +3 -0
- package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +3 -0
- package/bundled/dev-pipeline/templates/sections/phase-review-full.md +3 -0
- package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +3 -0
- package/bundled/dev-pipeline/templates/sections/phase0-init.md +3 -0
- package/bundled/dev-pipeline/templates/sections/phase0-test-baseline.md +3 -0
- package/bundled/dev-pipeline/templates/sections/resume-header.md +4 -1
- package/bundled/rules/prizm/prizm-commit-workflow.md +1 -0
- package/bundled/rules/prizm/prizm-documentation.md +15 -15
- package/bundled/rules/prizm/prizm-progressive-loading.md +2 -1
- package/bundled/skills/_metadata.json +1 -1
- package/bundled/skills/prizm-kit/assets/project-memory-template.md +4 -2
- package/bundled/skills/prizmkit-committer/SKILL.md +28 -0
- package/bundled/skills/prizmkit-implement/SKILL.md +2 -1
- package/bundled/skills/prizmkit-implement/references/deploy-guide-protocol.md +69 -0
- package/bundled/skills/prizmkit-init/SKILL.md +2 -1
- package/bundled/skills/prizmkit-init/references/config-schema.md +64 -0
- package/bundled/skills/prizmkit-init/references/tech-stack-catalog.md +13 -0
- package/bundled/skills/prizmkit-init/references/update-supplement.md +9 -0
- package/bundled/skills/prizmkit-plan/assets/spec-template.md +56 -0
- package/bundled/skills/prizmkit-plan/references/clarify-guide.md +67 -0
- package/bundled/skills/prizmkit-prizm-docs/SKILL.md +7 -4
- package/bundled/skills/prizmkit-prizm-docs/assets/PRIZM-SPEC.md +31 -1
- package/bundled/skills/prizmkit-retrospective/references/knowledge-injection-steps.md +49 -0
- package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +63 -0
- package/bundled/skills/recovery-workflow/SKILL.md +4 -2
- package/bundled/team/prizm-dev-team.json +1 -1
- package/package.json +1 -1
- package/src/config.js +504 -0
- package/src/prompts.js +210 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
## Workflow Checkpoint System
|
|
2
|
+
|
|
3
|
+
A checkpoint file tracks your progress through this workflow:
|
|
4
|
+
|
|
5
|
+
**Path**: `{{CHECKPOINT_PATH}}`
|
|
6
|
+
|
|
7
|
+
### Rules
|
|
8
|
+
|
|
9
|
+
1. **Before each skill**: Read `workflow-checkpoint.json`, verify the previous step has `status: "completed"` or `status: "skipped"`. If it is still `"pending"` or `"in_progress"`, you MUST complete it first before moving on.
|
|
10
|
+
|
|
11
|
+
2. **Starting a skill**: Update the current step to `status: "in_progress"`.
|
|
12
|
+
|
|
13
|
+
3. **After each skill completes**: Update the current step to `status: "completed"`. Then immediately re-read the file to verify the JSON is valid. If the read fails, re-write the file with correct JSON.
|
|
14
|
+
|
|
15
|
+
4. **On failure**: Set the step to `status: "failed"` and continue to the next step if possible, or halt and write failure-log.md.
|
|
16
|
+
|
|
17
|
+
5. **On session exit**: The checkpoint file reflects your actual progress. Do NOT manually set future steps to "completed".
|
|
18
|
+
|
|
19
|
+
### Checkpoint Update Pattern
|
|
20
|
+
|
|
21
|
+
After completing each skill:
|
|
22
|
+
|
|
23
|
+
1. Read `{{CHECKPOINT_PATH}}`
|
|
24
|
+
2. Update the current step `"status": "completed"`
|
|
25
|
+
3. Update the next step `"status": "in_progress"`
|
|
26
|
+
4. Write the updated JSON back to `{{CHECKPOINT_PATH}}`
|
|
27
|
+
5. Verify: `python3 -c "import json; json.load(open('{{CHECKPOINT_PATH}}'))"` — if this fails, re-write
|
|
28
|
+
|
|
29
|
+
### Resume Behavior
|
|
30
|
+
|
|
31
|
+
**Checkpoint is the primary source of truth for resume.** On retry sessions:
|
|
32
|
+
|
|
33
|
+
1. Read `workflow-checkpoint.json` — steps already `"completed"` or `"skipped"` are skipped
|
|
34
|
+
2. Start from the first `"pending"` or `"in_progress"` step
|
|
35
|
+
3. If `failure-log.md` exists, read it for diagnostic context (why the previous session failed, what approach to try differently) — but do NOT use it to determine which step to resume from
|
|
36
|
+
4. If `workflow-checkpoint.json` is missing or corrupted, fall back to `failure-log.md` + the resume phase as the legacy mechanism
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
**Check for previous failure log
|
|
1
|
+
**Check for previous failure log** (diagnostic context only — do NOT use to determine resume point):
|
|
2
2
|
```bash
|
|
3
3
|
cat .prizmkit/specs/{{FEATURE_SLUG}}/failure-log.md 2>/dev/null || echo "NO_PREVIOUS_FAILURE"
|
|
4
4
|
```
|
|
@@ -6,3 +6,4 @@ If failure-log.md exists:
|
|
|
6
6
|
- Read ROOT_CAUSE and SUGGESTION — adjust your approach accordingly
|
|
7
7
|
- Read DISCOVERED_TRAPS — if any are genuine, inject into .prizm-docs/ during the commit phase retrospective
|
|
8
8
|
- Do NOT delete failure-log.md until this session completes all phases and commits successfully
|
|
9
|
+
- **Note**: The resume point is determined by `workflow-checkpoint.json`, not by failure-log.md
|
|
@@ -14,3 +14,6 @@ Wait for Reviewer to return.
|
|
|
14
14
|
- If CRITICAL issues found: fix them yourself — read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` for full project context. Fix ONLY the listed CRITICAL issues in plan.md. Then re-run analyze (max 1 round).
|
|
15
15
|
|
|
16
16
|
**CP-2**: No CRITICAL issues.
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
**Checkpoint update**: Update `workflow-checkpoint.json` — set step `prizmkit-analyze` to `"completed"`.
|
|
@@ -14,3 +14,6 @@ Wait for Reviewer to return.
|
|
|
14
14
|
- If CRITICAL issues found: fix them yourself — read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` for full project context. Fix ONLY the listed CRITICAL issues in spec.md/plan.md. Then re-run analyze (max 1 round).
|
|
15
15
|
|
|
16
16
|
**CP-2**: No CRITICAL issues.
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
**Checkpoint update**: Update `workflow-checkpoint.json` — set step `prizmkit-analyze` to `"completed"`.
|
|
@@ -30,3 +30,6 @@ You MUST execute this phase. Do NOT skip it. Do NOT mark it as completed without
|
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
If verification fails, log the failure details but continue to commit. Failures do NOT block the commit, but you MUST attempt verification and MUST clean up the dev server.
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
**Checkpoint update**: Update `workflow-checkpoint.json` — set step `browser-verification` to `"completed"`.
|
|
@@ -34,3 +34,6 @@ This single commit includes: feature code + tests + .prizm-docs/ updates. Do NOT
|
|
|
34
34
|
git status --short
|
|
35
35
|
```
|
|
36
36
|
Working tree MUST be clean after this step. If any feature-related files remain, stage them into the SAME commit via `git add <file> && git commit --amend --no-edit`, do NOT create a separate commit.
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
**Checkpoint update**: After `/prizmkit-retrospective` completes, update `workflow-checkpoint.json` — set step `prizmkit-retrospective` to `"completed"`. After `/prizmkit-committer` completes, set step `prizmkit-committer` to `"completed"`.
|
|
@@ -24,3 +24,6 @@ This single commit includes: feature code + tests + .prizm-docs/ updates. Do NOT
|
|
|
24
24
|
git status --short
|
|
25
25
|
```
|
|
26
26
|
Working tree MUST be clean after this step. If any feature-related files remain, stage them into the SAME commit via `git add <file> && git commit --amend --no-edit`, do NOT create a separate commit.
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
**Checkpoint update**: After `/prizmkit-retrospective` completes, update `workflow-checkpoint.json` — set step `prizmkit-retrospective` to `"completed"`. After `/prizmkit-committer` completes, set step `prizmkit-committer` to `"completed"`.
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
- **Section 3 — Prizm Context**: content of root.prizm and relevant L1/L2 docs
|
|
2
2
|
- **Section 4 — Existing Source Files**: **full verbatim content** of each related file in fenced code blocks (with `### path/to/file` heading and line count). Include ALL files needed for implementation and review — downstream phases read this section instead of re-reading individual source files
|
|
3
3
|
- **Section 5 — Existing Tests**: full content of related test files as code block
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
**Checkpoint update**: Update `workflow-checkpoint.json` — set step `context-snapshot` to `"completed"`.
|
|
@@ -20,3 +20,6 @@ Wait for Critic to return.
|
|
|
20
20
|
- Read challenge-report.md. For items marked CRITICAL/HIGH: spawn Dev to fix, then proceed to Review.
|
|
21
21
|
|
|
22
22
|
**CP-3.5**: Code challenges reviewed and resolved.
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
**Checkpoint update**: Update `workflow-checkpoint.json` — set step `critic-code-review` to `"completed"`.
|
|
@@ -34,3 +34,6 @@ Deploy verification does NOT block the commit, but you MUST attempt it.
|
|
|
34
34
|
4. Record smoke test results in `## Deploy Verification` section
|
|
35
35
|
|
|
36
36
|
If the project cannot be started locally (e.g., requires external services, databases, credentials), skip the smoke test and note why.
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
**Checkpoint update**: Update `workflow-checkpoint.json` — set step `deploy-verification` to `"completed"`.
|
|
@@ -19,3 +19,6 @@ After Dev agent returns, verify the Implementation Log was written:
|
|
|
19
19
|
grep -q "## Implementation Log" .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md && echo "GATE:PASS" || echo "GATE:MISSING"
|
|
20
20
|
```
|
|
21
21
|
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."
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
**Checkpoint update**: Update `workflow-checkpoint.json` — set step `prizmkit-implement` to `"completed"`.
|
|
@@ -32,3 +32,6 @@ Wait for Dev to return. **If Dev times out before all tasks are `[x]`**:
|
|
|
32
32
|
3. Max 2 recovery retries. After 2 failures, orchestrator implements remaining tasks directly.
|
|
33
33
|
|
|
34
34
|
All tasks `[x]`, tests pass.
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
**Checkpoint update**: Update `workflow-checkpoint.json` — set step `prizmkit-implement` to `"completed"`.
|
|
@@ -30,3 +30,6 @@ $TEST_CMD 2>&1 | tee /tmp/test-baseline.txt | tail -20
|
|
|
30
30
|
4. If any criterion is not met, fix it now (max 2 fix rounds)
|
|
31
31
|
|
|
32
32
|
**CP-2**: All acceptance criteria met, all tests pass.
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
**Checkpoint update**: Update `workflow-checkpoint.json` — set step `prizmkit-implement` to `"completed"`.
|
|
@@ -15,3 +15,6 @@ Before proceeding past CP-1, verify:
|
|
|
15
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
16
|
|
|
17
17
|
**CP-1**: plan.md exists with Tasks section.
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
**Checkpoint update**: Update `workflow-checkpoint.json` — set step `prizmkit-plan` to `"completed"`.
|
|
@@ -14,3 +14,6 @@ Before proceeding past CP-1:
|
|
|
14
14
|
3. Resolve all uncertain DB design decisions before writing Tasks — document choices in plan.md
|
|
15
15
|
|
|
16
16
|
**CP-1**: plan.md exists with Tasks section.
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
**Checkpoint update**: Update `workflow-checkpoint.json` — set step `prizmkit-plan` to `"completed"`.
|
|
@@ -21,3 +21,6 @@ If GATE:MISSING — send message to Reviewer (re-spawn if needed): "Write the '#
|
|
|
21
21
|
- If NEEDS_FIXES: spawn Dev to fix (Dev reads Fix Instructions in snapshot), re-run Review (max 3 rounds)
|
|
22
22
|
|
|
23
23
|
**CP-3**: Tests pass, verdict is not NEEDS_FIXES.
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
**Checkpoint update**: Update `workflow-checkpoint.json` — set step `prizmkit-code-review` to `"completed"`.
|
|
@@ -23,3 +23,6 @@ If GATE:MISSING — send message to Reviewer (re-spawn if needed): "Write the '#
|
|
|
23
23
|
Then re-run Review (max 3 rounds).
|
|
24
24
|
|
|
25
25
|
**CP-3**: Integration tests pass, verdict is not NEEDS_FIXES.
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
**Checkpoint update**: Update `workflow-checkpoint.json` — set step `prizmkit-code-review` to `"completed"`.
|
|
@@ -80,3 +80,6 @@ Before proceeding past CP-1, verify:
|
|
|
80
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
81
|
|
|
82
82
|
**CP-1**: Both spec.md and plan.md exist.
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
**Checkpoint update**: Update `workflow-checkpoint.json` — set step `context-snapshot-and-plan` to `"completed"`.
|
|
@@ -2,3 +2,6 @@
|
|
|
2
2
|
- Run `/prizmkit-init` (invoke the prizmkit-init skill)
|
|
3
3
|
- Run `python3 {{INIT_SCRIPT_PATH}} --project-root {{PROJECT_ROOT}} --feature-id {{FEATURE_ID}} --feature-slug {{FEATURE_SLUG}}`
|
|
4
4
|
- **CP-0**: Verify `.prizm-docs/root.prizm`, `.prizmkit/config.json` exist
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
**Checkpoint update**: Update `workflow-checkpoint.json` — set step `prizmkit-init` to `"completed"`.
|
|
@@ -10,3 +10,6 @@ $TEST_CMD 2>&1 | tee /tmp/test-baseline.txt | tail -20
|
|
|
10
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
11
|
|
|
12
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.
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
**Checkpoint update**: Update `workflow-checkpoint.json` — set step `test-baseline` to `"completed"`.
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
### Resume from Phase {{RESUME_PHASE}}
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
**Primary**: Read `{{CHECKPOINT_PATH}}` — find the first step with `"pending"` or `"in_progress"` status and resume from there. Steps already `"completed"` or `"skipped"` must NOT be re-executed.
|
|
4
|
+
|
|
5
|
+
**Fallback**: If `workflow-checkpoint.json` is missing or corrupted, check `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` — if it exists, skip context building and use it directly.
|
|
@@ -8,3 +8,4 @@ Before any git commit in this project:
|
|
|
8
8
|
3. Bug fixes use `fix()` prefix, not `feat()`
|
|
9
9
|
4. Bug fixes run retrospective with structural sync only (Job 1)
|
|
10
10
|
5. Use `/prizmkit-committer` command for the pure commit workflow
|
|
11
|
+
6. After commit, `/prizmkit-committer` generates `session-summary.md` (lightweight cross-session handoff, not committed to git)
|
|
@@ -18,19 +18,20 @@ WHEN TO UPDATE .prizm-docs/:
|
|
|
18
18
|
- Before modifying any source file, read `.prizm-docs/root.prizm` if it exists to understand project structure.
|
|
19
19
|
|
|
20
20
|
FORMAT RULES (enforced by pre-commit hook — violations block commit):
|
|
21
|
-
- ALL CAPS section headers: MODULE:, FILES:, RESPONSIBILITY:,
|
|
21
|
+
- ALL CAPS section headers: MODULE:, FILES:, RESPONSIBILITY:, etc.
|
|
22
22
|
- KEY: value pairs and dash-prefixed lists only
|
|
23
23
|
- PROHIBITED: prose paragraphs, markdown headers (##/###), code blocks (```), emoji, ASCII art
|
|
24
|
+
- No UPDATED timestamps — git is the authoritative source for temporal information
|
|
24
25
|
- This format is designed for AI token efficiency, not human readability. Do not add human-friendly formatting.
|
|
25
26
|
|
|
26
27
|
SIZE LIMITS (hard — pre-commit hook blocks commits exceeding these):
|
|
27
28
|
- L0 root.prizm: 4KB max
|
|
28
|
-
- L1 module.prizm:
|
|
29
|
+
- L1 module.prizm: 4KB max
|
|
29
30
|
- L2 detail.prizm: 5KB max
|
|
30
31
|
|
|
31
32
|
SIZE OVERFLOW HANDLING:
|
|
32
|
-
- L0 approaching 4KB:
|
|
33
|
-
- L1 approaching
|
|
33
|
+
- L0 approaching 4KB: if MODULE_INDEX has > 15 entries, convert to MODULE_GROUPS format (group by domain). Otherwise consolidate descriptions, keep only top-5 RULES, remove PATTERNS detail.
|
|
34
|
+
- L1 approaching 4KB: trim KEY_FILES descriptions, ensure RULES <= 3 entries, move detail to L2
|
|
34
35
|
- L2 approaching 5KB: archive CHANGELOG entries older than 90 days to changelog-archive.prizm
|
|
35
36
|
- NEVER exceed hard limits — pre-commit hook will block the commit
|
|
36
37
|
|
|
@@ -40,26 +41,24 @@ L0 root.prizm:
|
|
|
40
41
|
- PRIZM_VERSION
|
|
41
42
|
- PROJECT
|
|
42
43
|
- LANG
|
|
43
|
-
- MODULE_INDEX (with -> pointers to L1 files)
|
|
44
|
+
- MODULE_INDEX or MODULE_GROUPS (with -> pointers to L1 files)
|
|
44
45
|
- RULES (top-level project rules)
|
|
45
|
-
- UPDATED
|
|
46
46
|
|
|
47
|
-
L1 module.prizm:
|
|
47
|
+
L1 module.prizm (structural index only):
|
|
48
48
|
- MODULE
|
|
49
49
|
- FILES
|
|
50
50
|
- RESPONSIBILITY
|
|
51
|
-
- INTERFACES (public/exported only)
|
|
52
51
|
- DEPENDENCIES
|
|
53
|
-
-
|
|
52
|
+
- L1 does NOT contain: INTERFACES, DATA_FLOW, TRAPS, DECISIONS (those belong in L2)
|
|
54
53
|
|
|
55
54
|
L2 detail.prizm:
|
|
56
55
|
- MODULE
|
|
57
56
|
- FILES
|
|
58
57
|
- KEY_FILES
|
|
59
58
|
- DEPENDENCIES
|
|
60
|
-
-
|
|
59
|
+
- INTERFACES
|
|
60
|
+
- TRAPS (with severity prefix: [CRITICAL], [HIGH], or [LOW])
|
|
61
61
|
- CHANGELOG
|
|
62
|
-
- UPDATED
|
|
63
62
|
|
|
64
63
|
L2 GENERATION TEMPLATE (use when AI first touches a sub-module with no L2 doc):
|
|
65
64
|
|
|
@@ -71,10 +70,11 @@ KEY_FILES:
|
|
|
71
70
|
DEPENDENCIES:
|
|
72
71
|
- uses: <lib>: <why>
|
|
73
72
|
- imports: <module>: <what>
|
|
73
|
+
INTERFACES:
|
|
74
|
+
- <exported function/class>: <signature and purpose>
|
|
74
75
|
TRAPS:
|
|
75
|
-
- <gotcha, race condition, or non-obvious coupling>
|
|
76
|
+
- [LOW] <gotcha, race condition, or non-obvious coupling> | FIX: <approach>
|
|
76
77
|
CHANGELOG:
|
|
77
|
-
-
|
|
78
|
-
UPDATED: <YYYY-MM-DD>
|
|
78
|
+
- root | add: initial L2 documentation
|
|
79
79
|
|
|
80
|
-
TRAPS is critical — always record gotchas, race conditions, non-obvious behavior, and surprising coupling between modules.
|
|
80
|
+
TRAPS is critical — always record gotchas, race conditions, non-obvious behavior, and surprising coupling between modules. Every TRAP must have a severity prefix ([CRITICAL], [HIGH], or [LOW]).
|
|
@@ -4,7 +4,8 @@ description: "PrizmKit progressive context loading protocol"
|
|
|
4
4
|
|
|
5
5
|
This project uses PrizmKit's progressive loading protocol:
|
|
6
6
|
- ON SESSION START: Read `.prizm-docs/root.prizm` (L0 — project map)
|
|
7
|
-
- ON
|
|
7
|
+
- ON RESUME (feature/bugfix directory has session-summary.md): Read session-summary.md first for prior context, then load only L1/L2 for modules mentioned in it
|
|
8
|
+
- ON TASK: Read L1 (`.prizm-docs/<module>.prizm`) for relevant modules. If MODULE_INDEX entries have keyword tags (e.g., `[login, jwt, oauth]`), match user's task description against tags to prioritize which modules' L1 to load first. If root.prizm uses MODULE_GROUPS, identify the relevant domain first, then load L1 only for modules in that domain.
|
|
8
9
|
- ON FILE EDIT: Read L2 (`.prizm-docs/<module>/<submodule>.prizm`) before modifying
|
|
9
10
|
- NEVER load all .prizm docs at once
|
|
10
11
|
- Arrow notation (->) in .prizm files indicates load pointers
|
|
@@ -5,7 +5,8 @@ This project uses PrizmKit with the Prizm documentation system for AI-optimized
|
|
|
5
5
|
|
|
6
6
|
### Progressive Loading Protocol
|
|
7
7
|
- ON SESSION START: Always read `.prizm-docs/root.prizm` first (L0 — project map)
|
|
8
|
-
- ON
|
|
8
|
+
- ON RESUME (feature/bugfix directory has session-summary.md): Read session-summary.md first for prior context, then load only L1/L2 for modules mentioned in it
|
|
9
|
+
- ON TASK: Read L1 (`.prizm-docs/<module>.prizm`) for relevant modules referenced in MODULE_INDEX or MODULE_GROUPS. If entries have keyword tags (e.g., `[login, jwt, oauth]`), match user's task against tags to prioritize which modules to load.
|
|
9
10
|
- ON FILE EDIT: Read L2 (`.prizm-docs/<module>/<submodule>.prizm`) before modifying files. Pay attention to TRAPS and DECISIONS.
|
|
10
11
|
- NEVER load all .prizm docs at once. Load only what is needed for the current task.
|
|
11
12
|
|
|
@@ -16,9 +17,10 @@ This project uses PrizmKit with the Prizm documentation system for AI-optimized
|
|
|
16
17
|
|
|
17
18
|
### Doc Format Rules
|
|
18
19
|
- All `.prizm` files use KEY: value format, not prose
|
|
19
|
-
- Size limits: L0 = 4KB, L1 =
|
|
20
|
+
- Size limits: L0 = 4KB, L1 = 4KB, L2 = 5KB
|
|
20
21
|
- Arrow notation (->) indicates load pointers to other .prizm docs
|
|
21
22
|
- DECISIONS and CHANGELOG are append-only (never delete entries)
|
|
23
|
+
- No date/time fields — git is the authoritative source for temporal info
|
|
22
24
|
|
|
23
25
|
### Creating New L2 Docs
|
|
24
26
|
- When you first modify files in a sub-module that has no L2 doc:
|
|
@@ -61,6 +61,34 @@ git status
|
|
|
61
61
|
```
|
|
62
62
|
- If "nothing to commit, working tree clean": commit verified successfully, proceed
|
|
63
63
|
|
|
64
|
+
#### Step 5.5: Generate Session Summary (for cross-session recovery)
|
|
65
|
+
|
|
66
|
+
After a successful commit, generate a lightweight handoff file for future sessions. Locate the artifact directory (`.prizmkit/specs/<feature-dir>/` for features, `.prizmkit/refactor/<slug>/` for refactors, `.prizmkit/bugfix/<id>/` for bugfixes) by checking which `plan.md` was used in this workflow.
|
|
67
|
+
|
|
68
|
+
If an artifact directory with `plan.md` is found, write `session-summary.md` in that directory:
|
|
69
|
+
|
|
70
|
+
```markdown
|
|
71
|
+
# Session Summary
|
|
72
|
+
## Completed Tasks
|
|
73
|
+
<list task IDs and one-line descriptions from plan.md [x] items>
|
|
74
|
+
|
|
75
|
+
## Files Changed
|
|
76
|
+
<list from `git diff HEAD~1 --name-only` of the commit just made>
|
|
77
|
+
|
|
78
|
+
## Key Decisions
|
|
79
|
+
<1-3 bullet points of non-obvious design choices made this session, referencing DECISIONS in .prizm-docs/ if applicable>
|
|
80
|
+
|
|
81
|
+
## Active TRAPS
|
|
82
|
+
<any CRITICAL or HIGH TRAPS relevant to the changed files, copied from .prizm-docs/ L2>
|
|
83
|
+
|
|
84
|
+
## Remaining Work
|
|
85
|
+
<list unchecked [ ] task IDs from plan.md, or "None — feature complete" if all done>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Keep this file under 1.5KB. If no artifact directory with `plan.md` can be identified (e.g., ad-hoc commit), skip this step.
|
|
89
|
+
|
|
90
|
+
**Lifecycle**: `session-summary.md` is a local cross-session artifact — do NOT commit it to git. It exists only on disk for the next session to read. Overwrite any existing `session-summary.md` from a previous session — this file reflects only the most recent commit's state. In pipeline mode, this file will remain as an untracked file after commit; the pipeline runner should ignore it (it is not a sign of incomplete work).
|
|
91
|
+
|
|
64
92
|
#### Step 6: Optional Push
|
|
65
93
|
Ask user: "Push to remote?"
|
|
66
94
|
- Yes: `git push`
|
|
@@ -29,8 +29,9 @@ description: "Execute plan.md tasks with TDD approach. Respects task ordering an
|
|
|
29
29
|
- **Feature mode**: read `spec.md` in the same directory
|
|
30
30
|
- **Refactor mode**: read `refactor-analysis.md` in the same directory — pay special attention to Scope Boundary (do not implement changes outside scope) and Baseline Tests (all must still pass)
|
|
31
31
|
- **Bugfix mode**: read `fix-plan.md` in the same directory
|
|
32
|
-
2. Load project context — use the most efficient source available:
|
|
32
|
+
2. Load project context — use the most efficient source available (check in this order):
|
|
33
33
|
- If `context-snapshot.md` exists in the feature directory → read it. Section 3 has Prizm docs + TRAPS. Section 4 has File Manifest (Tier-2/3) or full source (Tier-1). Read source files on-demand as directed by the manifest.
|
|
34
|
+
- Else if `session-summary.md` exists in the feature directory → read it for quick context recovery (completed tasks, key decisions, active TRAPS). Then load only the L1/L2 docs for modules listed in "Files Changed" — skip unrelated modules.
|
|
34
35
|
- Otherwise → **self-service context fallback**:
|
|
35
36
|
1. Read **architecture index**: `.prizm-docs/root.prizm` and relevant L1/L2 for affected modules. Pay special attention to TRAPS and DECISIONS.
|
|
36
37
|
2. Scan needed source files
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Deploy Guide Update Protocol
|
|
2
|
+
|
|
3
|
+
When dependency manifests change during implementation, update `deploy_guide.md` at the project root.
|
|
4
|
+
|
|
5
|
+
## Detection
|
|
6
|
+
|
|
7
|
+
1. Check if any dependency manifests were modified in this session:
|
|
8
|
+
```bash
|
|
9
|
+
git diff --name-only HEAD -- package.json requirements*.txt Pipfile pyproject.toml go.mod Cargo.toml pom.xml build.gradle Gemfile composer.json docker-compose*.yml Dockerfile .tool-versions 2>/dev/null
|
|
10
|
+
```
|
|
11
|
+
2. If no manifest files changed → skip this step entirely
|
|
12
|
+
3. If manifest files changed, scan for **newly added** dependencies (not version bumps):
|
|
13
|
+
```bash
|
|
14
|
+
git diff -U0 HEAD -- package.json requirements*.txt Pipfile pyproject.toml go.mod Cargo.toml pom.xml build.gradle Gemfile composer.json docker-compose*.yml Dockerfile .tool-versions 2>/dev/null | grep '^\+' | grep -v '^\+\+\+' | head -30
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Recording
|
|
18
|
+
|
|
19
|
+
For each genuinely new framework/tool, record in `deploy_guide.md` at project root:
|
|
20
|
+
|
|
21
|
+
| Field | Description | Source |
|
|
22
|
+
|-------|-------------|--------|
|
|
23
|
+
| **Name** | Framework/tool name | Package name from manifest |
|
|
24
|
+
| **Version** | Installed version or constraint | Version spec from manifest |
|
|
25
|
+
| **Purpose** | Why it was introduced | You just added it — you know why |
|
|
26
|
+
| **Install Command** | How to install locally | Standard install command for the ecosystem |
|
|
27
|
+
| **Key Config** | Config files or env vars needed | Config files you just created/modified |
|
|
28
|
+
| **Notes** | Setup gotchas, required services | Docker services, manual steps, env vars |
|
|
29
|
+
|
|
30
|
+
## Template for `deploy_guide.md`
|
|
31
|
+
|
|
32
|
+
```markdown
|
|
33
|
+
# Deploy Guide
|
|
34
|
+
|
|
35
|
+
> Auto-maintained by PrizmKit. Manual edits are preserved.
|
|
36
|
+
> Last updated: YYYY-MM-DD
|
|
37
|
+
|
|
38
|
+
## Frameworks & Tools
|
|
39
|
+
|
|
40
|
+
### <Framework Name>
|
|
41
|
+
|
|
42
|
+
- **Version**: <version constraint>
|
|
43
|
+
- **Purpose**: <why this framework is used>
|
|
44
|
+
- **Install**:
|
|
45
|
+
```bash
|
|
46
|
+
<install command>
|
|
47
|
+
```
|
|
48
|
+
- **Key Config**:
|
|
49
|
+
- `<config file or env var>`: <description>
|
|
50
|
+
- **Notes**:
|
|
51
|
+
- <any setup gotchas, required external services, manual steps>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Update Rules
|
|
55
|
+
|
|
56
|
+
- Create file if absent; append new sections if file exists
|
|
57
|
+
- Update version if framework already documented
|
|
58
|
+
- Preserve manually added content
|
|
59
|
+
- Keep entries sorted alphabetically
|
|
60
|
+
|
|
61
|
+
## Filter Out
|
|
62
|
+
|
|
63
|
+
- Patch version bumps of existing deps
|
|
64
|
+
- Dev-only tools needing no setup (linters, formatters)
|
|
65
|
+
- Transitive/lock-file-only changes
|
|
66
|
+
|
|
67
|
+
## Final Step
|
|
68
|
+
|
|
69
|
+
Stage the file: `git add deploy_guide.md`
|
|
@@ -71,7 +71,8 @@ BROWNFIELD WORKFLOW (existing project):
|
|
|
71
71
|
**Step 2: Prizm Documentation Generation**
|
|
72
72
|
Invoke prizmkit-prizm-docs (Init operation), passing the two-tier module structure from Step 1:
|
|
73
73
|
- Create `.prizm-docs/` directory structure mirroring the source tree (sub-module dirs become subdirectories under `.prizm-docs/<top-level>/`)
|
|
74
|
-
- Generate `root.prizm` (L0) with project meta and MODULE_INDEX listing only top-level modules
|
|
74
|
+
- 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).
|
|
75
|
+
- 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.
|
|
75
76
|
- Generate L1 docs for top-level modules at `.prizm-docs/<M>.prizm` and for sub-modules at `.prizm-docs/<M>/<S>.prizm`
|
|
76
77
|
- Create `changelog.prizm`
|
|
77
78
|
- Skip L2 (lazy generation) — L2 is generated on first file modification, saving tokens upfront
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# config.json Schema — Tech Stack Fields
|
|
2
|
+
|
|
3
|
+
## Merge Strategy
|
|
4
|
+
|
|
5
|
+
Handles re-init without losing user edits:
|
|
6
|
+
|
|
7
|
+
- Read existing `config.json` if present
|
|
8
|
+
- If `tech_stack` field exists AND `_auto_detected` is `false` or absent:
|
|
9
|
+
→ **SKIP** — user has manually configured tech stack, preserve their settings
|
|
10
|
+
- If `tech_stack` field exists AND `_auto_detected` is `true`:
|
|
11
|
+
→ **MERGE** — overwrite auto-detected values with new detection results, but preserve any keys the user added manually (keys not in the new detection result)
|
|
12
|
+
- If `tech_stack` field does NOT exist:
|
|
13
|
+
→ **WRITE** full detected tech stack with `"_auto_detected": true`
|
|
14
|
+
- Only include fields that were actually detected (no empty/null values)
|
|
15
|
+
|
|
16
|
+
## Field Definitions
|
|
17
|
+
|
|
18
|
+
| Field | Type | Description |
|
|
19
|
+
|-------|------|-------------|
|
|
20
|
+
| `adoption_mode` | string | `"passive"` \| `"advisory"` \| `"active"` |
|
|
21
|
+
| `platform` | string | `"codebuddy"` \| `"claude"` \| `"both"` |
|
|
22
|
+
| `tech_stack` | object | Detected or user-provided tech stack |
|
|
23
|
+
| `tech_stack._auto_detected` | boolean | `true` if auto-detected, `false` if user-provided |
|
|
24
|
+
|
|
25
|
+
## Examples
|
|
26
|
+
|
|
27
|
+
Fullstack project:
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"adoption_mode": "passive",
|
|
31
|
+
"platform": "claude",
|
|
32
|
+
"tech_stack": {
|
|
33
|
+
"language": "TypeScript",
|
|
34
|
+
"runtime": "Node.js 20",
|
|
35
|
+
"frontend_framework": "React",
|
|
36
|
+
"frontend_styling": "Tailwind CSS",
|
|
37
|
+
"backend_framework": "Express.js",
|
|
38
|
+
"database": "PostgreSQL",
|
|
39
|
+
"orm": "Prisma",
|
|
40
|
+
"testing": "Vitest",
|
|
41
|
+
"bundler": "Vite",
|
|
42
|
+
"project_type": "fullstack",
|
|
43
|
+
"_auto_detected": true
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Pure Python backend:
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"adoption_mode": "passive",
|
|
52
|
+
"platform": "claude",
|
|
53
|
+
"tech_stack": {
|
|
54
|
+
"language": "Python",
|
|
55
|
+
"runtime": "Python >=3.11",
|
|
56
|
+
"backend_framework": "FastAPI",
|
|
57
|
+
"database": "PostgreSQL",
|
|
58
|
+
"orm": "SQLAlchemy",
|
|
59
|
+
"testing": "pytest",
|
|
60
|
+
"project_type": "backend",
|
|
61
|
+
"_auto_detected": true
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Tech Stack Detection — Field Catalog
|
|
2
|
+
|
|
3
|
+
Adaptive field list — only include fields that apply to the project being scanned.
|
|
4
|
+
|
|
5
|
+
- **Language & Runtime**: e.g. TypeScript + Node.js 20, Python 3.11, Go 1.22
|
|
6
|
+
- **Frontend framework** (if applicable): React, Vue.js, Angular, Next.js, Svelte, etc.
|
|
7
|
+
- **Frontend styling** (if applicable): Tailwind CSS, SCSS, Styled Components, Material UI, etc.
|
|
8
|
+
- **Backend framework** (if applicable): Express.js, FastAPI, Django, NestJS, Gin, etc.
|
|
9
|
+
- **Database** (if applicable): PostgreSQL, MySQL, MongoDB, Redis, SQLite — detected from deps or `docker-compose.yml`
|
|
10
|
+
- **ORM** (if applicable): Prisma, Drizzle, TypeORM, SQLAlchemy, Mongoose, etc.
|
|
11
|
+
- **Bundler** (if applicable): Vite, Webpack, esbuild, Rollup, Turborepo
|
|
12
|
+
- **Testing**: Vitest, Jest, pytest, Go test, etc.
|
|
13
|
+
- **Project type** (inferred): `frontend` | `backend` | `fullstack` | `library` | `cli` | `monorepo`
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Update Supplement — Post-Merge Gap-Fill Procedure
|
|
2
|
+
|
|
3
|
+
Runs after tech stack merge in Update mode:
|
|
4
|
+
|
|
5
|
+
1. **Module scan**: Re-scan project directories using the same TWO-TIER model from Step 1. Compare discovered modules against existing MODULE_INDEX in root.prizm.
|
|
6
|
+
2. **Missing L1 check**: For any discovered module with no corresponding L1 `.prizm` doc → create L1 immediately and add to MODULE_INDEX.
|
|
7
|
+
3. **Missing L2 check**: For any module/sub-module that has source files with meaningful logic but no L2 `.prizm` doc → create L2 using the L2 GENERATION TEMPLATE. Judgment call: skip trivial wrapper directories or single-config modules.
|
|
8
|
+
4. **Stale L1 check**: For existing L1 docs, verify FILES count and KEY_FILES are still accurate. Update if source directory contents have changed significantly.
|
|
9
|
+
5. **Report**: Include in the Update report: modules added, L1 docs created, L2 docs created, stale docs refreshed.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Feature: [FEATURE_TITLE]
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
[One paragraph describing the feature purpose and business value]
|
|
5
|
+
|
|
6
|
+
## User Stories
|
|
7
|
+
|
|
8
|
+
### US1: [Story Title]
|
|
9
|
+
**As a** [role]
|
|
10
|
+
**I want** [capability]
|
|
11
|
+
**So that** [benefit]
|
|
12
|
+
|
|
13
|
+
**Acceptance Criteria:**
|
|
14
|
+
- [ ] Given [context], When [action], Then [expected result]
|
|
15
|
+
|
|
16
|
+
## Scope
|
|
17
|
+
|
|
18
|
+
### In Scope
|
|
19
|
+
- [Item 1]
|
|
20
|
+
|
|
21
|
+
### Out of Scope
|
|
22
|
+
- [Item 1]
|
|
23
|
+
|
|
24
|
+
## Dependencies
|
|
25
|
+
- [Dependency 1]: [Why needed]
|
|
26
|
+
|
|
27
|
+
## Data Model (if feature involves database changes)
|
|
28
|
+
|
|
29
|
+
### Existing Schema Reference
|
|
30
|
+
<!-- Read existing schema/model files BEFORE designing new tables. Document observed conventions here. -->
|
|
31
|
+
- Tables reviewed: [list existing tables related to this feature]
|
|
32
|
+
- Naming convention: [snake_case/camelCase — match existing]
|
|
33
|
+
- ID strategy: [UUID/auto-increment — match existing]
|
|
34
|
+
- Timestamp pattern: [created_at/updated_at — match existing]
|
|
35
|
+
- Soft delete: [yes/no, field name — match existing]
|
|
36
|
+
|
|
37
|
+
### New/Modified Entities
|
|
38
|
+
| Entity | Type (new/modify) | Key Fields | Relationships | Constraints |
|
|
39
|
+
|--------|-------------------|------------|---------------|-------------|
|
|
40
|
+
| [entity_name] | new | [field: type] | [FK to existing_table] | [NOT NULL, UNIQUE, etc.] |
|
|
41
|
+
|
|
42
|
+
### Open Data Model Questions
|
|
43
|
+
<!-- All questions here MUST be resolved before /prizmkit-plan generates Tasks -->
|
|
44
|
+
- [NEEDS CLARIFICATION] [Any uncertain data model decisions — field types, nullability, relationships]
|
|
45
|
+
|
|
46
|
+
## Constraints
|
|
47
|
+
- [Constraint 1]
|
|
48
|
+
|
|
49
|
+
## Clarifications
|
|
50
|
+
[NEEDS CLARIFICATION]: [Ambiguous item]
|
|
51
|
+
|
|
52
|
+
## Review Checklist
|
|
53
|
+
- [ ] All user stories have acceptance criteria
|
|
54
|
+
- [ ] Scope boundaries are clearly defined
|
|
55
|
+
- [ ] Dependencies are identified
|
|
56
|
+
- [ ] No implementation details (WHAT not HOW)
|