@kennethsolomon/shipkit 3.18.0 → 3.20.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.
Files changed (31) hide show
  1. package/README.md +25 -3
  2. package/package.json +1 -1
  3. package/skills/sk:brainstorming/SKILL.md +19 -128
  4. package/skills/sk:debug/SKILL.md +44 -111
  5. package/skills/sk:e2e/SKILL.md +45 -97
  6. package/skills/sk:features/SKILL.md +44 -99
  7. package/skills/sk:frontend-design/SKILL.md +16 -32
  8. package/skills/sk:laravel-deploy/SKILL.md +112 -0
  9. package/skills/sk:laravel-init/SKILL.md +18 -0
  10. package/skills/sk:lint/SKILL.md +42 -62
  11. package/skills/sk:mvp/SKILL.md +81 -134
  12. package/skills/sk:perf/SKILL.md +24 -43
  13. package/skills/sk:review/SKILL.md +57 -93
  14. package/skills/sk:security-check/SKILL.md +37 -43
  15. package/skills/sk:seo-audit/SKILL.md +75 -96
  16. package/skills/sk:setup-claude/SKILL.md +148 -0
  17. package/skills/sk:setup-claude/references/skill-profiles.md +201 -0
  18. package/skills/sk:setup-claude/templates/.claude/agents/debugger.md +7 -0
  19. package/skills/sk:setup-claude/templates/.claude/agents/qa-engineer.md +8 -0
  20. package/skills/sk:setup-claude/templates/.claude/agents/tech-writer.md +7 -0
  21. package/skills/sk:setup-claude/templates/.claude/rules/laravel.md.template +11 -0
  22. package/skills/sk:setup-claude/templates/CLAUDE.md.template +102 -244
  23. package/skills/sk:setup-claude/templates/commands/brainstorm.md.template +1 -1
  24. package/skills/sk:setup-claude/templates/commands/execute-plan.md.template +1 -1
  25. package/skills/sk:setup-claude/templates/commands/finish-feature.md.template +1 -1
  26. package/skills/sk:setup-claude/templates/commands/security-check.md.template +1 -1
  27. package/skills/sk:setup-claude/templates/commands/write-plan.md.template +1 -1
  28. package/skills/sk:setup-optimizer/SKILL.md +85 -14
  29. package/skills/sk:skill-creator/SKILL.md +115 -226
  30. package/skills/sk:website/SKILL.md +81 -149
  31. 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
- ## Overview
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
- Auto-detect the project's backend AND frontend testing frameworks, read the plan from `tasks/todo.md`, and write comprehensive failing tests BEFORE implementation. Tests define the expected behavior implementation makes them pass.
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 the detected framework is `@playwright/sk:test`**, also use:
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 before doing anything else. Apply every active lesson as a standing constraint. Look for:
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
- - Read `tasks/todo.md` to understand what will be implemented
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
- Scan for **both backend and frontend** testing stacks:
43
-
44
- **Backend detection:**
31
+ **Backend:**
45
32
  ```bash
46
- cat composer.json 2>/dev/null # PHPUnit / Pest
47
- cat pyproject.toml 2>/dev/null # pytest
48
- cat go.mod 2>/dev/null # Go testing
49
- cat Cargo.toml 2>/dev/null # Rust #[cfg(test)]
50
- cat Gemfile 2>/dev/null # RSpec / Minitest
51
- cat build.gradle 2>/dev/null # JUnit
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 detection:**
41
+ **Frontend:**
55
42
  ```bash
56
- cat package.json 2>/dev/null # Jest, Vitest, Mocha, Cypress, Playwright
43
+ cat package.json 2>/dev/null # Jest, Vitest, Mocha, Cypress, Playwright
57
44
  ```
58
45
 
59
- Check for framework-specific config:
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 ALL detected frameworks:
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 (e.g., API-only with no FE, or FE-only SPA), report that and proceed with what's available.
54
+ If only one stack exists, report that and proceed.
74
55
 
75
56
  ### 3. Check Existing Tests
76
57
 
77
- - Find existing tests related to the code being changed
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
- Find and read 1-2 existing test files **per stack** to learn patterns:
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 12 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
- Based on the plan in `tasks/todo.md`, identify test cases for each piece of planned code:
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 tests:**
109
- - **Component rendering**: Correct output for given props
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 directory as source | `src/auth/login.test.ts` |
122
- | Mirror `tests/` | Parallel directory structure | `tests/auth/login.test.ts` |
123
- | `__tests__/` | Jest/Vitest convention | `src/auth/__tests__/login.test.ts` |
124
- | `test_` prefix | Python convention | `tests/test_login.py` |
125
- | `_test` suffix | Go convention | `auth/login_test.go` |
126
- | `tests/Feature/` + `tests/Unit/` | Laravel/Pest convention | `tests/Feature/ServerTest.php` |
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 test names that explain expected behavior
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, generate FE test files:
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 detected in the project root:**
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
- - Use `test.describe` / `test` blocks not `describe`/`it`
155
- - Use role-based locators: `getByRole`, `getByLabel`, `getByText`, `getByPlaceholder` never CSS selectors
156
- - Use `test.beforeEach` for shared setup (auth, navigation)
157
- - Use `test.skip(!email, 'ENV_VAR not set skipping')` guards for credential-dependent tests
158
- - Auth credentials from env vars via `e2e/helpers/auth.ts` never hardcode credentials
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
- **Run the E2E spec to confirm tests fail or skip** (they should fail until implementation, or skip if env vars aren't set — both are acceptable for the RED phase):
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
- **Only if the Playwright MCP plugin is active in the session AND live selectors are needed:**
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 to confirm tests fail as expected:
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 the **expected behavior**. Implementation makes them pass. If you're unsure what a piece of code should do, the test is where you decide.
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