@wbern/claude-instructions 1.0.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 +411 -0
- package/bin/cli.js +99 -0
- package/downloads/with-beads/add-command.md +130 -0
- package/downloads/with-beads/ask.md +134 -0
- package/downloads/with-beads/beepboop.md +54 -0
- package/downloads/with-beads/commit.md +47 -0
- package/downloads/with-beads/cycle.md +89 -0
- package/downloads/with-beads/green.md +89 -0
- package/downloads/with-beads/issue.md +141 -0
- package/downloads/with-beads/plan.md +167 -0
- package/downloads/with-beads/red.md +85 -0
- package/downloads/with-beads/refactor.md +87 -0
- package/downloads/with-beads/ship.md +93 -0
- package/downloads/with-beads/show.md +107 -0
- package/downloads/with-beads/spike.md +89 -0
- package/downloads/with-beads/summarize.md +38 -0
- package/downloads/with-beads/tdd.md +89 -0
- package/downloads/with-beads/worktree-add.md +262 -0
- package/downloads/with-beads/worktree-cleanup.md +226 -0
- package/downloads/without-beads/add-command.md +130 -0
- package/downloads/without-beads/ask.md +126 -0
- package/downloads/without-beads/beepboop.md +46 -0
- package/downloads/without-beads/commit.md +47 -0
- package/downloads/without-beads/cycle.md +89 -0
- package/downloads/without-beads/green.md +89 -0
- package/downloads/without-beads/issue.md +133 -0
- package/downloads/without-beads/plan.md +107 -0
- package/downloads/without-beads/red.md +85 -0
- package/downloads/without-beads/refactor.md +87 -0
- package/downloads/without-beads/ship.md +85 -0
- package/downloads/without-beads/show.md +99 -0
- package/downloads/without-beads/spike.md +89 -0
- package/downloads/without-beads/summarize.md +30 -0
- package/downloads/without-beads/tdd.md +89 -0
- package/downloads/without-beads/worktree-add.md +262 -0
- package/downloads/without-beads/worktree-cleanup.md +226 -0
- package/package.json +65 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
---
|
|
2
|
+
allowed-tools: Read, Glob, Grep, Task, AskUserQuestion, mcp__github__issue_read, mcp__github__search_issues
|
|
3
|
+
description: Create implementation plan from feature/requirement with PRD-style discovery and TDD acceptance criteria
|
|
4
|
+
argument-hint: <feature/requirement description or GitHub issue URL/number>
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Plan: PRD-Informed Task Planning for TDD
|
|
8
|
+
|
|
9
|
+
Create structured implementation plan that bridges product thinking (PRD) with test-driven development.
|
|
10
|
+
|
|
11
|
+
## General Guidelines
|
|
12
|
+
|
|
13
|
+
### Output Style
|
|
14
|
+
- **Never explicitly mention TDD** in code, comments, commits, PRs, or issues
|
|
15
|
+
- Write natural, descriptive code without meta-commentary about the development process
|
|
16
|
+
- The code should speak for itself - TDD is the process, not the product
|
|
17
|
+
|
|
18
|
+
## Input
|
|
19
|
+
|
|
20
|
+
$ARGUMENTS
|
|
21
|
+
|
|
22
|
+
(If no input provided, check conversation context)
|
|
23
|
+
|
|
24
|
+
## Input Processing
|
|
25
|
+
|
|
26
|
+
The input can be one of:
|
|
27
|
+
1. **GitHub Issue URL** (e.g., `https://github.com/owner/repo/issues/123`)
|
|
28
|
+
2. **GitHub Issue Number** (e.g., `#123` or `123`)
|
|
29
|
+
3. **Feature Description** (e.g., "Add user authentication")
|
|
30
|
+
4. **Empty** - use conversation context
|
|
31
|
+
|
|
32
|
+
### GitHub Issue Integration
|
|
33
|
+
|
|
34
|
+
If input looks like a GitHub issue:
|
|
35
|
+
|
|
36
|
+
**Step 1: Extract Issue Number**
|
|
37
|
+
- From URL: extract owner/repo/number
|
|
38
|
+
- From number: try to infer repo from git remote
|
|
39
|
+
- From branch name: check patterns like `issue-123`, `123-feature`, `feature/123`
|
|
40
|
+
|
|
41
|
+
**Step 2: Fetch Issue**
|
|
42
|
+
Try GitHub MCP first:
|
|
43
|
+
- If available: use `mcp__github__issue_read` to fetch issue details
|
|
44
|
+
- If not available: show message and try `gh issue view <number>`
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
GitHub MCP not configured!
|
|
48
|
+
See: https://github.com/modelcontextprotocol/servers/tree/main/src/github
|
|
49
|
+
Trying GitHub CLI fallback...
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Step 3: Use Issue as Discovery Input**
|
|
53
|
+
- Title → Feature name
|
|
54
|
+
- Description → Problem statement and context
|
|
55
|
+
- Labels → Type/priority hints
|
|
56
|
+
- Comments → Additional requirements and discussion
|
|
57
|
+
- Linked issues → Dependencies
|
|
58
|
+
|
|
59
|
+
Extract from GitHub issue:
|
|
60
|
+
- Problem statement and context
|
|
61
|
+
- Acceptance criteria (if present)
|
|
62
|
+
- Technical notes (if present)
|
|
63
|
+
- Related issues/dependencies
|
|
64
|
+
|
|
65
|
+
## Process
|
|
66
|
+
|
|
67
|
+
## Discovery Phase
|
|
68
|
+
|
|
69
|
+
Understand the requirement by asking (use AskUserQuestion if needed):
|
|
70
|
+
|
|
71
|
+
**Problem Statement**
|
|
72
|
+
- What problem does this solve?
|
|
73
|
+
- Who experiences this problem?
|
|
74
|
+
- What's the current pain point?
|
|
75
|
+
|
|
76
|
+
**Desired Outcome**
|
|
77
|
+
- What should happen after this is built?
|
|
78
|
+
- How will users interact with it?
|
|
79
|
+
- What does success look like?
|
|
80
|
+
|
|
81
|
+
**Scope & Constraints**
|
|
82
|
+
- What's in scope vs. out of scope?
|
|
83
|
+
- Any technical constraints?
|
|
84
|
+
- Dependencies on other systems/features?
|
|
85
|
+
|
|
86
|
+
**Context Check**
|
|
87
|
+
- Search codebase for related features/modules
|
|
88
|
+
- Check for existing test files that might be relevant
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
## Key Principles
|
|
92
|
+
|
|
93
|
+
**From PRD World:**
|
|
94
|
+
- Start with user problems, not solutions
|
|
95
|
+
- Define success criteria upfront
|
|
96
|
+
- Understand constraints and scope
|
|
97
|
+
|
|
98
|
+
**From TDD World:**
|
|
99
|
+
- Make acceptance criteria test-ready
|
|
100
|
+
- Break work into small, testable pieces
|
|
101
|
+
- Each task should map to test(s)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
## Integration with Other Commands
|
|
105
|
+
|
|
106
|
+
- **Before /plan**: Use `/spike` if you need technical exploration first
|
|
107
|
+
- **After /plan**: Use `/red` to start TDD on first task
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Execute TDD Red Phase - write ONE failing test
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
RED PHASE! Apply the below to the info given by user input here:
|
|
6
|
+
|
|
7
|
+
$ARGUMENTS
|
|
8
|
+
|
|
9
|
+
(If there was no info above, use info from the current context of conversation. If there was not enough info, ask for it.)
|
|
10
|
+
|
|
11
|
+
## General Guidelines
|
|
12
|
+
|
|
13
|
+
### Output Style
|
|
14
|
+
- **Never explicitly mention TDD** in code, comments, commits, PRs, or issues
|
|
15
|
+
- Write natural, descriptive code without meta-commentary about the development process
|
|
16
|
+
- The code should speak for itself - TDD is the process, not the product
|
|
17
|
+
|
|
18
|
+
## TDD Fundamentals
|
|
19
|
+
|
|
20
|
+
### The TDD Cycle
|
|
21
|
+
|
|
22
|
+
The foundation of TDD is the Red-Green-Refactor cycle:
|
|
23
|
+
|
|
24
|
+
1. **Red Phase**: Write ONE failing test that describes desired behavior
|
|
25
|
+
|
|
26
|
+
- The test must fail for the RIGHT reason (not syntax/import errors)
|
|
27
|
+
- Only one test at a time - this is critical for TDD discipline
|
|
28
|
+
- **Adding a single test to a test file is ALWAYS allowed** - no prior test output needed
|
|
29
|
+
- Starting TDD for a new feature is always valid, even if test output shows unrelated work
|
|
30
|
+
|
|
31
|
+
2. **Green Phase**: Write MINIMAL code to make the test pass
|
|
32
|
+
|
|
33
|
+
- Implement only what's needed for the current failing test
|
|
34
|
+
- No anticipatory coding or extra features
|
|
35
|
+
- Address the specific failure message
|
|
36
|
+
|
|
37
|
+
3. **Refactor Phase**: Improve code structure while keeping tests green
|
|
38
|
+
- Only allowed when relevant tests are passing
|
|
39
|
+
- Requires proof that tests have been run and are green
|
|
40
|
+
- Applies to BOTH implementation and test code
|
|
41
|
+
- No refactoring with failing tests - fix them first
|
|
42
|
+
|
|
43
|
+
### Core Violations
|
|
44
|
+
|
|
45
|
+
1. **Multiple Test Addition**
|
|
46
|
+
|
|
47
|
+
- Adding more than one new test at once
|
|
48
|
+
- Exception: Initial test file setup or extracting shared test utilities
|
|
49
|
+
|
|
50
|
+
2. **Over-Implementation**
|
|
51
|
+
|
|
52
|
+
- Code that exceeds what's needed to pass the current failing test
|
|
53
|
+
- Adding untested features, methods, or error handling
|
|
54
|
+
- Implementing multiple methods when test only requires one
|
|
55
|
+
|
|
56
|
+
3. **Premature Implementation**
|
|
57
|
+
- Adding implementation before a test exists and fails properly
|
|
58
|
+
- Adding implementation without running the test first
|
|
59
|
+
- Refactoring when tests haven't been run or are failing
|
|
60
|
+
|
|
61
|
+
### Critical Principle: Incremental Development
|
|
62
|
+
|
|
63
|
+
Each step in TDD should address ONE specific issue:
|
|
64
|
+
|
|
65
|
+
- Test fails "not defined" → Create empty stub/class only
|
|
66
|
+
- Test fails "not a function" → Add method stub only
|
|
67
|
+
- Test fails with assertion → Implement minimal logic only
|
|
68
|
+
|
|
69
|
+
### Optional Pre-Phase: Spike Phase
|
|
70
|
+
|
|
71
|
+
In rare cases where the problem space, interface, or expected behavior is unclear, a **Spike Phase** may be used **before the Red Phase**.
|
|
72
|
+
This phase is **not part of the regular TDD workflow** and must only be applied under exceptional circumstances.
|
|
73
|
+
|
|
74
|
+
- The goal of a Spike is **exploration and learning**, not implementation.
|
|
75
|
+
- The code written during a Spike is **disposable** and **must not** be merged or reused directly.
|
|
76
|
+
- Once sufficient understanding is achieved, all spike code is discarded, and normal TDD resumes starting from the **Red Phase**.
|
|
77
|
+
- A Spike is justified only when it is impossible to define a meaningful failing test due to technical uncertainty or unknown system behavior.
|
|
78
|
+
|
|
79
|
+
### General Information
|
|
80
|
+
|
|
81
|
+
- Sometimes the test output shows as no tests have been run when a new test is failing due to a missing import or constructor. In such cases, allow the agent to create simple stubs. Ask them if they forgot to create a stub if they are stuck.
|
|
82
|
+
- It is never allowed to introduce new logic without evidence of relevant failing tests. However, stubs and simple implementation to make imports and test infrastructure work is fine.
|
|
83
|
+
- 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.
|
|
84
|
+
- Adding types, interfaces, or a constant in order to replace magic values is perfectly fine during refactoring.
|
|
85
|
+
- Provide the agent with helpful directions so that they do not get stuck when blocking them.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
allowed-tools: Read, Glob, Grep, Bash(pnpm test:*), Bash(pnpm:*)
|
|
3
|
+
description: Execute TDD Refactor Phase - improve code structure while keeping tests green
|
|
4
|
+
argument-hint: <refactoring description>
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Apply this document (specifically the Refactor phase), to the info given by user input here: $ARGUMENTS
|
|
8
|
+
|
|
9
|
+
## General Guidelines
|
|
10
|
+
|
|
11
|
+
### Output Style
|
|
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
|
+
(If there was no info above, fallback to:
|
|
17
|
+
1. Context of the conversation, if there's an immediate thing
|
|
18
|
+
2. `bd ready` to see what to work on next and start from there)
|
|
19
|
+
|
|
20
|
+
## TDD Fundamentals
|
|
21
|
+
|
|
22
|
+
### The TDD Cycle
|
|
23
|
+
|
|
24
|
+
The foundation of TDD is the Red-Green-Refactor cycle:
|
|
25
|
+
|
|
26
|
+
1. **Red Phase**: Write ONE failing test that describes desired behavior
|
|
27
|
+
|
|
28
|
+
- The test must fail for the RIGHT reason (not syntax/import errors)
|
|
29
|
+
- Only one test at a time - this is critical for TDD discipline
|
|
30
|
+
- **Adding a single test to a test file is ALWAYS allowed** - no prior test output needed
|
|
31
|
+
- Starting TDD for a new feature is always valid, even if test output shows unrelated work
|
|
32
|
+
|
|
33
|
+
2. **Green Phase**: Write MINIMAL code to make the test pass
|
|
34
|
+
|
|
35
|
+
- Implement only what's needed for the current failing test
|
|
36
|
+
- No anticipatory coding or extra features
|
|
37
|
+
- Address the specific failure message
|
|
38
|
+
|
|
39
|
+
3. **Refactor Phase**: Improve code structure while keeping tests green
|
|
40
|
+
- Only allowed when relevant tests are passing
|
|
41
|
+
- Requires proof that tests have been run and are green
|
|
42
|
+
- Applies to BOTH implementation and test code
|
|
43
|
+
- No refactoring with failing tests - fix them first
|
|
44
|
+
|
|
45
|
+
### Core Violations
|
|
46
|
+
|
|
47
|
+
1. **Multiple Test Addition**
|
|
48
|
+
|
|
49
|
+
- Adding more than one new test at once
|
|
50
|
+
- Exception: Initial test file setup or extracting shared test utilities
|
|
51
|
+
|
|
52
|
+
2. **Over-Implementation**
|
|
53
|
+
|
|
54
|
+
- Code that exceeds what's needed to pass the current failing test
|
|
55
|
+
- Adding untested features, methods, or error handling
|
|
56
|
+
- Implementing multiple methods when test only requires one
|
|
57
|
+
|
|
58
|
+
3. **Premature Implementation**
|
|
59
|
+
- Adding implementation before a test exists and fails properly
|
|
60
|
+
- Adding implementation without running the test first
|
|
61
|
+
- Refactoring when tests haven't been run or are failing
|
|
62
|
+
|
|
63
|
+
### Critical Principle: Incremental Development
|
|
64
|
+
|
|
65
|
+
Each step in TDD should address ONE specific issue:
|
|
66
|
+
|
|
67
|
+
- Test fails "not defined" → Create empty stub/class only
|
|
68
|
+
- Test fails "not a function" → Add method stub only
|
|
69
|
+
- Test fails with assertion → Implement minimal logic only
|
|
70
|
+
|
|
71
|
+
### Optional Pre-Phase: Spike Phase
|
|
72
|
+
|
|
73
|
+
In rare cases where the problem space, interface, or expected behavior is unclear, a **Spike Phase** may be used **before the Red Phase**.
|
|
74
|
+
This phase is **not part of the regular TDD workflow** and must only be applied under exceptional circumstances.
|
|
75
|
+
|
|
76
|
+
- The goal of a Spike is **exploration and learning**, not implementation.
|
|
77
|
+
- The code written during a Spike is **disposable** and **must not** be merged or reused directly.
|
|
78
|
+
- Once sufficient understanding is achieved, all spike code is discarded, and normal TDD resumes starting from the **Red Phase**.
|
|
79
|
+
- A Spike is justified only when it is impossible to define a meaningful failing test due to technical uncertainty or unknown system behavior.
|
|
80
|
+
|
|
81
|
+
### General Information
|
|
82
|
+
|
|
83
|
+
- Sometimes the test output shows as no tests have been run when a new test is failing due to a missing import or constructor. In such cases, allow the agent to create simple stubs. Ask them if they forgot to create a stub if they are stuck.
|
|
84
|
+
- It is never allowed to introduce new logic without evidence of relevant failing tests. However, stubs and simple implementation to make imports and test infrastructure work is fine.
|
|
85
|
+
- 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.
|
|
86
|
+
- Adding types, interfaces, or a constant in order to replace magic values is perfectly fine during refactoring.
|
|
87
|
+
- Provide the agent with helpful directions so that they do not get stuck when blocking them.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
allowed-tools: mcp__github__*, Bash(git:*)
|
|
3
|
+
description: Ship code directly to main - for small, obvious changes that don't need review (Cursor's modern alternative to PRs)
|
|
4
|
+
argument-hint: [optional-commit-message]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Ship - Direct Merge to Main
|
|
8
|
+
|
|
9
|
+
## General Guidelines
|
|
10
|
+
|
|
11
|
+
### Output Style
|
|
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
|
+
**Ship/Show/Ask Pattern - SHIP**
|
|
17
|
+
|
|
18
|
+
> 🎯 **Cursor says**: It's 2025! Not everything needs a PR. Ship small, obvious changes directly.
|
|
19
|
+
|
|
20
|
+
Ship is for small, obvious changes that don't need code review. Examples:
|
|
21
|
+
- Typo fixes
|
|
22
|
+
- Formatting changes
|
|
23
|
+
- Documentation updates
|
|
24
|
+
- Obvious bug fixes
|
|
25
|
+
- Dependency updates with passing tests
|
|
26
|
+
|
|
27
|
+
## Prerequisites
|
|
28
|
+
|
|
29
|
+
Before shipping directly to main:
|
|
30
|
+
1. All tests must pass
|
|
31
|
+
2. Linter must pass
|
|
32
|
+
3. Changes must be small and low-risk
|
|
33
|
+
4. CI must be green (if configured)
|
|
34
|
+
|
|
35
|
+
## Workflow
|
|
36
|
+
|
|
37
|
+
Current branch status:
|
|
38
|
+
!`git status`
|
|
39
|
+
|
|
40
|
+
Recent commits:
|
|
41
|
+
!`git log --oneline -5`
|
|
42
|
+
|
|
43
|
+
Arguments: $ARGUMENTS
|
|
44
|
+
|
|
45
|
+
**Process:**
|
|
46
|
+
|
|
47
|
+
1. **Verify Change Size**: Check git diff to ensure changes are small and focused
|
|
48
|
+
!`git diff --stat main`
|
|
49
|
+
|
|
50
|
+
2. **Run Tests**: Ensure all tests pass
|
|
51
|
+
!`npm test` or !`yarn test` or appropriate test command for the project
|
|
52
|
+
|
|
53
|
+
3. **Run Linter**: Ensure code quality checks pass
|
|
54
|
+
!`npm run lint` or !`yarn lint` or appropriate lint command (if available)
|
|
55
|
+
|
|
56
|
+
4. **Safety Check**: Confirm with user that this is truly a ship-worthy change:
|
|
57
|
+
- Is this a small, obvious change?
|
|
58
|
+
- Do all tests pass?
|
|
59
|
+
- Is CI green?
|
|
60
|
+
|
|
61
|
+
If ANY of these are "no", suggest using `/show` or `/ask` instead.
|
|
62
|
+
|
|
63
|
+
5. **Merge to Main**: If all checks pass and user confirms:
|
|
64
|
+
```bash
|
|
65
|
+
git checkout main
|
|
66
|
+
git pull origin main
|
|
67
|
+
git merge --ff-only [feature-branch] || git merge [feature-branch]
|
|
68
|
+
git push origin main
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
6. **Cleanup**: Delete the feature branch
|
|
72
|
+
```bash
|
|
73
|
+
git branch -d [feature-branch]
|
|
74
|
+
git push origin --delete [feature-branch]
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
7. **Notify**: Show summary of what was shipped
|
|
78
|
+
|
|
79
|
+
## Safety Rails
|
|
80
|
+
|
|
81
|
+
If tests fail, linter fails, or changes are large/complex, STOP and suggest:
|
|
82
|
+
- Use `/show` for changes that should be seen but don't need approval
|
|
83
|
+
- Use `/ask` (traditional PR) for complex changes needing discussion
|
|
84
|
+
|
|
85
|
+
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
allowed-tools: mcp__github__*, Bash(git:*)
|
|
3
|
+
description: Show code to team with auto-merge - for changes that should be visible but don't need approval (Cursor's modern workflow)
|
|
4
|
+
argument-hint: [optional-pr-title-and-description]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Show - Visible Merge with Optional Feedback
|
|
8
|
+
|
|
9
|
+
## General Guidelines
|
|
10
|
+
|
|
11
|
+
### Output Style
|
|
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
|
+
**Ship/Show/Ask Pattern - SHOW**
|
|
17
|
+
|
|
18
|
+
> 🚀 **Cursor says**: Not every change needs a traditional review. Show your work, then merge.
|
|
19
|
+
|
|
20
|
+
Show is for changes that teammates should see, but don't require approval. Examples:
|
|
21
|
+
- Refactoring with test coverage
|
|
22
|
+
- New features with comprehensive tests
|
|
23
|
+
- Performance improvements
|
|
24
|
+
- Non-breaking API changes
|
|
25
|
+
|
|
26
|
+
## Prerequisites
|
|
27
|
+
|
|
28
|
+
Before using show:
|
|
29
|
+
1. All tests must pass
|
|
30
|
+
2. Changes should have good test coverage
|
|
31
|
+
3. Changes should be non-breaking or backward compatible
|
|
32
|
+
4. CI must be green
|
|
33
|
+
|
|
34
|
+
## Workflow
|
|
35
|
+
|
|
36
|
+
Current branch status:
|
|
37
|
+
!`git status`
|
|
38
|
+
|
|
39
|
+
Recent commits:
|
|
40
|
+
!`git log --oneline -5`
|
|
41
|
+
|
|
42
|
+
Arguments: $ARGUMENTS
|
|
43
|
+
|
|
44
|
+
**Process:**
|
|
45
|
+
|
|
46
|
+
1. **Verify Quality**: Check that changes meet show criteria
|
|
47
|
+
- Run tests: !`npm test` or !`yarn test` or appropriate test command
|
|
48
|
+
- Check coverage is maintained or improved
|
|
49
|
+
- Verify no breaking changes
|
|
50
|
+
|
|
51
|
+
2. **Create Show PR**: Create a PR that will auto-merge after a short window
|
|
52
|
+
- Title: conventional commits format, prefixed with `[SHOW]`
|
|
53
|
+
- Description: Clear explanation of what changed and why
|
|
54
|
+
- Add label: "show" or "auto-merge"
|
|
55
|
+
- Set auto-merge if GitHub setting allows
|
|
56
|
+
|
|
57
|
+
3. **Configure Auto-Merge**:
|
|
58
|
+
- If GitHub Actions is configured, set to auto-merge after CI passes
|
|
59
|
+
- If not, provide instructions to merge after 1-2 hours of visibility
|
|
60
|
+
- Add notice that feedback is welcome but not required
|
|
61
|
+
|
|
62
|
+
4. **PR Description Template**:
|
|
63
|
+
```markdown
|
|
64
|
+
## 🚀 Show - Auto-merging after CI
|
|
65
|
+
|
|
66
|
+
**This is a SHOW PR**: Changes are ready to merge but shared for visibility.
|
|
67
|
+
Feedback welcome but not required. Will auto-merge when CI passes.
|
|
68
|
+
|
|
69
|
+
<!--
|
|
70
|
+
References: [link to relevant issues]
|
|
71
|
+
-->
|
|
72
|
+
|
|
73
|
+
### What changed
|
|
74
|
+
[Brief description]
|
|
75
|
+
|
|
76
|
+
### Why
|
|
77
|
+
[Rationale for change]
|
|
78
|
+
|
|
79
|
+
### Test coverage
|
|
80
|
+
- [ ] All tests pass
|
|
81
|
+
- [ ] Coverage maintained/improved
|
|
82
|
+
- [ ] No breaking changes
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
5. **Monitoring**: Check PR status and auto-merge when ready
|
|
86
|
+
|
|
87
|
+
## Decision Guide
|
|
88
|
+
|
|
89
|
+
Use **Show** when:
|
|
90
|
+
- ✅ Tests are comprehensive
|
|
91
|
+
- ✅ Changes are non-breaking
|
|
92
|
+
- ✅ You're confident in the approach
|
|
93
|
+
- ✅ Team should be aware of the change
|
|
94
|
+
|
|
95
|
+
Use **/ship** instead if: change is tiny and obvious (typo, formatting)
|
|
96
|
+
|
|
97
|
+
Use **/ask** instead if: change needs discussion, breaks APIs, or you're uncertain
|
|
98
|
+
|
|
99
|
+
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
allowed-tools: Read, Glob, Grep, Task
|
|
3
|
+
description: Execute TDD Spike Phase - exploratory coding to understand problem space before TDD
|
|
4
|
+
argument-hint: <exploration description>
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
SPIKE PHASE! Apply the below to the info given by user input here:
|
|
8
|
+
|
|
9
|
+
$ARGUMENTS
|
|
10
|
+
|
|
11
|
+
## General Guidelines
|
|
12
|
+
|
|
13
|
+
### Output Style
|
|
14
|
+
- **Never explicitly mention TDD** in code, comments, commits, PRs, or issues
|
|
15
|
+
- Write natural, descriptive code without meta-commentary about the development process
|
|
16
|
+
- The code should speak for itself - TDD is the process, not the product
|
|
17
|
+
|
|
18
|
+
(If there was no info above, fallback to:
|
|
19
|
+
1. Context of the conversation, if there's an immediate thing
|
|
20
|
+
2. `bd ready` to see what to work on next and start from there)
|
|
21
|
+
|
|
22
|
+
## TDD Fundamentals
|
|
23
|
+
|
|
24
|
+
### The TDD Cycle
|
|
25
|
+
|
|
26
|
+
The foundation of TDD is the Red-Green-Refactor cycle:
|
|
27
|
+
|
|
28
|
+
1. **Red Phase**: Write ONE failing test that describes desired behavior
|
|
29
|
+
|
|
30
|
+
- The test must fail for the RIGHT reason (not syntax/import errors)
|
|
31
|
+
- Only one test at a time - this is critical for TDD discipline
|
|
32
|
+
- **Adding a single test to a test file is ALWAYS allowed** - no prior test output needed
|
|
33
|
+
- Starting TDD for a new feature is always valid, even if test output shows unrelated work
|
|
34
|
+
|
|
35
|
+
2. **Green Phase**: Write MINIMAL code to make the test pass
|
|
36
|
+
|
|
37
|
+
- Implement only what's needed for the current failing test
|
|
38
|
+
- No anticipatory coding or extra features
|
|
39
|
+
- Address the specific failure message
|
|
40
|
+
|
|
41
|
+
3. **Refactor Phase**: Improve code structure while keeping tests green
|
|
42
|
+
- Only allowed when relevant tests are passing
|
|
43
|
+
- Requires proof that tests have been run and are green
|
|
44
|
+
- Applies to BOTH implementation and test code
|
|
45
|
+
- No refactoring with failing tests - fix them first
|
|
46
|
+
|
|
47
|
+
### Core Violations
|
|
48
|
+
|
|
49
|
+
1. **Multiple Test Addition**
|
|
50
|
+
|
|
51
|
+
- Adding more than one new test at once
|
|
52
|
+
- Exception: Initial test file setup or extracting shared test utilities
|
|
53
|
+
|
|
54
|
+
2. **Over-Implementation**
|
|
55
|
+
|
|
56
|
+
- Code that exceeds what's needed to pass the current failing test
|
|
57
|
+
- Adding untested features, methods, or error handling
|
|
58
|
+
- Implementing multiple methods when test only requires one
|
|
59
|
+
|
|
60
|
+
3. **Premature Implementation**
|
|
61
|
+
- Adding implementation before a test exists and fails properly
|
|
62
|
+
- Adding implementation without running the test first
|
|
63
|
+
- Refactoring when tests haven't been run or are failing
|
|
64
|
+
|
|
65
|
+
### Critical Principle: Incremental Development
|
|
66
|
+
|
|
67
|
+
Each step in TDD should address ONE specific issue:
|
|
68
|
+
|
|
69
|
+
- Test fails "not defined" → Create empty stub/class only
|
|
70
|
+
- Test fails "not a function" → Add method stub only
|
|
71
|
+
- Test fails with assertion → Implement minimal logic only
|
|
72
|
+
|
|
73
|
+
### Optional Pre-Phase: Spike Phase
|
|
74
|
+
|
|
75
|
+
In rare cases where the problem space, interface, or expected behavior is unclear, a **Spike Phase** may be used **before the Red Phase**.
|
|
76
|
+
This phase is **not part of the regular TDD workflow** and must only be applied under exceptional circumstances.
|
|
77
|
+
|
|
78
|
+
- The goal of a Spike is **exploration and learning**, not implementation.
|
|
79
|
+
- The code written during a Spike is **disposable** and **must not** be merged or reused directly.
|
|
80
|
+
- Once sufficient understanding is achieved, all spike code is discarded, and normal TDD resumes starting from the **Red Phase**.
|
|
81
|
+
- A Spike is justified only when it is impossible to define a meaningful failing test due to technical uncertainty or unknown system behavior.
|
|
82
|
+
|
|
83
|
+
### General Information
|
|
84
|
+
|
|
85
|
+
- Sometimes the test output shows as no tests have been run when a new test is failing due to a missing import or constructor. In such cases, allow the agent to create simple stubs. Ask them if they forgot to create a stub if they are stuck.
|
|
86
|
+
- It is never allowed to introduce new logic without evidence of relevant failing tests. However, stubs and simple implementation to make imports and test infrastructure work is fine.
|
|
87
|
+
- 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.
|
|
88
|
+
- Adding types, interfaces, or a constant in order to replace magic values is perfectly fine during refactoring.
|
|
89
|
+
- Provide the agent with helpful directions so that they do not get stuck when blocking them.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
allowed-tools: AskUserQuestion, mcp__beads__list, mcp__beads__stats
|
|
3
|
+
description: Summarize conversation progress and next steps
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Create a concise summary of the current conversation suitable for transferring context to a new conversation.
|
|
7
|
+
|
|
8
|
+
## Summary Structure
|
|
9
|
+
|
|
10
|
+
Provide a summary with these sections:
|
|
11
|
+
|
|
12
|
+
### What We Did
|
|
13
|
+
- Key accomplishments and changes made
|
|
14
|
+
- Important decisions or discoveries
|
|
15
|
+
- Files created, modified, or analyzed
|
|
16
|
+
|
|
17
|
+
### What We're Doing Next
|
|
18
|
+
- Immediate next steps
|
|
19
|
+
- Pending tasks or work in progress
|
|
20
|
+
- Goals or objectives to continue
|
|
21
|
+
|
|
22
|
+
### Blockers & User Input Needed
|
|
23
|
+
- Any issues requiring user intervention
|
|
24
|
+
- Decisions that need to be made
|
|
25
|
+
- Missing information or clarifications needed
|
|
26
|
+
|
|
27
|
+
## Output Format
|
|
28
|
+
|
|
29
|
+
Keep the summary concise and actionable - suitable for pasting into a new conversation to quickly restore context without needing the full conversation history.
|
|
30
|
+
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
allowed-tools: Read, Glob, Grep, Task
|
|
3
|
+
description: Remind agent about TDD approach and continue conversation
|
|
4
|
+
argument-hint: [optional-response-to-last-message]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# TDD Reminder
|
|
8
|
+
|
|
9
|
+
## General Guidelines
|
|
10
|
+
|
|
11
|
+
### Output Style
|
|
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
|
+
## TDD Fundamentals
|
|
17
|
+
|
|
18
|
+
### The TDD Cycle
|
|
19
|
+
|
|
20
|
+
The foundation of TDD is the Red-Green-Refactor cycle:
|
|
21
|
+
|
|
22
|
+
1. **Red Phase**: Write ONE failing test that describes desired behavior
|
|
23
|
+
|
|
24
|
+
- The test must fail for the RIGHT reason (not syntax/import errors)
|
|
25
|
+
- Only one test at a time - this is critical for TDD discipline
|
|
26
|
+
- **Adding a single test to a test file is ALWAYS allowed** - no prior test output needed
|
|
27
|
+
- Starting TDD for a new feature is always valid, even if test output shows unrelated work
|
|
28
|
+
|
|
29
|
+
2. **Green Phase**: Write MINIMAL code to make the test pass
|
|
30
|
+
|
|
31
|
+
- Implement only what's needed for the current failing test
|
|
32
|
+
- No anticipatory coding or extra features
|
|
33
|
+
- Address the specific failure message
|
|
34
|
+
|
|
35
|
+
3. **Refactor Phase**: Improve code structure while keeping tests green
|
|
36
|
+
- Only allowed when relevant tests are passing
|
|
37
|
+
- Requires proof that tests have been run and are green
|
|
38
|
+
- Applies to BOTH implementation and test code
|
|
39
|
+
- No refactoring with failing tests - fix them first
|
|
40
|
+
|
|
41
|
+
### Core Violations
|
|
42
|
+
|
|
43
|
+
1. **Multiple Test Addition**
|
|
44
|
+
|
|
45
|
+
- Adding more than one new test at once
|
|
46
|
+
- Exception: Initial test file setup or extracting shared test utilities
|
|
47
|
+
|
|
48
|
+
2. **Over-Implementation**
|
|
49
|
+
|
|
50
|
+
- Code that exceeds what's needed to pass the current failing test
|
|
51
|
+
- Adding untested features, methods, or error handling
|
|
52
|
+
- Implementing multiple methods when test only requires one
|
|
53
|
+
|
|
54
|
+
3. **Premature Implementation**
|
|
55
|
+
- Adding implementation before a test exists and fails properly
|
|
56
|
+
- Adding implementation without running the test first
|
|
57
|
+
- Refactoring when tests haven't been run or are failing
|
|
58
|
+
|
|
59
|
+
### Critical Principle: Incremental Development
|
|
60
|
+
|
|
61
|
+
Each step in TDD should address ONE specific issue:
|
|
62
|
+
|
|
63
|
+
- Test fails "not defined" → Create empty stub/class only
|
|
64
|
+
- Test fails "not a function" → Add method stub only
|
|
65
|
+
- Test fails with assertion → Implement minimal logic only
|
|
66
|
+
|
|
67
|
+
### Optional Pre-Phase: Spike Phase
|
|
68
|
+
|
|
69
|
+
In rare cases where the problem space, interface, or expected behavior is unclear, a **Spike Phase** may be used **before the Red Phase**.
|
|
70
|
+
This phase is **not part of the regular TDD workflow** and must only be applied under exceptional circumstances.
|
|
71
|
+
|
|
72
|
+
- The goal of a Spike is **exploration and learning**, not implementation.
|
|
73
|
+
- The code written during a Spike is **disposable** and **must not** be merged or reused directly.
|
|
74
|
+
- Once sufficient understanding is achieved, all spike code is discarded, and normal TDD resumes starting from the **Red Phase**.
|
|
75
|
+
- A Spike is justified only when it is impossible to define a meaningful failing test due to technical uncertainty or unknown system behavior.
|
|
76
|
+
|
|
77
|
+
### General Information
|
|
78
|
+
|
|
79
|
+
- Sometimes the test output shows as no tests have been run when a new test is failing due to a missing import or constructor. In such cases, allow the agent to create simple stubs. Ask them if they forgot to create a stub if they are stuck.
|
|
80
|
+
- It is never allowed to introduce new logic without evidence of relevant failing tests. However, stubs and simple implementation to make imports and test infrastructure work is fine.
|
|
81
|
+
- 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.
|
|
82
|
+
- Adding types, interfaces, or a constant in order to replace magic values is perfectly fine during refactoring.
|
|
83
|
+
- Provide the agent with helpful directions so that they do not get stuck when blocking them.
|
|
84
|
+
|
|
85
|
+
## Continue Conversation
|
|
86
|
+
|
|
87
|
+
User response to the last message: $ARGUMENTS
|
|
88
|
+
|
|
89
|
+
Please continue with TDD approach based on the above response.
|