@wbern/claude-instructions 2.8.1 → 2.9.1

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 CHANGED
@@ -14,7 +14,7 @@
14
14
  [![Made with Claude Code](https://img.shields.io/badge/Made%20with-Claude%20Code-blueviolet)](https://claude.ai/code)
15
15
  [![Contributors](https://img.shields.io/github/contributors/wbern/claude-instructions)](https://github.com/wbern/claude-instructions/graphs/contributors)
16
16
  [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen)](https://github.com/wbern/claude-instructions/pulls)
17
- [![Commands](https://img.shields.io/badge/commands-27-blue)](https://github.com/wbern/claude-instructions#available-commands)
17
+ [![Commands](https://img.shields.io/badge/commands-29-blue)](https://github.com/wbern/claude-instructions#available-commands)
18
18
 
19
19
  ```
20
20
  _==/ i i \==_
@@ -33,22 +33,26 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
33
33
 
34
34
  **TDD workflow commands for Claude Code CLI.**
35
35
 
36
+ > "TDD helps you to pay attention to the right issues at the right time so you can make your designs cleaner, you can refine your designs as you learn." — Kent Beck
37
+
36
38
  Claude Code supports [custom slash commands](https://docs.anthropic.com/en/docs/claude-code/slash-commands)—type `/foo` and Claude receives the contents of `foo.md` as instructions (from `.claude/commands/` in your repo or `~/.claude/commands/` in your home directory). This repo provides ready-made commands for Test-Driven Development workflows.
37
39
 
38
- While custom commands themselves is really just a glorified method of copy-paste, the way they can be used to bring stability to software development is what's worth trying out.
40
+ Custom commands are just a glorified copy-paste mechanism—but that simplicity is what makes them effective for establishing consistent development practices.
39
41
 
40
42
  Instead of explaining TDD principles each session, type `/red` to write a failing test, `/green` to make it pass, `/refactor` to clean up. The commands guide Claude through each step methodically—you focus on what to build, Claude handles the how.
41
43
 
44
+ Want to go faster? Use `/cycle` to let Claude run the entire red-green-refactor sequence before checking in with you. For even more autonomy (your mileage may vary), `/tdd` gives Claude full discretion on when to advance between phases.
45
+
42
46
  Also included are commands for commits, PRs, code reviews, and other tasks that come up during day-to-day development.
43
47
 
44
48
  ## Installation
45
49
 
46
50
  ```bash
47
- npx @wbern/claude-instructions
48
-
49
- // or
51
+ npx @wbern/claude-instructions # npm
52
+ ```
50
53
 
51
- pnpm dlx @wbern/claude-instructions
54
+ ```bash
55
+ pnpm dlx @wbern/claude-instructions # pnpm
52
56
  ```
53
57
 
54
58
  The interactive installer lets you choose:
@@ -71,10 +75,10 @@ Then add a postinstall script to your `package.json`:
71
75
  ```json
72
76
  {
73
77
  "scripts": {
74
- "postinstall": "npx @wbern/claude-instructions --scope=project --overwrite"
78
+ "postinstall": "claude-instructions --scope=project --overwrite"
75
79
  },
76
80
  "devDependencies": {
77
- "@wbern/claude-instructions": "^2.8.1"
81
+ "@wbern/claude-instructions": "^2.9.1"
78
82
  }
79
83
  }
80
84
  ```
@@ -118,7 +122,7 @@ Other instructions here...
118
122
  </claude-commands-template>
119
123
  ```
120
124
 
121
- When you run `npx @wbern/claude-instructions`, the template content is appended to all generated commands.
125
+ When you run `claude-instructions`, the template content is appended to all generated commands.
122
126
 
123
127
  ### Targeting Specific Commands
124
128
 
@@ -214,6 +218,7 @@ flowchart TB
214
218
  - `/gap` - Analyze conversation context for unaddressed items and gaps
215
219
  - `/forever` - Run autonomously until stopped or stuck
216
220
  - `/code-review` - Code review using dynamic category detection and domain-specific analysis
221
+ - `/polish` - Review and address issues in existing code - fix problems or justify skipping
217
222
 
218
223
  ### Ship / Show / Ask
219
224
 
@@ -233,6 +238,7 @@ flowchart TB
233
238
  - `/kata` - Generate a TDD practice challenge with boilerplate test setup
234
239
  - `/research` - Research a problem in parallel via web docs, web search, codebase exploration, and deep ultrathink
235
240
  - `/commitlint-checklist-nodejs` - Audit commit hook automation for Node.js projects
241
+ - `/upgrade-deps` - Check for dependency upgrades and assess safety before updating
236
242
 
237
243
  ## Getting Started
238
244
 
package/bin/cli.js CHANGED
@@ -130,10 +130,10 @@ import {
130
130
  text
131
131
  } from "@clack/prompts";
132
132
 
133
- // node_modules/.pnpm/diff@8.0.2/node_modules/diff/libesm/index.js
133
+ // node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/index.js
134
134
  init_esm_shims();
135
135
 
136
- // node_modules/.pnpm/diff@8.0.2/node_modules/diff/libesm/diff/base.js
136
+ // node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/base.js
137
137
  init_esm_shims();
138
138
  var Diff = class {
139
139
  diff(oldStr, newStr, options = {}) {
@@ -336,7 +336,7 @@ var Diff = class {
336
336
  }
337
337
  };
338
338
 
339
- // node_modules/.pnpm/diff@8.0.2/node_modules/diff/libesm/diff/line.js
339
+ // node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/line.js
340
340
  init_esm_shims();
341
341
  var LineDiff = class extends Diff {
342
342
  constructor() {
@@ -541,11 +541,7 @@ var CLI_OPTIONS = [
541
541
  }
542
542
  ];
543
543
  function generateHelpText() {
544
- const lines = [
545
- "Usage: npx @wbern/claude-instructions [options]",
546
- "",
547
- "Options:"
548
- ];
544
+ const lines = ["Usage: claude-instructions [options]", "", "Options:"];
549
545
  for (const opt of CLI_OPTIONS) {
550
546
  const suffix = opt.type === "string" ? "=<value>" : opt.type === "array" ? "=<list>" : "";
551
547
  const padding = 28 - (opt.flag.length + suffix.length);
@@ -1344,9 +1340,7 @@ async function main(args) {
1344
1340
  const isInteractiveMode = !args?.scope;
1345
1341
  let automationNote = "";
1346
1342
  if (isInteractiveMode) {
1347
- const userAgent = process.env.npm_config_user_agent || "";
1348
- const runCommand = userAgent.startsWith("pnpm/") ? "pnpm dlx @wbern/claude-instructions" : "npx @wbern/claude-instructions";
1349
- const parts = [runCommand];
1343
+ const parts = ["claude-instructions"];
1350
1344
  parts.push(`--scope=${scope}`);
1351
1345
  if (commandPrefix) {
1352
1346
  parts.push(`--prefix=${commandPrefix}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wbern/claude-instructions",
3
- "version": "2.8.1",
3
+ "version": "2.9.1",
4
4
  "description": "TDD workflow commands for Claude Code CLI",
5
5
  "type": "module",
6
6
  "bin": "./bin/cli.js",
package/src/README.md CHANGED
@@ -29,22 +29,26 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
29
29
 
30
30
  **TDD workflow commands for Claude Code CLI.**
31
31
 
32
+ > "TDD helps you to pay attention to the right issues at the right time so you can make your designs cleaner, you can refine your designs as you learn." — Kent Beck
33
+
32
34
  Claude Code supports [custom slash commands](https://docs.anthropic.com/en/docs/claude-code/slash-commands)—type `/foo` and Claude receives the contents of `foo.md` as instructions (from `.claude/commands/` in your repo or `~/.claude/commands/` in your home directory). This repo provides ready-made commands for Test-Driven Development workflows.
33
35
 
34
- While custom commands themselves is really just a glorified method of copy-paste, the way they can be used to bring stability to software development is what's worth trying out.
36
+ Custom commands are just a glorified copy-paste mechanism—but that simplicity is what makes them effective for establishing consistent development practices.
35
37
 
36
38
  Instead of explaining TDD principles each session, type `/red` to write a failing test, `/green` to make it pass, `/refactor` to clean up. The commands guide Claude through each step methodically—you focus on what to build, Claude handles the how.
37
39
 
40
+ Want to go faster? Use `/cycle` to let Claude run the entire red-green-refactor sequence before checking in with you. For even more autonomy (your mileage may vary), `/tdd` gives Claude full discretion on when to advance between phases.
41
+
38
42
  Also included are commands for commits, PRs, code reviews, and other tasks that come up during day-to-day development.
39
43
 
40
44
  ## Installation
41
45
 
42
46
  ```bash
43
- npx @wbern/claude-instructions
44
-
45
- // or
47
+ npx @wbern/claude-instructions # npm
48
+ ```
46
49
 
47
- pnpm dlx @wbern/claude-instructions
50
+ ```bash
51
+ pnpm dlx @wbern/claude-instructions # pnpm
48
52
  ```
49
53
 
50
54
  The interactive installer lets you choose:
@@ -67,7 +71,7 @@ Then add a postinstall script to your `package.json`:
67
71
  ```json
68
72
  {
69
73
  "scripts": {
70
- "postinstall": "npx @wbern/claude-instructions --scope=project --overwrite"
74
+ "postinstall": "claude-instructions --scope=project --overwrite"
71
75
  },
72
76
  "devDependencies": {
73
77
  "@wbern/claude-instructions": "^<!-- docs VERSION --><!-- /docs -->"
@@ -103,7 +107,7 @@ Other instructions here...
103
107
  </claude-commands-template>
104
108
  ```
105
109
 
106
- When you run `npx @wbern/claude-instructions`, the template content is appended to all generated commands.
110
+ When you run `claude-instructions`, the template content is appended to all generated commands.
107
111
 
108
112
  ### Targeting Specific Commands
109
113
 
@@ -0,0 +1,10 @@
1
+ | Category | File Patterns |
2
+ |----------|---------------|
3
+ | Frontend/UI | `*.tsx`, `*.jsx`, `components/`, `pages/`, `views/`, `*.vue` |
4
+ | Frontend/Styling | `*.css`, `*.scss`, `*.less`, `styles/`, `*.tailwind*`, `*.styled.*` |
5
+ | Backend/API | `routes/`, `api/`, `controllers/`, `services/`, `*.controller.*`, `*.service.*`, `*.resolver.*` |
6
+ | Backend/Data | `migrations/`, `models/`, `prisma/`, `schema.*`, `*.model.*`, `*.entity.*` |
7
+ | Tooling/Config | `scripts/`, `*.config.*`, `package.json`, `tsconfig.*`, `vite.*`, `webpack.*`, `eslint.*` |
8
+ | CI/CD | `.github/`, `.gitlab-ci.*`, `Dockerfile`, `docker-compose.*`, `*.yml` in CI paths |
9
+ | Tests | `*.test.*`, `*.spec.*`, `__tests__/`, `__mocks__/`, `*.stories.*` |
10
+ | Docs | `*.md`, `docs/`, `README*`, `CHANGELOG*` |
@@ -17,7 +17,11 @@ _order: 99
17
17
 
18
18
  Create a new custom command in `src/sources/` following the patterns below. Assess the structure carefully using the below info but also researching the repo.
19
19
 
20
- Command to create: $ARGUMENTS
20
+ **User arguments:**
21
+
22
+ Contribute-a-command: $ARGUMENTS
23
+
24
+ **End of user arguments**
21
25
 
22
26
  ## File Structure
23
27
 
@@ -49,9 +53,13 @@ Optional: `_requested-tools` (array), `_selectedByDefault: false`
49
53
  ### Test-Driven Development (spike, red, green, refactor, cycle)
50
54
 
51
55
  ```markdown
52
- [PHASE] PHASE! Apply the below to the info given by user input here:
56
+ **User arguments:**
57
+
58
+ [CommandName]: [DOLLAR]ARGUMENTS
53
59
 
54
- [DOLLAR]ARGUMENTS
60
+ **End of user arguments**
61
+
62
+ [PHASE] PHASE! Apply the below to the user input above.
55
63
 
56
64
  < !-- docs INCLUDE path='src/fragments/universal-guidelines.md' -->
57
65
  < !-- /docs -->
@@ -80,7 +88,13 @@ Add for red: `aaa-pattern.md`
80
88
  < !-- docs INCLUDE path='src/fragments/beads-awareness.md' featureFlag='beads' -->
81
89
  < !-- /docs -->
82
90
 
83
- [Description and [DOLLAR] embedded in flow]
91
+ [Description]
92
+
93
+ **User arguments:**
94
+
95
+ [CommandName]: [DOLLAR]ARGUMENTS
96
+
97
+ **End of user arguments**
84
98
 
85
99
  < !-- docs INCLUDE path='src/fragments/discovery-phase.md' -->
86
100
  < !-- /docs -->
@@ -100,7 +114,11 @@ Add for red: `aaa-pattern.md`
100
114
 
101
115
  [Workflow description]
102
116
 
103
- [DOLLAR]
117
+ **User arguments:**
118
+
119
+ [CommandName]: [DOLLAR]ARGUMENTS
120
+
121
+ **End of user arguments**
104
122
 
105
123
  [Process steps]
106
124
  ```
@@ -43,7 +43,11 @@ argument-hint: [required-arg] [optional-arg]
43
43
 
44
44
  Your command instructions here.
45
45
 
46
- Arguments: $ARGUMENTS
46
+ **User arguments:**
47
+
48
+ Add-command: $ARGUMENTS
49
+
50
+ **End of user arguments**
47
51
 
48
52
  File reference: @path/to/file.js
49
53
 
@@ -47,7 +47,11 @@ Current branch status:
47
47
  Recent commits:
48
48
  !`git log --oneline -5`
49
49
 
50
- Arguments: $ARGUMENTS
50
+ **User arguments:**
51
+
52
+ Ask: $ARGUMENTS
53
+
54
+ **End of user arguments**
51
55
 
52
56
  **This is the traditional Pull Request workflow**, but with explicit intent that review and approval are required.
53
57
 
@@ -21,7 +21,11 @@ Execute the user's requested task (e.g., posting PR comments, GitHub issue comme
21
21
 
22
22
  ## Instructions
23
23
 
24
- Arguments: $ARGUMENTS
24
+ **User arguments:**
25
+
26
+ Beepboop: $ARGUMENTS
27
+
28
+ **End of user arguments**
25
29
 
26
30
  **IMPORTANT Communication Format:**
27
31
 
@@ -17,7 +17,11 @@ _order: 2
17
17
 
18
18
  Create multiple atomic git commits, committing the smallest possible logical unit at a time
19
19
 
20
- Include any of the following info if specified: $ARGUMENTS
20
+ **User arguments:**
21
+
22
+ Busycommit: $ARGUMENTS
23
+
24
+ **End of user arguments**
21
25
 
22
26
  <!-- docs INCLUDE path='src/fragments/commit-process.md' -->
23
27
  <!-- /docs -->
@@ -84,16 +84,8 @@ Check for CLAUDE.md - if it exists, note any project-specific review patterns.
84
84
 
85
85
  Categorize each changed file into ONE primary category based on these patterns:
86
86
 
87
- | Category | File Patterns |
88
- |----------|---------------|
89
- | Frontend/UI | `*.tsx`, `*.jsx`, `components/`, `pages/`, `views/`, `*.vue` |
90
- | Frontend/Styling | `*.css`, `*.scss`, `*.less`, `styles/`, `*.tailwind*`, `*.styled.*` |
91
- | Backend/API | `routes/`, `api/`, `controllers/`, `services/`, `*.controller.*`, `*.service.*`, `*.resolver.*` |
92
- | Backend/Data | `migrations/`, `models/`, `prisma/`, `schema.*`, `*.model.*`, `*.entity.*` |
93
- | Tooling/Config | `scripts/`, `*.config.*`, `package.json`, `tsconfig.*`, `vite.*`, `webpack.*`, `eslint.*` |
94
- | CI/CD | `.github/`, `.gitlab-ci.*`, `Dockerfile`, `docker-compose.*`, `*.yml` in CI paths |
95
- | Tests | `*.test.*`, `*.spec.*`, `__tests__/`, `__mocks__/`, `*.stories.*` |
96
- | Docs | `*.md`, `docs/`, `README*`, `CHANGELOG*` |
87
+ <!-- docs INCLUDE path='src/fragments/file-categories.md' -->
88
+ <!-- /docs -->
97
89
 
98
90
  Output the categorization:
99
91
 
@@ -247,4 +239,8 @@ Provide a ready-to-paste PR description:
247
239
 
248
240
  ---
249
241
 
250
- Review target (branch name, PR number, or PR URL - leave empty for current branch): $ARGUMENTS
242
+ **User arguments:**
243
+
244
+ Code-review: $ARGUMENTS
245
+
246
+ **End of user arguments**
@@ -17,7 +17,11 @@ _order: 1
17
17
 
18
18
  Create a git commit following project standards
19
19
 
20
- Include any of the following info if specified: $ARGUMENTS
20
+ **User arguments:**
21
+
22
+ Commit: $ARGUMENTS
23
+
24
+ **End of user arguments**
21
25
 
22
26
  <!-- docs INCLUDE path='src/fragments/commit-process.md' -->
23
27
  <!-- /docs -->
@@ -16,7 +16,11 @@ _order: 25
16
16
 
17
17
  Scan the Node.js repository and report what commit automation is in place.
18
18
 
19
- $ARGUMENTS
19
+ **User arguments:**
20
+
21
+ Commitlint-checklist: $ARGUMENTS
22
+
23
+ **End of user arguments**
20
24
 
21
25
  ## Checks to Scan
22
26
 
@@ -19,9 +19,11 @@ Create structured implementation plan that bridges product thinking (PRD) with t
19
19
  <!-- docs INCLUDE path='src/fragments/no-plan-files.md' featureFlag='no-plan-files' -->
20
20
  <!-- /docs -->
21
21
 
22
- ## Input
22
+ **User arguments:**
23
23
 
24
- $ARGUMENTS
24
+ Create-issues: $ARGUMENTS
25
+
26
+ **End of user arguments**
25
27
 
26
28
  (If no input provided, check conversation context<!-- docs INCLUDE path='src/fragments/create-issues-beads-context-hint.md' featureFlag='beads' -->
27
29
  <!-- /docs -->)
@@ -6,9 +6,13 @@ _category: Test-Driven Development
6
6
  _order: 5
7
7
  ---
8
8
 
9
- RED+GREEN+REFACTOR (one cycle) PHASE! Apply the below to the info given by user input here:
9
+ **User arguments:**
10
10
 
11
- $ARGUMENTS
11
+ Cycle: $ARGUMENTS
12
+
13
+ **End of user arguments**
14
+
15
+ RED+GREEN+REFACTOR (one cycle) PHASE! Apply the below to the user input above.
12
16
 
13
17
  <!-- docs INCLUDE path='src/fragments/universal-guidelines.md' -->
14
18
  <!-- /docs -->
@@ -12,7 +12,11 @@ _order: 20
12
12
  <!-- docs INCLUDE path='src/fragments/beads-awareness.md' featureFlag='beads' -->
13
13
  <!-- /docs -->
14
14
 
15
- # Forever Mode: $ARGUMENTS
15
+ **User arguments:**
16
+
17
+ Forever: $ARGUMENTS
18
+
19
+ **End of user arguments**
16
20
 
17
21
  Run autonomously, finding and completing work until interrupted or truly stuck.
18
22
 
@@ -37,5 +37,8 @@ Present findings as a prioritized list with:
37
37
 
38
38
  If there are no gaps, confirm that everything discussed has been addressed.
39
39
 
40
- Additional info:
41
- $ARGUMENTS
40
+ **User arguments:**
41
+
42
+ Gap: $ARGUMENTS
43
+
44
+ **End of user arguments**
@@ -6,9 +6,13 @@ _category: Test-Driven Development
6
6
  _order: 3
7
7
  ---
8
8
 
9
- GREEN PHASE! Apply the below to the info given by user input here:
9
+ **User arguments:**
10
10
 
11
- $ARGUMENTS
11
+ Green: $ARGUMENTS
12
+
13
+ **End of user arguments**
14
+
15
+ GREEN PHASE! Apply the below to the user input above.
12
16
 
13
17
  <!-- docs INCLUDE path='src/fragments/universal-guidelines.md' -->
14
18
  <!-- /docs -->
@@ -21,9 +21,14 @@ Process:
21
21
 
22
22
  1. Get Issue Number
23
23
 
24
- - Either from branch name use that issue number
25
- - Patterns: issue-123, 123-feature, feature/123, fix/123
26
- - Or from this bullet point with custom info: $ARGUMENTS
24
+ **User arguments:**
25
+
26
+ Issue: $ARGUMENTS
27
+
28
+ **End of user arguments**
29
+
30
+ - Check if argument is an issue number
31
+ - Otherwise try branch name patterns: issue-123, 123-feature, feature/123, fix/123
27
32
  - If not found: ask user
28
33
 
29
34
  2. Fetch Issue
@@ -25,9 +25,11 @@ Generate a complete TDD practice setup:
25
25
  <!-- docs INCLUDE path='src/fragments/no-plan-files.md' featureFlag='no-plan-files' -->
26
26
  <!-- /docs -->
27
27
 
28
- ## Input
28
+ **User arguments:**
29
29
 
30
- $ARGUMENTS
30
+ Kata: $ARGUMENTS
31
+
32
+ **End of user arguments**
31
33
 
32
34
  (This command is interactive - arguments are ignored)
33
35
 
@@ -0,0 +1,168 @@
1
+ ---
2
+ description: Review and address issues in existing code - fix problems or justify skipping
3
+ argument-hint: [branch, PR#, file, or area to polish]
4
+ _hint: Fix or skip issues
5
+ _category: Workflow
6
+ _order: 36
7
+ _requested-tools:
8
+ - Bash(git diff:*)
9
+ - Bash(git status:*)
10
+ - Bash(git log:*)
11
+ - Bash(git rev-parse:*)
12
+ - Bash(git merge-base:*)
13
+ - Bash(git branch:*)
14
+ ---
15
+
16
+ <!-- docs INCLUDE path='src/fragments/universal-guidelines.md' -->
17
+ <!-- /docs -->
18
+
19
+ <!-- docs INCLUDE path='src/fragments/beads-awareness.md' featureFlag='beads' -->
20
+ <!-- /docs -->
21
+
22
+ <!-- docs INCLUDE path='src/fragments/no-plan-files.md' featureFlag='no-plan-files' -->
23
+ <!-- /docs -->
24
+
25
+ # Polish
26
+
27
+ Take another pass at existing work to address issues. Unlike `/code-review` which only identifies problems, `/polish` resolves each finding by either:
28
+
29
+ 1. **Fixing** - Implement the improvement
30
+ 2. **Skipping with justification** - Document why the issue can be deferred or ignored
31
+
32
+ ## Phase 0: Determine Scope
33
+
34
+ Parse the argument to determine what to polish:
35
+
36
+ | Input | Action |
37
+ |-------|--------|
38
+ | No argument | Detect divergence point, review uncommitted + committed changes |
39
+ | Branch name | Changes from that branch to HEAD |
40
+ | PR number (e.g., `123`) | Fetch PR diff from GitHub |
41
+ | PR URL (e.g., `github.com/.../pull/123`) | Extract PR number and fetch diff |
42
+ | File/path | Focus on specific file(s) |
43
+
44
+ **For GitHub PRs:**
45
+
46
+ 1. Try GitHub MCP first: `mcp__github__pull_request_read` with `method: "get_diff"`
47
+ 2. Fall back to `gh` CLI: `gh pr diff <number>`
48
+ 3. If neither works, report error and stop
49
+
50
+ **For local branches:**
51
+
52
+ 1. Get current branch: `git rev-parse --abbrev-ref HEAD`
53
+ 2. Detect divergence point (same logic as `/code-review`)
54
+ 3. Collect changed files from diff and uncommitted changes
55
+
56
+ ## Phase 1: Identify Issues
57
+
58
+ Categorize files based on these patterns:
59
+
60
+ <!-- docs INCLUDE path='src/fragments/file-categories.md' -->
61
+ <!-- /docs -->
62
+
63
+ For each category, identify issues at these severity levels:
64
+
65
+ - **blocker** - Must fix before merge
66
+ - **risky** - Should fix or have strong justification
67
+ - **nit** - Nice to have, easily skippable
68
+
69
+ ## Phase 2: Address Each Issue
70
+
71
+ For each identified issue, present it and then take action:
72
+
73
+ ### Format
74
+
75
+ ```
76
+ ### [file:line] [severity] Title
77
+
78
+ **Issue:** Description of the problem
79
+
80
+ **Action taken:**
81
+ - [ ] Fixed: [what was done]
82
+ - [ ] Skipped: [justification]
83
+ ```
84
+
85
+ ### Decision Guidelines
86
+
87
+ **Fix when:**
88
+
89
+ - Security vulnerability
90
+ - Correctness bug
91
+ - Missing error handling that could crash
92
+ - Breaking API changes without migration
93
+ - Tests that don't actually test anything
94
+
95
+ **Skip with justification when:**
96
+
97
+ - Stylistic preference with no functional impact
98
+ - Optimization for unlikely hot paths
99
+ - Refactoring that would expand scope significantly
100
+ - Issue exists in code outside the change scope
101
+ - Technical debt documented for future sprint
102
+
103
+ ### Fixing Issues
104
+
105
+ When fixing:
106
+
107
+ 1. Make the minimal change to address the issue
108
+ 2. Ensure tests still pass (run them if needed)
109
+ 3. Don't expand scope beyond the identified issue
110
+
111
+ <!-- docs INCLUDE path='src/fragments/peeping-tom-warning.md' -->
112
+ <!-- /docs -->
113
+
114
+ ### Skipping Issues
115
+
116
+ Valid skip justifications:
117
+
118
+ - "Out of scope - exists in unchanged code"
119
+ - "Performance optimization unnecessary - called N times per request"
120
+ - "Tracked for future work - see issue #X"
121
+ - "Intentional design decision - [reason]"
122
+ - "Would require significant refactoring - defer to dedicated PR"
123
+
124
+ Invalid skip justifications:
125
+
126
+ - "Too hard to fix"
127
+ - "It works fine"
128
+ - "No time"
129
+
130
+ ## Phase 3: Cross-Cutting Check
131
+
132
+ After addressing individual issues:
133
+
134
+ <!-- docs INCLUDE path='src/fragments/consistency-check.md' -->
135
+ <!-- /docs -->
136
+
137
+ Additional cross-cutting checks:
138
+
139
+ - Did fixes introduce new inconsistencies?
140
+ - Are skip justifications consistent with each other?
141
+ - Any patterns in what was skipped that suggest a bigger issue?
142
+
143
+ ## Phase 4: Summary
144
+
145
+ ```
146
+ ## Polish Summary
147
+
148
+ ### Fixed
149
+ - [list of fixes applied]
150
+
151
+ ### Skipped (with justification)
152
+ - [issue]: [justification]
153
+
154
+ ### Tests
155
+ - [ ] All tests passing
156
+ - [ ] No new warnings introduced
157
+
158
+ ### Remaining Work
159
+ - [any follow-up items identified]
160
+ ```
161
+
162
+ ---
163
+
164
+ **User arguments:**
165
+
166
+ Polish: $ARGUMENTS
167
+
168
+ **End of user arguments**
package/src/sources/pr.md CHANGED
@@ -27,7 +27,11 @@ Current branch status:
27
27
  Recent commits:
28
28
  !`git log --oneline -5`
29
29
 
30
- Arguments: $ARGUMENTS
30
+ **User arguments:**
31
+
32
+ PR: $ARGUMENTS
33
+
34
+ **End of user arguments**
31
35
 
32
36
  **Process:**
33
37
 
@@ -6,9 +6,13 @@ _category: Test-Driven Development
6
6
  _order: 2
7
7
  ---
8
8
 
9
- RED PHASE! Apply the below to the info given by user input here:
9
+ **User arguments:**
10
10
 
11
- $ARGUMENTS
11
+ Red: $ARGUMENTS
12
+
13
+ **End of user arguments**
14
+
15
+ RED PHASE! Apply the below to the user input above.
12
16
 
13
17
  <!-- docs INCLUDE path='src/fragments/universal-guidelines.md' -->
14
18
  <!-- /docs -->
@@ -6,7 +6,13 @@ _category: Test-Driven Development
6
6
  _order: 4
7
7
  ---
8
8
 
9
- Apply this document (specifically the Refactor phase), to the info given by user input here: $ARGUMENTS
9
+ **User arguments:**
10
+
11
+ Refactor: $ARGUMENTS
12
+
13
+ **End of user arguments**
14
+
15
+ Apply this document (specifically the Refactor phase) to the user input above.
10
16
 
11
17
  <!-- docs INCLUDE path='src/fragments/universal-guidelines.md' -->
12
18
  <!-- /docs -->
@@ -12,7 +12,11 @@ _order: 20
12
12
  <!-- docs INCLUDE path='src/fragments/beads-awareness.md' featureFlag='beads' -->
13
13
  <!-- /docs -->
14
14
 
15
- # Research: $ARGUMENTS
15
+ **User arguments:**
16
+
17
+ Research: $ARGUMENTS
18
+
19
+ **End of user arguments**
16
20
 
17
21
  Research the following problem or question thoroughly, like a senior developer would.
18
22
 
@@ -45,7 +45,11 @@ Current branch status:
45
45
  Recent commits:
46
46
  !`git log --oneline -5`
47
47
 
48
- Arguments: $ARGUMENTS
48
+ **User arguments:**
49
+
50
+ Ship: $ARGUMENTS
51
+
52
+ **End of user arguments**
49
53
 
50
54
  **Process:**
51
55
 
@@ -44,7 +44,11 @@ Current branch status:
44
44
  Recent commits:
45
45
  !`git log --oneline -5`
46
46
 
47
- Arguments: $ARGUMENTS
47
+ **User arguments:**
48
+
49
+ Show: $ARGUMENTS
50
+
51
+ **End of user arguments**
48
52
 
49
53
  **Process:**
50
54
 
@@ -12,7 +12,11 @@ _order: 16
12
12
  <!-- docs INCLUDE path='src/fragments/beads-awareness.md' featureFlag='beads' -->
13
13
  <!-- /docs -->
14
14
 
15
- # Simplify: $ARGUMENTS
15
+ **User arguments:**
16
+
17
+ Simplify: $ARGUMENTS
18
+
19
+ **End of user arguments**
16
20
 
17
21
  <!-- docs INCLUDE path='src/fragments/fallback-arguments.md' -->
18
22
  <!-- /docs -->
@@ -6,9 +6,13 @@ _category: Test-Driven Development
6
6
  _order: 1
7
7
  ---
8
8
 
9
- SPIKE PHASE! Apply the below to the info given by user input here:
9
+ **User arguments:**
10
10
 
11
- $ARGUMENTS
11
+ Spike: $ARGUMENTS
12
+
13
+ **End of user arguments**
14
+
15
+ SPIKE PHASE! Apply the below to the user input above.
12
16
 
13
17
  <!-- docs INCLUDE path='src/fragments/universal-guidelines.md' -->
14
18
  <!-- /docs -->
@@ -17,7 +17,11 @@ _order: 10
17
17
 
18
18
  Create a concise summary of the current conversation suitable for transferring context to a new conversation.
19
19
 
20
- Additional info: $ARGUMENTS
20
+ **User arguments:**
21
+
22
+ Summarize: $ARGUMENTS
23
+
24
+ **End of user arguments**
21
25
 
22
26
  <!-- docs INCLUDE path='src/fragments/summarize-structure.md' -->
23
27
  <!-- /docs -->
@@ -77,4 +77,8 @@ Output a structured report:
77
77
 
78
78
  ---
79
79
 
80
- Test path (leave empty for all tests): $ARGUMENTS
80
+ **User arguments:**
81
+
82
+ TDD-review: $ARGUMENTS
83
+
84
+ **End of user arguments**
@@ -22,6 +22,10 @@ _order: 1
22
22
 
23
23
  ## Continue Conversation
24
24
 
25
- User response to the last message: $ARGUMENTS
25
+ **User arguments:**
26
26
 
27
- Please continue with TDD approach based on the above response.
27
+ TDD: $ARGUMENTS
28
+
29
+ **End of user arguments**
30
+
31
+ Please continue with the user input above, applying TDD approach.
@@ -0,0 +1,186 @@
1
+ ---
2
+ description: Check for dependency upgrades and assess safety before updating
3
+ argument-hint: (no arguments - interactive)
4
+ _hint: Upgrade packages
5
+ _category: Utilities
6
+ _order: 50
7
+ ---
8
+
9
+ <!-- docs INCLUDE path='src/fragments/universal-guidelines.md' -->
10
+ <!-- /docs -->
11
+
12
+ <!-- docs INCLUDE path='src/fragments/beads-awareness.md' featureFlag='beads' -->
13
+ <!-- /docs -->
14
+
15
+ <!-- docs INCLUDE path='src/fragments/no-plan-files.md' featureFlag='no-plan-files' -->
16
+ <!-- /docs -->
17
+
18
+ # Upgrade Dependencies
19
+
20
+ Analyze available dependency upgrades, assess codebase safety signals, and guide the user through upgrade decisions.
21
+
22
+ ## Phase 1: Detect Environment
23
+
24
+ Scan for package manager and project setup:
25
+
26
+ | Check | How |
27
+ |-------|-----|
28
+ | Package manager | Look for `pnpm-lock.yaml`, `yarn.lock`, `package-lock.json`, `bun.lockb` |
29
+ | Lockfile present | Exists and tracked in git |
30
+ | Test script | `package.json` has `test` script |
31
+ | Test files | `*.test.*`, `*.spec.*`, `__tests__/` exist |
32
+ | CI config | `.github/workflows/`, `.gitlab-ci.yml`, etc. |
33
+ | Type checking | `tsconfig.json` or `jsconfig.json` present |
34
+
35
+ Output:
36
+
37
+ ```
38
+ ## Environment
39
+
40
+ Package manager: pnpm
41
+ Lockfile: ✓ pnpm-lock.yaml (tracked)
42
+ Test script: ✓ "vitest run"
43
+ Test files: ✓ 16 test files found
44
+ CI config: ✓ .github/workflows/release.yml
45
+ Types: ✓ tsconfig.json
46
+ ```
47
+
48
+ ## Phase 2: List Available Upgrades
49
+
50
+ Run the appropriate outdated command:
51
+
52
+ | Manager | Command |
53
+ |---------|---------|
54
+ | pnpm | `pnpm outdated --format json` |
55
+ | npm | `npm outdated --json` |
56
+ | yarn | `yarn outdated --json` |
57
+ | bun | `bun outdated` |
58
+
59
+ Group results by semver level:
60
+
61
+ ```
62
+ ## Available Upgrades
63
+
64
+ ### Patch (low risk)
65
+ | Package | Current | Latest | Age |
66
+ |---------|---------|--------|-----|
67
+ | lodash | 4.17.20 | 4.17.21 | 6 months |
68
+
69
+ ### Minor (medium risk)
70
+ | Package | Current | Latest | Age |
71
+ |---------|---------|--------|-----|
72
+ | vitest | 1.5.0 | 1.6.0 | 3 weeks |
73
+
74
+ ### Major (review changelog)
75
+ | Package | Current | Latest | Age |
76
+ |---------|---------|--------|-----|
77
+ | typescript | 4.9.5 | 5.4.2 | 8 months |
78
+ ```
79
+
80
+ Note: "Age" is time since the latest version was published. Packages < 14 days old may pose supply chain risk.
81
+
82
+ ## Phase 3: Safety Assessment
83
+
84
+ Present observable signals (not guarantees):
85
+
86
+ ```
87
+ ## Safety Signals
88
+
89
+ ✓ Test files present (16 files)
90
+ ✓ Test script configured
91
+ ✓ CI pipeline exists
92
+ ✓ Lockfile tracked in git
93
+ ✓ TypeScript for type safety
94
+ ⚠ No pre-commit hooks detected
95
+ ✗ Coverage threshold not configured
96
+
97
+ ──────────────────────────────────────────────────
98
+ ⚠ DISCLAIMER: This is a surface-level check based
99
+ on file presence, not actual test quality or
100
+ coverage. You know your codebase best.
101
+ ──────────────────────────────────────────────────
102
+ ```
103
+
104
+ ## Phase 4: Ask User
105
+
106
+ Use `AskUserQuestion` to determine next steps:
107
+
108
+ **Question: "How would you like to proceed?"** (header: "Upgrade")
109
+
110
+ Options:
111
+ 1. **Patches only** - "Upgrade patch versions (X.Y.Z → X.Y.Z+1), lowest risk"
112
+ 2. **Patches + minors** - "Include minor versions (X.Y → X.Y+1), some API additions"
113
+ 3. **Interactive selection** - "Choose specific packages to upgrade"
114
+ 4. **Doctor mode** - "Test each upgrade individually, keep only working ones (slower but safest)"
115
+ 5. **Just show outdated** - "Don't upgrade, just list what's available"
116
+
117
+ ## Phase 5: Execute Upgrade
118
+
119
+ Based on user selection:
120
+
121
+ ### Patches Only
122
+ ```bash
123
+ # pnpm
124
+ pnpm update --no-save # updates lockfile only for patches within range
125
+
126
+ # or with ncu
127
+ npx npm-check-updates --target patch -u && pnpm install
128
+ ```
129
+
130
+ ### Patches + Minors
131
+ ```bash
132
+ npx npm-check-updates --target minor -u && pnpm install
133
+ ```
134
+
135
+ ### Interactive Selection
136
+ ```bash
137
+ npx npm-check-updates -i
138
+ ```
139
+
140
+ ### Doctor Mode
141
+ ```bash
142
+ npx npm-check-updates --doctor -u
143
+ ```
144
+
145
+ This will:
146
+ 1. Verify tests pass before starting
147
+ 2. Try upgrading all dependencies
148
+ 3. If tests fail, test each dependency individually
149
+ 4. Keep only upgrades that pass tests
150
+
151
+ ### After Any Upgrade
152
+
153
+ 1. Run tests: `pnpm test`
154
+ 2. Run type check if available: `pnpm typecheck`
155
+ 3. Run build if available: `pnpm build`
156
+ 4. Report results to user
157
+
158
+ ## Phase 6: Summary
159
+
160
+ ```
161
+ ## Upgrade Summary
162
+
163
+ ### Upgraded
164
+ - lodash: 4.17.20 → 4.17.21 (patch)
165
+ - vitest: 1.5.0 → 1.6.0 (minor)
166
+
167
+ ### Skipped
168
+ - typescript: 4.9.5 → 5.4.2 (major - user opted out)
169
+
170
+ ### Verification
171
+ - [x] Tests passing
172
+ - [x] Types checking
173
+ - [x] Build successful
174
+
175
+ ### Next Steps
176
+ - Review changelog for skipped major upgrades
177
+ - Consider running full test suite in CI before merging
178
+ ```
179
+
180
+ ---
181
+
182
+ **User arguments:**
183
+
184
+ Upgrade: $ARGUMENTS
185
+
186
+ **End of user arguments**
@@ -17,7 +17,11 @@ _order: 1
17
17
  <!-- docs INCLUDE path='src/fragments/no-plan-files.md' featureFlag='no-plan-files' -->
18
18
  <!-- /docs -->
19
19
 
20
- Create a new git worktree for branch: $ARGUMENTS
20
+ **User arguments:**
21
+
22
+ Worktree-add: $ARGUMENTS
23
+
24
+ **End of user arguments**
21
25
 
22
26
  <current_state>
23
27
  Current branch: `git branch --show-current`
@@ -19,7 +19,11 @@ _order: 2
19
19
 
20
20
  Clean up merged worktrees by finding the oldest merged branch, consolidating settings, and removing stale worktrees.
21
21
 
22
- Additional info: $ARGUMENTS
22
+ **User arguments:**
23
+
24
+ Worktree-cleanup: $ARGUMENTS
25
+
26
+ **End of user arguments**
23
27
 
24
28
  <current_state>
25
29
  Current branch: `git branch --show-current`