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,79 +1,156 @@
1
1
  ---
2
2
  name: "prizmkit-retrospective"
3
- description: "Post-feature retrospective. Extracts lessons from completed features, updates Prizm docs TRAPS and RULES. Invoke after feature completion. (project)"
3
+ description: "Incremental .prizm-docs/ maintainer — the sole writer during ongoing development. Performs two jobs after code changes: (1) structural sync — update KEY_FILES/INTERFACES/DEPENDENCIES to reflect code changes, and (2) knowledge injection — extract TRAPS/RULES/DECISIONS from completed work. Run after code review passes and before committing. For initial doc setup, validation, or migration, use /prizmkit-prizm-docs instead. Trigger on: 'retrospective', 'retro', 'update docs', 'sync docs', 'wrap up', 'done with feature', 'feature complete'. (project)"
4
4
  ---
5
5
 
6
6
  # PrizmKit Retrospective
7
7
 
8
- Post-feature retrospective analysis that extracts lessons learned, updates Prizm documentation with discovered traps and rules, and documents improvements for future reference.
8
+ **The sole maintainer of `.prizm-docs/` project memory.** No other skill writes to `.prizm-docs/`. This skill performs two distinct jobs in one pass:
9
9
 
10
- ### When to Use
11
- - After completing a feature (spec, plan, tasks, implementation all done)
12
- - User says "retrospective", "retro", "lessons learned", "what did we learn"
13
- - Before starting a new major feature (to apply lessons from the last one)
10
+ 1. **Structural Sync** — reflect what changed in code (KEY_FILES, INTERFACES, DEPENDENCIES, file counts)
11
+ 2. **Knowledge Injection** extract what was learned (TRAPS, RULES, DECISIONS)
14
12
 
15
- ### prizmkit.retrospective
13
+ Both jobs are necessary because `.prizm-docs/` exists to help AI understand the project. Structural accuracy tells AI *what exists*; knowledge tells AI *why it exists and what to watch out for*.
16
14
 
17
- PRECONDITION: Completed feature with spec.md, plan.md, tasks.md in .prizmkit/specs/
15
+ ## When to Use
16
+
17
+ - **Before every commit** (mandatory in pipeline) — ensures docs and code are in sync
18
+ - After completing a feature (spec, plan, implementation all done)
19
+ - After code review passes (PASS or PASS WITH WARNINGS)
20
+ - User says "retrospective", "retro", "update docs", "sync docs", "wrap up"
21
+ - After refactoring or bugfix cycles (structural sync + optional TRAPS update)
22
+
23
+ ## When NOT to Use
24
+
25
+ - Only comments, whitespace, or formatting changed — no structural/knowledge change
26
+ - Only test files changed — no module-level impact
27
+ - Only .prizm files changed — avoid circular updates
28
+ - User just wants to commit without doc update — use `/prizmkit-committer` directly (but pipeline will flag `docs_missing`)
29
+
30
+ ---
31
+
32
+ ## Job 1: Structural Sync
33
+
34
+ Reflect code changes in `.prizm-docs/` so the project map stays accurate.
35
+
36
+ ### Steps
37
+
38
+ **1a.** Get changed files:
39
+ ```bash
40
+ git diff --cached --name-status
41
+ ```
42
+ If nothing staged, fallback:
43
+ ```bash
44
+ git diff --name-status
45
+ ```
46
+
47
+ **1b.** Read `.prizm-docs/root.prizm` to get MODULE_INDEX. Map each changed file to its module.
48
+
49
+ **1c.** Classify changes:
50
+ - `A` (added) → add to KEY_FILES, check for new INTERFACES
51
+ - `D` (deleted) → remove from KEY_FILES, update FILE count
52
+ - `M` (modified) → check if public interfaces or dependencies changed
53
+ - `R` (renamed) → update all path references
54
+
55
+ **1d.** Update affected docs (bottom-up: L2 → L1 → L0):
56
+
57
+ - **L2** (if exists): Update KEY_FILES, INTERFACES, DEPENDENCIES, CHANGELOG, UPDATED timestamp
58
+ - **L1**: Update FILES count, KEY_FILES (if major files added/removed), INTERFACES (if public API changed), UPDATED timestamp
59
+ - **L0 root.prizm**: Update MODULE_INDEX file counts only if counts changed. Update UPDATED only if structural change (module added/removed).
60
+
61
+ **1e.** If new directory with 3+ source files matches no existing module: create L1 doc immediately, add to MODULE_INDEX, defer L2.
62
+
63
+ **1f.** Enforce size limits:
64
+ - L0 > 4KB → consolidate MODULE_INDEX
65
+ - L1 > 3KB → move details to L2
66
+ - L2 > 5KB → archive old CHANGELOG entries
67
+
68
+ **SKIP structural sync if**: only internal implementation changed (no interface/dependency impact), only comments/whitespace, only test files, only .prizm files, bug fixes with no interface change.
69
+
70
+ ---
71
+
72
+ ## Job 2: Knowledge Injection
73
+
74
+ Extract what was learned and inject it into the modules where AI will read it. This job has value **only when real development work was done** — not for trivial changes.
75
+
76
+ ### When to run Job 2
77
+
78
+ - Feature completion (spec + plan + implementation done)
79
+ - Bugfix with a genuinely new pitfall discovered
80
+ - Refactor that revealed structural insights
81
+ - **Skip for**: trivial fixes, config changes, dependency bumps
18
82
 
19
83
  ### Steps
20
84
 
21
- #### Step 1: Gather Feature Artifacts
22
- Read all feature artifacts from .prizmkit/specs/###-feature-name/:
23
- - spec.md (original requirements and acceptance criteria)
24
- - plan.md (architecture decisions and implementation plan)
25
- - tasks.md (task breakdown and status)
26
- - data-model.md (if exists)
27
- - contracts/ directory (if exists)
28
-
29
- #### Step 2: Analyze Implementation
30
- Compare planned vs actual:
31
- - Tasks completed vs skipped why were tasks skipped?
32
- - Architecture deviations from plan what changed and why?
33
- - Unexpected challenges encountered — what surprised us?
34
- - Time-intensive areas what took longer than expected?
35
-
36
- #### Step 3: Extract Lessons
37
- Categorize findings:
38
- - **What went well** (reinforce these patterns)
39
- - **What went wrong** (create anti-patterns to avoid)
40
- - **What was surprising** (new patterns to document)
41
- - **What would you do differently** (improvement candidates)
42
-
43
- NOTE: If bug fixes were performed during this feature's implementation, they are refinements of the feature itself (completing its intended behavior), NOT separate features. Do not create separate documentation entries or REGISTRY records for bug fixes.
44
-
45
- #### Step 4: Generate Retrospective Document
46
- Write retrospective.md in .prizmkit/specs/###-feature-name/:
47
- ```markdown
48
- # Retrospective: <feature-name>
49
- Date: YYYY-MM-DD
50
-
51
- ## Summary Statistics
52
- - Tasks total: N
53
- - Tasks completed: N
54
- - Tasks skipped: N (with reasons)
55
-
56
- ## Key Decisions
57
- - Decision: <what> | Outcome: <good/bad/neutral> | Lesson: <takeaway>
58
-
59
- ## Patterns Discovered
60
- - Pattern: <name> | Context: <when to apply> | Benefit: <why>
61
-
62
- ## Anti-Patterns Discovered
63
- - Anti-pattern: <name> | Context: <when it occurred> | Fix: <what to do instead>
64
-
65
- ## Improvement Suggestions
66
- - Skill: <skill-name> | Suggestion: <what to improve>
85
+ **2a.** Gather context read the **actual code that was changed** plus any available artifacts:
86
+
87
+ - `git diff HEAD` the real source of truth for what happened
88
+ - `.prizmkit/specs/###-feature-name/plan.md` if feature work, read planned vs actual
89
+ - `.prizmkit/bugfix/<id>/fix-report.md` if bugfix, read what was discovered
90
+ - The relevant `.prizm-docs/` L1/L2 docs for affected modules
91
+
92
+ **2b.** Extract knowledge from what was **observed in code**, not invented:
93
+
94
+ **TRAPS** (highest priority) — things that look safe but break:
95
+ - Format: `- <what looks safe but is dangerous> | FIX: <correct approach>`
96
+ - Source: actual bugs hit, surprising behavior discovered in code, non-obvious coupling
97
+
98
+ **RULES**conventions established or constraints discovered:
99
+ - Format: `- MUST/NEVER/PREFER: <rule>`
100
+ - Source: patterns that proved necessary during implementation
101
+
102
+ **DECISIONS** architecture choices made and why:
103
+ - Format: `- [YYYY-MM-DD] <decision and rationale>`
104
+ - Format: `- REJECTED: <approach> <why it failed>`
105
+ - Source: alternatives tried, design trade-offs made
106
+
107
+ **QUALITY GATE**: Every item must answer: "If a new AI session reads only `.prizm-docs/` and this entry, does it gain actionable understanding that prevents mistakes or accelerates work?" If not, discard.
108
+
109
+ **2c.** Inject into the correct `.prizm-docs/` file:
110
+ - Module-level TRAPS/RULES/DECISIONS → the affected L1 or L2 `.prizm` file
111
+ - Project-level RULES/PATTERNS → `root.prizm`
112
+
113
+ **RULE**: Only add genuinely new information. Never duplicate existing entries. Never rewrite entire files.
114
+
115
+ ---
116
+
117
+ ## Final: Changelog + Stage
118
+
119
+ **3a.** Append to `.prizm-docs/changelog.prizm`:
120
+ - Format: `- YYYY-MM-DD | <module-path> | <verb>: <one-line description>`
121
+ - Verbs: add, update, fix, remove, refactor, rename, deprecate
122
+ - One entry per meaningful change, not one per file
123
+
124
+ **3b.** Stage all doc changes:
125
+ ```bash
126
+ git add .prizm-docs/
67
127
  ```
68
128
 
69
- #### Step 5: Update Prizm Docs
70
- For each lesson learned, update the relevant `.prizm-docs/` files:
71
- - Add discovered pitfalls to the affected module's TRAPS section
72
- - Add new conventions or rules to the affected module's RULES section
73
- - Append decisions to DECISIONS section with rationale
74
- - Update changelog.prizm with retrospective findings
75
-
76
- #### Step 6: Handoff
77
- Suggest next action:
78
- - `prizmkit.specify` — start next feature
79
- - No action needed just documenting for future reference
129
+ **3c.** Handoff:
130
+ - `/prizmkit-committer` proceed to commit
131
+
132
+ ---
133
+
134
+ ## Integration with Pipeline
135
+
136
+ In the dev-pipeline, this skill is the **single doc maintenance step** before commit:
137
+
138
+ ```
139
+ implement → code-review retrospective (memory maintenance) committer (pure commit)
140
+ ```
141
+
142
+ The pipeline enforces a **docs pass condition**: `.prizm-docs/` must show changes in the final commit. This skill is the sole satisfier of that requirement.
143
+
144
+ ## HANDOFF Chain
145
+
146
+ | From | To | Condition |
147
+ |------|----|-----------|
148
+ | `prizmkit-code-review` | **this skill** | Review passes or work is complete |
149
+ | **this skill** | `prizmkit-committer` | Memory maintained, ready to commit |
150
+ | `prizmkit-committer` | — | Committed |
151
+
152
+ ## Output
153
+
154
+ - `.prizm-docs/*.prizm` — Structurally synced + knowledge enriched
155
+ - `.prizm-docs/changelog.prizm` — Appended entries
156
+ - All changes staged via `git add .prizm-docs/`
@@ -0,0 +1,13 @@
1
+ # Retrospective: [FEATURE_NAME]
2
+ Date: YYYY-MM-DD
3
+
4
+ ## Knowledge Captured
5
+ - TRAPS added: N (list affected modules)
6
+ - RULES added: N (list affected modules)
7
+ - DECISIONS recorded: N (list affected modules)
8
+
9
+ ## Key Insights
10
+ - [insight]: [why it matters for future work]
11
+
12
+ ## .prizm-docs/ Updates
13
+ - [file]: [what was updated]
@@ -1,24 +1,34 @@
1
1
  ---
2
2
  name: "prizmkit-specify"
3
- description: "Create structured feature specifications from natural language. Invoke when starting a new feature, user says 'specify', 'define feature', or 'write requirements'. (project)"
3
+ description: "Create structured feature specifications from natural language. Use this skill whenever the user wants to define a new feature, describe what to build, or write requirements. Trigger on: 'specify', 'define feature', 'write requirements', 'new feature', 'what should we build', 'I want to add...', 'I want to build...', 'let's add', 'let's build', 'feature idea', or when the user describes a feature they want. This is the first step in the full dev workflow — always use before /prizmkit-plan. Skip for bug fixes, config tweaks, or simple refactors (use fast path). (project)"
4
4
  ---
5
5
 
6
6
  # PrizmKit Specify
7
7
 
8
8
  Create structured feature specifications from natural language descriptions. This skill transforms a feature idea into a well-structured spec with user stories, acceptance criteria, and scope boundaries.
9
9
 
10
- ## Commands
10
+ ### When to Use
11
+ - Starting a new feature — user says "specify", "define feature", "new feature", "I want to add..."
12
+ - Before `/prizmkit-plan` — to define WHAT will be built before deciding HOW
13
+ - When a feature idea needs to be formalized before implementation
14
+ - When multiple stakeholders need to agree on scope before coding starts
11
15
 
12
- ### prizmkit.specify
16
+ ### When NOT to Use
17
+ - Bug fixes with clear root cause → use fast path (`/prizmkit-plan` simplified → `/prizmkit-implement` → `/prizmkit-committer`)
18
+ - Config tweaks, typo fixes, simple refactors → edit directly
19
+ - Documentation-only changes → no spec needed
20
+ - User already has a detailed spec → skip to /prizmkit-plan
13
21
 
14
- Create a new feature specification.
15
-
16
- **STEPS:**
22
+ ## Execution Steps
17
23
 
18
24
  1. Ask user for feature description (natural language)
19
25
  2. Auto-generate 2-4 word feature slug from description
20
- 3. Determine next feature number by scanning `.prizmkit/specs/`
21
- 4. Create directory: `.prizmkit/specs/###-feature-name/`
26
+ 3. Determine next feature number by scanning `.prizmkit/specs/`:
27
+ - List existing `###-*` directories and find the highest numeric prefix
28
+ - Next number = highest + 1 (zero-padded to 3 digits)
29
+ - Append a short timestamp suffix (`-MMDD`) to prevent collisions in concurrent sessions. Example: `004-user-avatar-0319/`
30
+ - If `.prizmkit/specs/` is empty or doesn't exist, start at `001`
31
+ 4. Create directory: `.prizmkit/specs/###-feature-name-MMDD/`
22
32
  5. Load project context (use first available source):
23
33
  - If `.prizmkit/specs/###-feature-name/context-snapshot.md` exists → read Section 3 'Prizm Context' from it (do NOT re-read `.prizm-docs/` files)
24
34
  - Otherwise → read `.prizm-docs/root.prizm`
@@ -35,14 +45,58 @@ Create a new feature specification.
35
45
  - Check: No more than 3 `[NEEDS CLARIFICATION]` markers?
36
46
  8. Output: `spec.md` path and summary
37
47
 
38
- **KEY RULES:**
39
- - Focus on WHAT and WHY, never HOW (no tech stack details)
40
- - Max 3 `[NEEDS CLARIFICATION]` markers
41
- - Every user story MUST have at least one acceptance criterion in Given/When/Then format
42
- - Scope boundaries MUST be explicitly defined
43
- - Feature numbers are zero-padded to 3 digits (e.g., `001`, `012`)
48
+ ## Writing Principles
49
+
50
+ - **Focus on WHAT and WHY, never HOW** — the spec describes the problem space; implementation choices belong in plan.md. Mixing in tech stack details couples the spec to a specific solution and makes it harder to explore alternatives during planning.
51
+ - **Every user story needs acceptance criteria** in Given/When/Then format — without them, the implementer has no way to verify the feature works correctly, and the code reviewer has no baseline to check against.
52
+ - **Scope boundaries must be explicit** — without "Out of scope" boundaries, implementers tend to gold-plate features with capabilities nobody asked for, wasting time and adding complexity.
53
+ - **Max 3 `[NEEDS CLARIFICATION]` markers** — more than 3 means the feature idea isn't mature enough to spec. Suggest the user think through the concept further and return, or use `/prizmkit-clarify` to resolve them interactively.
54
+ - **Feature numbers are zero-padded to 3 digits** (e.g., `001`, `012`) with a `-MMDD` timestamp suffix — ensures consistent sorting and prevents collisions when multiple sessions run concurrently.
55
+
56
+ ## Handling Vague Inputs
57
+
58
+ When the user's feature description is vague:
59
+ 1. Extract what IS clear and write that into the spec
60
+ 2. Mark genuinely ambiguous parts with `[NEEDS CLARIFICATION]` and include a recommended default
61
+ 3. Suggest running `/prizmkit-clarify` to resolve ambiguities interactively before proceeding to plan
62
+
63
+ The goal is to never block progress — always produce a usable spec, even if it has open questions.
64
+
65
+ ## Example
66
+
67
+ **Input:** "I want users to upload avatars"
68
+
69
+ **Output:** `.prizmkit/specs/003-user-avatar/spec.md`
70
+ ```markdown
71
+ # Feature: User Avatar Upload
72
+
73
+ ## Overview
74
+ Allow users to upload and manage profile avatar images.
75
+
76
+ ## User Stories
77
+
78
+ ### US-1: Upload Avatar
79
+ As a registered user, I want to upload a profile picture,
80
+ so that other users can visually identify me.
81
+
82
+ **Acceptance Criteria:**
83
+ - Given I am on my profile page
84
+ - When I select an image file and click upload
85
+ - Then my avatar is updated and visible across the platform
86
+
87
+ ### US-2: Remove Avatar
88
+ As a registered user, I want to remove my avatar,
89
+ so that I can revert to a default placeholder.
90
+
91
+ ## Scope
92
+ - **In scope:** Upload, display, remove avatar; image format validation
93
+ - **Out of scope:** Image cropping/editing, avatar history
94
+
95
+ ## Open Questions
96
+ - [NEEDS CLARIFICATION] Maximum file size limit? Recommended: 10MB
97
+ ```
44
98
 
45
- **HANDOFF:** `prizmkit.plan` or `prizmkit.clarify`
99
+ **HANDOFF:** `/prizmkit-plan` or `/prizmkit-clarify`
46
100
 
47
101
  ## Template
48
102