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.
- package/bundled/VERSION.json +3 -3
- package/bundled/dev-pipeline/scripts/init-pipeline.py +2 -0
- package/bundled/dev-pipeline-windows/scripts/init-pipeline.py +2 -0
- package/bundled/skills/_metadata.json +1 -1
- package/bundled/skills/app-planner/SKILL.md +10 -347
- package/bundled/skills/app-planner/references/infrastructure-convention-discovery.md +108 -0
- package/bundled/skills/app-planner/references/project-conventions-discovery.md +59 -0
- package/bundled/skills/app-planner/references/project-state-detection.md +88 -0
- package/bundled/skills/app-planner/references/rules-configuration.md +46 -0
- package/bundled/skills/bug-fix-workflow/SKILL.md +1 -30
- package/bundled/skills/bug-fix-workflow/references/bug-diagnosis.md +66 -0
- package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +3 -40
- package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +49 -0
- package/bundled/skills/feature-pipeline-launcher/SKILL.md +3 -46
- package/bundled/skills/feature-pipeline-launcher/references/configuration.md +55 -0
- package/bundled/skills/feature-workflow/SKILL.md +5 -121
- package/bundled/skills/feature-workflow/references/brainstorm-guide.md +137 -0
- package/bundled/skills/prizm-kit/SKILL.md +11 -0
- package/bundled/skills/prizmkit-code-review/SKILL.md +66 -135
- package/bundled/skills/prizmkit-code-review/references/dev-agent-prompt.md +30 -0
- package/bundled/skills/prizmkit-code-review/references/review-report-template.md +31 -0
- package/bundled/skills/prizmkit-code-review/references/reviewer-agent-prompt.md +62 -0
- package/bundled/skills/prizmkit-code-review/scripts/check_loop.py +186 -0
- package/bundled/skills/prizmkit-committer/SKILL.md +6 -0
- package/bundled/skills/prizmkit-deploy/SKILL.md +48 -72
- package/bundled/skills/prizmkit-deploy/references/data-safety-examples.md +120 -0
- package/bundled/skills/prizmkit-deploy/references/ssh-bootstrap-flow.md +49 -0
- package/bundled/skills/prizmkit-deploy/references/ssh-execution-flow.md +41 -0
- package/bundled/skills/prizmkit-deploy/references/ssh-takeover.md +20 -0
- package/bundled/skills/prizmkit-implement/SKILL.md +6 -0
- package/bundled/skills/prizmkit-plan/SKILL.md +1 -83
- package/bundled/skills/prizmkit-plan/references/examples.md +85 -0
- package/bundled/skills/prizmkit-prizm-docs/SKILL.md +13 -0
- package/bundled/skills/prizmkit-test/SKILL.md +3 -151
- package/bundled/skills/prizmkit-test/references/examples.md +70 -0
- package/bundled/skills/prizmkit-test/references/test-generation-steps.md +49 -0
- package/bundled/skills/prizmkit-test/references/test-report-template.md +42 -0
- package/bundled/skills/recovery-workflow/SKILL.md +1 -30
- package/bundled/skills/recovery-workflow/references/detection.md +58 -0
- package/bundled/skills/refactor-pipeline-launcher/SKILL.md +3 -45
- package/bundled/skills/refactor-pipeline-launcher/references/configuration.md +54 -0
- package/bundled/skills/refactor-planner/SKILL.md +9 -149
- package/bundled/skills/refactor-planner/references/fast-path.md +59 -0
- package/bundled/skills/refactor-planner/references/planning-phases.md +135 -0
- package/bundled/skills/refactor-workflow/SKILL.md +4 -103
- package/bundled/skills/refactor-workflow/references/brainstorm-guide.md +116 -0
- package/bundled/skills-windows/app-planner/SKILL.md +10 -349
- package/bundled/skills-windows/app-planner/references/infrastructure-convention-discovery.md +108 -0
- package/bundled/skills-windows/app-planner/references/project-conventions-discovery.md +59 -0
- package/bundled/skills-windows/app-planner/references/project-state-detection.md +90 -0
- package/bundled/skills-windows/app-planner/references/rules-configuration.md +46 -0
- package/bundled/skills-windows/bug-fix-workflow/SKILL.md +1 -30
- package/bundled/skills-windows/bug-fix-workflow/references/bug-diagnosis.md +66 -0
- package/bundled/skills-windows/bugfix-pipeline-launcher/SKILL.md +2 -29
- package/bundled/skills-windows/bugfix-pipeline-launcher/references/configuration.md +49 -0
- package/bundled/skills-windows/feature-pipeline-launcher/SKILL.md +2 -35
- package/bundled/skills-windows/feature-pipeline-launcher/references/configuration.md +55 -0
- package/bundled/skills-windows/feature-workflow/SKILL.md +5 -121
- package/bundled/skills-windows/feature-workflow/references/brainstorm-guide.md +137 -0
- package/bundled/skills-windows/prizm-kit/SKILL.md +11 -0
- package/bundled/skills-windows/prizmkit-code-review/SKILL.md +66 -135
- package/bundled/skills-windows/prizmkit-code-review/references/dev-agent-prompt.md +30 -0
- package/bundled/skills-windows/prizmkit-code-review/references/review-report-template.md +31 -0
- package/bundled/skills-windows/prizmkit-code-review/references/reviewer-agent-prompt.md +62 -0
- package/bundled/skills-windows/prizmkit-code-review/scripts/check_loop.py +186 -0
- package/bundled/skills-windows/prizmkit-committer/SKILL.md +6 -0
- package/bundled/skills-windows/prizmkit-deploy/SKILL.md +49 -73
- package/bundled/skills-windows/prizmkit-deploy/references/data-safety-examples.md +120 -0
- package/bundled/skills-windows/prizmkit-deploy/references/direct-upload.md +3 -3
- package/bundled/skills-windows/prizmkit-deploy/references/ssh-bootstrap-flow.md +49 -0
- package/bundled/skills-windows/prizmkit-deploy/references/ssh-execution-flow.md +41 -0
- package/bundled/skills-windows/prizmkit-deploy/references/ssh-takeover.md +20 -0
- package/bundled/skills-windows/prizmkit-deploy/references/ssl-setup.md +2 -2
- package/bundled/skills-windows/prizmkit-implement/SKILL.md +6 -0
- package/bundled/skills-windows/prizmkit-plan/SKILL.md +1 -83
- package/bundled/skills-windows/prizmkit-plan/references/examples.md +85 -0
- package/bundled/skills-windows/prizmkit-prizm-docs/SKILL.md +13 -0
- package/bundled/skills-windows/prizmkit-retrospective/references/structural-sync-steps.md +1 -1
- package/bundled/skills-windows/prizmkit-test/SKILL.md +3 -151
- package/bundled/skills-windows/prizmkit-test/references/examples.md +70 -0
- package/bundled/skills-windows/prizmkit-test/references/test-generation-steps.md +49 -0
- package/bundled/skills-windows/prizmkit-test/references/test-report-template.md +42 -0
- package/bundled/skills-windows/recovery-workflow/SKILL.md +1 -52
- package/bundled/skills-windows/recovery-workflow/references/detection.md +58 -0
- package/bundled/skills-windows/refactor-pipeline-launcher/SKILL.md +2 -32
- package/bundled/skills-windows/refactor-pipeline-launcher/references/configuration.md +54 -0
- package/bundled/skills-windows/refactor-planner/SKILL.md +9 -149
- package/bundled/skills-windows/refactor-planner/references/fast-path.md +59 -0
- package/bundled/skills-windows/refactor-planner/references/planning-phases.md +135 -0
- package/bundled/skills-windows/refactor-workflow/SKILL.md +4 -103
- package/bundled/skills-windows/refactor-workflow/references/brainstorm-guide.md +116 -0
- package/package.json +1 -1
|
@@ -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
|
-
|
|
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.
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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)
|
|
@@ -88,36 +88,7 @@ recovery-workflow
|
|
|
88
88
|
|
|
89
89
|
Run the detection script:
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
python3 ${SKILL_DIR}/scripts/detect-recovery-state.py
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
The script uses **priority-ordered signature matching**:
|
|
96
|
-
|
|
97
|
-
```
|
|
98
|
-
1. Current branch matches fix/* → bug-fix-workflow
|
|
99
|
-
2. .prizmkit/bugfix/ directory has content → bug-fix-workflow
|
|
100
|
-
3. Current branch matches refactor/* → refactor-workflow
|
|
101
|
-
4. .prizmkit/plans/refactor-list.json exists → refactor-workflow
|
|
102
|
-
5. Current branch matches feat/* → feature-workflow
|
|
103
|
-
6. .prizmkit/plans/feature-list.json exists → feature-workflow
|
|
104
|
-
7. None of the above → no workflow detected
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
Bug-fix-workflow has highest priority because it is purely interactive and benefits most from recovery (no pipeline retry fallback).
|
|
108
|
-
|
|
109
|
-
### If no workflow detected
|
|
110
|
-
|
|
111
|
-
Show guidance and exit:
|
|
112
|
-
|
|
113
|
-
```
|
|
114
|
-
No interrupted workflow detected in this workspace.
|
|
115
|
-
|
|
116
|
-
To start a new workflow:
|
|
117
|
-
• /feature-workflow — build features from idea to code
|
|
118
|
-
• /bug-fix-workflow — fix a specific bug interactively
|
|
119
|
-
• /refactor-workflow — behavior-preserving code restructuring
|
|
120
|
-
```
|
|
91
|
+
Run the detection script (`python3 ${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`.
|
|
121
92
|
|
|
122
93
|
**CHECKPOINT CP-REC-0**: Workflow type and phase identified.
|
|
123
94
|
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Recovery Phase Detection
|
|
2
|
+
|
|
3
|
+
The script uses **priority-ordered signature matching**:
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
1. Current branch matches fix/* → bug-fix-workflow
|
|
7
|
+
2. .prizmkit/bugfix/ directory has content → bug-fix-workflow
|
|
8
|
+
3. Current branch matches refactor/* → refactor-workflow
|
|
9
|
+
4. .prizmkit/plans/refactor-list.json exists → refactor-workflow
|
|
10
|
+
5. Current branch matches feat/* → feature-workflow
|
|
11
|
+
6. .prizmkit/plans/feature-list.json exists → feature-workflow
|
|
12
|
+
7. None of the above → no workflow detected
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Bug-fix-workflow has highest priority because it is purely interactive and benefits most from recovery (no pipeline retry fallback).
|
|
16
|
+
|
|
17
|
+
## If No Workflow Detected
|
|
18
|
+
|
|
19
|
+
Show guidance and exit:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
No interrupted workflow detected in this workspace.
|
|
23
|
+
|
|
24
|
+
To start a new workflow:
|
|
25
|
+
• /feature-workflow — build features from idea to code
|
|
26
|
+
• /bug-fix-workflow — fix a specific bug interactively
|
|
27
|
+
• /refactor-workflow — behavior-preserving code restructuring
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Phase Inference Tables
|
|
31
|
+
|
|
32
|
+
### Bug-Fix-Workflow Recovery
|
|
33
|
+
|
|
34
|
+
| Detected State | Resume From | Actions |
|
|
35
|
+
|---------------|------------|---------|
|
|
36
|
+
| On `fix/<BUG_ID>-*` branch, no artifacts | Phase 1: Deep Bug Diagnosis | Read bug description from `.prizmkit/plans/bug-fix-list.json`. Start interactive diagnosis Q&A |
|
|
37
|
+
| `fix-plan.md` exists, no code changes | Phase 4: Fix | Read fix-plan.md. Implement the fix following the plan |
|
|
38
|
+
| `fix-plan.md` + code changes exist | Phase 5: Review | Invoke `/prizmkit-code-review` on all changes |
|
|
39
|
+
| All docs + review passed | Phase 6: User Verification | Ask user to verify the fix works |
|
|
40
|
+
| All docs + committed | Phase 7: Merge Decision | Ask merge vs keep branch |
|
|
41
|
+
|
|
42
|
+
Note: Bug-fix Phases 1-3 (Diagnosis, Triage, Reproduce) collapse to Phase 1 because they don't produce persistent artifacts. If interrupted during these phases, recovery restarts from Phase 1.
|
|
43
|
+
|
|
44
|
+
### Feature-Workflow Recovery
|
|
45
|
+
|
|
46
|
+
| Detected State | Resume From | Actions |
|
|
47
|
+
|---------------|------------|---------|
|
|
48
|
+
| No `.prizmkit/plans/feature-list.json` | Phase 1: Brainstorm | Cannot recover conversation context. Start requirement clarification, leverage workspace content |
|
|
49
|
+
| `.prizmkit/plans/feature-list.json` exists, no pipeline state | Phase 3: Launch | Invoke `feature-pipeline-launcher` |
|
|
50
|
+
| `.prizmkit/plans/feature-list.json` + pipeline state exists | Phase 4: Monitor | Check pipeline status via `feature-pipeline-launcher` (Intent B) |
|
|
51
|
+
|
|
52
|
+
### Refactor-Workflow Recovery
|
|
53
|
+
|
|
54
|
+
| Detected State | Resume From | Actions |
|
|
55
|
+
|---------------|------------|---------|
|
|
56
|
+
| No `.prizmkit/plans/refactor-list.json` | Phase 1: Brainstorm | Start refactoring goal clarification |
|
|
57
|
+
| `.prizmkit/plans/refactor-list.json` exists, no pipeline state | Phase 3: Launch | Invoke `refactor-pipeline-launcher` |
|
|
58
|
+
| `.prizmkit/plans/refactor-list.json` + pipeline state exists | Phase 4: Monitor | Check pipeline status |
|