prizmkit 1.0.45 → 1.0.66

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.
Files changed (67) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/adapters/claude/agent-adapter.js +2 -1
  3. package/bundled/adapters/claude/command-adapter.js +3 -3
  4. package/bundled/agents/prizm-dev-team-dev.md +1 -1
  5. package/bundled/dev-pipeline/README.md +6 -8
  6. package/bundled/dev-pipeline/assets/prizm-dev-team-integration.md +24 -19
  7. package/bundled/dev-pipeline/launch-bugfix-daemon.sh +2 -2
  8. package/bundled/dev-pipeline/launch-daemon.sh +2 -2
  9. package/bundled/dev-pipeline/lib/branch.sh +76 -0
  10. package/bundled/dev-pipeline/run-bugfix.sh +58 -149
  11. package/bundled/dev-pipeline/run.sh +60 -153
  12. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +17 -4
  13. package/bundled/dev-pipeline/scripts/parse-stream-progress.py +2 -2
  14. package/bundled/dev-pipeline/templates/bootstrap-tier1.md +16 -27
  15. package/bundled/dev-pipeline/templates/bootstrap-tier2.md +20 -32
  16. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +32 -53
  17. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +29 -41
  18. package/bundled/dev-pipeline/templates/session-status-schema.json +1 -1
  19. package/bundled/dev-pipeline/tests/conftest.py +19 -126
  20. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +207 -0
  21. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +128 -141
  22. package/bundled/dev-pipeline/tests/test_utils.py +51 -110
  23. package/bundled/rules/prizm/prizm-commit-workflow.md +3 -3
  24. package/bundled/skills/_metadata.json +15 -16
  25. package/bundled/skills/app-planner/SKILL.md +8 -7
  26. package/bundled/skills/bug-fix-workflow/SKILL.md +171 -0
  27. package/bundled/skills/bug-planner/SKILL.md +25 -33
  28. package/bundled/skills/bug-planner/scripts/validate-bug-list.py +156 -0
  29. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +5 -7
  30. package/bundled/skills/dev-pipeline-launcher/SKILL.md +4 -6
  31. package/bundled/skills/feature-workflow/SKILL.md +25 -42
  32. package/bundled/skills/prizm-kit/SKILL.md +61 -23
  33. package/bundled/skills/prizm-kit/assets/{claude-md-template.md → project-memory-template.md} +3 -3
  34. package/bundled/skills/prizmkit-analyze/SKILL.md +44 -33
  35. package/bundled/skills/prizmkit-clarify/SKILL.md +40 -30
  36. package/bundled/skills/prizmkit-code-review/SKILL.md +58 -45
  37. package/bundled/skills/prizmkit-committer/SKILL.md +30 -68
  38. package/bundled/skills/prizmkit-implement/SKILL.md +60 -28
  39. package/bundled/skills/prizmkit-init/SKILL.md +57 -66
  40. package/bundled/skills/prizmkit-plan/SKILL.md +60 -23
  41. package/bundled/skills/prizmkit-prizm-docs/SKILL.md +74 -19
  42. package/bundled/skills/prizmkit-prizm-docs/assets/PRIZM-SPEC.md +23 -23
  43. package/bundled/skills/prizmkit-retrospective/SKILL.md +142 -65
  44. package/bundled/skills/prizmkit-retrospective/assets/retrospective-template.md +13 -0
  45. package/bundled/skills/prizmkit-specify/SKILL.md +69 -15
  46. package/bundled/skills/refactor-workflow/SKILL.md +116 -52
  47. package/bundled/team/prizm-dev-team.json +2 -2
  48. package/package.json +1 -1
  49. package/src/scaffold.js +4 -4
  50. package/bundled/dev-pipeline/lib/worktree.sh +0 -164
  51. package/bundled/dev-pipeline/tests/__init__.py +0 -0
  52. package/bundled/dev-pipeline/tests/test_check_session.py +0 -131
  53. package/bundled/dev-pipeline/tests/test_cleanup_logs.py +0 -119
  54. package/bundled/dev-pipeline/tests/test_detect_stuck.py +0 -207
  55. package/bundled/dev-pipeline/tests/test_generate_prompt.py +0 -190
  56. package/bundled/dev-pipeline/tests/test_init_bugfix_pipeline.py +0 -153
  57. package/bundled/dev-pipeline/tests/test_init_pipeline.py +0 -241
  58. package/bundled/dev-pipeline/tests/test_update_bug_status.py +0 -142
  59. package/bundled/dev-pipeline/tests/test_update_feature_status.py +0 -338
  60. package/bundled/dev-pipeline/tests/test_worktree.py +0 -236
  61. package/bundled/dev-pipeline/tests/test_worktree_integration.py +0 -796
  62. package/bundled/skills/prizm-kit/assets/codebuddy-md-template.md +0 -35
  63. package/bundled/skills/prizm-kit/assets/hooks/prizm-commit-hook.json +0 -15
  64. package/bundled/skills/prizmkit-summarize/SKILL.md +0 -51
  65. package/bundled/skills/prizmkit-summarize/assets/registry-template.md +0 -18
  66. package/bundled/templates/hooks/commit-intent-claude.json +0 -26
  67. /package/bundled/templates/hooks/{commit-intent-codebuddy.json → commit-intent.json} +0 -0
@@ -1,51 +1,61 @@
1
1
  ---
2
2
  name: "prizmkit-clarify"
3
- description: "Interactive requirement clarification. Resolves ambiguities in feature specs by asking sequential questions. Invoke after 'specify' or when spec has NEEDS CLARIFICATION markers. (project)"
3
+ description: "Interactive requirement clarification. Resolves ambiguities in feature specs by asking sequential questions with recommended answers. Use when spec has unclear parts or you're unsure about requirements before planning. Use this skill whenever a spec has [NEEDS CLARIFICATION] markers, vague requirements, or the user wants to refine their feature definition before planning. Trigger on: 'clarify', 'refine spec', 'resolve ambiguities', 'spec has questions', 'unsure about requirements', 'spec is unclear'. (project)"
4
4
  ---
5
5
 
6
6
  # PrizmKit Clarify
7
7
 
8
8
  Interactive requirement clarification that resolves ambiguities in feature specifications. Asks focused questions one at a time, updating the spec atomically after each answer.
9
9
 
10
- ## Commands
11
-
12
- ### prizmkit.clarify
13
-
14
- Resolve ambiguities and underspecified areas in a feature specification.
10
+ ### When to Use
11
+ - After `/prizmkit-specify` when spec has `[NEEDS CLARIFICATION]` markers
12
+ - User says "clarify", "resolve ambiguities", "refine spec"
13
+ - Before `/prizmkit-plan` to ensure spec is unambiguous
15
14
 
16
15
  **PRECONDITION:** `spec.md` exists in current feature directory (`.prizmkit/specs/###-feature-name/`)
17
16
 
18
- **STEPS:**
17
+ ## Execution Steps
19
18
 
20
19
  1. Read `spec.md` from `.prizmkit/specs/###-feature-name/`
21
20
  2. Scan for `[NEEDS CLARIFICATION]` markers and underspecified areas
22
- 3. Categorize ambiguities by dimension:
23
- - Functional scope
24
- - Data model
25
- - UX flow
26
- - Non-functional requirements
27
- - Error handling
28
- - Edge cases
29
- - Integration points
30
- - Security
31
- - Performance
32
- - Accessibility
33
- 4. Ask questions ONE AT A TIME (not all at once), max 5 questions
34
- 5. For each question: provide a recommended answer with rationale
35
- 6. After each answer: immediately update `spec.md` atomically (not batch)
36
- 7. Support early termination: user says "done" or "stop"
21
+ 3. Categorize ambiguities by dimension and prioritize — address the ones that would most affect architecture and data model first, since those are hardest to change later:
22
+ - Functional scope (what does it do?)
23
+ - Data model (what entities, relationships?)
24
+ - UX flow (what does the user see?)
25
+ - Error handling (what happens when things fail?)
26
+ - Non-functional requirements (performance, security)
27
+ - Edge cases, integration points, accessibility
28
+ 4. Ask questions one at a time (max 5 per session) — batch questions overwhelm users and produce lower-quality answers because they rush through without thinking deeply about each one
29
+ 5. For each question: provide a recommended answer with rationale. The recommendation gives users a concrete starting point to accept, modify, or reject — this is much faster than open-ended questions
30
+ 6. After each answer: immediately update `spec.md` (not batched at the end). Atomic updates mean the spec is always in a consistent state, even if the session is interrupted
31
+ 7. Support early termination: user says "done" or "stop" — end immediately
37
32
  8. Remove resolved `[NEEDS CLARIFICATION]` markers
38
33
  9. After all questions resolved or user terminates: output summary of changes made
39
34
 
40
- **KEY RULES:**
41
- - NEVER ask all questions at once — sequential, one at a time
42
- - ALWAYS provide a recommended answer with rationale for each question
43
- - Updates to `spec.md` MUST be atomic (after each answer, not batched)
44
- - Max 5 questions per session
45
- - Respect early termination "done" or "stop" ends the session immediately
46
- - Do NOT introduce implementation details — keep spec at WHAT/WHY level
35
+ ## Example Session
36
+
37
+ **Question 1:**
38
+ > spec.md §3.2 says "User can upload files" but doesn't specify which file types or size limits.
39
+ >
40
+ > **Recommended answer:** Accept JPEG, PNG, and PDF up to 10MB. These are the most common user upload types, and 10MB covers high-res photos without straining storage.
41
+ >
42
+ > Do you agree, or would you like different constraints?
43
+
44
+ **User:** "Also allow SVG, and make it 25MB"
45
+
46
+ **Action:** Update spec.md §3.2:
47
+ ```
48
+ File upload: accepts JPEG, PNG, PDF, SVG. Max size: 25MB per file.
49
+ ```
50
+ Remove `[NEEDS CLARIFICATION]` marker from §3.2.
51
+
52
+ ## Guidelines
53
+
54
+ - Keep questions at the WHAT/WHY level — do not introduce implementation details (HOW). The spec describes the problem space; implementation choices belong in plan.md
55
+ - 5-question limit per session keeps clarification focused. If more questions remain, tell the user and suggest running clarify again after they've had time to think
56
+ - If the user's answer contradicts an existing requirement, point out the conflict and ask which one should change
47
57
 
48
- **HANDOFF:** `prizmkit.plan`
58
+ **HANDOFF:** `/prizmkit-plan`
49
59
 
50
60
  ## Output
51
61
 
@@ -1,70 +1,83 @@
1
1
  ---
2
2
  name: "prizmkit-code-review"
3
- description: "Code review against spec, plan, and best practices. Read-only analysis with severity ratings. Invoke after implementation or when user requests review. (project)"
3
+ description: "Code review against spec, plan, and best practices. Read-only analysis with severity ratings. Use this skill after implementation to catch spec compliance gaps, security issues, and pattern violations before committing. Trigger on: 'review', 'check code', 'review my implementation', 'code review', 'is it ready to commit'. (project)"
4
4
  ---
5
5
 
6
6
  # PrizmKit Code Review
7
7
 
8
- Perform a comprehensive code review against the feature spec, implementation plan, and project best practices. Produces a structured review report with severity ratings. This skill is strictly read-only and does not modify any files.
8
+ Perform a comprehensive code review against the feature spec, implementation plan, and project best practices. Produces a structured review report with severity ratings. This skill is strictly read-only it surfaces issues without auto-fixing them, so you can decide what actually needs changing.
9
9
 
10
- ## Commands
10
+ ### When to Use
11
+ - After `/prizmkit-implement` to verify code quality before commit
12
+ - User says "review", "check code", "review my implementation"
13
+ - As a quality gate before `/prizmkit-committer`
11
14
 
12
- ### prizmkit.code-review
15
+ **PRECONDITION (multi-mode):**
16
+ - **Feature mode**: `spec.md` and `plan.md` (with Tasks section) exist in `.prizmkit/specs/###-feature-name/` with completed tasks
17
+ - **Refactor mode**: `refactor-analysis.md` and `plan.md` (with Tasks section) exist in `.prizmkit/refactor/<refactor-slug>/` with completed tasks. No `spec.md` is needed — review against `refactor-analysis.md` goals and behavior preservation instead.
18
+ - **Bugfix mode**: `fix-plan.md` exists in `.prizmkit/bugfix/<BUG_ID>/` with completed tasks. Review against the bug description and reproduction test.
19
+ - **Auto-detect**: Check which artifact directory was passed by the calling workflow, or scan `.prizmkit/` for the most recently modified feature/refactor/bugfix directory.
13
20
 
14
- Review implemented code against spec and plan.
21
+ ## Execution Steps
15
22
 
16
- **PRECONDITION:** `spec.md`, `plan.md`, `tasks.md` exist in `.prizmkit/specs/###-feature-name/` with completed tasks
17
-
18
- **STEPS:**
19
-
20
- 1. Read `spec.md`, `plan.md`, `tasks.md` as review baseline
23
+ 1. **Detect mode and load review baseline**:
24
+ - If `spec.md` exists → **Feature mode**: read `spec.md` + `plan.md` as baseline. Review dimensions: spec compliance, plan adherence, code quality, security, consistency, test coverage.
25
+ - If `refactor-analysis.md` exists → **Refactor mode**: read `refactor-analysis.md` + `plan.md` as baseline. Review dimensions shift: replace "spec compliance" with **behavior preservation** (observable behavior unchanged), replace "plan adherence" with **structural improvement** (is the code measurably better?). Also check test integrity and code quality.
26
+ - If `fix-plan.md` exists → **Bugfix mode**: read `fix-plan.md` as baseline. Review dimensions: bug is actually fixed, no regressions, reproduction test passes, minimal change scope.
27
+ - If none found prompt user: "No review baseline found. Which workflow are you in? (feature/refactor/bugfix)"
21
28
  2. Read `.prizm-docs/root.prizm` RULES for project conventions
22
29
  3. Scan all code files referenced in completed tasks
23
30
  4. Review across 6 dimensions:
24
- - **Spec compliance**: Does code implement all acceptance criteria?
25
- - **Plan adherence**: Does implementation follow architectural decisions?
26
- - **Code quality**: Naming, structure, complexity, DRY
27
- - **Security**: Common vulnerabilities (injection, auth, data exposure)
28
- - **Consistency**: Follows project patterns from `.prizm-docs/` PATTERNS
29
- - **Test coverage**: Are critical paths tested?
31
+ - **Spec compliance**: Does code implement all acceptance criteria? Missing criteria are the #1 source of "it works but it's wrong" bugs
32
+ - **Plan adherence**: Does implementation follow architectural decisions in plan.md? Deviations may be improvements or may break assumptions other components depend on
33
+ - **Code quality**: Naming, structure, complexity, DRY. Focus on maintainability — will someone understand this code in 6 months?
34
+ - **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
35
+ - **Consistency**: Follows project patterns from `.prizm-docs/` PATTERNS section. Inconsistent patterns increase cognitive load for every future reader
36
+ - **Test coverage**: Are critical paths tested? Focus on paths that handle user input, money, or state transitions
30
37
  5. Generate findings with severity: `CRITICAL` > `HIGH` > `MEDIUM` > `LOW`
31
- 6. Max 30 findings
32
- 7. Verdict: `PASS` | `PASS WITH WARNINGS` | `NEEDS FIXES`
33
- 8. OUTPUT: Structured review report (to conversation only, NOT written to file)
34
-
35
- **KEY RULES:**
36
- - This is STRICTLY READ-ONLYdoes NOT modify any files
37
- - Output goes to conversation ONLY, not to any file
38
- - Max 30 findings to keep review actionable
39
- - Every CRITICAL finding MUST include a specific fix suggestion
40
- - Spec compliance failures are always rated HIGH or CRITICAL
41
- - Security findings are always rated HIGH or CRITICAL
42
-
43
- **VERDICT CRITERIA:**
38
+ 6. Determine verdict (see criteria below)
39
+ 7. Output structured review report to conversation only
40
+
41
+ ## Severity & Verdict
42
+
43
+ Spec compliance failures are always HIGH or CRITICAL if the code doesn't match what was agreed in the spec, that's a functional gap, not a style issue. Security findings follow the same rule.
44
+
45
+ **Verdict criteria:**
44
46
  - `PASS`: No CRITICAL or HIGH findings
45
47
  - `PASS WITH WARNINGS`: No CRITICAL findings, some HIGH findings
46
48
  - `NEEDS FIXES`: Any CRITICAL findings present
47
49
 
48
- **HANDOFF:** `prizmkit.summarize` (if PASS) or `prizmkit.implement` (if NEEDS FIXES)
50
+ Cap findings at 30 to keep the review actionable. If there are more, summarize the overflow with counts by dimension. Every CRITICAL finding includes a specific fix suggestion — telling someone "this is broken" without saying how to fix it wastes their time.
49
51
 
50
- ## Output
52
+ 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.
51
53
 
52
- Review report is output to conversation only. No files are created or modified.
54
+ ## Example Finding
53
55
 
54
- **Report Format:**
55
56
  ```
56
- ## Code Review: [Feature Name]
57
+ #### [CRITICAL] SQL Injection in User Search
58
+ - File: src/services/userService.ts:47
59
+ - Dimension: security
60
+ - Description: User input `searchTerm` is interpolated directly into SQL query string without parameterization
61
+ - Suggestion: Use parameterized query: `db.query('SELECT * FROM users WHERE name LIKE $1', [`%${searchTerm}%`])`
62
+
63
+ #### [HIGH] Missing Acceptance Criterion
64
+ - File: src/routes/upload.ts
65
+ - Dimension: spec-compliance
66
+ - Description: spec.md §AC-3 requires "display progress bar during upload" but no progress tracking is implemented
67
+ - Suggestion: Add upload progress callback using xhr.upload.onprogress or fetch with ReadableStream
68
+ ```
57
69
 
58
- ### Summary
59
- - Files reviewed: N
60
- - Findings: N (Critical: N, High: N, Medium: N, Low: N)
61
- - Verdict: [PASS | PASS WITH WARNINGS | NEEDS FIXES]
70
+ **HANDOFF:** `/prizmkit-retrospective` (if PASS) or `/prizmkit-implement` (if NEEDS FIXES)
62
71
 
63
- ### Findings
72
+ ## Loop Protection
64
73
 
65
- #### [SEVERITY] Finding Title
66
- - File: path/to/file:line
67
- - Dimension: [spec-compliance | plan-adherence | code-quality | security | consistency | test-coverage]
68
- - Description: [What was found]
69
- - Suggestion: [How to fix]
70
- ```
74
+ In unattended pipeline mode, the review→fix→review cycle can loop indefinitely if fixes introduce new issues. To prevent this:
75
+
76
+ - Track a `review_iteration` counter starting at 1. Each review-fix-review cycle increments the counter.
77
+ - **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)."
78
+ - Unresolved findings should be recorded in the review report so they can be tracked as follow-up work.
79
+ - This guard exists because some review cycles oscillate (fixing one issue introduces another) and blocking forever is worse than shipping with documented known issues.
80
+
81
+ ## Output
82
+
83
+ Review report is output to conversation only. No files are created or modified.
@@ -1,17 +1,18 @@
1
1
  ---
2
2
  name: "prizmkit-committer"
3
- description: "Commit workflow with automatic Prizm doc updates, changelog management, and learning capture. Invoke when user wants to commit, finish task, or ship changes. (project)"
3
+ description: "Pure git commit workflow with safety checks. Stages files, analyzes diff, generates Conventional Commits message, and commits. Does NOT modify .prizm-docs/ memory maintenance is handled by /prizmkit-retrospective before this skill is invoked. Trigger on: 'commit', '提交', 'finish', 'done', 'ship it', 'save my work'. (project)"
4
4
  ---
5
5
 
6
6
  # PrizmKit Committer
7
7
 
8
- Automated commit workflow that keeps Prizm documentation in sync, manages changelog entries, and captures learnings from each commit.
8
+ Pure git commit workflow. Analyzes changes, generates a Conventional Commits message, performs safety checks, and commits.
9
+
10
+ **This skill is a pure git commit tool. It does NOT modify any project files — no `.prizm-docs/`, no source code, no documentation.** It only reads diffs, generates a commit message, and commits. For feature/refactor workflows, run `/prizmkit-retrospective` before this skill to sync `.prizm-docs/`. For bug fixes, skip retrospective entirely — bug fixes do not update `.prizm-docs/`.
9
11
 
10
12
  ### When to Use
11
13
  - User says "commit", "提交", "finish", "done with this task", "ship it"
12
- - After implementing a feature or fixing a bug
13
- - CodeBuddy: the UserPromptSubmit hook will remind to use this skill
14
- - Claude Code: the `.claude/rules/prizm-commit-workflow.md` rule will enforce this
14
+ - After `/prizmkit-retrospective` has finished memory maintenance
15
+ - The UserPromptSubmit hook will remind to use this skill when commit intent is detected
15
16
 
16
17
  ### Workflow
17
18
 
@@ -24,53 +25,7 @@ git status
24
25
  - If "nothing to commit, working tree clean": inform user and stop
25
26
  - If there are changes: proceed
26
27
 
27
- #### Step 2: Prizm Documentation Update (CRITICAL — must complete before commit)
28
-
29
- 2a. Get changed files:
30
- ```bash
31
- git diff --cached --name-status
32
- ```
33
- If nothing staged, also check:
34
- ```bash
35
- git diff --name-status
36
- ```
37
-
38
- 2b. Read .prizm-docs/root.prizm to get MODULE_INDEX
39
-
40
- 2c. Map each changed file to its module using MODULE_INDEX paths
41
-
42
- 2d. For each affected module:
43
- - IF L2 doc exists (.prizm-docs/<module>/<submodule>.prizm):
44
- - Update KEY_FILES (add new files, remove deleted, note modified)
45
- - Update INTERFACES (if public signatures changed)
46
- - Update DEPENDENCIES (if imports changed)
47
- - Append to module CHANGELOG section
48
- - Update UPDATED timestamp
49
- - IF L1 doc exists (.prizm-docs/<module>.prizm):
50
- - Update FILES count
51
- - Update KEY_FILES (if major files added/removed)
52
- - Update UPDATED timestamp
53
- - Update root.prizm:
54
- - Update MODULE_INDEX file counts (only if counts changed)
55
- - UPDATED timestamp (only if structural changes)
56
-
57
- 2e. Append to .prizm-docs/changelog.prizm:
58
- Format: `- YYYY-MM-DD | <module-path> | <verb>: <one-line description>`
59
- Verbs: add, update, fix, remove, refactor, rename, deprecate
60
-
61
- 2f. Stage prizm docs:
62
- ```bash
63
- git add .prizm-docs/
64
- ```
65
-
66
- SKIP CONDITIONS for doc update:
67
- - Only internal implementation changed (no interface/dependency change)
68
- - Only comments, whitespace, or formatting changed
69
- - Only test files changed
70
- - Only .prizm files changed (avoid circular updates)
71
- - Bug fixes to existing features (bugs are incomplete features being refined, not new functionality — no new doc entries needed)
72
-
73
- #### Step 3: Diff Analysis
28
+ #### Step 2: Diff Analysis
74
29
  ```bash
75
30
  git diff HEAD
76
31
  ```
@@ -79,16 +34,12 @@ Analyze:
79
34
  - Scope: affected module name
80
35
  - Description: imperative mood summary
81
36
 
82
- #### Step 4: Update CHANGELOG.md
83
- If CHANGELOG.md exists, append entry following Keep a Changelog format.
84
- If manage_changelog.py exists in skill scripts:
85
- ```bash
86
- python3 ${SKILL_DIR}/scripts/manage_changelog.py add --type <type> --message "<description>"
87
- ```
37
+ #### Step 3: Update CHANGELOG.md
38
+ 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.
88
39
 
89
- #### Step 5: Git Commit
40
+ #### Step 4: Git Commit
90
41
 
91
- 5a. Safety check before staging:
42
+ 4a. Safety check before staging:
92
43
  ```bash
93
44
  git diff --name-only
94
45
  git ls-files --others --exclude-standard
@@ -99,18 +50,18 @@ Review the output for sensitive files. If any file matches these patterns, **STO
99
50
  - `credentials.*`, `*secret*`
100
51
  - `*.sqlite`, `*.db` (database files)
101
52
 
102
- 5b. Stage and commit:
53
+ 4b. Stage and commit:
103
54
  ```bash
104
- git add -A
55
+ git add <specific-files>
105
56
  git diff --cached --name-only
106
57
  ```
107
- Review staged file list one final time, then:
58
+ Stage files explicitly by name rather than using `git add -A`, which can accidentally include sensitive files or large binaries that appeared between the safety check and staging. Review staged file list one final time, then:
108
59
  ```bash
109
60
  git commit -m "<type>(<scope>): <description>"
110
61
  ```
111
62
  Follow Conventional Commits format.
112
63
 
113
- #### Step 6: Verification
64
+ #### Step 5: Verification
114
65
  ```bash
115
66
  git log -1 --stat
116
67
  ```
@@ -121,9 +72,9 @@ Then verify working tree is clean:
121
72
  git status
122
73
  ```
123
74
  - If "nothing to commit, working tree clean": commit verified successfully, proceed
124
- - If there are uncommitted changes remaining: **STOP** and report error all changes must be captured in the commit. Run `git add -A && git commit --amend --no-edit` to include missed files, then re-verify
75
+ - If there are uncommitted changes remaining: **STOP** and report what files were missed. Stage the missed files explicitly by name and create a new commit (do NOT amend the previous commit amending risks destroying unrelated changes from prior commits)
125
76
 
126
- #### Step 7: Optional Push
77
+ #### Step 6: Optional Push
127
78
  Ask user: "Push to remote?"
128
79
  - Yes: `git push`
129
80
  - No: Stop
@@ -131,5 +82,16 @@ Ask user: "Push to remote?"
131
82
  ### Error Handling
132
83
  - If git diff is empty but untracked files exist: run `git add -N .` first (respects .gitignore)
133
84
  - If CHANGELOG.md script fails: update manually or ask user
134
- - If .prizm-docs/ doesn't exist: skip Step 2 entirely (project not initialized)
135
- - If sensitive files are detected during Step 5a safety check: warn user and do NOT stage them automatically
85
+ - If sensitive files are detected during Step 4a safety check: warn user and do NOT stage them automatically
86
+
87
+ ## Example
88
+
89
+ **Feature commit:**
90
+ ```
91
+ git commit -m "feat(avatar): add user avatar upload with S3 storage"
92
+ ```
93
+
94
+ **Bug fix commit:**
95
+ ```
96
+ git commit -m "fix(auth): handle null token in refresh flow"
97
+ ```
@@ -1,46 +1,78 @@
1
1
  ---
2
2
  name: "prizmkit-implement"
3
- description: "Execute implementation following tasks.md. Respects task ordering, dependencies, and TDD approach. Marks tasks complete as they finish. Invoke with 'implement' or 'build'. (project)"
3
+ description: "Execute implementation following plan.md tasks. Respects task ordering, dependencies, and TDD approach. Marks tasks complete as they finish. Use this skill whenever you're ready to write code for a planned feature, or for fast-path changes where the user describes a simple fix directly. Trigger on: 'implement', 'build', 'code it', 'start coding', '开发', 'write the code'. (project)"
4
4
  ---
5
5
 
6
6
  # PrizmKit Implement
7
7
 
8
- Execute implementation by following the task breakdown in tasks.md. Respects task ordering, dependency constraints, and applies a TDD approach where applicable. Marks each task complete as it finishes.
8
+ Execute implementation by following the task breakdown in plan.md. Respects task ordering, dependency constraints, and applies a TDD approach where applicable. Marks each task complete as it finishes.
9
9
 
10
- ## Commands
10
+ ### When to Use
11
+ - After `/prizmkit-plan` (or `/prizmkit-analyze`) when ready to write code
12
+ - User says "implement", "build", "code it", "start coding", "开发"
13
+ - For fast-path: user describes a simple change directly (fast-path skips specify, but still requires a simplified plan.md with Tasks section)
11
14
 
12
- ### prizmkit.implement
15
+ **PRECONDITION (multi-mode):**
16
+ - **Feature mode** (default): `plan.md` exists in `.prizmkit/specs/###-feature-name/` with a Tasks section containing unchecked tasks
17
+ - **Refactor mode**: `plan.md` exists in `.prizmkit/refactor/<refactor-slug>/` with a Tasks section containing unchecked tasks
18
+ - **Bugfix mode**: `plan.md` exists in `.prizmkit/bugfix/<BUG_ID>/` with a Tasks section containing unchecked tasks
19
+ - **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.
13
20
 
14
- Implement the feature by executing tasks from tasks.md.
21
+ ## Execution Steps
15
22
 
16
- **PRECONDITION:** `plan.md` exists in `.prizmkit/specs/###-feature-name/` with a Tasks section containing unchecked tasks
17
-
18
- **STEPS:**
19
-
20
- 1. Read `plan.md` (including Tasks section), `spec.md` for full context
21
- 2. Load project context (use first available source):
22
- - If `.prizmkit/specs/###-feature-name/context-snapshot.md` exists read it (Section 3 has Prizm docs + TRAPS, Section 4 has source files). Do NOT re-read `.prizm-docs/` or individual source files.
23
- - Otherwise read relevant `.prizm-docs/` L1/L2 for affected modules (check TRAPS and DECISIONS sections)
23
+ 1. **Detect mode and read context**:
24
+ - Locate `plan.md` (check the artifact directory passed by the calling workflow, or auto-detect per PRECONDITION above)
25
+ - Read `plan.md` (including Tasks section)
26
+ - Read the companion input document for full context:
27
+ - **Feature mode**: read `spec.md` in the same directory
28
+ - **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)
29
+ - **Bugfix mode**: read `fix-plan.md` in the same directory
30
+ 2. Load project context use the most efficient source available:
31
+ - If `context-snapshot.md` exists in the feature directory → read it. Section 3 has Prizm docs + TRAPS, Section 4 has source files. This snapshot was built in Phase 1 of the pipeline to avoid re-reading dozens of individual files, saving significant tokens.
32
+ - Otherwise → read relevant `.prizm-docs/` L1/L2 for affected modules. Pay special attention to TRAPS (gotchas, race conditions) and DECISIONS (past architectural choices you should respect).
24
33
  3. Check if checkpoint tasks are complete before proceeding to next phase
25
34
  4. For each unchecked task in order:
26
- a. If task has `[P]` marker and previous parallel tasks are running, can proceed in parallel
27
- b. Read L2 doc for target file's module (if exists)
28
- c. Implement following TDD: write test first if applicable
29
- d. Mark task as `[x]` in `plan.md` Tasks section
30
- e. If error occurs: for sequential tasks, stop and report; for parallel tasks, continue others
31
- 5. At each checkpoint: verify build passes and tests pass
35
+ a. If task has `[P]` marker, it can run in parallel with other `[P]` tasks in the same group
36
+ b. Read L2 doc for target file's module (if exists) — TRAPS save you from repeating known mistakes
37
+ c. Apply TDD where applicable: write a failing test first, then implement until it passes. For UI components or configuration changes where unit tests don't apply, skip the test-first step.
38
+ d. Mark task as `[x]` in `plan.md` Tasks section immediately — not batched at the end. Immediate marking means the plan always reflects true progress, even if the session is interrupted.
39
+ e. Error handling: sequential tasks stop on failure (later tasks may depend on this one). Parallel `[P]` tasks continue — report all failures at the end.
40
+ 5. At each checkpoint: verify build passes and tests pass. Checkpoints catch integration errors early — skipping them means cascading failures in later phases that are much harder to debug.
32
41
  6. After all tasks: run full test suite
33
- 7. Output: implementation summary with pass/fail status
42
+ 7. Output implementation summary with pass/fail status
43
+
44
+ ## Task Format in plan.md
45
+
46
+ Tasks in plan.md look like this:
47
+ ```markdown
48
+ ## Tasks
49
+
50
+ ### Phase 1: Data Layer
51
+ - [ ] Create User model with avatar field in src/models/user.ts
52
+ - [ ] Add S3 upload utility in src/lib/s3.ts
53
+ - [x] ~~Set up database migration~~ (already done)
54
+
55
+ ### Phase 2: API [P]
56
+ - [ ] [P] POST /api/avatar endpoint in src/routes/avatar.ts
57
+ - [ ] [P] DELETE /api/avatar endpoint in src/routes/avatar.ts
58
+
59
+ ### Phase 3: UI
60
+ - [ ] Avatar upload component in src/components/AvatarUpload.tsx
61
+ - [ ] CP: Integration checkpoint — full test suite must pass
62
+ ```
63
+
64
+ - `[ ]` / `[x]` — unchecked / completed
65
+ - `[P]` — can run in parallel with other `[P]` tasks in the same phase
66
+ - `CP:` — checkpoint where build + tests must pass before continuing
67
+
68
+ ## Recovery
34
69
 
35
- **KEY RULES:**
36
- - NEVER skip a checkpoint build and tests MUST pass before proceeding to next phase
37
- - Sequential tasks MUST execute in order stop on failure
38
- - Parallel tasks (`[P]` marker) MAY continue if one fails, but report all failures
39
- - TDD approach: write test first, then implement, then verify test passes
40
- - Read TRAPS before implementing: prefer `context-snapshot.md` Section 3 (if exists), otherwise `.prizm-docs/` TRAPS section
41
- - Mark each task `[x]` in `plan.md` Tasks section immediately upon completion (not batched)
70
+ If a session is interrupted mid-implementation:
71
+ - Completed tasks are already marked `[x]` in plan.md (because we mark immediately)
72
+ - Resume by re-running `/prizmkit-implement` it picks up from the first unchecked task
73
+ - context-snapshot.md persists across sessions for consistent context
42
74
 
43
- **HANDOFF:** `prizmkit.code-review`
75
+ **HANDOFF:** `/prizmkit-code-review`
44
76
 
45
77
  ## Output
46
78