shokunin 1.0.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/LICENSE +21 -0
- package/README.md +268 -0
- package/agents/code-reviewer.md +45 -0
- package/bin/install.js +181 -0
- package/package.json +33 -0
- package/skills/build/SKILL.md +88 -0
- package/skills/docs/SKILL.md +76 -0
- package/skills/plan/SKILL.md +121 -0
- package/skills/review/SKILL.md +67 -0
- package/skills/ship/SKILL.md +126 -0
- package/skills/start/SKILL.md +84 -0
- package/skills/wip/SKILL.md +59 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mike Skaife
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
# 職人 shokunin
|
|
2
|
+
|
|
3
|
+
**Craftsmanship in AI-assisted development.**
|
|
4
|
+
|
|
5
|
+
Shokunin (職人) is the Japanese word for artisan — a person who devotes themselves to their craft, refining their process with every piece of work. In Japanese culture, a shokunin doesn't just build things; they take pride in *how* they build them. Every detail matters. Every cut is deliberate.
|
|
6
|
+
|
|
7
|
+
This package brings that philosophy to software engineering with Claude Code. It's a lightweight, structured engineering process — seven skills that guide you from idea to shipped feature with discipline, visibility, and care.
|
|
8
|
+
|
|
9
|
+
No hidden sub-agents doing work you can't see. No XML plans you can't reason about. Just clean markdown, TDD, and a craftsman's workflow.
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Install into your project
|
|
15
|
+
npx shokunin@latest
|
|
16
|
+
|
|
17
|
+
# Start a feature
|
|
18
|
+
/start PROJ-123 add user authentication
|
|
19
|
+
|
|
20
|
+
# In the new worktree
|
|
21
|
+
/plan Add OAuth2 with Google and GitHub providers
|
|
22
|
+
/build
|
|
23
|
+
/review
|
|
24
|
+
/ship
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Philosophy
|
|
28
|
+
|
|
29
|
+
AI-assisted development is powerful, but power without discipline produces fragile work. Shokunin is built on three principles:
|
|
30
|
+
|
|
31
|
+
1. **Visibility** — You see every line of code being written. Implementation happens in your conversation, not behind closed doors. You are the craftsman; the AI is your tool.
|
|
32
|
+
|
|
33
|
+
2. **Discipline** — Plan before you build. Test before you ship. Review before you merge. Each phase has a purpose, and skipping phases produces sloppy work.
|
|
34
|
+
|
|
35
|
+
3. **Traceability** — Every commit links to a ticket. Every PR links to a plan. When something breaks six months from now, you can trace it back to the decision that caused it.
|
|
36
|
+
|
|
37
|
+
## Skills
|
|
38
|
+
|
|
39
|
+
| Skill | Purpose |
|
|
40
|
+
|-------|---------|
|
|
41
|
+
| `/start` | Create a git worktree, branch, and plan scaffold for a new feature |
|
|
42
|
+
| `/plan` | Design the feature interactively — produces a granular task list |
|
|
43
|
+
| `/build` | Implement tasks one by one with TDD and progress tracking |
|
|
44
|
+
| `/review` | Run a thorough code review on all changes |
|
|
45
|
+
| `/ship` | Squash commits, add Jira reference, create a pull request |
|
|
46
|
+
| `/wip` | Show all features in flight and their progress |
|
|
47
|
+
| `/docs` | Create or update technical documentation |
|
|
48
|
+
|
|
49
|
+
## The Workflow
|
|
50
|
+
|
|
51
|
+
### 1. `/start` — Begin with Intent
|
|
52
|
+
|
|
53
|
+
Every feature starts with a clean workspace.
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
/start PROJ-123 add user authentication
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
This creates:
|
|
60
|
+
- A git worktree at `../PROJ-123-add-user-authentication/`
|
|
61
|
+
- A branch `PROJ-123/add-user-authentication`
|
|
62
|
+
- A plan scaffold at `.claude/plans/PROJ-123.md`
|
|
63
|
+
|
|
64
|
+
Open a new terminal, `cd` into the worktree, and start Claude Code.
|
|
65
|
+
|
|
66
|
+
### 2. `/plan` — Measure Twice, Cut Once
|
|
67
|
+
|
|
68
|
+
Before writing any code, define what you're building.
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
/plan Add OAuth2 authentication with Google and GitHub providers
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
The plan phase is interactive — Claude will ask about scope, edge cases, and acceptance criteria. The output is a detailed plan file with:
|
|
75
|
+
|
|
76
|
+
- **Summary** — what and why
|
|
77
|
+
- **Acceptance criteria** — how you'll know it's done
|
|
78
|
+
- **Granular task list** — grouped by phase, with exact file paths, dependencies, and scope for each task
|
|
79
|
+
|
|
80
|
+
Each task is sized for a single TDD red-green-refactor cycle.
|
|
81
|
+
|
|
82
|
+
### 3. `/build` — Steady Hands
|
|
83
|
+
|
|
84
|
+
Execute the plan, one task at a time.
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
/build
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Build reads the plan and works through tasks sequentially:
|
|
91
|
+
1. Picks the next pending task (respecting dependencies)
|
|
92
|
+
2. Announces what it's about to do
|
|
93
|
+
3. Implements using TDD — write a failing test, make it pass, refactor
|
|
94
|
+
4. Marks the task complete and makes a WIP commit
|
|
95
|
+
5. Pauses between phases for your confirmation
|
|
96
|
+
|
|
97
|
+
You see everything. Every test written, every file edited. If something looks wrong, you can intervene immediately.
|
|
98
|
+
|
|
99
|
+
### 4. `/review` — Critical Eye
|
|
100
|
+
|
|
101
|
+
Once all tasks are complete, review the full changeset.
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
/review
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
The review runs in a forked sub-agent using the code-reviewer, examining:
|
|
108
|
+
- Correctness, edge cases, and error handling
|
|
109
|
+
- Security vulnerabilities
|
|
110
|
+
- Performance issues
|
|
111
|
+
- Code quality and maintainability
|
|
112
|
+
- Test coverage and quality
|
|
113
|
+
|
|
114
|
+
Results come back to your conversation as a structured report. You decide what to fix.
|
|
115
|
+
|
|
116
|
+
### 5. `/ship` — Deliver with Pride
|
|
117
|
+
|
|
118
|
+
Package the work and create a pull request.
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
/ship
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Ship will:
|
|
125
|
+
1. Show you the commits to squash and files changed
|
|
126
|
+
2. Propose a commit message with the Jira ticket prefix: `PROJ-123: feat: add OAuth2 authentication`
|
|
127
|
+
3. Propose a PR title and body (derived from the plan)
|
|
128
|
+
4. **Wait for your confirmation** before doing anything
|
|
129
|
+
5. Squash all WIP commits into a single clean commit
|
|
130
|
+
6. Push and create the PR
|
|
131
|
+
|
|
132
|
+
After the PR is merged on GitHub, clean up with `git worktree remove`.
|
|
133
|
+
|
|
134
|
+
## Plan File Format
|
|
135
|
+
|
|
136
|
+
Plans live at `.claude/plans/<TICKET>.md` — one per feature, no merge conflicts.
|
|
137
|
+
|
|
138
|
+
```markdown
|
|
139
|
+
# Feature: Add user authentication
|
|
140
|
+
|
|
141
|
+
**Ticket:** PROJ-123
|
|
142
|
+
**Branch:** PROJ-123/add-user-authentication
|
|
143
|
+
**Status:** in-progress
|
|
144
|
+
**Created:** 2026-03-17
|
|
145
|
+
|
|
146
|
+
## Summary
|
|
147
|
+
Add OAuth2 authentication supporting Google and GitHub providers,
|
|
148
|
+
with session management and token refresh.
|
|
149
|
+
|
|
150
|
+
## Acceptance Criteria
|
|
151
|
+
- [ ] Users can sign in with Google
|
|
152
|
+
- [ ] Users can sign in with GitHub
|
|
153
|
+
- [ ] Sessions persist across browser restarts
|
|
154
|
+
- [ ] Tokens refresh automatically before expiry
|
|
155
|
+
|
|
156
|
+
## Tasks
|
|
157
|
+
|
|
158
|
+
### Phase 1: Data Model
|
|
159
|
+
|
|
160
|
+
#### Task 1.1: Create user model
|
|
161
|
+
- **Files:** `src/models/user.ts` (create), `prisma/schema.prisma` (modify)
|
|
162
|
+
- **Depends on:** none
|
|
163
|
+
- **Scope:** Define User model with email, name, provider, providerId fields. Add Prisma schema and generate client.
|
|
164
|
+
- **Status:** [x] complete
|
|
165
|
+
|
|
166
|
+
#### Task 1.2: Create session model
|
|
167
|
+
- **Files:** `src/models/session.ts` (create), `prisma/schema.prisma` (modify)
|
|
168
|
+
- **Depends on:** Task 1.1
|
|
169
|
+
- **Scope:** Define Session model linked to User. Include token, refreshToken, expiresAt fields.
|
|
170
|
+
- **Status:** [~] in-progress
|
|
171
|
+
|
|
172
|
+
### Phase 2: API Routes
|
|
173
|
+
...
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
**Task statuses:** `[ ] pending` → `[~] in-progress` → `[x] complete` → `[!] blocked`
|
|
177
|
+
|
|
178
|
+
## Parallel Development
|
|
179
|
+
|
|
180
|
+
Shokunin uses git worktrees to support working on multiple features simultaneously.
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
~/src/myproject/ main repo
|
|
184
|
+
+-- ../PROJ-123-add-auth/ worktree (Claude session B)
|
|
185
|
+
+-- ../PROJ-456-fix-dashboard/ worktree (Claude session C)
|
|
186
|
+
+-- ../PROJ-789-api-refactor/ worktree (Claude session D)
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Each worktree is a separate directory with its own branch and Claude Code session. Run `/wip` from any session to see all features in flight:
|
|
190
|
+
|
|
191
|
+
```
|
|
192
|
+
Shokunin — Work in Progress
|
|
193
|
+
|
|
194
|
+
| Worktree | Branch | Ticket | Status | Progress |
|
|
195
|
+
|-------------------------|--------------------------|----------|-------------|-----------|
|
|
196
|
+
| ../PROJ-123-add-auth | PROJ-123/add-auth | PROJ-123 | in-progress | 4/7 tasks |
|
|
197
|
+
| ../PROJ-456-fix-dash | PROJ-456/fix-dash | PROJ-456 | review | 5/5 tasks |
|
|
198
|
+
| . (main) | main | — | — | — |
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Git Strategy
|
|
202
|
+
|
|
203
|
+
- **Branch naming:** `<TICKET>/<kebab-case-description>`
|
|
204
|
+
- **During development:** WIP commits (`wip: <task name>`) — safe, cheap, squashed later
|
|
205
|
+
- **At ship time:** All commits squashed into one: `PROJ-123: feat: description`
|
|
206
|
+
- **PRs:** Created via `gh pr create`, merged manually on GitHub
|
|
207
|
+
- **Cleanup:** `git worktree remove` after merge
|
|
208
|
+
|
|
209
|
+
## Quick Flow
|
|
210
|
+
|
|
211
|
+
For small changes that don't need a worktree, skip `/start`:
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
git checkout -b PROJ-789/fix-date-picker
|
|
215
|
+
# then in Claude Code:
|
|
216
|
+
/plan Fix the date picker timezone bug
|
|
217
|
+
/build
|
|
218
|
+
/review
|
|
219
|
+
/ship
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Configuration
|
|
223
|
+
|
|
224
|
+
### Prerequisites
|
|
225
|
+
|
|
226
|
+
- **Claude Code** — [claude.com/claude-code](https://claude.com/claude-code)
|
|
227
|
+
- **gh CLI** — installed and authenticated (`brew install gh && gh auth login`)
|
|
228
|
+
- **Git** — version 2.15+ (for worktree support)
|
|
229
|
+
|
|
230
|
+
### Permissions
|
|
231
|
+
|
|
232
|
+
Add `Bash(gh *)` to your Claude Code allow list for `/ship` to create PRs:
|
|
233
|
+
|
|
234
|
+
In `~/.claude/settings.json`, add to the `permissions.allow` array:
|
|
235
|
+
```json
|
|
236
|
+
"Bash(gh *)"
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Customisation
|
|
240
|
+
|
|
241
|
+
After installation, skills live in your project's `.claude/skills/` directory. You can customise them per-project — they're just markdown files. Changes won't be overwritten unless you run `npx shokunin --force`.
|
|
242
|
+
|
|
243
|
+
## How It Compares to GSD
|
|
244
|
+
|
|
245
|
+
| | Shokunin | GSD |
|
|
246
|
+
|---|---|---|
|
|
247
|
+
| **Plans** | Markdown with task list | XML |
|
|
248
|
+
| **Implementation** | Main conversation (visible) | Sub-agents (hidden) |
|
|
249
|
+
| **Complexity** | 7 skills, zero dependencies | 39+ commands, 15 agents |
|
|
250
|
+
| **Git strategy** | WIP commits, squash at ship | Atomic commits per task |
|
|
251
|
+
| **Task tracking** | Checkbox in plan file | XML state management |
|
|
252
|
+
| **Parallel work** | Git worktrees | Git worktrees |
|
|
253
|
+
| **Philosophy** | Craftsman with tool | Autonomous system |
|
|
254
|
+
|
|
255
|
+
Shokunin is deliberately simpler. You trade automation for visibility and control. If you want an autonomous system that handles everything, use GSD. If you want to see every line of code and stay in the driver's seat, use shokunin.
|
|
256
|
+
|
|
257
|
+
## Contributing
|
|
258
|
+
|
|
259
|
+
Contributions welcome. Please:
|
|
260
|
+
|
|
261
|
+
1. Fork the repo
|
|
262
|
+
2. Create a feature branch
|
|
263
|
+
3. Make your changes (and yes, use shokunin to do it)
|
|
264
|
+
4. Open a PR with a clear description
|
|
265
|
+
|
|
266
|
+
## License
|
|
267
|
+
|
|
268
|
+
MIT
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-reviewer
|
|
3
|
+
description: Expert code reviewer for the shokunin engineering process. Reviews code changes for correctness, security, performance, and maintainability.
|
|
4
|
+
model: sonnet
|
|
5
|
+
color: purple
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are an expert code reviewer with deep expertise in software engineering best practices, security, performance, and maintainability. You approach code review as a collaborative process, providing constructive feedback that helps developers improve.
|
|
9
|
+
|
|
10
|
+
## Your Review Process
|
|
11
|
+
|
|
12
|
+
1. **Understand Context**: First understand what the code is trying to accomplish
|
|
13
|
+
2. **Check Correctness**: Verify logic, edge cases, and error handling
|
|
14
|
+
3. **Assess Quality**: Evaluate readability, maintainability, and adherence to project conventions
|
|
15
|
+
4. **Identify Issues**: Look for bugs, security vulnerabilities, and performance problems
|
|
16
|
+
5. **Suggest Improvements**: Provide actionable, specific recommendations
|
|
17
|
+
|
|
18
|
+
## Review Categories
|
|
19
|
+
|
|
20
|
+
For each review, assess:
|
|
21
|
+
- **Correctness**: Does the code work as intended? Are edge cases handled?
|
|
22
|
+
- **Security**: Are there vulnerabilities? Is input validated? Are secrets exposed?
|
|
23
|
+
- **Performance**: Are there inefficiencies? Unnecessary computations? Memory leaks?
|
|
24
|
+
- **Readability**: Is the code clear? Are names meaningful? Is complexity appropriate?
|
|
25
|
+
- **Maintainability**: Is it testable? Does it follow project patterns? Is it documented?
|
|
26
|
+
- **Error Handling**: Are errors handled gracefully? Are failures recoverable?
|
|
27
|
+
- **Testing**: Is test coverage appropriate? Are tests good quality? Are there any gaps or issues with existing tests?
|
|
28
|
+
|
|
29
|
+
## Output Format
|
|
30
|
+
|
|
31
|
+
Structure your review as:
|
|
32
|
+
1. **Summary**: Brief overview of the code and your assessment
|
|
33
|
+
2. **Critical Issues**: Must-fix problems (bugs, security, breaking changes)
|
|
34
|
+
3. **Improvements**: Recommended changes for quality
|
|
35
|
+
4. **Minor Suggestions**: Optional enhancements
|
|
36
|
+
5. **Positive Notes**: What was done well
|
|
37
|
+
|
|
38
|
+
## Principles
|
|
39
|
+
|
|
40
|
+
- Be specific: Reference exact lines and provide concrete examples
|
|
41
|
+
- Be constructive: Explain why something is an issue and how to fix it
|
|
42
|
+
- Be balanced: Acknowledge good code, not just problems
|
|
43
|
+
- Prioritize: Distinguish critical issues from nice-to-haves
|
|
44
|
+
- Respect context: Consider project conventions and constraints
|
|
45
|
+
- Ask questions: If intent is unclear, ask rather than assume
|
package/bin/install.js
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const readline = require('readline');
|
|
6
|
+
|
|
7
|
+
const SKILLS = ['start', 'plan', 'build', 'review', 'ship', 'wip', 'docs'];
|
|
8
|
+
const AGENTS = ['code-reviewer'];
|
|
9
|
+
|
|
10
|
+
function findProjectRoot(startDir) {
|
|
11
|
+
let dir = startDir;
|
|
12
|
+
while (dir !== path.dirname(dir)) {
|
|
13
|
+
if (fs.existsSync(path.join(dir, '.git')) || fs.existsSync(path.join(dir, 'package.json'))) {
|
|
14
|
+
return dir;
|
|
15
|
+
}
|
|
16
|
+
dir = path.dirname(dir);
|
|
17
|
+
}
|
|
18
|
+
return startDir;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function copyFileSync(src, dest) {
|
|
22
|
+
const destDir = path.dirname(dest);
|
|
23
|
+
if (!fs.existsSync(destDir)) {
|
|
24
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
25
|
+
}
|
|
26
|
+
fs.copyFileSync(src, dest);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function filesDiffer(src, dest) {
|
|
30
|
+
if (!fs.existsSync(dest)) return true;
|
|
31
|
+
const srcContent = fs.readFileSync(src, 'utf8');
|
|
32
|
+
const destContent = fs.readFileSync(dest, 'utf8');
|
|
33
|
+
return srcContent !== destContent;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function addToGitignore(projectRoot) {
|
|
37
|
+
const gitignorePath = path.join(projectRoot, '.gitignore');
|
|
38
|
+
const entry = '.claude/plans/';
|
|
39
|
+
|
|
40
|
+
if (fs.existsSync(gitignorePath)) {
|
|
41
|
+
const content = fs.readFileSync(gitignorePath, 'utf8');
|
|
42
|
+
if (content.includes(entry)) return false;
|
|
43
|
+
fs.appendFileSync(gitignorePath, `\n# Shokunin feature plans (working documents)\n${entry}\n`);
|
|
44
|
+
} else {
|
|
45
|
+
fs.writeFileSync(gitignorePath, `# Shokunin feature plans (working documents)\n${entry}\n`);
|
|
46
|
+
}
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async function promptUser(question) {
|
|
51
|
+
const rl = readline.createInterface({
|
|
52
|
+
input: process.stdin,
|
|
53
|
+
output: process.stdout,
|
|
54
|
+
});
|
|
55
|
+
return new Promise((resolve) => {
|
|
56
|
+
rl.question(question, (answer) => {
|
|
57
|
+
rl.close();
|
|
58
|
+
resolve(answer.trim().toLowerCase());
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async function main() {
|
|
64
|
+
const args = process.argv.slice(2);
|
|
65
|
+
const force = args.includes('--force');
|
|
66
|
+
|
|
67
|
+
const projectRoot = findProjectRoot(process.cwd());
|
|
68
|
+
const packageRoot = path.resolve(__dirname, '..');
|
|
69
|
+
|
|
70
|
+
console.log('');
|
|
71
|
+
console.log(' \u8077\u4eba shokunin');
|
|
72
|
+
console.log(' Craftsmanship in AI-assisted development');
|
|
73
|
+
console.log('');
|
|
74
|
+
console.log(` Project: ${projectRoot}`);
|
|
75
|
+
console.log('');
|
|
76
|
+
|
|
77
|
+
const claudeDir = path.join(projectRoot, '.claude');
|
|
78
|
+
const skillsDir = path.join(claudeDir, 'skills');
|
|
79
|
+
const agentsDir = path.join(claudeDir, 'agents');
|
|
80
|
+
const plansDir = path.join(claudeDir, 'plans');
|
|
81
|
+
|
|
82
|
+
// Ensure directories exist
|
|
83
|
+
for (const dir of [skillsDir, agentsDir, plansDir]) {
|
|
84
|
+
if (!fs.existsSync(dir)) {
|
|
85
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
let installed = 0;
|
|
90
|
+
let skipped = 0;
|
|
91
|
+
let updated = 0;
|
|
92
|
+
|
|
93
|
+
// Install skills
|
|
94
|
+
for (const skill of SKILLS) {
|
|
95
|
+
const src = path.join(packageRoot, 'skills', skill, 'SKILL.md');
|
|
96
|
+
const dest = path.join(skillsDir, skill, 'SKILL.md');
|
|
97
|
+
|
|
98
|
+
if (!fs.existsSync(src)) {
|
|
99
|
+
console.log(` [warn] Skill source not found: ${skill}`);
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (fs.existsSync(dest) && !force) {
|
|
104
|
+
if (filesDiffer(src, dest)) {
|
|
105
|
+
const answer = await promptUser(` Skill /${skill} already exists and differs. Overwrite? [y/N] `);
|
|
106
|
+
if (answer !== 'y' && answer !== 'yes') {
|
|
107
|
+
skipped++;
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
copyFileSync(src, dest);
|
|
111
|
+
updated++;
|
|
112
|
+
} else {
|
|
113
|
+
skipped++;
|
|
114
|
+
}
|
|
115
|
+
} else {
|
|
116
|
+
copyFileSync(src, dest);
|
|
117
|
+
installed++;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Install agents
|
|
122
|
+
for (const agent of AGENTS) {
|
|
123
|
+
const src = path.join(packageRoot, 'agents', `${agent}.md`);
|
|
124
|
+
const dest = path.join(agentsDir, `${agent}.md`);
|
|
125
|
+
|
|
126
|
+
if (!fs.existsSync(src)) {
|
|
127
|
+
console.log(` [warn] Agent source not found: ${agent}`);
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if (fs.existsSync(dest) && !force) {
|
|
132
|
+
if (filesDiffer(src, dest)) {
|
|
133
|
+
const answer = await promptUser(` Agent ${agent} already exists and differs. Overwrite? [y/N] `);
|
|
134
|
+
if (answer !== 'y' && answer !== 'yes') {
|
|
135
|
+
skipped++;
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
copyFileSync(src, dest);
|
|
139
|
+
updated++;
|
|
140
|
+
} else {
|
|
141
|
+
skipped++;
|
|
142
|
+
}
|
|
143
|
+
} else {
|
|
144
|
+
copyFileSync(src, dest);
|
|
145
|
+
installed++;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Update .gitignore
|
|
150
|
+
const gitignoreUpdated = addToGitignore(projectRoot);
|
|
151
|
+
|
|
152
|
+
// Summary
|
|
153
|
+
console.log('');
|
|
154
|
+
console.log(' Done!');
|
|
155
|
+
if (installed > 0) console.log(` Installed: ${installed}`);
|
|
156
|
+
if (updated > 0) console.log(` Updated: ${updated}`);
|
|
157
|
+
if (skipped > 0) console.log(` Unchanged: ${skipped}`);
|
|
158
|
+
if (gitignoreUpdated) console.log(' Added .claude/plans/ to .gitignore');
|
|
159
|
+
console.log('');
|
|
160
|
+
console.log(' Skills installed:');
|
|
161
|
+
for (const skill of SKILLS) {
|
|
162
|
+
console.log(` /${skill}`);
|
|
163
|
+
}
|
|
164
|
+
console.log('');
|
|
165
|
+
console.log(' Quick start:');
|
|
166
|
+
console.log(' /start PROJ-123 my new feature # Create workspace');
|
|
167
|
+
console.log(' /plan # Design the feature');
|
|
168
|
+
console.log(' /build # Implement with TDD');
|
|
169
|
+
console.log(' /review # Code review');
|
|
170
|
+
console.log(' /ship # Squash, PR, ship it');
|
|
171
|
+
console.log('');
|
|
172
|
+
console.log(' Prerequisites:');
|
|
173
|
+
console.log(' - gh CLI installed and authenticated (for /ship)');
|
|
174
|
+
console.log(' - Add Bash(gh *) to ~/.claude/settings.json allow list');
|
|
175
|
+
console.log('');
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
main().catch((err) => {
|
|
179
|
+
console.error('Error:', err.message);
|
|
180
|
+
process.exit(1);
|
|
181
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "shokunin",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Lightweight engineering process skills for Claude Code — craftsmanship in AI-assisted development",
|
|
5
|
+
"bin": {
|
|
6
|
+
"shokunin": "bin/install.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin/",
|
|
10
|
+
"skills/",
|
|
11
|
+
"agents/",
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE"
|
|
14
|
+
],
|
|
15
|
+
"keywords": [
|
|
16
|
+
"claude-code",
|
|
17
|
+
"engineering-process",
|
|
18
|
+
"developer-tools",
|
|
19
|
+
"ai-development",
|
|
20
|
+
"tdd",
|
|
21
|
+
"code-review",
|
|
22
|
+
"git-workflow"
|
|
23
|
+
],
|
|
24
|
+
"author": "Mike Skaife",
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "https://github.com/mskaife/shokunin"
|
|
29
|
+
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=18.0.0"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: build
|
|
3
|
+
description: Implement features by working through the task list in the plan file. Executes tasks sequentially with TDD, updates progress, and makes WIP commits.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /build — Steady Hands
|
|
8
|
+
|
|
9
|
+
You are the build phase of the shokunin engineering process. Your job is to execute the plan methodically — one task at a time, with discipline and visibility.
|
|
10
|
+
|
|
11
|
+
## Process
|
|
12
|
+
|
|
13
|
+
### 1. Load the Plan
|
|
14
|
+
|
|
15
|
+
Get the current branch name:
|
|
16
|
+
```
|
|
17
|
+
!git branch --show-current
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Extract the Jira ticket ID from the branch name (segment before the first `/`).
|
|
21
|
+
|
|
22
|
+
Read `.claude/plans/<ticket>.md`. If it doesn't exist, tell the user to run `/plan` first and stop.
|
|
23
|
+
|
|
24
|
+
### 2. Update Status
|
|
25
|
+
|
|
26
|
+
If the plan status is `planning`, update it to `in-progress`.
|
|
27
|
+
|
|
28
|
+
### 3. Find the Next Task
|
|
29
|
+
|
|
30
|
+
Scan the plan for the next task with `**Status:** [ ] pending`. Respect dependency order — if a task depends on another task that isn't `[x] complete`, skip it and find the next unblocked task.
|
|
31
|
+
|
|
32
|
+
If all tasks are complete, update the plan status to `review` and suggest the user runs `/review`. Stop.
|
|
33
|
+
|
|
34
|
+
### 4. Start the Task
|
|
35
|
+
|
|
36
|
+
Update the task status in the plan file to `**Status:** [~] in-progress`.
|
|
37
|
+
|
|
38
|
+
Announce to the user:
|
|
39
|
+
- The task name and number (e.g. "Task 2.1: Create auth middleware")
|
|
40
|
+
- The files involved and whether they're being created or modified
|
|
41
|
+
- The scope — what you're about to do
|
|
42
|
+
|
|
43
|
+
### 5. Implement with TDD
|
|
44
|
+
|
|
45
|
+
Follow the TDD cycle as defined in the project's CLAUDE.md:
|
|
46
|
+
1. **Red:** Write a failing test that defines the expected behaviour
|
|
47
|
+
2. **Green:** Write the minimum code to make the test pass
|
|
48
|
+
3. **Refactor:** Clean up while keeping tests green
|
|
49
|
+
|
|
50
|
+
Run tests after each step to confirm the cycle.
|
|
51
|
+
|
|
52
|
+
### 6. Complete the Task
|
|
53
|
+
|
|
54
|
+
Once the task passes all tests:
|
|
55
|
+
1. Update the task status in the plan file to `**Status:** [x] complete`
|
|
56
|
+
2. Make a WIP commit: `wip: <task name>`
|
|
57
|
+
|
|
58
|
+
### 7. Handle Blocked Tasks
|
|
59
|
+
|
|
60
|
+
If a task cannot be completed (missing dependency, unclear requirement, external blocker):
|
|
61
|
+
1. Update the task status to `**Status:** [!] blocked — <reason>`
|
|
62
|
+
2. Tell the user why it's blocked
|
|
63
|
+
3. Move to the next unblocked task
|
|
64
|
+
|
|
65
|
+
### 8. Phase Boundaries
|
|
66
|
+
|
|
67
|
+
When you complete the last task in a phase, **pause and check in with the user** before starting the next phase. Present:
|
|
68
|
+
- What was completed in the phase
|
|
69
|
+
- What's coming in the next phase
|
|
70
|
+
- Any issues or decisions that came up
|
|
71
|
+
|
|
72
|
+
Wait for the user to confirm before proceeding.
|
|
73
|
+
|
|
74
|
+
### 9. Completion
|
|
75
|
+
|
|
76
|
+
When all tasks are complete:
|
|
77
|
+
1. Update the plan status to `review`
|
|
78
|
+
2. Present a summary of everything that was built
|
|
79
|
+
3. Suggest: "All tasks complete. Run `/review` to review the changes."
|
|
80
|
+
|
|
81
|
+
## Important
|
|
82
|
+
|
|
83
|
+
- **One task at a time** — never skip ahead or parallelise
|
|
84
|
+
- **Always update the plan file** — it's the source of truth for progress
|
|
85
|
+
- **Always make WIP commits** — they protect against session loss and get squashed later
|
|
86
|
+
- **Pause between phases** — give the user a checkpoint
|
|
87
|
+
- **Follow existing project conventions** — match the patterns you find in the codebase
|
|
88
|
+
- **TDD is non-negotiable** — red, green, refactor for every task
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: docs
|
|
3
|
+
description: Create or update technical documentation in the docs/ directory. Can target a specific topic or auto-detect what needs documenting from recent changes.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
argument-hint: [topic, component, or "all" to update everything]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /docs — Record the Craft
|
|
9
|
+
|
|
10
|
+
You are the documentation phase of the shokunin engineering process. Good documentation is part of the craft — it respects the next person who reads the code.
|
|
11
|
+
|
|
12
|
+
## Process
|
|
13
|
+
|
|
14
|
+
### 1. Determine Scope
|
|
15
|
+
|
|
16
|
+
If `$ARGUMENTS` is provided, use it as the scope:
|
|
17
|
+
- A specific topic: "auth", "API endpoints", "database schema"
|
|
18
|
+
- A component name: "user-service", "middleware"
|
|
19
|
+
- `"all"` — update all documentation
|
|
20
|
+
|
|
21
|
+
If no arguments, detect what changed:
|
|
22
|
+
```bash
|
|
23
|
+
git diff main...HEAD --name-only
|
|
24
|
+
```
|
|
25
|
+
Document the areas affected by recent changes.
|
|
26
|
+
|
|
27
|
+
### 2. Explore the Code
|
|
28
|
+
|
|
29
|
+
Read the relevant source files to understand the current implementation. Don't document from memory or assumptions — document what actually exists.
|
|
30
|
+
|
|
31
|
+
Look for:
|
|
32
|
+
- Public APIs, interfaces, and types
|
|
33
|
+
- Configuration and environment variables
|
|
34
|
+
- Architecture decisions and patterns
|
|
35
|
+
- Integration points and dependencies
|
|
36
|
+
- Setup and deployment requirements
|
|
37
|
+
|
|
38
|
+
### 3. Write Documentation
|
|
39
|
+
|
|
40
|
+
Create or update files in the `docs/` directory:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
docs/
|
|
44
|
+
README.md # Project overview, getting started, architecture summary
|
|
45
|
+
architecture.md # System architecture, key decisions, component relationships
|
|
46
|
+
api/ # API documentation (endpoints, request/response schemas)
|
|
47
|
+
<resource>.md # One file per API resource
|
|
48
|
+
guides/ # How-to guides for common tasks
|
|
49
|
+
<guide-name>.md # One file per guide
|
|
50
|
+
<component>/ # Per-component documentation as needed
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Documentation Principles
|
|
54
|
+
|
|
55
|
+
- **Document the why and how**, not just the what — the code already shows the what
|
|
56
|
+
- **Reference source file paths** — link docs to the code they describe
|
|
57
|
+
- **Include usage examples** — show, don't just tell
|
|
58
|
+
- **Update existing docs** — don't create duplicates
|
|
59
|
+
- **Keep it current** — stale docs are worse than no docs
|
|
60
|
+
- **Use clear headings** — docs should be scannable
|
|
61
|
+
- **If `docs/README.md` exists**, update its table of contents to include new pages
|
|
62
|
+
|
|
63
|
+
### 4. Commit
|
|
64
|
+
|
|
65
|
+
After writing documentation:
|
|
66
|
+
```bash
|
|
67
|
+
git add docs/
|
|
68
|
+
git commit -m "docs: update <scope> documentation"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Important
|
|
72
|
+
|
|
73
|
+
- **Read the code first** — never document from assumption
|
|
74
|
+
- **Respect existing structure** — if docs already exist, follow the established pattern
|
|
75
|
+
- **Don't over-document** — focus on what someone new to the codebase needs to know
|
|
76
|
+
- **Keep it maintainable** — docs that are too detailed become stale faster
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: plan
|
|
3
|
+
description: Create or refine a feature plan with a granular, dependency-ordered task list. Use this when starting to plan a new feature or when you need to adjust an existing plan.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
argument-hint: [feature description or refinement instructions]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /plan — Measure Twice, Cut Once
|
|
9
|
+
|
|
10
|
+
You are the planning phase of the shokunin engineering process. Your job is to produce a detailed, actionable plan that `/build` can execute mechanically. Never start implementation — planning only.
|
|
11
|
+
|
|
12
|
+
## Process
|
|
13
|
+
|
|
14
|
+
### 1. Detect Context
|
|
15
|
+
|
|
16
|
+
Get the current branch name:
|
|
17
|
+
```
|
|
18
|
+
!git branch --show-current
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Extract the Jira ticket ID from the branch name (the segment before the first `/`, e.g. `PROJ-123/add-auth` → `PROJ-123`). If the branch has no ticket prefix (e.g. `main`), ask the user for the ticket ID.
|
|
22
|
+
|
|
23
|
+
### 2. Check for Existing Plan
|
|
24
|
+
|
|
25
|
+
Look for `.claude/plans/<ticket>.md`. If it exists and has tasks, this is a **refinement** — ask the user what they want to change rather than starting from scratch.
|
|
26
|
+
|
|
27
|
+
If no plan exists, create a new one.
|
|
28
|
+
|
|
29
|
+
### 3. Understand the Feature
|
|
30
|
+
|
|
31
|
+
If `$ARGUMENTS` is provided, use it as the starting point. Otherwise, ask the user to describe what they want to build.
|
|
32
|
+
|
|
33
|
+
Before writing the plan, engage interactively:
|
|
34
|
+
- Ask about scope boundaries — what's in, what's out
|
|
35
|
+
- Ask about edge cases and error scenarios
|
|
36
|
+
- Ask about acceptance criteria — how will we know it's done?
|
|
37
|
+
- Clarify any ambiguity — don't assume
|
|
38
|
+
|
|
39
|
+
### 4. Explore the Codebase
|
|
40
|
+
|
|
41
|
+
Before generating tasks, explore the existing codebase to understand:
|
|
42
|
+
- Project conventions and patterns (naming, file structure, test patterns)
|
|
43
|
+
- Existing code that can be reused or extended
|
|
44
|
+
- Related files that will need modification
|
|
45
|
+
- The test framework and patterns in use
|
|
46
|
+
|
|
47
|
+
### 5. Generate the Plan
|
|
48
|
+
|
|
49
|
+
Write `.claude/plans/<ticket>.md` using this exact format:
|
|
50
|
+
|
|
51
|
+
```markdown
|
|
52
|
+
# Feature: <title>
|
|
53
|
+
|
|
54
|
+
**Ticket:** <PROJ-123>
|
|
55
|
+
**Branch:** <PROJ-123/feature-slug>
|
|
56
|
+
**Status:** planning
|
|
57
|
+
**Created:** <YYYY-MM-DD>
|
|
58
|
+
|
|
59
|
+
## Summary
|
|
60
|
+
<2-3 sentences: what we're building and why>
|
|
61
|
+
|
|
62
|
+
## Acceptance Criteria
|
|
63
|
+
- [ ] <criterion 1>
|
|
64
|
+
- [ ] <criterion 2>
|
|
65
|
+
- [ ] <criterion 3>
|
|
66
|
+
|
|
67
|
+
## Tasks
|
|
68
|
+
|
|
69
|
+
Tasks are grouped by phase, ordered by dependency, and specify exact file paths.
|
|
70
|
+
|
|
71
|
+
### Phase 1: <phase name>
|
|
72
|
+
|
|
73
|
+
#### Task 1.1: <concise task name>
|
|
74
|
+
- **Files:** `path/to/file.ts` (create), `path/to/other.ts` (modify)
|
|
75
|
+
- **Depends on:** none
|
|
76
|
+
- **Scope:** <what this task must accomplish — specific enough to implement without guessing>
|
|
77
|
+
- **Status:** [ ] pending
|
|
78
|
+
|
|
79
|
+
#### Task 1.2: <concise task name>
|
|
80
|
+
- **Files:** `path/to/file.test.ts` (create)
|
|
81
|
+
- **Depends on:** Task 1.1
|
|
82
|
+
- **Scope:** <what this task must accomplish>
|
|
83
|
+
- **Status:** [ ] pending
|
|
84
|
+
|
|
85
|
+
### Phase 2: <phase name>
|
|
86
|
+
|
|
87
|
+
#### Task 2.1: <concise task name>
|
|
88
|
+
- **Files:** `path/to/file.ts` (create)
|
|
89
|
+
- **Depends on:** Task 1.1
|
|
90
|
+
- **Scope:** <what this task must accomplish>
|
|
91
|
+
- **Status:** [ ] pending
|
|
92
|
+
|
|
93
|
+
## Notes
|
|
94
|
+
<Design decisions, constraints, open questions discovered during planning>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Task List Guidelines
|
|
98
|
+
|
|
99
|
+
- **Group by phase:** e.g. Data Model, API, UI, Integration Tests
|
|
100
|
+
- **Order by dependency:** each task lists what it depends on
|
|
101
|
+
- **Specify exact file paths:** include whether each file is created or modified
|
|
102
|
+
- **Define scope precisely:** enough detail that `/build` can implement without guessing
|
|
103
|
+
- **Size for TDD:** each task should map to a single red-green-refactor cycle
|
|
104
|
+
- **Include test tasks:** tests are first-class tasks, not afterthoughts
|
|
105
|
+
- **Be realistic about phases:** don't over-decompose simple features
|
|
106
|
+
|
|
107
|
+
### 6. Review with the User
|
|
108
|
+
|
|
109
|
+
After writing the plan, present a summary:
|
|
110
|
+
- Total task count and phase breakdown
|
|
111
|
+
- Key design decisions made
|
|
112
|
+
- Any open questions or risks
|
|
113
|
+
|
|
114
|
+
Wait for the user to approve or request changes before considering planning complete.
|
|
115
|
+
|
|
116
|
+
## Important
|
|
117
|
+
|
|
118
|
+
- **Never implement code** — planning only
|
|
119
|
+
- **Never skip the interactive phase** — always ask before assuming
|
|
120
|
+
- **Always explore the codebase first** — plans grounded in reality, not imagination
|
|
121
|
+
- **Keep plans lean** — enough detail to execute, not a novel
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: review
|
|
3
|
+
description: Run a thorough code review on recent changes using the code-reviewer agent. Use this after building a feature to catch issues before shipping.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
context: fork
|
|
6
|
+
agent: code-reviewer
|
|
7
|
+
allowed-tools: Read, Grep, Glob, Bash(git diff *), Bash(git log *), Bash(git status *), Bash(git branch *)
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# /review — Critical Eye
|
|
11
|
+
|
|
12
|
+
You are the review phase of the shokunin engineering process. Review all changes on the current branch against main with a craftsman's attention to detail.
|
|
13
|
+
|
|
14
|
+
## Process
|
|
15
|
+
|
|
16
|
+
### 1. Gather Context
|
|
17
|
+
|
|
18
|
+
Get the current branch and diff:
|
|
19
|
+
```
|
|
20
|
+
git branch --show-current
|
|
21
|
+
git diff main...HEAD --stat
|
|
22
|
+
git diff main...HEAD --name-only
|
|
23
|
+
git log main..HEAD --oneline
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### 2. Read Changed Files
|
|
27
|
+
|
|
28
|
+
Read every file that was changed. Understand the full context — not just the diff, but the surrounding code.
|
|
29
|
+
|
|
30
|
+
### 3. Review
|
|
31
|
+
|
|
32
|
+
Apply a thorough review across these categories:
|
|
33
|
+
|
|
34
|
+
- **Correctness:** Does the code work as intended? Are edge cases handled?
|
|
35
|
+
- **Security:** Are there vulnerabilities? Is input validated? Are secrets exposed?
|
|
36
|
+
- **Performance:** Are there inefficiencies? Unnecessary computations? Memory leaks?
|
|
37
|
+
- **Readability:** Is the code clear? Are names meaningful? Is complexity appropriate?
|
|
38
|
+
- **Maintainability:** Is it testable? Does it follow project patterns? Is coupling minimised?
|
|
39
|
+
- **Error Handling:** Are errors handled gracefully? Are failures recoverable?
|
|
40
|
+
- **Testing:** Is coverage appropriate? Are tests good quality? Any gaps?
|
|
41
|
+
|
|
42
|
+
### 4. Output
|
|
43
|
+
|
|
44
|
+
Structure your review as:
|
|
45
|
+
|
|
46
|
+
**Summary**
|
|
47
|
+
Brief overview of the changes and your overall assessment.
|
|
48
|
+
|
|
49
|
+
**Critical Issues**
|
|
50
|
+
Must-fix problems — bugs, security vulnerabilities, breaking changes. These block shipping.
|
|
51
|
+
|
|
52
|
+
**Improvements**
|
|
53
|
+
Recommended changes that would meaningfully improve quality. Not blockers, but strongly suggested.
|
|
54
|
+
|
|
55
|
+
**Minor Suggestions**
|
|
56
|
+
Optional enhancements — style, naming, minor optimisations.
|
|
57
|
+
|
|
58
|
+
**Positive Notes**
|
|
59
|
+
What was done well. Acknowledge good work.
|
|
60
|
+
|
|
61
|
+
## Principles
|
|
62
|
+
|
|
63
|
+
- Be specific — reference exact files and lines, provide concrete examples
|
|
64
|
+
- Be constructive — explain why something is an issue and how to fix it
|
|
65
|
+
- Be balanced — acknowledge good code, not just problems
|
|
66
|
+
- Prioritise — distinguish critical issues from nice-to-haves
|
|
67
|
+
- Respect context — consider project conventions and constraints
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ship
|
|
3
|
+
description: Squash WIP commits into a single commit with Jira reference, then create a pull request. Use this when a feature is built and reviewed.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
allowed-tools: Bash(git *), Bash(gh *)
|
|
6
|
+
argument-hint: [PR title override]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# /ship — Deliver with Pride
|
|
10
|
+
|
|
11
|
+
You are the shipping phase of the shokunin engineering process. Package the work cleanly — one commit, clear message, traceable to the ticket.
|
|
12
|
+
|
|
13
|
+
## Process
|
|
14
|
+
|
|
15
|
+
### 1. Extract Context
|
|
16
|
+
|
|
17
|
+
Get the current branch:
|
|
18
|
+
```
|
|
19
|
+
!git branch --show-current
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Extract the Jira ticket ID from the branch name (segment before the first `/`). If the branch doesn't follow the `TICKET/description` format, ask the user for the ticket ID.
|
|
23
|
+
|
|
24
|
+
### 2. Assess the Changes
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
git log main..HEAD --oneline
|
|
28
|
+
git diff main...HEAD --stat
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Show the user:
|
|
32
|
+
- Number of commits to squash
|
|
33
|
+
- Files changed summary
|
|
34
|
+
- The Jira ticket ID detected
|
|
35
|
+
|
|
36
|
+
### 3. Read the Plan
|
|
37
|
+
|
|
38
|
+
Read `.claude/plans/<ticket>.md` if it exists. Use the summary and acceptance criteria to inform the commit message and PR body.
|
|
39
|
+
|
|
40
|
+
### 4. Propose the Commit
|
|
41
|
+
|
|
42
|
+
Draft a commit message in this format:
|
|
43
|
+
```
|
|
44
|
+
<TICKET-ID>: <conventional commit type>: <concise description>
|
|
45
|
+
|
|
46
|
+
<Longer description if needed, derived from the plan summary>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Example:
|
|
50
|
+
```
|
|
51
|
+
PROJ-123: feat: add OAuth2 authentication with Google and GitHub
|
|
52
|
+
|
|
53
|
+
Implements OAuth2 login flow with Google and GitHub providers.
|
|
54
|
+
Includes session management, token refresh, and logout.
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Conventional commit types: `feat`, `fix`, `refactor`, `docs`, `test`, `chore`, `perf`
|
|
58
|
+
|
|
59
|
+
### 5. Propose the PR
|
|
60
|
+
|
|
61
|
+
Draft a PR title and body:
|
|
62
|
+
|
|
63
|
+
**Title:** Short, descriptive (under 70 chars). Use `$ARGUMENTS` as override if provided.
|
|
64
|
+
|
|
65
|
+
**Body:**
|
|
66
|
+
```markdown
|
|
67
|
+
## Summary
|
|
68
|
+
<Bullet points derived from plan summary and acceptance criteria>
|
|
69
|
+
|
|
70
|
+
## Changes
|
|
71
|
+
<Key technical changes, derived from the diff>
|
|
72
|
+
|
|
73
|
+
## Test Plan
|
|
74
|
+
<How to verify this works, derived from acceptance criteria>
|
|
75
|
+
|
|
76
|
+
## Ticket
|
|
77
|
+
<TICKET-ID>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### 6. Confirm with the User
|
|
81
|
+
|
|
82
|
+
Present the proposed commit message, PR title, and PR body. **Wait for explicit confirmation** before proceeding. The user may want to adjust the wording.
|
|
83
|
+
|
|
84
|
+
### 7. Execute
|
|
85
|
+
|
|
86
|
+
Only after confirmation:
|
|
87
|
+
|
|
88
|
+
1. Squash all commits into one:
|
|
89
|
+
```bash
|
|
90
|
+
git reset --soft main
|
|
91
|
+
git commit -m "<approved commit message>"
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
2. Delete the plan file (it served its purpose, PR body captures the summary):
|
|
95
|
+
```bash
|
|
96
|
+
git rm .claude/plans/<ticket>.md 2>/dev/null
|
|
97
|
+
git commit --amend --no-edit
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
3. Push the branch:
|
|
101
|
+
```bash
|
|
102
|
+
git push -u origin HEAD
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
4. Create the PR:
|
|
106
|
+
```bash
|
|
107
|
+
gh pr create --title "<title>" --body "<body>"
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### 8. Print Cleanup Instructions
|
|
111
|
+
|
|
112
|
+
After the PR is created, tell the user:
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
PR created: <URL>
|
|
116
|
+
|
|
117
|
+
After the PR is merged, clean up the worktree:
|
|
118
|
+
git worktree remove <worktree-dir>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Important
|
|
122
|
+
|
|
123
|
+
- **Always confirm before squashing** — squashing is destructive to local history
|
|
124
|
+
- **Always include the Jira ticket** — traceability is non-negotiable
|
|
125
|
+
- **Never merge the PR** — that's a manual step on GitHub
|
|
126
|
+
- **Never force push to main** — only push the feature branch
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: start
|
|
3
|
+
description: Initialize a new feature with a git worktree, branch, and plan scaffold. Use this when beginning work on a new Jira ticket.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
allowed-tools: Bash(git *), Bash(mkdir *), Write, Read, Glob
|
|
6
|
+
argument-hint: <PROJ-123> <short feature description>
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# /start — Begin with Intent
|
|
10
|
+
|
|
11
|
+
You are the initialisation phase of the shokunin engineering process. Set up a clean workspace for a new feature.
|
|
12
|
+
|
|
13
|
+
## Process
|
|
14
|
+
|
|
15
|
+
### 1. Parse Arguments
|
|
16
|
+
|
|
17
|
+
`$ARGUMENTS` should contain: `<TICKET-ID> <feature description>`
|
|
18
|
+
|
|
19
|
+
- First word: Jira ticket ID (e.g. `PROJ-123`, `ENG-42`). Validate it matches the pattern `[A-Z]+-\d+`. If invalid, ask the user for the correct ticket ID.
|
|
20
|
+
- Remaining words: feature description (e.g. "add user authentication")
|
|
21
|
+
|
|
22
|
+
### 2. Derive Names
|
|
23
|
+
|
|
24
|
+
- **Branch name:** `<ticket>/<slugified-description>` — lowercase, hyphens, no special chars
|
|
25
|
+
- Example: `PROJ-123/add-user-authentication`
|
|
26
|
+
- **Worktree directory:** `../<ticket>-<slug>`
|
|
27
|
+
- Example: `../PROJ-123-add-user-authentication`
|
|
28
|
+
|
|
29
|
+
### 3. Create Worktree
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
git worktree add -b <branch-name> <worktree-dir> main
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
If the branch already exists, ask the user if they want to resume work on it or start fresh.
|
|
36
|
+
|
|
37
|
+
### 4. Create Plan Scaffold
|
|
38
|
+
|
|
39
|
+
Create the directory `.claude/plans/` in the worktree if it doesn't exist.
|
|
40
|
+
|
|
41
|
+
Write `.claude/plans/<ticket>.md` with this scaffold:
|
|
42
|
+
|
|
43
|
+
```markdown
|
|
44
|
+
# Feature: <feature description>
|
|
45
|
+
|
|
46
|
+
**Ticket:** <TICKET-ID>
|
|
47
|
+
**Branch:** <branch-name>
|
|
48
|
+
**Status:** planning
|
|
49
|
+
**Created:** <YYYY-MM-DD>
|
|
50
|
+
|
|
51
|
+
## Summary
|
|
52
|
+
<To be filled during /plan>
|
|
53
|
+
|
|
54
|
+
## Acceptance Criteria
|
|
55
|
+
- [ ] <To be defined during /plan>
|
|
56
|
+
|
|
57
|
+
## Tasks
|
|
58
|
+
<To be generated during /plan>
|
|
59
|
+
|
|
60
|
+
## Notes
|
|
61
|
+
<To be captured during /plan>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### 5. Print Next Steps
|
|
65
|
+
|
|
66
|
+
Tell the user:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
Feature workspace created:
|
|
70
|
+
Worktree: <worktree-dir>
|
|
71
|
+
Branch: <branch-name>
|
|
72
|
+
Plan: .claude/plans/<ticket>.md
|
|
73
|
+
|
|
74
|
+
Next: Open a new terminal and run:
|
|
75
|
+
cd <worktree-dir> && claude
|
|
76
|
+
|
|
77
|
+
Then use /plan to define the feature.
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Important
|
|
81
|
+
|
|
82
|
+
- **Never start planning or implementing** — just set up the workspace
|
|
83
|
+
- **Always create a worktree** — this enables parallel feature development
|
|
84
|
+
- **Always scaffold the plan file** — it's the entry point for `/plan`
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wip
|
|
3
|
+
description: Show work in progress — list active feature worktrees, branches, and plan progress. Use this to get an overview of all features in flight.
|
|
4
|
+
allowed-tools: Bash(git worktree *), Bash(git branch *), Bash(git log *), Bash(git status *), Read, Glob
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /wip — Survey the Workshop
|
|
8
|
+
|
|
9
|
+
You are the status overview of the shokunin engineering process. Show the craftsman what's on the workbench.
|
|
10
|
+
|
|
11
|
+
## Process
|
|
12
|
+
|
|
13
|
+
### 1. List Worktrees
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
git worktree list
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
For each worktree, extract:
|
|
20
|
+
- Path
|
|
21
|
+
- Branch name
|
|
22
|
+
- Jira ticket (from branch name, segment before `/`)
|
|
23
|
+
|
|
24
|
+
### 2. Check Plan Progress
|
|
25
|
+
|
|
26
|
+
For each worktree, check if `.claude/plans/*.md` exists. If it does, read it and count:
|
|
27
|
+
- Total tasks (lines matching `**Status:**`)
|
|
28
|
+
- Pending (`[ ] pending`)
|
|
29
|
+
- In progress (`[~] in-progress`)
|
|
30
|
+
- Complete (`[x] complete`)
|
|
31
|
+
- Blocked (`[!] blocked`)
|
|
32
|
+
|
|
33
|
+
Also read the plan status field (`planning`, `in-progress`, `review`, `shipped`).
|
|
34
|
+
|
|
35
|
+
### 3. Current Branch Details
|
|
36
|
+
|
|
37
|
+
If the current directory is on a feature branch:
|
|
38
|
+
- Show commit count since main: `git log main..HEAD --oneline | wc -l`
|
|
39
|
+
- Show if there are uncommitted changes: `git status --short`
|
|
40
|
+
|
|
41
|
+
### 4. Present the Overview
|
|
42
|
+
|
|
43
|
+
Format as a clear, scannable table:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
Shokunin — Work in Progress
|
|
47
|
+
|
|
48
|
+
| Worktree | Branch | Ticket | Status | Progress |
|
|
49
|
+
|----------|--------|--------|--------|----------|
|
|
50
|
+
| ../PROJ-123-auth | PROJ-123/add-auth | PROJ-123 | in-progress | 4/7 tasks |
|
|
51
|
+
| ../PROJ-456-dash | PROJ-456/fix-dash | PROJ-456 | review | 5/5 tasks |
|
|
52
|
+
| . (main) | main | — | — | — |
|
|
53
|
+
|
|
54
|
+
Current branch: PROJ-123/add-auth
|
|
55
|
+
Commits ahead of main: 4
|
|
56
|
+
Uncommitted changes: 2 files
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
If there are no feature worktrees, just show the current branch status.
|