@wbern/claude-instructions 1.21.0 → 2.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/README.md +4 -2
- package/bin/cli.js +329 -192
- package/package.json +2 -3
- package/src/README.md +279 -0
- package/src/fragments/aaa-pattern.md +7 -0
- package/src/fragments/beads-awareness.md +1 -0
- package/src/fragments/beads-integration.md +8 -0
- package/{downloads/without-beads/commit.md → src/fragments/commit-process.md} +0 -17
- package/src/fragments/consistency-check.md +1 -0
- package/src/fragments/discovery-phase.md +22 -0
- package/src/fragments/fallback-arguments-beads.md +3 -0
- package/src/fragments/fallback-arguments.md +1 -0
- package/src/fragments/fullwidth-dollar-note.md +1 -0
- package/src/fragments/gap-beads.md +1 -0
- package/src/fragments/git-host-detection.md +19 -0
- package/src/fragments/github-issue-fetch.md +10 -0
- package/src/fragments/peeping-tom-warning.md +9 -0
- package/src/fragments/plan-beads-context-hint.md +1 -0
- package/src/fragments/plan-beads-details.md +49 -0
- package/src/fragments/plan-beads-integration.md +2 -0
- package/src/fragments/summarize-beads.md +8 -0
- package/{downloads/without-beads/summarize.md → src/fragments/summarize-structure.md} +0 -20
- package/{downloads/without-beads/tdd.md → src/fragments/tdd-fundamentals.md} +0 -21
- package/src/fragments/test-quality-criteria.md +24 -0
- package/src/fragments/universal-guidelines.md +6 -0
- package/{downloads/without-beads → src/sources}/add-command.md +11 -25
- package/{downloads/without-beads → src/sources}/ask.md +11 -6
- package/{downloads/without-beads → src/sources}/beepboop.md +7 -6
- package/{downloads/without-beads → src/sources}/busycommit.md +9 -36
- package/{downloads/without-beads → src/sources}/code-review.md +16 -30
- package/src/sources/commit.md +20 -0
- package/src/sources/cycle.md +23 -0
- package/{downloads/without-beads → src/sources}/gap.md +11 -8
- package/src/sources/green.md +23 -0
- package/src/sources/issue.md +42 -0
- package/{downloads/without-beads → src/sources}/kata.md +10 -9
- package/{downloads/without-beads → src/sources}/plan.md +18 -39
- package/{downloads/without-beads → src/sources}/pr.md +10 -6
- package/src/sources/red.md +26 -0
- package/src/sources/refactor.md +27 -0
- package/{downloads/without-beads → src/sources}/ship.md +11 -6
- package/{downloads/without-beads → src/sources}/show.md +11 -6
- package/src/sources/spike.md +23 -0
- package/src/sources/summarize.md +23 -0
- package/{downloads/without-beads → src/sources}/tdd-review.md +11 -31
- package/src/sources/tdd.md +24 -0
- package/{downloads/without-beads → src/sources}/worktree-add.md +13 -31
- package/{downloads/without-beads → src/sources}/worktree-cleanup.md +9 -27
- package/downloads/with-beads/add-command.md +0 -159
- package/downloads/with-beads/ask.md +0 -144
- package/downloads/with-beads/beepboop.md +0 -47
- package/downloads/with-beads/busycommit.md +0 -78
- package/downloads/with-beads/code-review.md +0 -263
- package/downloads/with-beads/commands-metadata.json +0 -155
- package/downloads/with-beads/commit.md +0 -49
- package/downloads/with-beads/cycle.md +0 -95
- package/downloads/with-beads/gap.md +0 -38
- package/downloads/with-beads/green.md +0 -95
- package/downloads/with-beads/issue.md +0 -152
- package/downloads/with-beads/kata.md +0 -444
- package/downloads/with-beads/plan.md +0 -186
- package/downloads/with-beads/pr.md +0 -82
- package/downloads/with-beads/red.md +0 -103
- package/downloads/with-beads/refactor.md +0 -105
- package/downloads/with-beads/ship.md +0 -98
- package/downloads/with-beads/show.md +0 -114
- package/downloads/with-beads/spike.md +0 -95
- package/downloads/with-beads/summarize.md +0 -54
- package/downloads/with-beads/tdd-review.md +0 -102
- package/downloads/with-beads/tdd.md +0 -94
- package/downloads/with-beads/worktree-add.md +0 -357
- package/downloads/with-beads/worktree-cleanup.md +0 -250
- package/downloads/without-beads/commands-metadata.json +0 -155
- package/downloads/without-beads/cycle.md +0 -90
- package/downloads/without-beads/green.md +0 -90
- package/downloads/without-beads/issue.md +0 -140
- package/downloads/without-beads/red.md +0 -98
- package/downloads/without-beads/refactor.md +0 -100
- package/downloads/without-beads/spike.md +0 -90
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wbern/claude-instructions",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "TDD workflow commands for Claude Code CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "./bin/cli.js",
|
|
7
7
|
"files": [
|
|
8
8
|
"bin",
|
|
9
|
-
"
|
|
9
|
+
"src"
|
|
10
10
|
],
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
"author": "wbern",
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"scripts": {
|
|
30
|
-
"clean": "rm -rf downloads",
|
|
31
30
|
"build": "tsx scripts/build.ts",
|
|
32
31
|
"build:cli": "tsup",
|
|
33
32
|
"test:manual": "pnpm build:cli && TMPDIR=$(mktemp -d) && pnpm pack --pack-destination $TMPDIR && cd $TMPDIR && tar -xzf *.tgz && cd package && pnpm i && node bin/cli.js",
|
package/src/README.md
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
# @wbern/claude-instructions
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@wbern/claude-instructions)
|
|
4
|
+
[](https://www.npmjs.com/package/@wbern/claude-instructions)
|
|
5
|
+
[](https://github.com/wbern/claude-instructions/actions/workflows/release.yml)
|
|
6
|
+
[](https://codecov.io/gh/wbern/claude-instructions)
|
|
7
|
+
[](https://opensource.org/licenses/MIT)
|
|
8
|
+
|
|
9
|
+
[](https://claude.ai/code)
|
|
10
|
+
[](https://github.com/wbern/claude-instructions/graphs/contributors)
|
|
11
|
+
[](https://github.com/wbern/claude-instructions/pulls)
|
|
12
|
+
<!-- docs COMMANDS_BADGE -->
|
|
13
|
+
<!-- /docs -->
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
_==/ i i \==_
|
|
17
|
+
/XX/ |\___/| \XX\
|
|
18
|
+
/XXXX\ |XXXXX| /XXXX\
|
|
19
|
+
|XXXXXX\_ _XXXXXXX_ _/XXXXXX|
|
|
20
|
+
XXXXXXXXXXXxxxxxxxXXXXXXXXXXXxxxxxxxXXXXXXXXXXX
|
|
21
|
+
|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX|
|
|
22
|
+
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
|
23
|
+
|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX|
|
|
24
|
+
XXXXXX/^^^^"\XXXXXXXXXXXXXXXXXXXXX/^^^^^\XXXXXX
|
|
25
|
+
|XXX| \XXX/^^\XXXXX/^^\XXX/ |XXX|
|
|
26
|
+
\XX\ \X/ \XXX/ \X/ /XX/
|
|
27
|
+
"\ " \X/ " /"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**TDD workflow commands for Claude Code CLI.**
|
|
31
|
+
|
|
32
|
+
Test-Driven Development (TDD) gives you structure and confidence—a discipline proven by decades of practitioners from Extreme Programming to modern teams. These commands let Claude do the typing while you do the thinking.
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npx @wbern/claude-instructions
|
|
38
|
+
|
|
39
|
+
// or
|
|
40
|
+
|
|
41
|
+
pnpm dlx @wbern/claude-instructions
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The interactive installer lets you choose:
|
|
45
|
+
|
|
46
|
+
- **Variant**: With or without [Beads MCP](https://github.com/steveyegge/beads) integration
|
|
47
|
+
- **Scope**: User-level (global) or project-level installation
|
|
48
|
+
|
|
49
|
+
After installation, restart Claude Code if it's currently running.
|
|
50
|
+
|
|
51
|
+
### Adding to Your Repository
|
|
52
|
+
|
|
53
|
+
To automatically regenerate commands when teammates install dependencies, add it as a dev dependency with a postinstall script:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npm install --save-dev @wbern/claude-instructions
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Then add a postinstall script to your `package.json`:
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"scripts": {
|
|
64
|
+
"postinstall": "npx @wbern/claude-instructions --variant=without-beads --scope=project --prefix="
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"@wbern/claude-instructions": "^1.0.0"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
This ensures commands are regenerated whenever anyone runs `npm install`, `pnpm install`, or `yarn install`.
|
|
73
|
+
|
|
74
|
+
**CLI Options:**
|
|
75
|
+
|
|
76
|
+
<!-- docs CLI_OPTIONS -->
|
|
77
|
+
<!-- /docs -->
|
|
78
|
+
|
|
79
|
+
## Customizing Commands
|
|
80
|
+
|
|
81
|
+
You can inject project-specific instructions into generated commands by adding a `<claude-commands-template>` block to your `CLAUDE.md` or `AGENTS.md` file.
|
|
82
|
+
|
|
83
|
+
### Basic Usage
|
|
84
|
+
|
|
85
|
+
Add this to your project's `CLAUDE.md`:
|
|
86
|
+
|
|
87
|
+
```markdown
|
|
88
|
+
# My Project
|
|
89
|
+
|
|
90
|
+
Other instructions here...
|
|
91
|
+
|
|
92
|
+
<claude-commands-template>
|
|
93
|
+
## Project-Specific Rules
|
|
94
|
+
|
|
95
|
+
- Always use pnpm instead of npm
|
|
96
|
+
- Run tests with `pnpm test`
|
|
97
|
+
</claude-commands-template>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
When you run `npx @wbern/claude-instructions`, the template content is appended to all generated commands.
|
|
101
|
+
|
|
102
|
+
### Targeting Specific Commands
|
|
103
|
+
|
|
104
|
+
Use the `commands` attribute to inject content only into specific commands:
|
|
105
|
+
|
|
106
|
+
```markdown
|
|
107
|
+
<claude-commands-template commands="commit,ask">
|
|
108
|
+
## Git Conventions
|
|
109
|
+
|
|
110
|
+
- Use conventional commits format
|
|
111
|
+
- Reference issue numbers in commits
|
|
112
|
+
</claude-commands-template>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
This injects the content only into `commit.md` and `ask.md`.
|
|
116
|
+
|
|
117
|
+
### File Priority
|
|
118
|
+
|
|
119
|
+
The generator looks for template blocks in this order:
|
|
120
|
+
1. `CLAUDE.md` (checked first)
|
|
121
|
+
2. `AGENTS.md` (fallback)
|
|
122
|
+
|
|
123
|
+
Only the first file found is used.
|
|
124
|
+
|
|
125
|
+
## Which Command Should I Use?
|
|
126
|
+
|
|
127
|
+
### Main Workflow
|
|
128
|
+
|
|
129
|
+
This is the core TDD workflow. Additional utility commands (worktrees, spikes, etc.) are listed in [Available Commands](#available-commands) below.
|
|
130
|
+
|
|
131
|
+
```mermaid
|
|
132
|
+
flowchart TB
|
|
133
|
+
Start([Start New Work])
|
|
134
|
+
|
|
135
|
+
Start --> Step1[<b>1. PLAN</b>]
|
|
136
|
+
|
|
137
|
+
Step1 --> Issue[📋 /issue<br/>Have GitHub issue<br/><i>Requires: GitHub MCP</i>]
|
|
138
|
+
Step1 --> Plan[📝 /plan<br/>No issue yet<br/><i>Optional: Beads MCP</i>]
|
|
139
|
+
|
|
140
|
+
Issue --> Step2[<b>2. CODE with TDD</b>]
|
|
141
|
+
Plan --> Step2
|
|
142
|
+
|
|
143
|
+
Step2 -->|Manual| Red[🔴 /red<br/>Write failing test]
|
|
144
|
+
Red --> Green[🟢 /green<br/>Make it pass]
|
|
145
|
+
Green --> Refactor[🔵 /refactor<br/>Clean up code]
|
|
146
|
+
Refactor --> MoreTests{More tests?}
|
|
147
|
+
|
|
148
|
+
Step2 -->|Automated| Cycle[🔄 /cycle<br/>Runs red+green+refactor]
|
|
149
|
+
Cycle --> MoreTests
|
|
150
|
+
|
|
151
|
+
MoreTests -->|Yes| Step2
|
|
152
|
+
MoreTests -->|No| Step3
|
|
153
|
+
|
|
154
|
+
Step3[<b>3. SHIP</b>]
|
|
155
|
+
|
|
156
|
+
Step3 --> Commit[📦 /commit<br/>Create commit]
|
|
157
|
+
Commit --> ShipChoice{How to<br/>merge?}
|
|
158
|
+
|
|
159
|
+
ShipChoice -->|Simple change| Ship[🚢 /ship<br/>Direct to main<br/><i>Requires: GitHub MCP</i>]
|
|
160
|
+
ShipChoice -->|Show team| Show[👀 /show<br/>Auto-merge + notify<br/><i>Requires: GitHub MCP</i>]
|
|
161
|
+
ShipChoice -->|Needs review| Ask[💬 /ask<br/>Create PR<br/><i>Requires: GitHub MCP</i>]
|
|
162
|
+
|
|
163
|
+
Ship --> Done([✅ Done])
|
|
164
|
+
Show --> Done
|
|
165
|
+
Ask --> Done
|
|
166
|
+
|
|
167
|
+
style Start fill:#e1f5ff
|
|
168
|
+
style Step1 fill:#fff4e6
|
|
169
|
+
style Step2 fill:#e8f5e9
|
|
170
|
+
style Step3 fill:#fce4ec
|
|
171
|
+
style Done fill:#c8e6c9
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## Available Commands
|
|
175
|
+
|
|
176
|
+
<!-- docs COMMANDS_LIST -->
|
|
177
|
+
<!-- /docs -->
|
|
178
|
+
|
|
179
|
+
## Getting Started
|
|
180
|
+
|
|
181
|
+
### Quick Start: Your First TDD Cycle
|
|
182
|
+
|
|
183
|
+
Here's a simple example to get you started with the TDD workflow:
|
|
184
|
+
|
|
185
|
+
**1. Write a failing test (`/red`)**
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
You: /red add a function that validates email addresses
|
|
189
|
+
|
|
190
|
+
Claude: I'll write a failing test for email validation.
|
|
191
|
+
[Creates test file with a test that checks email validation]
|
|
192
|
+
[Runs test - shows it failing because function doesn't exist yet]
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**2. Make it pass (`/green`)**
|
|
196
|
+
|
|
197
|
+
```
|
|
198
|
+
You: /green
|
|
199
|
+
|
|
200
|
+
Claude: I'll implement the minimal code to pass the test.
|
|
201
|
+
[Creates the email validation function with basic implementation]
|
|
202
|
+
[Runs test - shows it passing]
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
**3. Refactor for quality (`/refactor`)**
|
|
206
|
+
|
|
207
|
+
```
|
|
208
|
+
You: /refactor extract regex pattern to a constant
|
|
209
|
+
|
|
210
|
+
Claude: I'll refactor while keeping tests green.
|
|
211
|
+
[Extracts magic values, improves code structure]
|
|
212
|
+
[Runs tests - confirms they still pass]
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Complete Workflow Example
|
|
216
|
+
|
|
217
|
+
**Starting from a GitHub issue:**
|
|
218
|
+
|
|
219
|
+
```
|
|
220
|
+
/issue 123
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Claude analyzes the GitHub issue and creates a TDD implementation plan showing what tests to write.
|
|
224
|
+
|
|
225
|
+
**Running a full TDD cycle:**
|
|
226
|
+
|
|
227
|
+
```
|
|
228
|
+
/cycle implement user authentication with password hashing
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Claude executes the complete red-green-refactor cycle: writes a failing test, implements it, then refactors.
|
|
232
|
+
|
|
233
|
+
**Individual phases for more control:**
|
|
234
|
+
|
|
235
|
+
```
|
|
236
|
+
/red test that users can't login with wrong password
|
|
237
|
+
/green
|
|
238
|
+
/refactor move password verification to separate function
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
**Committing and creating PRs:**
|
|
242
|
+
|
|
243
|
+
```
|
|
244
|
+
/commit
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Claude reviews changes, drafts a commit message following project standards, and creates the commit.
|
|
248
|
+
|
|
249
|
+
```
|
|
250
|
+
/ask
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
Claude analyzes commits, creates a PR with summary and test plan.
|
|
254
|
+
|
|
255
|
+
### What to Expect
|
|
256
|
+
|
|
257
|
+
- **`/red`** - Claude writes ONE failing test based on your description
|
|
258
|
+
- **`/green`** - Claude writes minimal implementation to pass the current failing test
|
|
259
|
+
- **`/refactor`** - Claude improves code structure without changing behavior
|
|
260
|
+
- **`/cycle`** - Claude runs all three phases in sequence for a complete feature
|
|
261
|
+
|
|
262
|
+
The commands enforce TDD discipline: you can't refactor with failing tests, can't write multiple tests at once, and implementation must match test requirements.
|
|
263
|
+
|
|
264
|
+
## Example Conversations
|
|
265
|
+
|
|
266
|
+
<!-- docs EXAMPLE_CONVERSATIONS -->
|
|
267
|
+
<!-- /docs -->
|
|
268
|
+
|
|
269
|
+
## Contributing
|
|
270
|
+
|
|
271
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development workflow, build system, and fragment management.
|
|
272
|
+
|
|
273
|
+
## Credits
|
|
274
|
+
|
|
275
|
+
TDD workflow instructions adapted from [TDD Guard](https://github.com/nizos/tdd-guard) by Nizar.
|
|
276
|
+
|
|
277
|
+
FIRST principles and test quality criteria from [TDD Manifesto](https://tddmanifesto.com/).
|
|
278
|
+
|
|
279
|
+
Example kata from [Cyber-Dojo](https://cyber-dojo.org/).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Beads is available for task tracking. Use `mcp__beads__*` tools to manage issues (the user interacts via `bd` commands).
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Create a git commit following project standards
|
|
3
|
-
argument-hint: [optional-commit-description]
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
## General Guidelines
|
|
7
|
-
|
|
8
|
-
### Output Style
|
|
9
|
-
|
|
10
|
-
- **Never explicitly mention TDD** in code, comments, commits, PRs, or issues
|
|
11
|
-
- Write natural, descriptive code without meta-commentary about the development process
|
|
12
|
-
- The code should speak for itself - TDD is the process, not the product
|
|
13
|
-
|
|
14
|
-
Create a git commit following project standards
|
|
15
|
-
|
|
16
|
-
Include any of the following info if specified: $ARGUMENTS
|
|
17
|
-
|
|
18
1
|
## Commit Message Rules
|
|
19
2
|
|
|
20
3
|
Follows [Conventional Commits](https://www.conventionalcommits.org/) standard.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
8. **Consistency check** - Look for inconsistent patterns, naming conventions, or structure across the codebase
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
## Discovery Phase
|
|
2
|
+
|
|
3
|
+
Understand the requirement by asking (use AskUserQuestion if needed):
|
|
4
|
+
|
|
5
|
+
**Problem Statement**
|
|
6
|
+
- What problem does this solve?
|
|
7
|
+
- Who experiences this problem?
|
|
8
|
+
- What's the current pain point?
|
|
9
|
+
|
|
10
|
+
**Desired Outcome**
|
|
11
|
+
- What should happen after this is built?
|
|
12
|
+
- How will users interact with it?
|
|
13
|
+
- What does success look like?
|
|
14
|
+
|
|
15
|
+
**Scope & Constraints**
|
|
16
|
+
- What's in scope vs. out of scope?
|
|
17
|
+
- Any technical constraints?
|
|
18
|
+
- Dependencies on other systems/features?
|
|
19
|
+
|
|
20
|
+
**Context Check**
|
|
21
|
+
- Search codebase for related features/modules
|
|
22
|
+
- Check for existing test files that might be relevant
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(If there was no info above, fallback to the context of the conversation)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
**Note for AI**: The example below uses a fullwidth dollar sign ($, U+FF04) to prevent interpolation in this documentation. When creating actual commands, use the regular `$` character.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4. **Open issues** - Beads issues that are still open or in progress
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<detect_provider>
|
|
2
|
+
<check_remote_url>git remote get-url origin</check_remote_url>
|
|
3
|
+
<identify_host>
|
|
4
|
+
- github.com → GitHub
|
|
5
|
+
- gitlab.com → GitLab
|
|
6
|
+
- bitbucket.org → Bitbucket
|
|
7
|
+
- Other → Ask user
|
|
8
|
+
</identify_host>
|
|
9
|
+
</detect_provider>
|
|
10
|
+
<check_available_tools>
|
|
11
|
+
<list_mcp_servers>Check which git-hosting MCP servers are available (github, gitlab, etc.)</list_mcp_servers>
|
|
12
|
+
<check_cli>Check if gh/glab CLI is available as fallback</check_cli>
|
|
13
|
+
</check_available_tools>
|
|
14
|
+
<select_tool>
|
|
15
|
+
<if_single_mcp>If only one relevant MCP available, confirm with user</if_single_mcp>
|
|
16
|
+
<if_multiple>Let user choose which tool to use</if_multiple>
|
|
17
|
+
<if_told_earlier>If user specified tool earlier in conversation, use that without asking again</if_told_earlier>
|
|
18
|
+
<store_as>$GIT_HOST_TOOL (e.g., "github_mcp", "gitlab_mcp", "gh_cli")</store_as>
|
|
19
|
+
</select_tool>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Try to fetch the issue using GitHub MCP (mcp__github__issue_read tool).
|
|
2
|
+
|
|
3
|
+
If GitHub MCP is not configured, show:
|
|
4
|
+
```
|
|
5
|
+
GitHub MCP not configured!
|
|
6
|
+
See: https://github.com/modelcontextprotocol/servers/tree/main/src/github
|
|
7
|
+
Trying GitHub CLI fallback...
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Then try using `gh issue view [ISSUE_NUMBER] --json` as fallback.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
### Watch for Brittle Tests
|
|
2
|
+
|
|
3
|
+
When refactoring implementation, watch for **Peeping Tom** tests that:
|
|
4
|
+
|
|
5
|
+
- Test private methods or internal state directly
|
|
6
|
+
- Assert on implementation details rather than behavior
|
|
7
|
+
- Break on any refactoring even when behavior is preserved
|
|
8
|
+
|
|
9
|
+
If tests fail after a pure refactoring (no behavior change), consider whether the tests are testing implementation rather than behavior.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
or run `bd ready` to see existing work
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
### Create Beads Issues
|
|
2
|
+
|
|
3
|
+
For each task, create a bd issue with:
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
bd create "Task title" \
|
|
7
|
+
--type [feature|bug|task|chore] \
|
|
8
|
+
--priority [1-3] \
|
|
9
|
+
--description "Context and what needs to be built" \
|
|
10
|
+
--design "Technical approach, architecture notes" \
|
|
11
|
+
--acceptance "Given-When-Then acceptance criteria"
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
**Issue Structure Best Practices:**
|
|
15
|
+
|
|
16
|
+
**Title**: Action-oriented, specific
|
|
17
|
+
- ✅ "Add JWT token validation middleware"
|
|
18
|
+
- ❌ "Authentication stuff"
|
|
19
|
+
|
|
20
|
+
**Description**: Provide context
|
|
21
|
+
- Why this task exists
|
|
22
|
+
- How it fits into the larger feature
|
|
23
|
+
- Links to related issues/docs
|
|
24
|
+
|
|
25
|
+
**Design**: Technical approach
|
|
26
|
+
- Key interfaces/types needed
|
|
27
|
+
- Algorithm or approach
|
|
28
|
+
- Libraries or patterns to use
|
|
29
|
+
- Known gotchas or considerations
|
|
30
|
+
|
|
31
|
+
**Acceptance Criteria**: Test-ready scenarios
|
|
32
|
+
- Given-When-Then format
|
|
33
|
+
- Concrete, verifiable conditions
|
|
34
|
+
- Cover main case + edge cases
|
|
35
|
+
- Map 1:1 to future tests
|
|
36
|
+
|
|
37
|
+
**Dependencies**: Link related issues
|
|
38
|
+
```bash
|
|
39
|
+
bd dep add ISSUE-123 ISSUE-456 --type blocks
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Validation
|
|
43
|
+
|
|
44
|
+
After creating issues, verify:
|
|
45
|
+
- ✅ Each issue has clear acceptance criteria
|
|
46
|
+
- ✅ Dependencies are mapped (use `bd dep add`)
|
|
47
|
+
- ✅ Issues are ordered by implementation sequence
|
|
48
|
+
- ✅ First few issues are ready to start (`bd ready` shows them)
|
|
49
|
+
- ✅ Each issue is small enough for TDD (if too big, break down more)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
## Beads Integration
|
|
2
|
+
|
|
3
|
+
If Beads MCP is available, check for task tracking status and ask if the user wants to:
|
|
4
|
+
1. Review current task status
|
|
5
|
+
2. Update task states based on conversation progress
|
|
6
|
+
3. Include Beads context in the summary
|
|
7
|
+
|
|
8
|
+
Use AskUserQuestion to confirm Beads integration preferences.
|
|
@@ -1,38 +1,18 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Summarize conversation progress and next steps
|
|
3
|
-
argument-hint: [optional additional info]
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
## General Guidelines
|
|
7
|
-
|
|
8
|
-
### Output Style
|
|
9
|
-
|
|
10
|
-
- **Never explicitly mention TDD** in code, comments, commits, PRs, or issues
|
|
11
|
-
- Write natural, descriptive code without meta-commentary about the development process
|
|
12
|
-
- The code should speak for itself - TDD is the process, not the product
|
|
13
|
-
|
|
14
|
-
Create a concise summary of the current conversation suitable for transferring context to a new conversation.
|
|
15
|
-
|
|
16
|
-
Additional info: $ARGUMENTS
|
|
17
|
-
|
|
18
1
|
## Summary Structure
|
|
19
2
|
|
|
20
3
|
Provide a summary with these sections:
|
|
21
4
|
|
|
22
5
|
### What We Did
|
|
23
|
-
|
|
24
6
|
- Key accomplishments and changes made
|
|
25
7
|
- Important decisions or discoveries
|
|
26
8
|
- Files created, modified, or analyzed
|
|
27
9
|
|
|
28
10
|
### What We're Doing Next
|
|
29
|
-
|
|
30
11
|
- Immediate next steps
|
|
31
12
|
- Pending tasks or work in progress
|
|
32
13
|
- Goals or objectives to continue
|
|
33
14
|
|
|
34
15
|
### Blockers & User Input Needed
|
|
35
|
-
|
|
36
16
|
- Any issues requiring user intervention
|
|
37
17
|
- Decisions that need to be made
|
|
38
18
|
- Missing information or clarifications needed
|
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Remind agent about TDD approach and continue conversation
|
|
3
|
-
argument-hint: [optional-response-to-last-message]
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# TDD Reminder
|
|
7
|
-
|
|
8
|
-
## General Guidelines
|
|
9
|
-
|
|
10
|
-
### Output Style
|
|
11
|
-
|
|
12
|
-
- **Never explicitly mention TDD** in code, comments, commits, PRs, or issues
|
|
13
|
-
- Write natural, descriptive code without meta-commentary about the development process
|
|
14
|
-
- The code should speak for itself - TDD is the process, not the product
|
|
15
|
-
|
|
16
1
|
## TDD Fundamentals
|
|
17
2
|
|
|
18
3
|
### The TDD Cycle
|
|
@@ -84,9 +69,3 @@ This phase is **not part of the regular TDD workflow** and must only be applied
|
|
|
84
69
|
- In the refactor phase, it is perfectly fine to refactor both test and implementation code. That said, completely new functionality is not allowed. Types, clean up, abstractions, and helpers are allowed as long as they do not introduce new behavior.
|
|
85
70
|
- Adding types, interfaces, or a constant in order to replace magic values is perfectly fine during refactoring.
|
|
86
71
|
- Provide the agent with helpful directions so that they do not get stuck when blocking them.
|
|
87
|
-
|
|
88
|
-
## Continue Conversation
|
|
89
|
-
|
|
90
|
-
User response to the last message: $ARGUMENTS
|
|
91
|
-
|
|
92
|
-
Please continue with TDD approach based on the above response.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#### FIRST Principles
|
|
2
|
+
|
|
3
|
+
| Principle | What to Check |
|
|
4
|
+
|-----------|---------------|
|
|
5
|
+
| **Fast** | Tests complete quickly, no I/O, no network calls, no sleep()/setTimeout delays |
|
|
6
|
+
| **Independent** | No shared mutable state, no execution order dependencies between tests |
|
|
7
|
+
| **Repeatable** | No Date.now(), no Math.random() without seeding, no external service dependencies |
|
|
8
|
+
| **Self-validating** | Meaningful assertions that verify behavior, no manual verification needed |
|
|
9
|
+
|
|
10
|
+
#### TDD Anti-patterns
|
|
11
|
+
|
|
12
|
+
| Anti-pattern | Detection Signals |
|
|
13
|
+
|--------------|-------------------|
|
|
14
|
+
| **The Liar** | `expect(true).toBe(true)`, empty test bodies, tests with no assertions |
|
|
15
|
+
| **Excessive Setup** | >20 lines of arrange code, >5 mocks, deep nested object construction |
|
|
16
|
+
| **The One** | >5 assertions testing unrelated behaviors in a single test |
|
|
17
|
+
| **The Peeping Tom** | Testing private methods, asserting on internal state, tests that break on any refactor |
|
|
18
|
+
| **The Slow Poke** | Real database/network calls, file I/O, hard-coded timeouts |
|
|
19
|
+
|
|
20
|
+
#### Test Structure (AAA Pattern)
|
|
21
|
+
|
|
22
|
+
- **Arrange**: Clear setup with minimal fixtures
|
|
23
|
+
- **Act**: Single action being tested
|
|
24
|
+
- **Assert**: Specific, behavior-focused assertions
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
## General Guidelines
|
|
2
|
+
|
|
3
|
+
### Output Style
|
|
4
|
+
- **Never explicitly mention TDD** in code, comments, commits, PRs, or issues
|
|
5
|
+
- Write natural, descriptive code without meta-commentary about the development process
|
|
6
|
+
- The code should speak for itself - TDD is the process, not the product
|