@kennethsolomon/shipkit 3.19.0 → 3.21.0
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/README.md +36 -4
- package/package.json +1 -1
- package/skills/sk:brainstorming/SKILL.md +19 -128
- package/skills/sk:debug/SKILL.md +44 -111
- package/skills/sk:e2e/SKILL.md +45 -97
- package/skills/sk:features/SKILL.md +44 -99
- package/skills/sk:frontend-design/SKILL.md +16 -32
- package/skills/sk:laravel-init/SKILL.md +8 -7
- package/skills/sk:laravel-new/SKILL.md +1 -0
- package/skills/sk:lint/SKILL.md +42 -62
- package/skills/sk:mvp/SKILL.md +81 -134
- package/skills/sk:perf/SKILL.md +24 -43
- package/skills/sk:review/SKILL.md +57 -93
- package/skills/sk:security-check/SKILL.md +37 -43
- package/skills/sk:seo-audit/SKILL.md +75 -96
- package/skills/sk:setup-claude/SKILL.md +154 -0
- package/skills/sk:setup-claude/references/skill-profiles.md +223 -0
- package/skills/sk:setup-claude/scripts/__pycache__/apply_setup_claude.cpython-314.pyc +0 -0
- package/skills/sk:setup-claude/scripts/apply_setup_claude.py +110 -10
- package/skills/sk:setup-claude/templates/.claude/rules/laravel.md.template +14 -0
- package/skills/sk:setup-claude/templates/CLAUDE.md.template +102 -247
- package/skills/sk:setup-claude/templates/commands/brainstorm.md.template +1 -1
- package/skills/sk:setup-claude/templates/commands/execute-plan.md.template +1 -1
- package/skills/sk:setup-claude/templates/commands/finish-feature.md.template +1 -1
- package/skills/sk:setup-claude/templates/commands/security-check.md.template +1 -1
- package/skills/sk:setup-claude/templates/commands/write-plan.md.template +1 -1
- package/skills/sk:setup-claude/tests/__pycache__/test_apply_setup_claude.cpython-314.pyc +0 -0
- package/skills/sk:setup-claude/tests/test_apply_setup_claude.py +267 -0
- package/skills/sk:setup-optimizer/SKILL.md +101 -17
- package/skills/sk:skill-creator/SKILL.md +115 -226
- package/skills/sk:website/SKILL.md +81 -149
- package/skills/sk:write-tests/SKILL.md +44 -110
|
@@ -5,160 +5,105 @@ description: "TDD: Auto-detect BE + FE testing stacks, write failing tests befor
|
|
|
5
5
|
|
|
6
6
|
# Test Generation (TDD)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Auto-detect backend AND frontend testing frameworks, read `tasks/todo.md`, write comprehensive failing tests BEFORE implementation. Tests define expected behavior — implementation makes them pass.
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
> **Requirements changed mid-workflow?** Run `/sk:change` first. It will classify the scope and tell you whether to update tests (Tier 1), revise the plan (Tier 2), or re-brainstorm (Tier 3). Never update tests based on a changed requirement without going through `/sk:change` first.
|
|
10
|
+
> **Requirements changed mid-workflow?** Run `/sk:change` first. Never update tests based on a changed requirement without going through `/sk:change` first.
|
|
13
11
|
|
|
14
12
|
## Allowed Tools
|
|
15
13
|
|
|
16
14
|
Bash, Read, Write, Edit, Glob, Grep
|
|
17
15
|
|
|
18
|
-
**When
|
|
16
|
+
**When detected framework is `@playwright/sk:test`**, also use:
|
|
19
17
|
mcp__plugin_playwright_playwright__browser_snapshot, mcp__plugin_playwright_playwright__browser_run_code, mcp__plugin_playwright_playwright__browser_navigate, mcp__plugin_playwright_playwright__browser_take_screenshot
|
|
20
18
|
|
|
21
|
-
## Steps
|
|
22
|
-
|
|
23
|
-
You MUST complete these steps in order:
|
|
19
|
+
## Steps (complete in order)
|
|
24
20
|
|
|
25
21
|
### 0. Check Project Lessons
|
|
26
22
|
|
|
27
|
-
If `tasks/lessons.md` exists, read it
|
|
28
|
-
- Known flaky test patterns in this project
|
|
29
|
-
- Mocking approaches that caused issues before
|
|
30
|
-
- Framework-specific gotchas
|
|
31
|
-
- File location conventions that broke in the past
|
|
23
|
+
If `tasks/lessons.md` exists, read it first. Apply every active lesson as a standing constraint. Look for: flaky test patterns, mocking approaches that caused issues, framework-specific gotchas, file location conventions that broke.
|
|
32
24
|
|
|
33
25
|
### 1. Read the Plan
|
|
34
26
|
|
|
35
|
-
|
|
36
|
-
- Read `tasks/progress.md` for context from brainstorm/design steps
|
|
37
|
-
- Identify all code that will be created or modified
|
|
38
|
-
- This is the **source of truth** for what tests to write
|
|
27
|
+
Read `tasks/todo.md` (source of truth for what to test) and `tasks/progress.md` for brainstorm/design context. Identify all code to be created or modified.
|
|
39
28
|
|
|
40
29
|
### 2. Detect ALL Testing Frameworks
|
|
41
30
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
**Backend detection:**
|
|
31
|
+
**Backend:**
|
|
45
32
|
```bash
|
|
46
|
-
cat composer.json 2>/dev/null
|
|
47
|
-
cat pyproject.toml 2>/dev/null
|
|
48
|
-
cat go.mod 2>/dev/null
|
|
49
|
-
cat Cargo.toml 2>/dev/null
|
|
50
|
-
cat Gemfile 2>/dev/null
|
|
51
|
-
cat build.gradle 2>/dev/null
|
|
33
|
+
cat composer.json 2>/dev/null # PHPUnit / Pest
|
|
34
|
+
cat pyproject.toml 2>/dev/null # pytest
|
|
35
|
+
cat go.mod 2>/dev/null # Go testing
|
|
36
|
+
cat Cargo.toml 2>/dev/null # Rust #[cfg(test)]
|
|
37
|
+
cat Gemfile 2>/dev/null # RSpec / Minitest
|
|
38
|
+
cat build.gradle 2>/dev/null # JUnit
|
|
52
39
|
```
|
|
53
40
|
|
|
54
|
-
**Frontend
|
|
41
|
+
**Frontend:**
|
|
55
42
|
```bash
|
|
56
|
-
cat package.json 2>/dev/null
|
|
43
|
+
cat package.json 2>/dev/null # Jest, Vitest, Mocha, Cypress, Playwright
|
|
57
44
|
```
|
|
58
45
|
|
|
59
|
-
Check for
|
|
60
|
-
- `vitest.config.ts` / `vite.config.ts` (Vitest)
|
|
61
|
-
- `jest.config.js` / `jest.config.ts` (Jest)
|
|
62
|
-
- `phpunit.xml` / `pest` in composer.json (PHPUnit / Pest)
|
|
63
|
-
- `pytest.ini` / `conftest.py` (pytest)
|
|
64
|
-
- `cypress.config.ts` (Cypress)
|
|
65
|
-
- `playwright.config.ts` (Playwright)
|
|
46
|
+
Check for config files: `vitest.config.ts`, `jest.config.js`, `phpunit.xml`, `pytest.ini`, `conftest.py`, `cypress.config.ts`, `playwright.config.ts`.
|
|
66
47
|
|
|
67
|
-
Report
|
|
48
|
+
Report all detected frameworks:
|
|
68
49
|
```
|
|
69
50
|
Backend: [framework] ([language]) — [test runner command]
|
|
70
51
|
Frontend: [framework] ([language]) — [test runner command]
|
|
71
52
|
```
|
|
72
53
|
|
|
73
|
-
If only one stack exists
|
|
54
|
+
If only one stack exists, report that and proceed.
|
|
74
55
|
|
|
75
56
|
### 3. Check Existing Tests
|
|
76
57
|
|
|
77
|
-
|
|
78
|
-
- If modifying existing behavior: **update those tests first** to expect the new behavior
|
|
79
|
-
- If adding new code: identify what test files need to be created
|
|
80
|
-
- Report: "Updating X existing test files, creating Y new test files"
|
|
58
|
+
Find tests related to code being changed. If modifying existing behavior: update those tests first to expect the new behavior. Report: "Updating X existing test files, creating Y new test files."
|
|
81
59
|
|
|
82
60
|
### 4. Learn Project Test Conventions
|
|
83
61
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
From existing tests, learn:
|
|
87
|
-
- Import style and aliases
|
|
88
|
-
- Test structure (describe/it, test(), func TestX)
|
|
89
|
-
- Assertion library and patterns
|
|
90
|
-
- Mocking approach
|
|
91
|
-
- Setup/teardown patterns
|
|
92
|
-
- File naming convention
|
|
93
|
-
- Test file location (co-located vs `tests/` directory)
|
|
94
|
-
|
|
95
|
-
If **no existing tests** are found, use `references/patterns.md` for framework-appropriate templates.
|
|
62
|
+
Read 1–2 existing test files per stack. Learn: import style, test structure, assertion library, mocking approach, setup/teardown, file naming, file location. If no existing tests, use `references/patterns.md`.
|
|
96
63
|
|
|
97
64
|
### 5. Analyze Target Code from Plan
|
|
98
65
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
**Backend tests:**
|
|
102
|
-
- **Happy path**: Normal expected behavior for each endpoint/function
|
|
103
|
-
- **Edge cases**: Empty inputs, boundary values, null/undefined
|
|
104
|
-
- **Error handling**: Invalid inputs, thrown exceptions, error responses
|
|
105
|
-
- **Authorization**: Ensure policies/guards are tested
|
|
106
|
-
- **Validation**: All form request / input validation rules
|
|
66
|
+
**Backend test cases:**
|
|
67
|
+
- Happy path, edge cases (empty/boundary/null), error handling, authorization, validation
|
|
107
68
|
|
|
108
|
-
**Frontend
|
|
109
|
-
-
|
|
110
|
-
- **User interactions**: Click, type, submit, navigate
|
|
111
|
-
- **Conditional rendering**: Show/hide based on state
|
|
112
|
-
- **Error states**: Loading, empty, error displays
|
|
113
|
-
- **Form handling**: Validation, submission, reset
|
|
69
|
+
**Frontend test cases:**
|
|
70
|
+
- Component rendering, user interactions, conditional rendering, error/loading/empty states, form handling
|
|
114
71
|
|
|
115
72
|
### 6. Determine Test File Locations
|
|
116
73
|
|
|
117
|
-
Follow the project's existing convention:
|
|
118
|
-
|
|
119
74
|
| Convention | Pattern | Example |
|
|
120
|
-
|
|
121
|
-
| Co-located | Same
|
|
122
|
-
| Mirror `tests/` | Parallel
|
|
123
|
-
| `__tests__/` | Jest/Vitest
|
|
124
|
-
| `test_` prefix | Python
|
|
125
|
-
| `_test` suffix | Go
|
|
126
|
-
| `tests/Feature/` + `tests/Unit/` | Laravel/Pest
|
|
75
|
+
|---|---|---|
|
|
76
|
+
| Co-located | Same dir as source | `src/auth/login.test.ts` |
|
|
77
|
+
| Mirror `tests/` | Parallel structure | `tests/auth/login.test.ts` |
|
|
78
|
+
| `__tests__/` | Jest/Vitest | `src/auth/__tests__/login.test.ts` |
|
|
79
|
+
| `test_` prefix | Python | `tests/test_login.py` |
|
|
80
|
+
| `_test` suffix | Go | `auth/login_test.go` |
|
|
81
|
+
| `tests/Feature/` + `tests/Unit/` | Laravel/Pest | `tests/Feature/ServerTest.php` |
|
|
127
82
|
|
|
128
83
|
### 7. Write Backend Test Files
|
|
129
84
|
|
|
130
|
-
Generate complete test files matching the project's style:
|
|
131
85
|
- One test per behavior, not per line of code
|
|
132
|
-
- Descriptive
|
|
86
|
+
- Descriptive names that explain expected behavior
|
|
133
87
|
- Arrange-Act-Assert pattern
|
|
134
88
|
- Mock external dependencies, not the code under test
|
|
135
89
|
- Test behavior, not implementation details
|
|
136
90
|
|
|
137
91
|
### 8. Write Frontend Test Files
|
|
138
92
|
|
|
139
|
-
If a frontend stack was detected,
|
|
140
|
-
- Component tests for every new/modified component
|
|
141
|
-
- Page tests for every new/modified page
|
|
142
|
-
- Hook tests for custom hooks
|
|
143
|
-
- Mock framework helpers (e.g., Inertia's `useForm`, Next.js `useRouter`, SvelteKit `goto`)
|
|
144
|
-
- Use `@testing-library` conventions: prefer `getByRole`, `getByText`, `getByLabelText`
|
|
145
|
-
|
|
146
|
-
Skip this step if no FE stack was detected.
|
|
93
|
+
If a frontend stack was detected: component tests, page tests, hook tests, mock framework helpers (Inertia `useForm`, Next.js `useRouter`, SvelteKit `goto`). Use `@testing-library` conventions: prefer `getByRole`, `getByText`, `getByLabelText`. Skip if no FE stack.
|
|
147
94
|
|
|
148
95
|
### 8b. Write E2E Spec Files (conditional)
|
|
149
96
|
|
|
150
|
-
**Only if `playwright.config.ts` or `playwright.config.js` is
|
|
151
|
-
|
|
152
|
-
Write `e2e/<feature>.spec.ts` files covering the acceptance criteria from `tasks/todo.md`. Follow these rules:
|
|
97
|
+
**Only if `playwright.config.ts` or `playwright.config.js` is in the project root.**
|
|
153
98
|
|
|
154
|
-
|
|
155
|
-
- Use
|
|
156
|
-
-
|
|
157
|
-
-
|
|
158
|
-
-
|
|
99
|
+
Write `e2e/<feature>.spec.ts` files covering acceptance criteria from `tasks/todo.md`:
|
|
100
|
+
- Use `test.describe` / `test` blocks (not `describe`/`it`)
|
|
101
|
+
- Role-based locators only: `getByRole`, `getByLabel`, `getByText`, `getByPlaceholder` — never CSS selectors
|
|
102
|
+
- `test.beforeEach` for shared setup (auth, navigation)
|
|
103
|
+
- `test.skip(!email, 'ENV_VAR not set — skipping')` guards for credential-dependent tests
|
|
104
|
+
- Auth credentials from env vars via `e2e/helpers/auth.ts` — never hardcode
|
|
159
105
|
- Soft assertions (`expect.soft`) for non-critical checks; hard `expect` for gate conditions
|
|
160
106
|
|
|
161
|
-
E2E spec example structure:
|
|
162
107
|
```ts
|
|
163
108
|
import { test, expect } from '@playwright/test'
|
|
164
109
|
import { signIn, TEST_USERS } from './helpers/auth'
|
|
@@ -179,32 +124,21 @@ test.describe('[Feature] — [scenario]', () => {
|
|
|
179
124
|
|
|
180
125
|
Create `e2e/helpers/auth.ts` if it doesn't exist (see `/sk:e2e` Playwright Setup Reference).
|
|
181
126
|
|
|
182
|
-
|
|
127
|
+
Run to confirm RED phase:
|
|
183
128
|
```bash
|
|
184
129
|
npx playwright test e2e/<feature>.spec.ts --reporter=list
|
|
185
130
|
```
|
|
186
131
|
|
|
187
132
|
### 8c. Playwright MCP Inspection (optional)
|
|
188
133
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
Use the Playwright MCP plugin to inspect live page state for more accurate selectors:
|
|
192
|
-
|
|
193
|
-
1. Navigate to target URL
|
|
194
|
-
2. Capture accessibility snapshot for role-based selectors
|
|
195
|
-
3. Screenshot for visual reference
|
|
134
|
+
Only if Playwright MCP plugin is active AND live selectors are needed: navigate to target URL, capture accessibility snapshot, screenshot for visual reference.
|
|
196
135
|
|
|
197
136
|
### 9. Verify Tests Fail (Red Phase)
|
|
198
137
|
|
|
199
|
-
Run both suites
|
|
200
|
-
|
|
201
|
-
- **Tests SHOULD fail** — this confirms they're testing the right thing
|
|
202
|
-
- If tests pass without implementation, they're not testing anything useful — rewrite them
|
|
203
|
-
- Report which tests fail and why (missing class, missing route, missing component, etc.)
|
|
138
|
+
Run both suites. Tests SHOULD fail — this confirms they test the right thing. If tests pass without implementation, rewrite them. Report which tests fail and why.
|
|
204
139
|
|
|
205
140
|
### 10. Report
|
|
206
141
|
|
|
207
|
-
Output:
|
|
208
142
|
```
|
|
209
143
|
BE tests written: X tests in Y files ([framework])
|
|
210
144
|
FE tests written: X tests in Y files ([framework]) ← omit if no FE stack
|
|
@@ -215,7 +149,7 @@ Status: RED (tests fail as expected — ready for implementation)
|
|
|
215
149
|
|
|
216
150
|
## Key Principle
|
|
217
151
|
|
|
218
|
-
Tests define
|
|
152
|
+
Tests define **expected behavior**. Implementation makes them pass. If unsure what code should do, the test is where you decide.
|
|
219
153
|
|
|
220
154
|
---
|
|
221
155
|
|