prizmkit 1.0.105 → 1.0.108
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/claude/command-adapter.js +3 -2
- package/bundled/adapters/codebuddy/skill-adapter.js +1 -1
- package/bundled/dev-pipeline/templates/bootstrap-tier1.md +6 -1
- package/bundled/dev-pipeline/templates/bootstrap-tier2.md +6 -1
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +6 -1
- package/bundled/skills/_metadata.json +1 -1
- package/bundled/skills/prizm-kit/SKILL.md +15 -0
- package/bundled/skills/prizmkit-analyze/SKILL.md +6 -1
- package/bundled/skills/prizmkit-clarify/SKILL.md +5 -1
- package/bundled/skills/prizmkit-code-review/SKILL.md +20 -102
- package/bundled/skills/prizmkit-code-review/rules/dimensions-bugfix.md +25 -0
- package/bundled/skills/prizmkit-code-review/rules/dimensions-feature.md +43 -0
- package/bundled/skills/prizmkit-code-review/rules/dimensions-refactor.md +25 -0
- package/bundled/skills/prizmkit-code-review/rules/fix-strategy.md +61 -0
- package/bundled/skills/prizmkit-committer/SKILL.md +16 -3
- package/bundled/skills/prizmkit-implement/SKILL.md +9 -5
- package/bundled/skills/prizmkit-plan/SKILL.md +9 -5
- package/bundled/skills/prizmkit-prizm-docs/assets/PRIZM-SPEC.md +1 -1
- package/bundled/skills/prizmkit-retrospective/SKILL.md +5 -5
- package/package.json +1 -1
package/bundled/VERSION.json
CHANGED
|
@@ -102,8 +102,9 @@ export async function installCommand(corePath, targetRoot) {
|
|
|
102
102
|
const skillName = path.basename(corePath);
|
|
103
103
|
const hasAssets = existsSync(path.join(corePath, 'assets'));
|
|
104
104
|
const hasScripts = existsSync(path.join(corePath, 'scripts'));
|
|
105
|
+
const hasRules = existsSync(path.join(corePath, 'rules'));
|
|
105
106
|
|
|
106
|
-
if (hasAssets || hasScripts) {
|
|
107
|
+
if (hasAssets || hasScripts || hasRules) {
|
|
107
108
|
// Use directory structure for commands with resources
|
|
108
109
|
const targetDir = path.join(targetRoot, COMMANDS_DIR, skillName);
|
|
109
110
|
mkdirSync(targetDir, { recursive: true });
|
|
@@ -117,7 +118,7 @@ export async function installCommand(corePath, targetRoot) {
|
|
|
117
118
|
}
|
|
118
119
|
|
|
119
120
|
// Copy assets and scripts
|
|
120
|
-
for (const subdir of ['scripts', 'assets']) {
|
|
121
|
+
for (const subdir of ['scripts', 'assets', 'rules']) {
|
|
121
122
|
const srcSubdir = path.join(corePath, subdir);
|
|
122
123
|
if (existsSync(srcSubdir)) {
|
|
123
124
|
cpSync(srcSubdir, path.join(targetDir, subdir), { recursive: true });
|
|
@@ -58,7 +58,7 @@ export async function installSkill(corePath, targetRoot, options = {}) {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
// Copy scripts/ and assets/ if they exist
|
|
61
|
-
for (const subdir of ['scripts', 'assets']) {
|
|
61
|
+
for (const subdir of ['scripts', 'assets', 'rules']) {
|
|
62
62
|
const srcSubdir = path.join(corePath, subdir);
|
|
63
63
|
if (existsSync(srcSubdir)) {
|
|
64
64
|
cpSync(srcSubdir, path.join(targetDir, subdir), { recursive: true });
|
|
@@ -80,7 +80,7 @@ cat .prizmkit/specs/{{FEATURE_SLUG}}/failure-log.md 2>/dev/null || echo "NO_PREV
|
|
|
80
80
|
If failure-log.md exists:
|
|
81
81
|
- Read ROOT_CAUSE and SUGGESTION — adjust your approach accordingly
|
|
82
82
|
- Read DISCOVERED_TRAPS — if any are genuine, inject into .prizm-docs/ during Phase 4 retrospective
|
|
83
|
-
- Do NOT delete failure-log.md until this session
|
|
83
|
+
- Do NOT delete failure-log.md until this session completes all phases and commits successfully
|
|
84
84
|
|
|
85
85
|
```bash
|
|
86
86
|
ls .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md 2>/dev/null && echo "EXISTS" || echo "MISSING"
|
|
@@ -193,6 +193,11 @@ If you encounter an unrecoverable error, context overflow, or are about to exit
|
|
|
193
193
|
|
|
194
194
|
2. This file is intentionally lightweight — write it BEFORE context runs out.
|
|
195
195
|
|
|
196
|
+
**Lifecycle**: failure-log.md is a temporary cross-session artifact. Do NOT commit it to git. After a successful session (all phases complete + commit done), delete it:
|
|
197
|
+
```bash
|
|
198
|
+
rm -f .prizmkit/specs/{{FEATURE_SLUG}}/failure-log.md
|
|
199
|
+
```
|
|
200
|
+
|
|
196
201
|
## Reminders
|
|
197
202
|
|
|
198
203
|
- Tier 1: you handle everything directly — no subagents needed
|
|
@@ -91,7 +91,7 @@ cat .prizmkit/specs/{{FEATURE_SLUG}}/failure-log.md 2>/dev/null || echo "NO_PREV
|
|
|
91
91
|
If failure-log.md exists:
|
|
92
92
|
- Read ROOT_CAUSE and SUGGESTION — adjust your approach accordingly
|
|
93
93
|
- Read DISCOVERED_TRAPS — if any are genuine, inject into .prizm-docs/ during Phase 5 retrospective
|
|
94
|
-
- Do NOT delete failure-log.md until this session
|
|
94
|
+
- Do NOT delete failure-log.md until this session completes all phases and commits successfully
|
|
95
95
|
|
|
96
96
|
```bash
|
|
97
97
|
ls .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md 2>/dev/null && echo "EXISTS" || echo "MISSING"
|
|
@@ -242,6 +242,11 @@ If you encounter an unrecoverable error, context overflow, or are about to exit
|
|
|
242
242
|
|
|
243
243
|
2. This file is intentionally lightweight — write it BEFORE context runs out.
|
|
244
244
|
|
|
245
|
+
**Lifecycle**: failure-log.md is a temporary cross-session artifact. Do NOT commit it to git. After a successful session (all phases complete + commit done), delete it:
|
|
246
|
+
```bash
|
|
247
|
+
rm -f .prizmkit/specs/{{FEATURE_SLUG}}/failure-log.md
|
|
248
|
+
```
|
|
249
|
+
|
|
245
250
|
## Reminders
|
|
246
251
|
|
|
247
252
|
- Tier 2: orchestrator builds context+plan, Dev implements, Reviewer reviews+tests — use direct Agent spawn for agents
|
|
@@ -154,7 +154,7 @@ cat .prizmkit/specs/{{FEATURE_SLUG}}/failure-log.md 2>/dev/null || echo "NO_PREV
|
|
|
154
154
|
If failure-log.md exists:
|
|
155
155
|
- Read ROOT_CAUSE and SUGGESTION — adjust your approach accordingly
|
|
156
156
|
- Read DISCOVERED_TRAPS — if any are genuine, inject into .prizm-docs/ during Phase 6 retrospective
|
|
157
|
-
- Do NOT delete failure-log.md until this session
|
|
157
|
+
- Do NOT delete failure-log.md until this session completes all phases and commits successfully
|
|
158
158
|
|
|
159
159
|
Check existing artifacts first:
|
|
160
160
|
```bash
|
|
@@ -422,6 +422,11 @@ If you encounter an unrecoverable error, context overflow, or are about to exit
|
|
|
422
422
|
|
|
423
423
|
2. This file is intentionally lightweight — write it BEFORE context runs out.
|
|
424
424
|
|
|
425
|
+
**Lifecycle**: failure-log.md is a temporary cross-session artifact. Do NOT commit it to git. After a successful session (all phases complete + commit done), delete it:
|
|
426
|
+
```bash
|
|
427
|
+
rm -f .prizmkit/specs/{{FEATURE_SLUG}}/failure-log.md
|
|
428
|
+
```
|
|
429
|
+
|
|
425
430
|
## Reminders
|
|
426
431
|
|
|
427
432
|
- Tier 3: full team — Dev (implementation) → Reviewer (review + test) — spawn agents directly via Agent tool
|
|
@@ -71,6 +71,21 @@ PrizmKit produces two complementary knowledge layers:
|
|
|
71
71
|
.prizmkit/specs/ → Feature "what to do" (workflow: spec → plan → code(implement))
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
+
## Core Skill Reference
|
|
75
|
+
|
|
76
|
+
| Skill | Purpose | Trigger Phrases |
|
|
77
|
+
|-------|---------|-----------------|
|
|
78
|
+
| `/prizmkit-specify` | Natural language → structured spec.md | "specify", "new feature", "I want to add..." |
|
|
79
|
+
| `/prizmkit-clarify` | Resolve spec ambiguities interactively | "clarify", "refine spec", "resolve ambiguities" |
|
|
80
|
+
| `/prizmkit-plan` | Spec → plan.md with architecture + tasks | "plan", "architect", "break it down", "create tasks" |
|
|
81
|
+
| `/prizmkit-analyze` | Cross-doc consistency check (read-only) | "analyze", "check consistency", "validate spec" |
|
|
82
|
+
| `/prizmkit-implement` | Execute plan.md tasks, write code (TDD) | "implement", "build", "code it", "start coding" |
|
|
83
|
+
| `/prizmkit-code-review` | Diagnose issues + produce Fix Instructions | "review", "check code", "is it ready to commit" |
|
|
84
|
+
| `/prizmkit-retrospective` | Sync .prizm-docs/ with code changes | "retrospective", "retro", "sync docs", "wrap up" |
|
|
85
|
+
| `/prizmkit-committer` | Safe git commit with Conventional Commits | "commit", "submit", "finish", "ship it" |
|
|
86
|
+
| `/prizmkit-init` | Project bootstrap + .prizm-docs/ setup | "init", "initialize", "take over this project" |
|
|
87
|
+
| `/prizmkit-prizm-docs` | Doc management (init/status/rebuild/validate) | "check docs", "rebuild docs", "validate docs" |
|
|
88
|
+
|
|
74
89
|
**Reading guide**:
|
|
75
90
|
- Need code structure/modules/interfaces/traps/decisions? → `.prizm-docs/`
|
|
76
91
|
|
|
@@ -12,7 +12,12 @@ Perform a non-destructive cross-artifact consistency and quality analysis across
|
|
|
12
12
|
- User says "analyze", "check consistency", "validate spec", "review plan"
|
|
13
13
|
- Before `/prizmkit-implement` as a quality gate
|
|
14
14
|
|
|
15
|
-
**PRECONDITION:**
|
|
15
|
+
**PRECONDITION:**
|
|
16
|
+
|
|
17
|
+
| Required Artifact | Directory | Check | If Missing |
|
|
18
|
+
|---|---|---|---|
|
|
19
|
+
| `spec.md` | `.prizmkit/specs/###-feature-name/` | File exists | Run `/prizmkit-specify` |
|
|
20
|
+
| `plan.md` (with Tasks section) | `.prizmkit/specs/###-feature-name/` | File exists + has Tasks section | Run `/prizmkit-plan` |
|
|
16
21
|
|
|
17
22
|
## Operating Constraints
|
|
18
23
|
|
|
@@ -12,7 +12,11 @@ Interactive requirement clarification that resolves ambiguities in feature speci
|
|
|
12
12
|
- User says "clarify", "resolve ambiguities", "refine spec"
|
|
13
13
|
- Before `/prizmkit-plan` to ensure spec is unambiguous
|
|
14
14
|
|
|
15
|
-
**PRECONDITION:**
|
|
15
|
+
**PRECONDITION:**
|
|
16
|
+
|
|
17
|
+
| Required Artifact | Directory | Check | If Missing |
|
|
18
|
+
|---|---|---|---|
|
|
19
|
+
| `spec.md` | `.prizmkit/specs/###-feature-name/` | File exists with `[NEEDS CLARIFICATION]` markers or underspecified areas | Run `/prizmkit-specify` first |
|
|
16
20
|
|
|
17
21
|
## Execution Steps
|
|
18
22
|
|
|
@@ -7,8 +7,8 @@ description: "Code review with fix strategy formulation. Diagnoses issues across
|
|
|
7
7
|
|
|
8
8
|
Perform a comprehensive code review against the feature spec, implementation plan, and project best practices. This skill has two phases:
|
|
9
9
|
|
|
10
|
-
1. **Diagnostic Review** — read-only analysis
|
|
11
|
-
2. **Fix Strategy Formulation** — for each finding,
|
|
10
|
+
1. **Diagnostic Review** — read-only analysis producing findings with severity ratings
|
|
11
|
+
2. **Fix Strategy Formulation** — for each finding, produce actionable Fix Instructions
|
|
12
12
|
|
|
13
13
|
The review itself is read-only. Fix Instructions are structured guidance for the developer — the reviewer does not modify code.
|
|
14
14
|
|
|
@@ -17,58 +17,35 @@ The review itself is read-only. Fix Instructions are structured guidance for the
|
|
|
17
17
|
- User says "review", "check code", "review my implementation"
|
|
18
18
|
- As a quality gate before `/prizmkit-committer`
|
|
19
19
|
|
|
20
|
-
**PRECONDITION
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
**PRECONDITION:**
|
|
21
|
+
|
|
22
|
+
| Mode | Required Artifacts | Directory | Check | If Missing |
|
|
23
|
+
|---|---|---|---|---|
|
|
24
|
+
| **Feature** | `spec.md` + `plan.md` (with Tasks) | `.prizmkit/specs/###-feature-name/` | Files exist + tasks completed | Run `/prizmkit-implement` |
|
|
25
|
+
| **Refactor** | `refactor-analysis.md` + `plan.md` (with Tasks) | `.prizmkit/refactor/<refactor-slug>/` | Files exist + tasks completed. Review against behavior preservation, not spec. | Run `/prizmkit-implement` in refactor mode |
|
|
26
|
+
| **Bugfix** | `fix-plan.md` | `.prizmkit/bugfix/<BUG_ID>/` | File exists + tasks completed. Review against bug description + reproduction test. | Run `/prizmkit-implement` in bugfix mode |
|
|
27
|
+
|
|
28
|
+
**Auto-detect**: Check which artifact directory was passed by the calling workflow, or scan `.prizmkit/` for the most recently modified feature/refactor/bugfix directory.
|
|
25
29
|
|
|
26
30
|
## Phase 1: Diagnostic Review
|
|
27
31
|
|
|
28
|
-
1. **Detect mode and load review baseline**:
|
|
29
|
-
- If `spec.md` exists → **Feature mode**: read `spec.md` + `plan.md` as baseline.
|
|
30
|
-
- If `refactor-analysis.md` exists → **Refactor mode**: read `refactor-analysis.md` + `plan.md` as baseline.
|
|
31
|
-
- If `fix-plan.md` exists → **Bugfix mode**: read `fix-plan.md` as baseline.
|
|
32
|
+
1. **Detect mode and load review baseline + dimension rules**:
|
|
33
|
+
- If `spec.md` exists → **Feature mode**: read `spec.md` + `plan.md` as baseline. Load `${SKILL_DIR}/rules/dimensions-feature.md` for review dimensions.
|
|
34
|
+
- If `refactor-analysis.md` exists → **Refactor mode**: read `refactor-analysis.md` + `plan.md` as baseline. Load `${SKILL_DIR}/rules/dimensions-refactor.md` for review dimensions.
|
|
35
|
+
- If `fix-plan.md` exists → **Bugfix mode**: read `fix-plan.md` as baseline. Load `${SKILL_DIR}/rules/dimensions-bugfix.md` for review dimensions.
|
|
32
36
|
- If none found → prompt user: "No review baseline found. Which workflow are you in? (feature/refactor/bugfix)"
|
|
33
37
|
2. Read **architecture index**: `.prizm-docs/root.prizm` RULES and PATTERNS for project conventions
|
|
34
38
|
3. Read **past decisions**: check DECISIONS sections in relevant `.prizm-docs/` L1/L2 files — helps verify implementation respects established conventions
|
|
35
39
|
4. Read '## Implementation Log' section of context-snapshot.md in the feature directory (if exists) — understand Dev's implementation decisions, trade-offs, and notable discoveries. This context helps distinguish intentional design choices from accidental patterns during review.
|
|
36
40
|
5. Scan all code files referenced in completed tasks
|
|
37
|
-
6. Review across
|
|
38
|
-
- **Spec compliance**: Does code implement all acceptance criteria? Missing criteria are the #1 source of "it works but it's wrong" bugs
|
|
39
|
-
- **Plan adherence**: Does implementation follow architectural decisions in plan.md? Deviations may be improvements or may break assumptions other components depend on
|
|
40
|
-
- **Code quality**: Naming, structure, complexity, DRY. Focus on maintainability — will someone understand this code in 6 months?
|
|
41
|
-
- **Security**: Injection (SQL, XSS, command), auth/authz gaps, sensitive data exposure, insecure defaults. Security issues are always HIGH+ because they're the hardest to catch later
|
|
42
|
-
- **Consistency**: Follows project patterns from `.prizm-docs/` PATTERNS section. Inconsistent patterns increase cognitive load for every future reader
|
|
43
|
-
- **Test coverage**: Are critical paths tested? Focus on paths that handle user input, money, or state transitions
|
|
41
|
+
6. Review across all dimensions defined in the loaded rules file
|
|
44
42
|
7. Generate findings with severity: `CRITICAL` > `HIGH` > `MEDIUM` > `LOW`
|
|
45
43
|
|
|
46
44
|
## Phase 2: Fix Strategy Formulation
|
|
47
45
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
1. **Root Cause Analysis** — identify WHY the problem exists, not just WHAT is wrong. Trace the issue to its origin (wrong assumption? missing context? copy-paste error?)
|
|
51
|
-
2. **Impact Analysis** — search the codebase for all callers/dependents of the affected code. List concrete file:line locations that will be affected by the fix
|
|
52
|
-
3. **Fix Strategy** — concrete step-by-step modification plan:
|
|
53
|
-
- What to change, where, and in what order
|
|
54
|
-
- Which project conventions to follow (reference `.prizm-docs/` RULES)
|
|
55
|
-
- Dependencies between fixes (FIX-1 must be done before FIX-3)
|
|
56
|
-
4. **Code Guidance** — show before/after code snippets for the key change. Keep minimal — enough to unambiguate the approach, not a full implementation
|
|
57
|
-
5. **Verification Criteria** — how to confirm the fix works:
|
|
58
|
-
- Specific commands to run (grep patterns, test commands)
|
|
59
|
-
- What the output should look like
|
|
60
|
-
- Edge cases to verify
|
|
61
|
-
|
|
62
|
-
### Finding Grouping
|
|
63
|
-
|
|
64
|
-
Group related findings that should be fixed together. If FIX-1 and FIX-3 share the same root cause or affect the same code path, mark them as a group with a shared fix strategy. This prevents Dev from fixing symptoms individually only to have the underlying cause persist.
|
|
46
|
+
Load `${SKILL_DIR}/rules/fix-strategy.md` for the complete fix formulation process, finding format, grouping rules, and priority ordering.
|
|
65
47
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
Order Fix Instructions by:
|
|
69
|
-
1. **Dependencies first** — if FIX-2 depends on FIX-1, FIX-1 comes first
|
|
70
|
-
2. **CRITICAL before HIGH** — severity determines priority within independent fixes
|
|
71
|
-
3. **Grouped fixes together** — related findings are adjacent
|
|
48
|
+
For each finding from Phase 1 (CRITICAL and HIGH are mandatory; MEDIUM/LOW when actionable), follow the fix strategy rules to produce structured Fix Instructions.
|
|
72
49
|
|
|
73
50
|
## Severity & Verdict
|
|
74
51
|
|
|
@@ -83,65 +60,6 @@ Cap findings at 30 to keep the review actionable. If there are more, summarize t
|
|
|
83
60
|
|
|
84
61
|
If you're unsure whether something is a bug or intentional design, flag it as MEDIUM with a note asking the developer to confirm. Don't silently skip uncertain findings.
|
|
85
62
|
|
|
86
|
-
## Finding Format
|
|
87
|
-
|
|
88
|
-
```
|
|
89
|
-
#### FIX-1: [CRITICAL] SQL Injection in User Search
|
|
90
|
-
- Location: src/services/userService.ts:47
|
|
91
|
-
- Dimension: security
|
|
92
|
-
- Root Cause: User input `searchTerm` is interpolated directly into SQL query
|
|
93
|
-
string. The `buildQuery()` helper (line 12) accepts raw strings without
|
|
94
|
-
sanitization, and all callers trust it blindly.
|
|
95
|
-
- Impact: All callers of `searchUsers()` are affected — found 3 call sites:
|
|
96
|
-
routes/api.ts:89, routes/admin.ts:34, services/reportService.ts:112
|
|
97
|
-
- Fix Strategy:
|
|
98
|
-
1. Replace string interpolation with parameterized query at line 47
|
|
99
|
-
2. Update `buildQuery()` helper to accept params array
|
|
100
|
-
3. Update all 3 call sites to pass params
|
|
101
|
-
Note: project uses `pg` client directly (not ORM), follow the pattern
|
|
102
|
-
established in `orderService.ts:23` per .prizm-docs/ RULES
|
|
103
|
-
- Code Guidance:
|
|
104
|
-
```ts
|
|
105
|
-
// line 47: change from
|
|
106
|
-
const result = await db.query(`SELECT * FROM users WHERE name LIKE '%${searchTerm}%'`);
|
|
107
|
-
// to
|
|
108
|
-
const result = await db.query('SELECT * FROM users WHERE name LIKE $1', [`%${searchTerm}%`]);
|
|
109
|
-
```
|
|
110
|
-
- Verification:
|
|
111
|
-
- `grep -rn "\${.*}" src/ --include="*.ts"` returns no SQL-context matches
|
|
112
|
-
- Test `user.search.test.ts` covers parameterized path
|
|
113
|
-
- Existing test suite passes
|
|
114
|
-
- Related: FIX-3 (same pattern in reportService)
|
|
115
|
-
- Depends On: (none)
|
|
116
|
-
- Blocks: FIX-3
|
|
117
|
-
|
|
118
|
-
#### FIX-2: [HIGH] Missing Acceptance Criterion AC-3
|
|
119
|
-
- Location: src/routes/upload.ts
|
|
120
|
-
- Dimension: spec-compliance
|
|
121
|
-
- Root Cause: spec.md §AC-3 requires "display progress bar during upload" but
|
|
122
|
-
the upload handler uses a simple fetch() without progress tracking.
|
|
123
|
-
Implementation Log does not mention this criterion — likely overlooked.
|
|
124
|
-
- Impact: Upload route only — no cross-module impact
|
|
125
|
-
- Fix Strategy:
|
|
126
|
-
1. Replace fetch() with XMLHttpRequest or fetch + ReadableStream
|
|
127
|
-
2. Add progress callback that emits percentage events
|
|
128
|
-
3. Wire progress events to the UI component (if frontend exists)
|
|
129
|
-
- Code Guidance:
|
|
130
|
-
```ts
|
|
131
|
-
// Replace simple fetch with progress-aware upload
|
|
132
|
-
const xhr = new XMLHttpRequest();
|
|
133
|
-
xhr.upload.onprogress = (e) => {
|
|
134
|
-
if (e.lengthComputable) onProgress(Math.round(e.loaded / e.total * 100));
|
|
135
|
-
};
|
|
136
|
-
```
|
|
137
|
-
- Verification:
|
|
138
|
-
- Upload a file > 1MB and verify progress callback fires
|
|
139
|
-
- Test covers progress event emission
|
|
140
|
-
- Related: (none)
|
|
141
|
-
- Depends On: (none)
|
|
142
|
-
- Blocks: (none)
|
|
143
|
-
```
|
|
144
|
-
|
|
145
63
|
## Review Notes Format
|
|
146
64
|
|
|
147
65
|
When writing to context-snapshot.md, use this structured format:
|
|
@@ -156,7 +74,7 @@ When writing to context-snapshot.md, use this structured format:
|
|
|
156
74
|
### Fix Instructions (ordered by priority)
|
|
157
75
|
|
|
158
76
|
#### FIX-1: [SEVERITY] Title
|
|
159
|
-
(
|
|
77
|
+
(finding format per ${SKILL_DIR}/rules/fix-strategy.md)
|
|
160
78
|
|
|
161
79
|
#### FIX-2: [SEVERITY] Title
|
|
162
80
|
...
|
|
@@ -177,7 +95,7 @@ In unattended pipeline mode, the review→fix→review cycle can loop indefinite
|
|
|
177
95
|
- Track a `review_iteration` counter starting at 1. Each review-fix-review cycle increments the counter.
|
|
178
96
|
- **max_iterations = 5**: If `review_iteration >= 5`, you MUST proceed to `/prizmkit-retrospective` regardless of remaining findings. Log remaining issues as known technical debt: "Loop protection triggered — proceeding to retrospective with N unresolved findings (iterations: 5/5)."
|
|
179
97
|
- Unresolved findings should be recorded in the review report so they can be tracked as follow-up work.
|
|
180
|
-
- On re-review (iteration > 1): only check the specific Verification Criteria from previous Fix Instructions + scan for regressions. Do NOT re-run the full
|
|
98
|
+
- On re-review (iteration > 1): only check the specific Verification Criteria from previous Fix Instructions + scan for regressions. Do NOT re-run the full dimension review unless new code was added beyond the fix scope.
|
|
181
99
|
|
|
182
100
|
## Output
|
|
183
101
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Review Dimensions — Bugfix Mode
|
|
2
|
+
|
|
3
|
+
Review code against `fix-plan.md` and the bug description. Minimal scope — the fix should change as little as possible.
|
|
4
|
+
|
|
5
|
+
## Bugfix-Specific Dimensions
|
|
6
|
+
|
|
7
|
+
### Bug Actually Fixed
|
|
8
|
+
- The reproduction steps from fix-plan.md no longer trigger the bug
|
|
9
|
+
- The root cause identified in fix-plan.md is addressed (not just symptoms)
|
|
10
|
+
- A regression test exists that would catch this bug if reintroduced
|
|
11
|
+
|
|
12
|
+
### No Regressions
|
|
13
|
+
- All existing tests still pass
|
|
14
|
+
- The fix does not change behavior for non-buggy inputs
|
|
15
|
+
- Related code paths are not inadvertently affected
|
|
16
|
+
|
|
17
|
+
### Minimal Change Scope
|
|
18
|
+
- Only files directly related to the bug are modified
|
|
19
|
+
- No "while I'm here" refactoring mixed with the fix
|
|
20
|
+
- If scope creep is detected, flag it — those changes belong in a separate commit
|
|
21
|
+
|
|
22
|
+
### Reproduction Test
|
|
23
|
+
- A test exists that reproduces the exact bug scenario
|
|
24
|
+
- The test would fail on the pre-fix code and pass on the post-fix code
|
|
25
|
+
- The test covers the specific input/state that triggered the bug
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Review Dimensions — Feature Mode
|
|
2
|
+
|
|
3
|
+
Review code against `spec.md` and `plan.md` across 6 dimensions:
|
|
4
|
+
|
|
5
|
+
## 1. Spec Compliance
|
|
6
|
+
Does code implement all acceptance criteria? Missing criteria are the #1 source of "it works but it's wrong" bugs.
|
|
7
|
+
- Check every acceptance criterion in spec.md has a corresponding implementation
|
|
8
|
+
- Verify edge cases mentioned in spec are handled
|
|
9
|
+
- Confirm scope boundaries are respected (no over-implementation, no under-implementation)
|
|
10
|
+
|
|
11
|
+
## 2. Plan Adherence
|
|
12
|
+
Does implementation follow architectural decisions in plan.md? Deviations may be improvements or may break assumptions other components depend on.
|
|
13
|
+
- Check component structure matches plan's architecture approach
|
|
14
|
+
- Verify data model matches plan's schema design
|
|
15
|
+
- Confirm API contracts (endpoints, request/response) match plan
|
|
16
|
+
|
|
17
|
+
## 3. Code Quality
|
|
18
|
+
Naming, structure, complexity, DRY. Focus on maintainability — will someone understand this code in 6 months?
|
|
19
|
+
- Function/variable names are descriptive and consistent with project conventions
|
|
20
|
+
- No unnecessary complexity (cyclomatic complexity, deep nesting)
|
|
21
|
+
- No copy-paste duplication that should be abstracted
|
|
22
|
+
- Error messages are informative for debugging
|
|
23
|
+
|
|
24
|
+
## 4. Security
|
|
25
|
+
Injection (SQL, XSS, command), auth/authz gaps, sensitive data exposure, insecure defaults. Security issues are always HIGH+ because they're the hardest to catch later.
|
|
26
|
+
- User input is validated and sanitized before use in queries, HTML, or commands
|
|
27
|
+
- Authentication and authorization checks are present on protected routes
|
|
28
|
+
- Sensitive data (passwords, tokens, PII) is not logged or exposed in responses
|
|
29
|
+
- Cryptographic operations use established libraries, not custom implementations
|
|
30
|
+
|
|
31
|
+
## 5. Consistency
|
|
32
|
+
Follows project patterns from `.prizm-docs/` PATTERNS section. Inconsistent patterns increase cognitive load for every future reader.
|
|
33
|
+
- Code style matches existing codebase conventions
|
|
34
|
+
- Error handling follows established patterns
|
|
35
|
+
- File organization follows project structure conventions
|
|
36
|
+
- Naming conventions align with `.prizm-docs/` RULES
|
|
37
|
+
|
|
38
|
+
## 6. Test Coverage
|
|
39
|
+
Are critical paths tested? Focus on paths that handle user input, money, or state transitions.
|
|
40
|
+
- Happy path tests exist for each user story
|
|
41
|
+
- Error/edge case tests for critical paths
|
|
42
|
+
- Tests are deterministic (no flaky timing dependencies)
|
|
43
|
+
- Test names clearly describe what they verify
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Review Dimensions — Refactor Mode
|
|
2
|
+
|
|
3
|
+
Review code against `refactor-analysis.md` goals. Standard dimensions (code quality, security, consistency, test coverage) still apply — load `${SKILL_DIR}/rules/dimensions-feature.md` §3–§6 for those.
|
|
4
|
+
|
|
5
|
+
## Refactor-Specific Dimensions
|
|
6
|
+
|
|
7
|
+
### Behavior Preservation (replaces Spec Compliance)
|
|
8
|
+
Observable behavior must remain unchanged. This is the #1 refactor risk — "improving" code that subtly changes behavior.
|
|
9
|
+
- All existing tests still pass without modification (test changes during refactor are a red flag)
|
|
10
|
+
- Public API signatures are unchanged (parameter types, return types, error types)
|
|
11
|
+
- Side effects (logging, metrics, events) are preserved unless explicitly scoped for removal
|
|
12
|
+
- Edge case handling is preserved — refactors often silently drop edge case branches
|
|
13
|
+
|
|
14
|
+
### Structural Improvement (replaces Plan Adherence)
|
|
15
|
+
Is the code measurably better against the refactor goals?
|
|
16
|
+
- Complexity metrics improved (fewer nested conditions, shorter functions)
|
|
17
|
+
- Coupling reduced (fewer cross-module imports, clearer boundaries)
|
|
18
|
+
- Duplication reduced (DRY violations eliminated per refactor-analysis.md scope)
|
|
19
|
+
- Readability improved (naming, organization, documentation)
|
|
20
|
+
|
|
21
|
+
### Test Integrity
|
|
22
|
+
Refactors must not weaken the test suite.
|
|
23
|
+
- No tests were deleted or skipped
|
|
24
|
+
- Test coverage percentage is equal or higher
|
|
25
|
+
- If tests were rewritten, they cover the same behavioral scenarios
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Fix Strategy Formulation
|
|
2
|
+
|
|
3
|
+
For each finding from the Diagnostic Review (CRITICAL and HIGH mandatory; MEDIUM/LOW when actionable):
|
|
4
|
+
|
|
5
|
+
## Per-Finding Analysis
|
|
6
|
+
|
|
7
|
+
### 1. Root Cause Analysis
|
|
8
|
+
Identify WHY the problem exists, not just WHAT is wrong. Trace the issue to its origin (wrong assumption? missing context? copy-paste error?).
|
|
9
|
+
|
|
10
|
+
### 2. Impact Analysis
|
|
11
|
+
Search the codebase for all callers/dependents of the affected code. List concrete `file:line` locations that will be affected by the fix.
|
|
12
|
+
|
|
13
|
+
### 3. Fix Strategy
|
|
14
|
+
Concrete step-by-step modification plan:
|
|
15
|
+
- What to change, where, and in what order
|
|
16
|
+
- Which project conventions to follow (reference `.prizm-docs/` RULES)
|
|
17
|
+
- Dependencies between fixes (FIX-1 must be done before FIX-3)
|
|
18
|
+
|
|
19
|
+
### 4. Code Guidance
|
|
20
|
+
Show before/after code snippets for the key change. Keep minimal — enough to unambiguate the approach, not a full implementation.
|
|
21
|
+
|
|
22
|
+
### 5. Verification Criteria
|
|
23
|
+
How to confirm the fix works:
|
|
24
|
+
- Specific commands to run (grep patterns, test commands)
|
|
25
|
+
- What the output should look like
|
|
26
|
+
- Edge cases to verify
|
|
27
|
+
|
|
28
|
+
## Finding Grouping
|
|
29
|
+
|
|
30
|
+
Group related findings that should be fixed together. If FIX-1 and FIX-3 share the same root cause or affect the same code path, mark them as a group with a shared fix strategy. This prevents Dev from fixing symptoms individually only to have the underlying cause persist.
|
|
31
|
+
|
|
32
|
+
## Fix Priority Ordering
|
|
33
|
+
|
|
34
|
+
Order Fix Instructions by:
|
|
35
|
+
1. **Dependencies first** — if FIX-2 depends on FIX-1, FIX-1 comes first
|
|
36
|
+
2. **CRITICAL before HIGH** — severity determines priority within independent fixes
|
|
37
|
+
3. **Grouped fixes together** — related findings are adjacent
|
|
38
|
+
|
|
39
|
+
## Finding Format
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
#### FIX-N: [SEVERITY] Title
|
|
43
|
+
- Location: file:line
|
|
44
|
+
- Dimension: category
|
|
45
|
+
- Root Cause: explanation
|
|
46
|
+
- Impact: affected callers/dependents with file:line locations
|
|
47
|
+
- Fix Strategy:
|
|
48
|
+
1. step one
|
|
49
|
+
2. step two
|
|
50
|
+
Note: reference project conventions from .prizm-docs/ RULES
|
|
51
|
+
- Code Guidance:
|
|
52
|
+
```language
|
|
53
|
+
// before → after
|
|
54
|
+
```
|
|
55
|
+
- Verification:
|
|
56
|
+
- command to run
|
|
57
|
+
- expected output
|
|
58
|
+
- Related: FIX-X (if grouped)
|
|
59
|
+
- Depends On: FIX-Y (if dependency)
|
|
60
|
+
- Blocks: FIX-Z (if blocking)
|
|
61
|
+
```
|
|
@@ -14,6 +14,14 @@ Pure git commit workflow. Analyzes changes, generates a Conventional Commits mes
|
|
|
14
14
|
- After `/prizmkit-retrospective` has finished architecture sync
|
|
15
15
|
- The UserPromptSubmit hook will remind to use this skill when commit intent is detected
|
|
16
16
|
|
|
17
|
+
**PRECONDITION:**
|
|
18
|
+
|
|
19
|
+
| Required State | Check | If Missing |
|
|
20
|
+
|---|---|---|
|
|
21
|
+
| Uncommitted changes exist | `git status` shows modified/added/untracked files | Inform user "nothing to commit" and stop |
|
|
22
|
+
| `.prizm-docs/` synced (feature/refactor) | `/prizmkit-retrospective` has run | Run `/prizmkit-retrospective` first |
|
|
23
|
+
| Code review passed (pipeline mode) | `context-snapshot.md` has Review Notes with PASS/PASS_WITH_WARNINGS | Run `/prizmkit-code-review` first |
|
|
24
|
+
|
|
17
25
|
### Workflow
|
|
18
26
|
|
|
19
27
|
Follow these steps STRICTLY in order:
|
|
@@ -32,9 +40,14 @@ By consulting the primary agent or based on the existing context, condense this
|
|
|
32
40
|
If CHANGELOG.md exists in the project root, append an entry following Keep a Changelog format under the `[Unreleased]` section. Match the existing style in the file.
|
|
33
41
|
|
|
34
42
|
#### Step 4: Git Commit
|
|
35
|
-
|
|
36
|
-
git add .
|
|
37
|
-
|
|
43
|
+
|
|
44
|
+
Stage changes using a safe strategy — **never use `git add .` or `git add -A`** as they may stage sensitive files (.env, credentials, secrets) or unintended changes:
|
|
45
|
+
|
|
46
|
+
1. Review untracked files with `git status`. Warn the user if any files match sensitive patterns (`.env*`, `*credential*`, `*secret*`, `*.pem`, `*.key`).
|
|
47
|
+
2. Stage tracked modified files: `git add -u`
|
|
48
|
+
3. For new files: stage explicitly by name after confirming they should be included.
|
|
49
|
+
4. Verify staged content with `git diff --cached --stat` before committing.
|
|
50
|
+
|
|
38
51
|
```bash
|
|
39
52
|
git commit -m "<type>(<scope>): <description>"
|
|
40
53
|
```
|
|
@@ -12,11 +12,15 @@ Execute implementation by following the task breakdown in plan.md. Respects task
|
|
|
12
12
|
- User says "implement", "build", "code it", "start coding", "develop"
|
|
13
13
|
- For fast-path: user describes a simple change directly (fast-path skips specify, but still requires a simplified plan.md with Tasks section)
|
|
14
14
|
|
|
15
|
-
**PRECONDITION
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
**PRECONDITION:**
|
|
16
|
+
|
|
17
|
+
| Mode | Required Artifact | Directory | Check | If Missing |
|
|
18
|
+
|---|---|---|---|---|
|
|
19
|
+
| **Feature** (default) | `plan.md` with Tasks section | `.prizmkit/specs/###-feature-name/` | File exists + unchecked tasks | Run `/prizmkit-plan` |
|
|
20
|
+
| **Refactor** | `plan.md` with Tasks section | `.prizmkit/refactor/<refactor-slug>/` | File exists + unchecked tasks | Run `/prizmkit-plan` in refactor mode |
|
|
21
|
+
| **Bugfix** | `plan.md` with Tasks section | `.prizmkit/bugfix/<BUG_ID>/` | File exists + unchecked tasks | Run `/prizmkit-plan` in bugfix mode |
|
|
22
|
+
|
|
23
|
+
**Auto-detect**: If the calling workflow passes an explicit artifact directory, use that. Otherwise scan `.prizmkit/` subdirectories for the most recently modified `plan.md` with unchecked tasks.
|
|
20
24
|
|
|
21
25
|
## Execution Steps
|
|
22
26
|
|
|
@@ -18,11 +18,15 @@ Generate a comprehensive technical implementation plan from a feature specificat
|
|
|
18
18
|
- Simple bug fix or config change → use fast path (`/prizmkit-plan` with simplified output → `/prizmkit-implement` → `/prizmkit-committer`)
|
|
19
19
|
- User just wants to explore/research → answer directly, no plan artifact needed
|
|
20
20
|
|
|
21
|
-
**PRECONDITION
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
**PRECONDITION:**
|
|
22
|
+
|
|
23
|
+
| Mode | Required Artifact | Directory | Check | If Missing |
|
|
24
|
+
|---|---|---|---|---|
|
|
25
|
+
| **Feature** (default) | `spec.md` + `.prizm-docs/root.prizm` | `.prizmkit/specs/###-feature-name/` | File exists | Prompt: "No spec found — run `/prizmkit-specify` first?" |
|
|
26
|
+
| **Refactor** | `refactor-analysis.md` | `.prizmkit/refactor/<refactor-slug>/` | File exists | Run upstream refactor workflow |
|
|
27
|
+
| **Bugfix** | `fix-plan.md` or bug description from caller | `.prizmkit/bugfix/<BUG_ID>/` | File exists or caller-provided | Run `/bug-fix-workflow` |
|
|
28
|
+
|
|
29
|
+
**Auto-detect**: If the calling workflow passes an explicit artifact directory, use that. Otherwise check which input document type exists.
|
|
26
30
|
|
|
27
31
|
## Execution Steps
|
|
28
32
|
|
|
@@ -250,7 +250,7 @@ CONSTRAINTS:
|
|
|
250
250
|
- TRAPS section is CRITICAL for preventing AI from making known mistakes
|
|
251
251
|
- TRAPS entries MUST have severity prefix ([CRITICAL], [HIGH], or [LOW]). [REVIEW] may precede severity as a temporary staleness marker.
|
|
252
252
|
- TRAPS optional fields: append `| REF: <7-char-hash>` for traceability, `| STALE_IF: <glob>` for auto-expiry detection
|
|
253
|
-
- TRAPS severity
|
|
253
|
+
- TRAPS severity: CRITICAL = data loss/security/financial/crash, HIGH = functional failure/silent error, LOW = naming/minor quality (see TRAPS_FORMAT_REFERENCE in Section 3.2)
|
|
254
254
|
- REJECTED entries prevent AI from re-proposing failed approaches
|
|
255
255
|
- FILES lists all files, not just key ones
|
|
256
256
|
- RULES may only SUPPLEMENT root.prizm RULES with module-specific exceptions, never contradict them
|
|
@@ -78,8 +78,8 @@ While updating an affected L1/L2 doc, if you encounter TRAPS entries **without**
|
|
|
78
78
|
**1g. TRAPS staleness check** (only when an L2 doc's TRAPS section has > 10 entries):
|
|
79
79
|
|
|
80
80
|
Perform a quick staleness scan on existing TRAPS to prevent unbounded accumulation:
|
|
81
|
-
1. If a TRAP has `STALE_IF:` and the glob-matched files no longer exist (verified via `ls`
|
|
82
|
-
2. If a TRAP has `REF:`
|
|
81
|
+
1. If a TRAP has `STALE_IF:` and the glob-matched files no longer exist (verified via `ls`) → delete the TRAP entry, append CHANGELOG: `remove: archived stale TRAP - <summary>`
|
|
82
|
+
2. If a TRAP has `REF:` → check if the referenced file still exists and the REF commit is less than 180 days old (via `git log --since="180 days ago" <hash> 2>/dev/null`). If the file is deleted OR the REF commit is older than 180 days → prepend `[REVIEW]` to the severity, signaling it needs verification during the next retrospective Job 2
|
|
83
83
|
3. Process at most 5 of the oldest TRAPS per L2 doc per session (to bound context cost)
|
|
84
84
|
|
|
85
85
|
This step is lightweight — it only triggers when TRAPS exceed 10 entries, and processes at most 5 per run.
|
|
@@ -117,10 +117,10 @@ Extract TRAPS, RULES, and DECISIONS from development work and inject into `.priz
|
|
|
117
117
|
- Full format: `- [SEVERITY] <description> | FIX: <approach> | REF: <hash> | STALE_IF: <glob>`
|
|
118
118
|
- Source: actual bugs hit, surprising behavior discovered in code, non-obvious coupling
|
|
119
119
|
|
|
120
|
-
**TRAPS severity classification
|
|
121
|
-
- `[CRITICAL]`: data loss, security
|
|
120
|
+
**TRAPS severity classification**:
|
|
121
|
+
- `[CRITICAL]`: data loss, security, financial error, system crash
|
|
122
122
|
- `[HIGH]`: functional failure, silent error, interface incompatibility
|
|
123
|
-
- `[LOW]`: misleading naming, non-intuitive API
|
|
123
|
+
- `[LOW]`: misleading naming, non-intuitive API, minor performance issue
|
|
124
124
|
|
|
125
125
|
When writing TRAPS:
|
|
126
126
|
- Severity prefix is MANDATORY (e.g., `[CRITICAL]`, `[HIGH]`, `[LOW]`)
|