prizmkit 1.1.79 → 1.1.80

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 (92) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/dev-pipeline/scripts/init-pipeline.py +2 -0
  3. package/bundled/dev-pipeline-windows/scripts/init-pipeline.py +2 -0
  4. package/bundled/skills/_metadata.json +1 -1
  5. package/bundled/skills/app-planner/SKILL.md +10 -347
  6. package/bundled/skills/app-planner/references/infrastructure-convention-discovery.md +108 -0
  7. package/bundled/skills/app-planner/references/project-conventions-discovery.md +59 -0
  8. package/bundled/skills/app-planner/references/project-state-detection.md +88 -0
  9. package/bundled/skills/app-planner/references/rules-configuration.md +46 -0
  10. package/bundled/skills/bug-fix-workflow/SKILL.md +1 -30
  11. package/bundled/skills/bug-fix-workflow/references/bug-diagnosis.md +66 -0
  12. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +3 -40
  13. package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +49 -0
  14. package/bundled/skills/feature-pipeline-launcher/SKILL.md +3 -46
  15. package/bundled/skills/feature-pipeline-launcher/references/configuration.md +55 -0
  16. package/bundled/skills/feature-workflow/SKILL.md +5 -121
  17. package/bundled/skills/feature-workflow/references/brainstorm-guide.md +137 -0
  18. package/bundled/skills/prizm-kit/SKILL.md +11 -0
  19. package/bundled/skills/prizmkit-code-review/SKILL.md +66 -135
  20. package/bundled/skills/prizmkit-code-review/references/dev-agent-prompt.md +30 -0
  21. package/bundled/skills/prizmkit-code-review/references/review-report-template.md +31 -0
  22. package/bundled/skills/prizmkit-code-review/references/reviewer-agent-prompt.md +62 -0
  23. package/bundled/skills/prizmkit-code-review/scripts/check_loop.py +186 -0
  24. package/bundled/skills/prizmkit-committer/SKILL.md +6 -0
  25. package/bundled/skills/prizmkit-deploy/SKILL.md +48 -72
  26. package/bundled/skills/prizmkit-deploy/references/data-safety-examples.md +120 -0
  27. package/bundled/skills/prizmkit-deploy/references/ssh-bootstrap-flow.md +49 -0
  28. package/bundled/skills/prizmkit-deploy/references/ssh-execution-flow.md +41 -0
  29. package/bundled/skills/prizmkit-deploy/references/ssh-takeover.md +20 -0
  30. package/bundled/skills/prizmkit-implement/SKILL.md +6 -0
  31. package/bundled/skills/prizmkit-plan/SKILL.md +1 -83
  32. package/bundled/skills/prizmkit-plan/references/examples.md +85 -0
  33. package/bundled/skills/prizmkit-prizm-docs/SKILL.md +13 -0
  34. package/bundled/skills/prizmkit-test/SKILL.md +3 -151
  35. package/bundled/skills/prizmkit-test/references/examples.md +70 -0
  36. package/bundled/skills/prizmkit-test/references/test-generation-steps.md +49 -0
  37. package/bundled/skills/prizmkit-test/references/test-report-template.md +42 -0
  38. package/bundled/skills/recovery-workflow/SKILL.md +1 -30
  39. package/bundled/skills/recovery-workflow/references/detection.md +58 -0
  40. package/bundled/skills/refactor-pipeline-launcher/SKILL.md +3 -45
  41. package/bundled/skills/refactor-pipeline-launcher/references/configuration.md +54 -0
  42. package/bundled/skills/refactor-planner/SKILL.md +9 -149
  43. package/bundled/skills/refactor-planner/references/fast-path.md +59 -0
  44. package/bundled/skills/refactor-planner/references/planning-phases.md +135 -0
  45. package/bundled/skills/refactor-workflow/SKILL.md +4 -103
  46. package/bundled/skills/refactor-workflow/references/brainstorm-guide.md +116 -0
  47. package/bundled/skills-windows/app-planner/SKILL.md +10 -349
  48. package/bundled/skills-windows/app-planner/references/infrastructure-convention-discovery.md +108 -0
  49. package/bundled/skills-windows/app-planner/references/project-conventions-discovery.md +59 -0
  50. package/bundled/skills-windows/app-planner/references/project-state-detection.md +90 -0
  51. package/bundled/skills-windows/app-planner/references/rules-configuration.md +46 -0
  52. package/bundled/skills-windows/bug-fix-workflow/SKILL.md +1 -30
  53. package/bundled/skills-windows/bug-fix-workflow/references/bug-diagnosis.md +66 -0
  54. package/bundled/skills-windows/bugfix-pipeline-launcher/SKILL.md +2 -29
  55. package/bundled/skills-windows/bugfix-pipeline-launcher/references/configuration.md +49 -0
  56. package/bundled/skills-windows/feature-pipeline-launcher/SKILL.md +2 -35
  57. package/bundled/skills-windows/feature-pipeline-launcher/references/configuration.md +55 -0
  58. package/bundled/skills-windows/feature-workflow/SKILL.md +5 -121
  59. package/bundled/skills-windows/feature-workflow/references/brainstorm-guide.md +137 -0
  60. package/bundled/skills-windows/prizm-kit/SKILL.md +11 -0
  61. package/bundled/skills-windows/prizmkit-code-review/SKILL.md +66 -135
  62. package/bundled/skills-windows/prizmkit-code-review/references/dev-agent-prompt.md +30 -0
  63. package/bundled/skills-windows/prizmkit-code-review/references/review-report-template.md +31 -0
  64. package/bundled/skills-windows/prizmkit-code-review/references/reviewer-agent-prompt.md +62 -0
  65. package/bundled/skills-windows/prizmkit-code-review/scripts/check_loop.py +186 -0
  66. package/bundled/skills-windows/prizmkit-committer/SKILL.md +6 -0
  67. package/bundled/skills-windows/prizmkit-deploy/SKILL.md +49 -73
  68. package/bundled/skills-windows/prizmkit-deploy/references/data-safety-examples.md +120 -0
  69. package/bundled/skills-windows/prizmkit-deploy/references/direct-upload.md +3 -3
  70. package/bundled/skills-windows/prizmkit-deploy/references/ssh-bootstrap-flow.md +49 -0
  71. package/bundled/skills-windows/prizmkit-deploy/references/ssh-execution-flow.md +41 -0
  72. package/bundled/skills-windows/prizmkit-deploy/references/ssh-takeover.md +20 -0
  73. package/bundled/skills-windows/prizmkit-deploy/references/ssl-setup.md +2 -2
  74. package/bundled/skills-windows/prizmkit-implement/SKILL.md +6 -0
  75. package/bundled/skills-windows/prizmkit-plan/SKILL.md +1 -83
  76. package/bundled/skills-windows/prizmkit-plan/references/examples.md +85 -0
  77. package/bundled/skills-windows/prizmkit-prizm-docs/SKILL.md +13 -0
  78. package/bundled/skills-windows/prizmkit-retrospective/references/structural-sync-steps.md +1 -1
  79. package/bundled/skills-windows/prizmkit-test/SKILL.md +3 -151
  80. package/bundled/skills-windows/prizmkit-test/references/examples.md +70 -0
  81. package/bundled/skills-windows/prizmkit-test/references/test-generation-steps.md +49 -0
  82. package/bundled/skills-windows/prizmkit-test/references/test-report-template.md +42 -0
  83. package/bundled/skills-windows/recovery-workflow/SKILL.md +1 -52
  84. package/bundled/skills-windows/recovery-workflow/references/detection.md +58 -0
  85. package/bundled/skills-windows/refactor-pipeline-launcher/SKILL.md +2 -32
  86. package/bundled/skills-windows/refactor-pipeline-launcher/references/configuration.md +54 -0
  87. package/bundled/skills-windows/refactor-planner/SKILL.md +9 -149
  88. package/bundled/skills-windows/refactor-planner/references/fast-path.md +59 -0
  89. package/bundled/skills-windows/refactor-planner/references/planning-phases.md +135 -0
  90. package/bundled/skills-windows/refactor-workflow/SKILL.md +4 -103
  91. package/bundled/skills-windows/refactor-workflow/references/brainstorm-guide.md +116 -0
  92. package/package.json +1 -1
@@ -5,7 +5,7 @@ Read this file when DNS is confirmed pointing to the server and SSL needs to be
5
5
  ## Step 1 — Detect cloud vendor
6
6
 
7
7
  ```
8
- # Try metadata endpoints to detect cloud vendor (run on server via SSH)
8
+ # Try metadata endpoints to detect cloud vendor
9
9
  curl -s --connect-timeout 2 http://100.100.100.200/latest/meta-data/ && echo "ALIBABA"
10
10
  curl -s --connect-timeout 2 http://metadata.tencentyun.com/latest/meta-data/ && echo "TENCENT"
11
11
  curl -s --connect-timeout 2 http://169.254.169.254/latest/meta-data/ && echo "AWS/GCP/AZURE"
@@ -25,7 +25,7 @@ Also check `/etc/hostname` for vendor patterns.
25
25
  ## Step 3 — Certbot install & certificate request
26
26
 
27
27
  ```
28
- # Install certbot (idempotent, on server)
28
+ # Install certbot (idempotent)
29
29
  which certbot || apt-get install -y certbot python3-certbot-nginx
30
30
 
31
31
  # Request certificate
@@ -10,6 +10,12 @@ description: "Execute plan.md tasks with TDD approach. Respects task ordering an
10
10
  - User says "implement", "build", "code it", "start coding", "develop"
11
11
  - For fast-path: user describes a simple change directly (fast-path skips specify, but still requires a simplified plan.md with Tasks section)
12
12
 
13
+ ### When NOT to Use
14
+ - No plan.md exists — run /prizmkit-plan first
15
+ - All tasks in plan.md are already checked off — nothing to implement
16
+ - Trivial one-line changes (typo, config tweak) — edit directly without the full workflow
17
+ - Design/planning phase — use /prizmkit-plan to produce spec and plan first
18
+
13
19
  **PRECONDITION:**
14
20
 
15
21
  | Required Artifact | Check | If Missing |
@@ -86,89 +86,7 @@ A universal spec + plan generator. Takes a natural-language description of ANY d
86
86
 
87
87
  ## Examples
88
88
 
89
- ### Example 1: New Feature
90
-
91
- **Input:** "I want users to upload avatars"
92
-
93
- **Phase 0 output:** `.prizmkit/specs/003-user-avatar/spec.md`
94
- ```markdown
95
- # User Avatar Upload
96
- ## Overview
97
- Allow registered users to upload and manage profile pictures.
98
- ## Goals
99
- ### G-1: Upload Avatar
100
- As a registered user, I want to upload a profile picture,
101
- so that other users can visually identify me.
102
- **Acceptance Criteria:**
103
- - Given I am on my profile page
104
- - When I select an image file and click upload
105
- - Then my avatar is updated and visible across the platform
106
- ## Scope
107
- - **In scope:** Upload, display, remove avatar; image format validation
108
- - **Out of scope:** Image cropping/editing, avatar history
109
- ```
110
-
111
- **Phase 1-2 output:** `plan.md` excerpt:
112
- ```markdown
113
- ## Tasks
114
- ### Phase: Foundation (T-010~T-019)
115
- - [ ] [T-010] [G-1] Add avatar_url field to User model — file: src/models/user.ts
116
- - [ ] [T-011] [G-1] Create S3 upload utility — file: src/lib/s3.ts
117
- ### Phase: Core [P] (T-100~T-109)
118
- - [ ] [T-100] [P] [G-1] POST /api/avatar upload endpoint — file: src/routes/avatar.ts
119
- ```
120
-
121
- ### Example 2: Refactoring
122
-
123
- **Input:** "Extract shared auth middleware from the API routes"
124
-
125
- **Phase 0 output:** `.prizmkit/specs/004-extract-auth-middleware/spec.md`
126
- ```markdown
127
- # Extract Auth Middleware
128
- ## Overview
129
- Consolidate duplicated authentication logic scattered across route files into a single shared middleware.
130
- ## Goals
131
- ### G-1: Extract Shared Authentication Logic
132
- Consolidate duplicated auth checks from 5 route files into a single middleware module.
133
- **Acceptance Criteria:**
134
- - All existing auth-related tests pass without modification
135
- - Auth logic exists in exactly one file (src/middleware/auth.ts)
136
- - No route file contains inline token verification
137
- ## Scope
138
- - **In scope:** src/routes/users.ts, orders.ts, admin.ts, payments.ts, profile.ts
139
- - **Out of scope:** Authorization (role-based access), rate limiting
140
- ## Behavior Preservation
141
- - All 23 existing API tests must pass unchanged
142
- - Response formats and HTTP status codes must not change
143
- - Error message strings must remain identical
144
- ```
145
-
146
- ### Example 3: Bug Fix
147
-
148
- **Input:** "Login page crashes when API returns 401"
149
-
150
- **Phase 0 output:** `.prizmkit/specs/005-login-401-crash/spec.md`
151
- ```markdown
152
- # Fix: Login Crash on 401 Response
153
- ## Overview
154
- Login page throws unhandled exception when auth API returns 401, causing a white screen.
155
- ## Goals
156
- ### G-1: Handle 401 Response Gracefully
157
- When the auth API returns 401, display an error message instead of crashing.
158
- **Acceptance Criteria:**
159
- - Given user submits invalid credentials, When API returns 401, Then error message "Invalid credentials" is displayed
160
- - Given user submits invalid credentials, When API returns 401, Then no unhandled exception is thrown
161
- ## Root Cause
162
- - Error classification: Runtime
163
- - Root cause: `AuthService.handleLogin()` at src/services/auth.ts:42 does not handle null token
164
- - Affected files: src/services/auth.ts (L42), src/pages/login.tsx (L28)
165
- ## Scope
166
- - **In scope:** Null handling in auth service, error display in login page
167
- - **Out of scope:** Other HTTP error codes (403, 500), auth flow redesign
168
- ## Behavior Preservation
169
- - All existing login success tests must pass unchanged
170
- - Auth token flow for valid credentials must not change
171
- ```
89
+ Read `${SKILL_DIR}/references/examples.md` for worked examples of feature, refactoring, and bug fix planning.
172
90
 
173
91
  ## References
174
92
 
@@ -0,0 +1,85 @@
1
+ # Plan Examples
2
+
3
+ ## Example 1: New Feature
4
+
5
+ **Input:** "I want users to upload avatars"
6
+
7
+ **Phase 0 output:** `.prizmkit/specs/003-user-avatar/spec.md`
8
+ ```markdown
9
+ # User Avatar Upload
10
+ ## Overview
11
+ Allow registered users to upload and manage profile pictures.
12
+ ## Goals
13
+ ### G-1: Upload Avatar
14
+ As a registered user, I want to upload a profile picture,
15
+ so that other users can visually identify me.
16
+ **Acceptance Criteria:**
17
+ - Given I am on my profile page
18
+ - When I select an image file and click upload
19
+ - Then my avatar is updated and visible across the platform
20
+ ## Scope
21
+ - **In scope:** Upload, display, remove avatar; image format validation
22
+ - **Out of scope:** Image cropping/editing, avatar history
23
+ ```
24
+
25
+ **Phase 1-2 output:** `plan.md` excerpt:
26
+ ```markdown
27
+ ## Tasks
28
+ ### Phase: Foundation (T-010~T-019)
29
+ - [ ] [T-010] [G-1] Add avatar_url field to User model — file: src/models/user.ts
30
+ - [ ] [T-011] [G-1] Create S3 upload utility — file: src/lib/s3.ts
31
+ ### Phase: Core [P] (T-100~T-109)
32
+ - [ ] [T-100] [P] [G-1] POST /api/avatar upload endpoint — file: src/routes/avatar.ts
33
+ ```
34
+
35
+ ## Example 2: Refactoring
36
+
37
+ **Input:** "Extract shared auth middleware from the API routes"
38
+
39
+ **Phase 0 output:** `.prizmkit/specs/004-extract-auth-middleware/spec.md`
40
+ ```markdown
41
+ # Extract Auth Middleware
42
+ ## Overview
43
+ Consolidate duplicated authentication logic scattered across route files into a single shared middleware.
44
+ ## Goals
45
+ ### G-1: Extract Shared Authentication Logic
46
+ Consolidate duplicated auth checks from 5 route files into a single middleware module.
47
+ **Acceptance Criteria:**
48
+ - All existing auth-related tests pass without modification
49
+ - Auth logic exists in exactly one file (src/middleware/auth.ts)
50
+ - No route file contains inline token verification
51
+ ## Scope
52
+ - **In scope:** src/routes/users.ts, orders.ts, admin.ts, payments.ts, profile.ts
53
+ - **Out of scope:** Authorization (role-based access), rate limiting
54
+ ## Behavior Preservation
55
+ - All 23 existing API tests must pass unchanged
56
+ - Response formats and HTTP status codes must not change
57
+ - Error message strings must remain identical
58
+ ```
59
+
60
+ ## Example 3: Bug Fix
61
+
62
+ **Input:** "Login page crashes when API returns 401"
63
+
64
+ **Phase 0 output:** `.prizmkit/specs/005-login-401-crash/spec.md`
65
+ ```markdown
66
+ # Fix: Login Crash on 401 Response
67
+ ## Overview
68
+ Login page throws unhandled exception when auth API returns 401, causing a white screen.
69
+ ## Goals
70
+ ### G-1: Handle 401 Response Gracefully
71
+ When the auth API returns 401, display an error message instead of crashing.
72
+ **Acceptance Criteria:**
73
+ - Given user submits invalid credentials, When API returns 401, Then error message "Invalid credentials" is displayed
74
+ - Given user submits invalid credentials, When API returns 401, Then no unhandled exception is thrown
75
+ ## Root Cause
76
+ - Error classification: Runtime
77
+ - Root cause: `AuthService.handleLogin()` at src/services/auth.ts:42 does not handle null token
78
+ - Affected files: src/services/auth.ts (L42), src/pages/login.tsx (L28)
79
+ ## Scope
80
+ - **In scope:** Null handling in auth service, error display in login page
81
+ - **Out of scope:** Other HTTP error codes (403, 500), auth flow redesign
82
+ ## Behavior Preservation
83
+ - All existing login success tests must pass unchanged
84
+ - Auth token flow for valid credentials must not change
85
+ ```
@@ -36,6 +36,19 @@ This skill handles 6 operations. When invoked, determine the user's intent and e
36
36
 
37
37
  **Key principle**: `/prizmkit-prizm-docs` defines WHAT the docs should look like and bootstraps them. `/prizmkit-retrospective` is the SOLE WRITER that keeps docs in sync with code during ongoing development.
38
38
 
39
+ ### When to Use
40
+ - First-time project documentation setup (init)
41
+ - Checking if docs are up to date (status)
42
+ - Rebuilding stale module docs after major changes (rebuild)
43
+ - Validating doc format compliance (validate)
44
+ - Migrating existing docs to Prizm format (migrate)
45
+ - User says "initialize docs", "check doc status", "rebuild docs", "validate docs"
46
+
47
+ ### When NOT to Use
48
+ - Incremental doc updates after code changes → use /prizmkit-retrospective (the sole writer during development)
49
+ - Project has no .prizmkit/prizm-docs/ and user doesn't want to initialize
50
+ - User wants to edit code → use /prizmkit-plan and /prizmkit-implement
51
+
39
52
  ## Operation: Init
40
53
 
41
54
  Bootstrap .prizmkit/prizm-docs/ for the current project.
@@ -36,7 +36,7 @@ git diff HEAD --name-status
36
36
  **1g. TRAPS staleness check** (only when an L2 doc's TRAPS section has > 10 entries):
37
37
 
38
38
  Perform a quick staleness scan on existing TRAPS to prevent unbounded accumulation:
39
- 1. If a TRAP has `STALE_IF:` and the glob-matched files no longer exist (verified via `Get-ChildItem`) → delete the TRAP entry
39
+ 1. If a TRAP has `STALE_IF:` and the glob-matched files no longer exist (verified via `ls`) → delete the TRAP entry
40
40
  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>$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
41
41
  3. Process at most 5 of the oldest TRAPS per L2 doc per session (to bound context cost)
42
42
 
@@ -108,94 +108,11 @@ Compare what exists against what should exist, across three levels:
108
108
 
109
109
  ### Phase 4: Generate Missing Tests
110
110
 
111
- Generate tests in priority order: unit → integration → E2E. After each batch, run immediately.
112
-
113
- When generated tests fail, distinguish two cases:
114
- - **Test bug** (syntax error, wrong import, wrong mock, wrong framework API usage) → fix the test and re-run
115
- - **Assertion failure** (test is valid but code returns unexpected result) → mark as "needs review" in report; do NOT modify production code. This is a potential bug discovered by the generated test.
116
-
117
- If a test fails repeatedly after 2 fix attempts, skip it and mark as "unresolved" in the report.
118
-
119
- **4a. Unit Tests (always applicable)**
120
-
121
- For each uncovered interface:
122
- - Read the source file to understand function signature and logic
123
- - Generate test file matching project conventions (framework, naming, directory, import style, mock/fixture patterns)
124
- - Common naming patterns to match:
125
- - `src/foo.ts` → `src/__tests__/foo.test.ts` or `src/foo.spec.ts` or `tests/foo_test.py`
126
- - Mirror the existing pattern; if no tests exist, use the framework's default convention
127
- - Cover: happy path, edge cases (null/undefined/empty), error conditions, boundary values
128
- - Do NOT test framework internals or third-party library behavior
129
- - Run tests immediately after generating
130
-
131
- **4b. Integration Tests**
132
-
133
- For each module with dependencies:
134
- - Generate tests for the module's primary interface exercising its real dependencies
135
- - If API endpoints exist: request/response tests (valid input, invalid input, missing params, auth)
136
- - If database operations exist: CRUD tests using the project's existing test database config
137
- - Run tests immediately after generating
138
-
139
- **4c. E2E Tests (conditional)**
140
-
141
- Preconditions (ALL must be met):
142
- - Playwright is available (`@playwright/test` or `playwright` in package.json dependencies, or `npx playwright --version` succeeds as fallback)
143
- - Playwright browsers are installed (check `npx playwright install --dry-run 2>/dev/null` exits cleanly, or `node_modules/.cache/ms-playwright/` directory exists; if missing, warn in report and skip E2E)
144
- - Project has a UI layer
145
- - Project can be started (start/dev script in package.json)
146
- - Acceptance criteria exist in spec.md files
147
-
148
- If ALL met:
149
- - **Before starting dev server**: detect whether it's already running: (1) check `package.json` scripts for port flags (`--port`, `-p`, `PORT=`), (2) fall back to framework defaults (3000 for React/Next/Express, 5173 for Vite, 8000 for Django, 5000 for Flask), (3) if still unknown, ask the user. Use the detected port in `lsof -i :<port>` to check. If running, tell user: "Dev server appears to be already running on port {N}. Use this running instance for E2E tests?" If user confirms, use existing instance. If user declines, skip E2E.
150
- - Start the project dev server (only if not already running). Wait for it to be ready.
151
- - For each uncovered acceptance criterion, generate a Playwright test script
152
- - Run generated E2E tests, capture screenshots of failures
153
- - **Only stop dev server if you started it.** Never stop a server that was already running.
154
-
155
- If NOT met:
156
- - Note what was skipped and why in the report
157
- - If only the server wasn't startable: still generate E2E script files but mark as "not run — manual execution needed"
111
+ Read `${SKILL_DIR}/references/test-generation-steps.md` for the detailed generation procedure — priority order (unit → integration → E2E), failure handling rules, and generation patterns for each test level.
158
112
 
159
113
  ### Phase 5: Unified Report
160
114
 
161
- Create `.prizmkit/test/{YYYY_MM_DD_HH_MM_SS}_testresult/` directory.
162
-
163
- **test-report.md** format:
164
-
165
- ```markdown
166
- # Test Report — {timestamp}
167
-
168
- ## Summary
169
- - Scope: {full / module: name / feature: ###-name}
170
- - Architecture: {frontend / backend / fullstack}
171
- - Test framework: {name}
172
- - Mode: {interactive / headless}
173
-
174
- ## Existing Tests
175
- - Total: {N} | Passed: {N} | Failed: {N}
176
- {failed test details or "All passing"}
177
- {or "No existing tests found — generated first batch"}
178
-
179
- ## Coverage Gaps Found
180
- | Module | Interface | Type | Status |
181
- |--------|-----------|------|--------|
182
- | ... | ... | unit/integration/e2e | covered / generated / needs-review / unresolved / skipped |
183
-
184
- ## Generated Tests
185
- - Unit: {N} generated, {N} needs-review, {N} unresolved
186
- - Integration: {N} generated, {N} needs-review, {N} unresolved
187
- - E2E: {N} generated, {N} skipped ({reason})
188
-
189
- ## Final Status
190
- - All tests passing: {yes / no}
191
- - Needs human review: {list of tests marked needs-review}
192
- {remaining failures if any}
193
- ```
194
-
195
- Also save:
196
- - `existing-test-output.txt` — raw output from Phase 2
197
- - `generated-tests/` — copies of all generated test files
198
- - `e2e-output/` — E2E logs and failure screenshots (if applicable)
115
+ Create `.prizmkit/test/{YYYY_MM_DD_HH_MM_SS}_testresult/` directory. Read `${SKILL_DIR}/references/test-report-template.md` for the full report format and artifact list.
199
116
 
200
117
  ## Output
201
118
 
@@ -211,71 +128,6 @@ If the session is interrupted:
211
128
 
212
129
  ## Examples
213
130
 
214
- ### Example 1: Full-Project Quality Check with Test Generation
215
-
216
- **User**: `/prizmkit-test`
217
-
218
- **Phase 0 — Architecture Detection**:
219
- ```
220
- Detected: Fullstack (React + Express)
221
- Test framework: Vitest (7 existing test files)
222
- ```
223
-
224
- **Phase 1 — Scope Selection** (user selects option 1):
225
- ```
226
- Scope: Full project (all modules, all specs)
227
- ```
228
-
229
- **Phase 2 — Existing Tests**: 7 test files found, 20 tests run, 18 passed, 2 pre-existing failures (recorded, not fixed).
230
-
231
- **Phase 3 — Gap Analysis** (excerpt):
232
- | Module | Interface | Type | Status |
233
- |--------|-----------|------|--------|
234
- | auth | login() | unit | missing |
235
- | auth | register() | unit | missing |
236
- | payment | processPayment() | unit | missing |
237
- | payment | api/checkout | integration | missing |
238
- | — | Checkout flow | e2e | missing |
239
-
240
- **Phase 4**: Generated 5 unit tests (3 passing, 2 assertion failures marked "needs-review"), 1 integration test (passing), 1 E2E test (passing).
241
-
242
- **Phase 5 — Report Summary**:
243
- ```
244
- Generated: 5 unit (2 needs-review), 1 integration, 1 E2E
245
- Report: .prizmkit/test/2026_05_23_14_30_00_testresult/test-report.md
246
- Needs human review: processPayment (returns 400 for negative amounts, expected 422), refund (missing authorization header causes 500 instead of 401)
247
- ```
248
-
249
- ### Example 2: Single-Feature Targeted Test
250
-
251
- **User**: `/prizmkit-test`
252
-
253
- **Phase 0 — Architecture Detection**:
254
- ```
255
- Detected: Backend (Express)
256
- Test framework: Vitest
257
- ```
258
-
259
- **Phase 1 — Scope Selection** (user selects option 3, then picks "042-payment-gateway"):
260
- ```
261
- Scope: Single feature — 042-payment-gateway
262
- Test files in scope: 2
263
-
264
- **Phase 2 — Existing Tests**: 2 test files, 8 tests, all passing.
265
-
266
- **Phase 3 — Gap Analysis** (excerpt):
267
- | Module | Interface | Type | Status |
268
- |--------|-----------|------|--------|
269
- | payment | processPayment() | unit | missing |
270
- | payment | refund() | unit | missing |
271
-
272
- **Phase 4**: Generated 2 unit tests (both passing). No integration/E2E applicable for this scope.
273
-
274
- **Phase 5 — Report Summary**:
275
- ```
276
- Generated: 2 unit tests (all passing)
277
- Report: .prizmkit/test/2026_05_23_15_00_00_testresult/test-report.md
278
- All tests passing. Ready for commit.
279
- ```
131
+ Read `${SKILL_DIR}/references/examples.md` for worked examples of full-project and single-feature test runs.
280
132
 
281
133
  **HANDOFF:** Independent skill — no handoff. User may proceed to `/prizmkit-committer` if all tests pass, or fix issues manually if tests are marked "needs-review".
@@ -0,0 +1,70 @@
1
+ # Test Examples
2
+
3
+ ## Example 1: Full-Project Quality Check with Test Generation
4
+
5
+ **User**: `/prizmkit-test`
6
+
7
+ **Phase 0 — Architecture Detection**:
8
+ ```
9
+ Detected: Fullstack (React + Express)
10
+ Test framework: Vitest (7 existing test files)
11
+ ```
12
+
13
+ **Phase 1 — Scope Selection** (user selects option 1):
14
+ ```
15
+ Scope: Full project (all modules, all specs)
16
+ ```
17
+
18
+ **Phase 2 — Existing Tests**: 7 test files found, 20 tests run, 18 passed, 2 pre-existing failures (recorded, not fixed).
19
+
20
+ **Phase 3 — Gap Analysis** (excerpt):
21
+ | Module | Interface | Type | Status |
22
+ |--------|-----------|------|--------|
23
+ | auth | login() | unit | missing |
24
+ | auth | register() | unit | missing |
25
+ | payment | processPayment() | unit | missing |
26
+ | payment | api/checkout | integration | missing |
27
+ | — | Checkout flow | e2e | missing |
28
+
29
+ **Phase 4**: Generated 5 unit tests (3 passing, 2 assertion failures marked "needs-review"), 1 integration test (passing), 1 E2E test (passing).
30
+
31
+ **Phase 5 — Report Summary**:
32
+ ```
33
+ Generated: 5 unit (2 needs-review), 1 integration, 1 E2E
34
+ Report: .prizmkit/test/2026_05_23_14_30_00_testresult/test-report.md
35
+ Needs human review: processPayment (returns 400 for negative amounts, expected 422), refund (missing authorization header causes 500 instead of 401)
36
+ ```
37
+
38
+ ## Example 2: Single-Feature Targeted Test
39
+
40
+ **User**: `/prizmkit-test`
41
+
42
+ **Phase 0 — Architecture Detection**:
43
+ ```
44
+ Detected: Backend (Express)
45
+ Test framework: Vitest
46
+ ```
47
+
48
+ **Phase 1 — Scope Selection** (user selects option 3, then picks "042-payment-gateway"):
49
+ ```
50
+ Scope: Single feature — 042-payment-gateway
51
+ Test files in scope: 2
52
+
53
+ **Phase 2 — Existing Tests**: 2 test files, 8 tests, all passing.
54
+
55
+ **Phase 3 — Gap Analysis** (excerpt):
56
+ | Module | Interface | Type | Status |
57
+ |--------|-----------|------|--------|
58
+ | payment | processPayment() | unit | missing |
59
+ | payment | refund() | unit | missing |
60
+
61
+ **Phase 4**: Generated 2 unit tests (both passing). No integration/E2E applicable for this scope.
62
+
63
+ **Phase 5 — Report Summary**:
64
+ ```
65
+ Generated: 2 unit tests (all passing)
66
+ Report: .prizmkit/test/2026_05_23_15_00_00_testresult/test-report.md
67
+ All tests passing. Ready for commit.
68
+ ```
69
+
70
+ **HANDOFF**: Independent skill — no handoff. User may proceed to `/prizmkit-committer` if all tests pass, or fix issues manually if tests are marked "needs-review".
@@ -0,0 +1,49 @@
1
+ # Test Generation Steps (Phase 4)
2
+
3
+ Generate tests in priority order: unit → integration → E2E. After each batch, run immediately.
4
+
5
+ When generated tests fail, distinguish two cases:
6
+ - **Test bug** (syntax error, wrong import, wrong mock, wrong framework API usage) → fix the test and re-run
7
+ - **Assertion failure** (test is valid but code returns unexpected result) → mark as "needs review" in report; do NOT modify production code. This is a potential bug discovered by the generated test.
8
+
9
+ If a test fails repeatedly after 2 fix attempts, skip it and mark as "unresolved" in the report.
10
+
11
+ ## 4a. Unit Tests (always applicable)
12
+
13
+ For each uncovered interface:
14
+ - Read the source file to understand function signature and logic
15
+ - Generate test file matching project conventions (framework, naming, directory, import style, mock/fixture patterns)
16
+ - Common naming patterns to match:
17
+ - `src/foo.ts` → `src/__tests__/foo.test.ts` or `src/foo.spec.ts` or `tests/foo_test.py`
18
+ - Mirror the existing pattern; if no tests exist, use the framework's default convention
19
+ - Cover: happy path, edge cases (null/undefined/empty), error conditions, boundary values
20
+ - Do NOT test framework internals or third-party library behavior
21
+ - Run tests immediately after generating
22
+
23
+ ## 4b. Integration Tests
24
+
25
+ For each module with dependencies:
26
+ - Generate tests for the module's primary interface exercising its real dependencies
27
+ - If API endpoints exist: request/response tests (valid input, invalid input, missing params, auth)
28
+ - If database operations exist: CRUD tests using the project's existing test database config
29
+ - Run tests immediately after generating
30
+
31
+ ## 4c. E2E Tests (conditional)
32
+
33
+ Preconditions (ALL must be met):
34
+ - Playwright is available (`@playwright/test` or `playwright` in package.json dependencies, or `npx playwright --version` succeeds as fallback)
35
+ - Playwright browsers are installed (check `npx playwright install --dry-run 2>/dev/null` exits cleanly, or `node_modules/.cache/ms-playwright/` directory exists; if missing, warn in report and skip E2E)
36
+ - Project has a UI layer
37
+ - Project can be started (start/dev script in package.json)
38
+ - Acceptance criteria exist in spec.md files
39
+
40
+ If ALL met:
41
+ - **Before starting dev server**: detect whether it's already running: (1) check `package.json` scripts for port flags (`--port`, `-p`, `PORT=`), (2) fall back to framework defaults (3000 for React/Next/Express, 5173 for Vite, 8000 for Django, 5000 for Flask), (3) if still unknown, ask the user. Use the detected port in `lsof -i :<port>` to check. If running, tell user: "Dev server appears to be already running on port {N}. Use this running instance for E2E tests?" If user confirms, use existing instance. If user declines, skip E2E.
42
+ - Start the project dev server (only if not already running). Wait for it to be ready.
43
+ - For each uncovered acceptance criterion, generate a Playwright test script
44
+ - Run generated E2E tests, capture screenshots of failure.
45
+ - **Only stop dev server if you started it.** Never stop a server that was already running.
46
+
47
+ If NOT met:
48
+ - Note what was skipped and why in the report
49
+ - If only the server wasn't startable: still generate E2E script files but mark as "not run — manual execution needed"
@@ -0,0 +1,42 @@
1
+ # Test Report Output Template
2
+
3
+ Used in Phase 5 of `/prizmkit-test`. Create `.prizmkit/test/{YYYY_MM_DD_HH_MM_SS}_testresult/` directory and write `test-report.md`.
4
+
5
+ ## test-report.md Format
6
+
7
+ ```markdown
8
+ # Test Report — {timestamp}
9
+
10
+ ## Summary
11
+ - Scope: {full / module: name / feature: ###-name}
12
+ - Architecture: {frontend / backend / fullstack}
13
+ - Test framework: {name}
14
+ - Mode: {interactive / headless}
15
+
16
+ ## Existing Tests
17
+ - Total: {N} | Passed: {N} | Failed: {N}
18
+ {failed test details or "All passing"}
19
+ {or "No existing tests found — generated first batch"}
20
+
21
+ ## Coverage Gaps Found
22
+ | Module | Interface | Type | Status |
23
+ |--------|-----------|------|--------|
24
+ | ... | ... | unit/integration/e2e | covered / generated / needs-review / unresolved / skipped |
25
+
26
+ ## Generated Tests
27
+ - Unit: {N} generated, {N} needs-review, {N} unresolved
28
+ - Integration: {N} generated, {N} needs-review, {N} unresolved
29
+ - E2E: {N} generated, {N} skipped ({reason})
30
+
31
+ ## Final Status
32
+ - All tests passing: {yes / no}
33
+ - Needs human review: {list of tests marked needs-review}
34
+ {remaining failures if any}
35
+ ```
36
+
37
+ ## Artifacts
38
+
39
+ Also save alongside `test-report.md`:
40
+ - `existing-test-output.txt` — raw output from Phase 2
41
+ - `generated-tests/` — copies of all generated test files
42
+ - `e2e-output/` — E2E logs and failure screenshots (if applicable)
@@ -86,58 +86,7 @@ recovery-workflow
86
86
 
87
87
  **Goal**: Identify which workflow was interrupted and what phase it reached.
88
88
 
89
- Run the detection script:
90
-
91
- ```powershell
92
- function Invoke-PrizmPython {
93
- param([Parameter(ValueFromRemainingArguments = $true)][string[]]$Arguments)
94
- $python = Get-Command python -ErrorAction SilentlyContinue
95
- if ($python) {
96
- & $python.Source -c 'import sys; raise SystemExit(0 if sys.version_info[0] == 3 else 1)' *> $null
97
- if ($LASTEXITCODE -eq 0) {
98
- & $python.Source @Arguments
99
- return
100
- }
101
- }
102
- $py = Get-Command py -ErrorAction SilentlyContinue
103
- if ($py) {
104
- & $py.Source -3 -c 'import sys; raise SystemExit(0 if sys.version_info[0] == 3 else 1)' *> $null
105
- if ($LASTEXITCODE -eq 0) {
106
- & $py.Source -3 @Arguments
107
- return
108
- }
109
- }
110
- throw "Python 3 is required. Install Python and ensure python or py is in PATH."
111
- }
112
- Invoke-PrizmPython ${SKILL_DIR}/scripts/detect-recovery-state.py
113
- ```
114
-
115
- The script uses **priority-ordered signature matching**:
116
-
117
- ```
118
- 1. Current branch matches fix/* → bug-fix-workflow
119
- 2. .prizmkit/bugfix/ directory has content → bug-fix-workflow
120
- 3. Current branch matches refactor/* → refactor-workflow
121
- 4. .prizmkit/plans/refactor-list.json exists → refactor-workflow
122
- 5. Current branch matches feat/* → feature-workflow
123
- 6. .prizmkit/plans/feature-list.json exists → feature-workflow
124
- 7. None of the above → no workflow detected
125
- ```
126
-
127
- Bug-fix-workflow has highest priority because it is purely interactive and benefits most from recovery (no pipeline retry fallback).
128
-
129
- ### If no workflow detected
130
-
131
- Show guidance and exit:
132
-
133
- ```
134
- No interrupted workflow detected in this workspace.
135
-
136
- To start a new workflow:
137
- • /feature-workflow — build features from idea to code
138
- • /bug-fix-workflow — fix a specific bug interactively
139
- • /refactor-workflow — behavior-preserving code restructuring
140
- ```
89
+ Run the detection script (`Invoke-PrizmPython ${SKILL_DIR}/scripts/detect-recovery-state.py`). For the full signature matching table, phase inference tables (bug-fix/feature/refactor), and no-workflow-detected guidance, read `${SKILL_DIR}/references/detection.md`.
141
90
 
142
91
  **CHECKPOINT CP-REC-0**: Workflow type and phase identified.
143
92