@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
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Creates a pull request using GitHub MCP
|
|
3
|
-
argument-hint: [optional-pr-title-and-description]
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Create Pull Request
|
|
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
|
-
Beads is available for task tracking. Use `mcp__beads__*` tools to manage issues (the user interacts via `bd` commands).
|
|
17
|
-
|
|
18
|
-
Create a pull request for the current branch using GitHub MCP tools.
|
|
19
|
-
|
|
20
|
-
## Workflow
|
|
21
|
-
|
|
22
|
-
Current branch status:
|
|
23
|
-
!`git status`
|
|
24
|
-
|
|
25
|
-
Recent commits:
|
|
26
|
-
!`git log --oneline -5`
|
|
27
|
-
|
|
28
|
-
Arguments: $ARGUMENTS
|
|
29
|
-
|
|
30
|
-
**Process:**
|
|
31
|
-
|
|
32
|
-
1. **Ensure Branch is Ready**:
|
|
33
|
-
!`git status`
|
|
34
|
-
- Commit all changes
|
|
35
|
-
- Push to remote: `git push origin [branch-name]`
|
|
36
|
-
|
|
37
|
-
2. **Create PR**: Create a well-formatted pull request
|
|
38
|
-
|
|
39
|
-
Title: conventional commits format, like `feat(#123): add user authentication`
|
|
40
|
-
|
|
41
|
-
Description template:
|
|
42
|
-
|
|
43
|
-
```markdown
|
|
44
|
-
<!--
|
|
45
|
-
Are there any relevant issues / PRs / mailing lists discussions?
|
|
46
|
-
Please reference them here.
|
|
47
|
-
-->
|
|
48
|
-
|
|
49
|
-
## References
|
|
50
|
-
|
|
51
|
-
- [links to github issues referenced in commit messages]
|
|
52
|
-
|
|
53
|
-
## Summary
|
|
54
|
-
|
|
55
|
-
[Brief description of changes]
|
|
56
|
-
|
|
57
|
-
## Test Plan
|
|
58
|
-
|
|
59
|
-
- [ ] Tests pass
|
|
60
|
-
- [ ] Manual testing completed
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
3. **Set Base Branch**: Default to main unless specified otherwise
|
|
64
|
-
|
|
65
|
-
4. **Link Issues**: Reference related issues found in commit messages
|
|
66
|
-
|
|
67
|
-
## Use GitHub MCP Tools
|
|
68
|
-
|
|
69
|
-
1. Check current branch and ensure it's pushed
|
|
70
|
-
2. Create a well-formatted pull request with proper title and description
|
|
71
|
-
3. Set the base branch (default: main)
|
|
72
|
-
4. Include relevant issue references if found in commit messages
|
|
73
|
-
|
|
74
|
-
### Beads Integration
|
|
75
|
-
|
|
76
|
-
Use Beads MCP to:
|
|
77
|
-
|
|
78
|
-
- Track work with `bd ready` to find next task
|
|
79
|
-
- Create issues with `bd create "description"`
|
|
80
|
-
- Track dependencies with `bd dep add`
|
|
81
|
-
|
|
82
|
-
See <https://github.com/steveyegge/beads> for more information.
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Execute TDD Red Phase - write ONE failing test
|
|
3
|
-
argument-hint: [optional additional info]
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
RED PHASE! Apply the below to the info given by user input here:
|
|
7
|
-
|
|
8
|
-
$ARGUMENTS
|
|
9
|
-
|
|
10
|
-
## General Guidelines
|
|
11
|
-
|
|
12
|
-
### Output Style
|
|
13
|
-
|
|
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
|
-
Beads is available for task tracking. Use `mcp__beads__*` tools to manage issues (the user interacts via `bd` commands).
|
|
19
|
-
|
|
20
|
-
(If there was no info above, fallback to:
|
|
21
|
-
|
|
22
|
-
1. Context of the conversation, if there's an immediate thing
|
|
23
|
-
2. `bd ready` to see what to work on next and start from there)
|
|
24
|
-
|
|
25
|
-
## TDD Fundamentals
|
|
26
|
-
|
|
27
|
-
### The TDD Cycle
|
|
28
|
-
|
|
29
|
-
The foundation of TDD is the Red-Green-Refactor cycle:
|
|
30
|
-
|
|
31
|
-
1. **Red Phase**: Write ONE failing test that describes desired behavior
|
|
32
|
-
|
|
33
|
-
- The test must fail for the RIGHT reason (not syntax/import errors)
|
|
34
|
-
- Only one test at a time - this is critical for TDD discipline
|
|
35
|
-
- Exception: For browser-level tests or expensive setup (e.g., Storybook `*.stories.tsx`), group multiple assertions within a single test block to avoid redundant setup - but only when adding assertions to an existing interaction flow. If new user interactions are required, still create a new test. Split files by category if they exceed ~1000 lines.
|
|
36
|
-
- **Adding a single test to a test file is ALWAYS allowed** - no prior test output needed
|
|
37
|
-
- Starting TDD for a new feature is always valid, even if test output shows unrelated work
|
|
38
|
-
- For DOM-based tests, use `data-testid` attributes to select elements rather than CSS classes, tag names, or text content
|
|
39
|
-
- Avoid hard-coded timeouts both in form of sleep() or timeout: 5000 etc; use proper async patterns (`waitFor`, `findBy*`, event-based sync) instead and rely on global test configs for timeout settings
|
|
40
|
-
|
|
41
|
-
2. **Green Phase**: Write MINIMAL code to make the test pass
|
|
42
|
-
|
|
43
|
-
- Implement only what's needed for the current failing test
|
|
44
|
-
- No anticipatory coding or extra features
|
|
45
|
-
- Address the specific failure message
|
|
46
|
-
|
|
47
|
-
3. **Refactor Phase**: Improve code structure while keeping tests green
|
|
48
|
-
- Only allowed when relevant tests are passing
|
|
49
|
-
- Requires proof that tests have been run and are green
|
|
50
|
-
- Applies to BOTH implementation and test code
|
|
51
|
-
- No refactoring with failing tests - fix them first
|
|
52
|
-
|
|
53
|
-
### Core Violations
|
|
54
|
-
|
|
55
|
-
1. **Multiple Test Addition**
|
|
56
|
-
|
|
57
|
-
- Adding more than one new test at once
|
|
58
|
-
- Exception: Initial test file setup or extracting shared test utilities
|
|
59
|
-
|
|
60
|
-
2. **Over-Implementation**
|
|
61
|
-
|
|
62
|
-
- Code that exceeds what's needed to pass the current failing test
|
|
63
|
-
- Adding untested features, methods, or error handling
|
|
64
|
-
- Implementing multiple methods when test only requires one
|
|
65
|
-
|
|
66
|
-
3. **Premature Implementation**
|
|
67
|
-
- Adding implementation before a test exists and fails properly
|
|
68
|
-
- Adding implementation without running the test first
|
|
69
|
-
- Refactoring when tests haven't been run or are failing
|
|
70
|
-
|
|
71
|
-
### Critical Principle: Incremental Development
|
|
72
|
-
|
|
73
|
-
Each step in TDD should address ONE specific issue:
|
|
74
|
-
|
|
75
|
-
- Test fails "not defined" → Create empty stub/class only
|
|
76
|
-
- Test fails "not a function" → Add method stub only
|
|
77
|
-
- Test fails with assertion → Implement minimal logic only
|
|
78
|
-
|
|
79
|
-
### Optional Pre-Phase: Spike Phase
|
|
80
|
-
|
|
81
|
-
In rare cases where the problem space, interface, or expected behavior is unclear, a **Spike Phase** may be used **before the Red Phase**.
|
|
82
|
-
This phase is **not part of the regular TDD workflow** and must only be applied under exceptional circumstances.
|
|
83
|
-
|
|
84
|
-
- The goal of a Spike is **exploration and learning**, not implementation.
|
|
85
|
-
- The code written during a Spike is **disposable** and **must not** be merged or reused directly.
|
|
86
|
-
- Once sufficient understanding is achieved, all spike code is discarded, and normal TDD resumes starting from the **Red Phase**.
|
|
87
|
-
- A Spike is justified only when it is impossible to define a meaningful failing test due to technical uncertainty or unknown system behavior.
|
|
88
|
-
|
|
89
|
-
### General Information
|
|
90
|
-
|
|
91
|
-
- 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.
|
|
92
|
-
- 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.
|
|
93
|
-
- 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.
|
|
94
|
-
- Adding types, interfaces, or a constant in order to replace magic values is perfectly fine during refactoring.
|
|
95
|
-
- Provide the agent with helpful directions so that they do not get stuck when blocking them.
|
|
96
|
-
|
|
97
|
-
### Test Structure (AAA Pattern)
|
|
98
|
-
|
|
99
|
-
Structure each test with clear phases:
|
|
100
|
-
|
|
101
|
-
- **Arrange**: Set up test data and preconditions (keep minimal)
|
|
102
|
-
- **Act**: Execute the single action being tested
|
|
103
|
-
- **Assert**: Verify the expected outcome with specific assertions
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Execute TDD Refactor Phase - improve code structure while keeping tests green
|
|
3
|
-
argument-hint: <refactoring description>
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Apply this document (specifically the Refactor phase), to the info given by user input here: $ARGUMENTS
|
|
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
|
-
Beads is available for task tracking. Use `mcp__beads__*` tools to manage issues (the user interacts via `bd` commands).
|
|
17
|
-
|
|
18
|
-
(If there was no info above, fallback to:
|
|
19
|
-
|
|
20
|
-
1. Context of the conversation, if there's an immediate thing
|
|
21
|
-
2. `bd ready` to see what to work on next and start from there)
|
|
22
|
-
|
|
23
|
-
## TDD Fundamentals
|
|
24
|
-
|
|
25
|
-
### The TDD Cycle
|
|
26
|
-
|
|
27
|
-
The foundation of TDD is the Red-Green-Refactor cycle:
|
|
28
|
-
|
|
29
|
-
1. **Red Phase**: Write ONE failing test that describes desired behavior
|
|
30
|
-
|
|
31
|
-
- The test must fail for the RIGHT reason (not syntax/import errors)
|
|
32
|
-
- Only one test at a time - this is critical for TDD discipline
|
|
33
|
-
- Exception: For browser-level tests or expensive setup (e.g., Storybook `*.stories.tsx`), group multiple assertions within a single test block to avoid redundant setup - but only when adding assertions to an existing interaction flow. If new user interactions are required, still create a new test. Split files by category if they exceed ~1000 lines.
|
|
34
|
-
- **Adding a single test to a test file is ALWAYS allowed** - no prior test output needed
|
|
35
|
-
- Starting TDD for a new feature is always valid, even if test output shows unrelated work
|
|
36
|
-
- For DOM-based tests, use `data-testid` attributes to select elements rather than CSS classes, tag names, or text content
|
|
37
|
-
- Avoid hard-coded timeouts both in form of sleep() or timeout: 5000 etc; use proper async patterns (`waitFor`, `findBy*`, event-based sync) instead and rely on global test configs for timeout settings
|
|
38
|
-
|
|
39
|
-
2. **Green Phase**: Write MINIMAL code to make the test pass
|
|
40
|
-
|
|
41
|
-
- Implement only what's needed for the current failing test
|
|
42
|
-
- No anticipatory coding or extra features
|
|
43
|
-
- Address the specific failure message
|
|
44
|
-
|
|
45
|
-
3. **Refactor Phase**: Improve code structure while keeping tests green
|
|
46
|
-
- Only allowed when relevant tests are passing
|
|
47
|
-
- Requires proof that tests have been run and are green
|
|
48
|
-
- Applies to BOTH implementation and test code
|
|
49
|
-
- No refactoring with failing tests - fix them first
|
|
50
|
-
|
|
51
|
-
### Core Violations
|
|
52
|
-
|
|
53
|
-
1. **Multiple Test Addition**
|
|
54
|
-
|
|
55
|
-
- Adding more than one new test at once
|
|
56
|
-
- Exception: Initial test file setup or extracting shared test utilities
|
|
57
|
-
|
|
58
|
-
2. **Over-Implementation**
|
|
59
|
-
|
|
60
|
-
- Code that exceeds what's needed to pass the current failing test
|
|
61
|
-
- Adding untested features, methods, or error handling
|
|
62
|
-
- Implementing multiple methods when test only requires one
|
|
63
|
-
|
|
64
|
-
3. **Premature Implementation**
|
|
65
|
-
- Adding implementation before a test exists and fails properly
|
|
66
|
-
- Adding implementation without running the test first
|
|
67
|
-
- Refactoring when tests haven't been run or are failing
|
|
68
|
-
|
|
69
|
-
### Critical Principle: Incremental Development
|
|
70
|
-
|
|
71
|
-
Each step in TDD should address ONE specific issue:
|
|
72
|
-
|
|
73
|
-
- Test fails "not defined" → Create empty stub/class only
|
|
74
|
-
- Test fails "not a function" → Add method stub only
|
|
75
|
-
- Test fails with assertion → Implement minimal logic only
|
|
76
|
-
|
|
77
|
-
### Optional Pre-Phase: Spike Phase
|
|
78
|
-
|
|
79
|
-
In rare cases where the problem space, interface, or expected behavior is unclear, a **Spike Phase** may be used **before the Red Phase**.
|
|
80
|
-
This phase is **not part of the regular TDD workflow** and must only be applied under exceptional circumstances.
|
|
81
|
-
|
|
82
|
-
- The goal of a Spike is **exploration and learning**, not implementation.
|
|
83
|
-
- The code written during a Spike is **disposable** and **must not** be merged or reused directly.
|
|
84
|
-
- Once sufficient understanding is achieved, all spike code is discarded, and normal TDD resumes starting from the **Red Phase**.
|
|
85
|
-
- A Spike is justified only when it is impossible to define a meaningful failing test due to technical uncertainty or unknown system behavior.
|
|
86
|
-
|
|
87
|
-
### General Information
|
|
88
|
-
|
|
89
|
-
- 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.
|
|
90
|
-
- 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.
|
|
91
|
-
- 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.
|
|
92
|
-
- Adding types, interfaces, or a constant in order to replace magic values is perfectly fine during refactoring.
|
|
93
|
-
- Provide the agent with helpful directions so that they do not get stuck when blocking them.
|
|
94
|
-
|
|
95
|
-
### Watch for Brittle Tests
|
|
96
|
-
|
|
97
|
-
When refactoring implementation, watch for **Peeping Tom** tests that:
|
|
98
|
-
|
|
99
|
-
- Test private methods or internal state directly
|
|
100
|
-
- Assert on implementation details rather than behavior
|
|
101
|
-
- Break on any refactoring even when behavior is preserved
|
|
102
|
-
|
|
103
|
-
If tests fail after a pure refactoring (no behavior change), consider whether the tests are testing implementation rather than behavior.
|
|
104
|
-
|
|
105
|
-
1. **Consistency check** - Look for inconsistent patterns, naming conventions, or structure across the codebase
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Ship code directly to main - for small, obvious changes that don't need review
|
|
3
|
-
argument-hint: [optional-commit-message]
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Ship - Direct Merge to Main
|
|
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
|
-
Beads is available for task tracking. Use `mcp__beads__*` tools to manage issues (the user interacts via `bd` commands).
|
|
17
|
-
|
|
18
|
-
**Ship/Show/Ask Pattern - SHIP**
|
|
19
|
-
|
|
20
|
-
Ship is for small, obvious changes that don't need code review. Examples:
|
|
21
|
-
|
|
22
|
-
- Typo fixes
|
|
23
|
-
- Formatting changes
|
|
24
|
-
- Documentation updates
|
|
25
|
-
- Obvious bug fixes
|
|
26
|
-
- Dependency updates with passing tests
|
|
27
|
-
|
|
28
|
-
## Prerequisites
|
|
29
|
-
|
|
30
|
-
Before shipping directly to main:
|
|
31
|
-
|
|
32
|
-
1. All tests must pass
|
|
33
|
-
2. Linter must pass
|
|
34
|
-
3. Changes must be small and low-risk
|
|
35
|
-
4. CI must be green (if configured)
|
|
36
|
-
|
|
37
|
-
## Workflow
|
|
38
|
-
|
|
39
|
-
Current branch status:
|
|
40
|
-
!`git status`
|
|
41
|
-
|
|
42
|
-
Recent commits:
|
|
43
|
-
!`git log --oneline -5`
|
|
44
|
-
|
|
45
|
-
Arguments: $ARGUMENTS
|
|
46
|
-
|
|
47
|
-
**Process:**
|
|
48
|
-
|
|
49
|
-
1. **Verify Change Size**: Check git diff to ensure changes are small and focused
|
|
50
|
-
!`git diff --stat main`
|
|
51
|
-
|
|
52
|
-
2. **Run Tests**: Ensure all tests pass
|
|
53
|
-
!`npm test` or !`yarn test` or appropriate test command for the project
|
|
54
|
-
|
|
55
|
-
3. **Run Linter**: Ensure code quality checks pass
|
|
56
|
-
!`npm run lint` or !`yarn lint` or appropriate lint command (if available)
|
|
57
|
-
|
|
58
|
-
4. **Safety Check**: Confirm with user that this is truly a ship-worthy change:
|
|
59
|
-
- Is this a small, obvious change?
|
|
60
|
-
- Do all tests pass?
|
|
61
|
-
- Is CI green?
|
|
62
|
-
|
|
63
|
-
If ANY of these are "no", suggest using `/show` or `/ask` instead.
|
|
64
|
-
|
|
65
|
-
5. **Merge to Main**: If all checks pass and user confirms:
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
git checkout main
|
|
69
|
-
git pull origin main
|
|
70
|
-
git merge --ff-only [feature-branch] || git merge [feature-branch]
|
|
71
|
-
git push origin main
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
6. **Cleanup**: Delete the feature branch
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
git branch -d [feature-branch]
|
|
78
|
-
git push origin --delete [feature-branch]
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
7. **Notify**: Show summary of what was shipped
|
|
82
|
-
|
|
83
|
-
## Safety Rails
|
|
84
|
-
|
|
85
|
-
If tests fail, linter fails, or changes are large/complex, STOP and suggest:
|
|
86
|
-
|
|
87
|
-
- Use `/show` for changes that should be seen but don't need approval
|
|
88
|
-
- Use `/ask` (traditional PR) for complex changes needing discussion
|
|
89
|
-
|
|
90
|
-
### Beads Integration
|
|
91
|
-
|
|
92
|
-
Use Beads MCP to:
|
|
93
|
-
|
|
94
|
-
- Track work with `bd ready` to find next task
|
|
95
|
-
- Create issues with `bd create "description"`
|
|
96
|
-
- Track dependencies with `bd dep add`
|
|
97
|
-
|
|
98
|
-
See <https://github.com/steveyegge/beads> for more information.
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Show code to team with auto-merge - for changes that should be visible but don't need approval
|
|
3
|
-
argument-hint: [optional-pr-title-and-description]
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Show - Visible Merge with Optional Feedback
|
|
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
|
-
Beads is available for task tracking. Use `mcp__beads__*` tools to manage issues (the user interacts via `bd` commands).
|
|
17
|
-
|
|
18
|
-
**Ship/Show/Ask Pattern - SHOW**
|
|
19
|
-
|
|
20
|
-
Show is for changes that teammates should see, but don't require approval. Examples:
|
|
21
|
-
|
|
22
|
-
- Refactoring with test coverage
|
|
23
|
-
- New features with comprehensive tests
|
|
24
|
-
- Performance improvements
|
|
25
|
-
- Non-breaking API changes
|
|
26
|
-
|
|
27
|
-
## Prerequisites
|
|
28
|
-
|
|
29
|
-
Before using show:
|
|
30
|
-
|
|
31
|
-
1. All tests must pass
|
|
32
|
-
2. Changes should have good test coverage
|
|
33
|
-
3. Changes should be non-breaking or backward compatible
|
|
34
|
-
4. CI must be green
|
|
35
|
-
|
|
36
|
-
## Workflow
|
|
37
|
-
|
|
38
|
-
Current branch status:
|
|
39
|
-
!`git status`
|
|
40
|
-
|
|
41
|
-
Recent commits:
|
|
42
|
-
!`git log --oneline -5`
|
|
43
|
-
|
|
44
|
-
Arguments: $ARGUMENTS
|
|
45
|
-
|
|
46
|
-
**Process:**
|
|
47
|
-
|
|
48
|
-
1. **Verify Quality**: Check that changes meet show criteria
|
|
49
|
-
- Run tests: !`npm test` or !`yarn test` or appropriate test command
|
|
50
|
-
- Check coverage is maintained or improved
|
|
51
|
-
- Verify no breaking changes
|
|
52
|
-
|
|
53
|
-
2. **Create Show PR**: Create a PR that will auto-merge after a short window
|
|
54
|
-
- Title: conventional commits format, prefixed with `[SHOW]`
|
|
55
|
-
- Description: Clear explanation of what changed and why
|
|
56
|
-
- Add label: "show" or "auto-merge"
|
|
57
|
-
- Set auto-merge if GitHub setting allows
|
|
58
|
-
|
|
59
|
-
3. **Configure Auto-Merge**:
|
|
60
|
-
- If GitHub Actions is configured, set to auto-merge after CI passes
|
|
61
|
-
- If not, provide instructions to merge after 1-2 hours of visibility
|
|
62
|
-
- Add notice that feedback is welcome but not required
|
|
63
|
-
|
|
64
|
-
4. **PR Description Template**:
|
|
65
|
-
|
|
66
|
-
```markdown
|
|
67
|
-
## 🚀 Show - Auto-merging after CI
|
|
68
|
-
|
|
69
|
-
**This is a SHOW PR**: Changes are ready to merge but shared for visibility.
|
|
70
|
-
Feedback welcome but not required. Will auto-merge when CI passes.
|
|
71
|
-
|
|
72
|
-
<!--
|
|
73
|
-
References: [link to relevant issues]
|
|
74
|
-
-->
|
|
75
|
-
|
|
76
|
-
### What changed
|
|
77
|
-
|
|
78
|
-
[Brief description]
|
|
79
|
-
|
|
80
|
-
### Why
|
|
81
|
-
|
|
82
|
-
[Rationale for change]
|
|
83
|
-
|
|
84
|
-
### Test coverage
|
|
85
|
-
|
|
86
|
-
- [ ] All tests pass
|
|
87
|
-
- [ ] Coverage maintained/improved
|
|
88
|
-
- [ ] No breaking changes
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
5. **Monitoring**: Check PR status and auto-merge when ready
|
|
92
|
-
|
|
93
|
-
## Decision Guide
|
|
94
|
-
|
|
95
|
-
Use **Show** when:
|
|
96
|
-
|
|
97
|
-
- ✅ Tests are comprehensive
|
|
98
|
-
- ✅ Changes are non-breaking
|
|
99
|
-
- ✅ You're confident in the approach
|
|
100
|
-
- ✅ Team should be aware of the change
|
|
101
|
-
|
|
102
|
-
Use **/ship** instead if: change is tiny and obvious (typo, formatting)
|
|
103
|
-
|
|
104
|
-
Use **/ask** instead if: change needs discussion, breaks APIs, or you're uncertain
|
|
105
|
-
|
|
106
|
-
### Beads Integration
|
|
107
|
-
|
|
108
|
-
Use Beads MCP to:
|
|
109
|
-
|
|
110
|
-
- Track work with `bd ready` to find next task
|
|
111
|
-
- Create issues with `bd create "description"`
|
|
112
|
-
- Track dependencies with `bd dep add`
|
|
113
|
-
|
|
114
|
-
See <https://github.com/steveyegge/beads> for more information.
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Execute TDD Spike Phase - exploratory coding to understand problem space before TDD
|
|
3
|
-
argument-hint: <exploration description>
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
SPIKE PHASE! Apply the below to the info given by user input here:
|
|
7
|
-
|
|
8
|
-
$ARGUMENTS
|
|
9
|
-
|
|
10
|
-
## General Guidelines
|
|
11
|
-
|
|
12
|
-
### Output Style
|
|
13
|
-
|
|
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
|
-
Beads is available for task tracking. Use `mcp__beads__*` tools to manage issues (the user interacts via `bd` commands).
|
|
19
|
-
|
|
20
|
-
(If there was no info above, fallback to:
|
|
21
|
-
|
|
22
|
-
1. Context of the conversation, if there's an immediate thing
|
|
23
|
-
2. `bd ready` to see what to work on next and start from there)
|
|
24
|
-
|
|
25
|
-
## TDD Fundamentals
|
|
26
|
-
|
|
27
|
-
### The TDD Cycle
|
|
28
|
-
|
|
29
|
-
The foundation of TDD is the Red-Green-Refactor cycle:
|
|
30
|
-
|
|
31
|
-
1. **Red Phase**: Write ONE failing test that describes desired behavior
|
|
32
|
-
|
|
33
|
-
- The test must fail for the RIGHT reason (not syntax/import errors)
|
|
34
|
-
- Only one test at a time - this is critical for TDD discipline
|
|
35
|
-
- Exception: For browser-level tests or expensive setup (e.g., Storybook `*.stories.tsx`), group multiple assertions within a single test block to avoid redundant setup - but only when adding assertions to an existing interaction flow. If new user interactions are required, still create a new test. Split files by category if they exceed ~1000 lines.
|
|
36
|
-
- **Adding a single test to a test file is ALWAYS allowed** - no prior test output needed
|
|
37
|
-
- Starting TDD for a new feature is always valid, even if test output shows unrelated work
|
|
38
|
-
- For DOM-based tests, use `data-testid` attributes to select elements rather than CSS classes, tag names, or text content
|
|
39
|
-
- Avoid hard-coded timeouts both in form of sleep() or timeout: 5000 etc; use proper async patterns (`waitFor`, `findBy*`, event-based sync) instead and rely on global test configs for timeout settings
|
|
40
|
-
|
|
41
|
-
2. **Green Phase**: Write MINIMAL code to make the test pass
|
|
42
|
-
|
|
43
|
-
- Implement only what's needed for the current failing test
|
|
44
|
-
- No anticipatory coding or extra features
|
|
45
|
-
- Address the specific failure message
|
|
46
|
-
|
|
47
|
-
3. **Refactor Phase**: Improve code structure while keeping tests green
|
|
48
|
-
- Only allowed when relevant tests are passing
|
|
49
|
-
- Requires proof that tests have been run and are green
|
|
50
|
-
- Applies to BOTH implementation and test code
|
|
51
|
-
- No refactoring with failing tests - fix them first
|
|
52
|
-
|
|
53
|
-
### Core Violations
|
|
54
|
-
|
|
55
|
-
1. **Multiple Test Addition**
|
|
56
|
-
|
|
57
|
-
- Adding more than one new test at once
|
|
58
|
-
- Exception: Initial test file setup or extracting shared test utilities
|
|
59
|
-
|
|
60
|
-
2. **Over-Implementation**
|
|
61
|
-
|
|
62
|
-
- Code that exceeds what's needed to pass the current failing test
|
|
63
|
-
- Adding untested features, methods, or error handling
|
|
64
|
-
- Implementing multiple methods when test only requires one
|
|
65
|
-
|
|
66
|
-
3. **Premature Implementation**
|
|
67
|
-
- Adding implementation before a test exists and fails properly
|
|
68
|
-
- Adding implementation without running the test first
|
|
69
|
-
- Refactoring when tests haven't been run or are failing
|
|
70
|
-
|
|
71
|
-
### Critical Principle: Incremental Development
|
|
72
|
-
|
|
73
|
-
Each step in TDD should address ONE specific issue:
|
|
74
|
-
|
|
75
|
-
- Test fails "not defined" → Create empty stub/class only
|
|
76
|
-
- Test fails "not a function" → Add method stub only
|
|
77
|
-
- Test fails with assertion → Implement minimal logic only
|
|
78
|
-
|
|
79
|
-
### Optional Pre-Phase: Spike Phase
|
|
80
|
-
|
|
81
|
-
In rare cases where the problem space, interface, or expected behavior is unclear, a **Spike Phase** may be used **before the Red Phase**.
|
|
82
|
-
This phase is **not part of the regular TDD workflow** and must only be applied under exceptional circumstances.
|
|
83
|
-
|
|
84
|
-
- The goal of a Spike is **exploration and learning**, not implementation.
|
|
85
|
-
- The code written during a Spike is **disposable** and **must not** be merged or reused directly.
|
|
86
|
-
- Once sufficient understanding is achieved, all spike code is discarded, and normal TDD resumes starting from the **Red Phase**.
|
|
87
|
-
- A Spike is justified only when it is impossible to define a meaningful failing test due to technical uncertainty or unknown system behavior.
|
|
88
|
-
|
|
89
|
-
### General Information
|
|
90
|
-
|
|
91
|
-
- 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.
|
|
92
|
-
- 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.
|
|
93
|
-
- 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.
|
|
94
|
-
- Adding types, interfaces, or a constant in order to replace magic values is perfectly fine during refactoring.
|
|
95
|
-
- Provide the agent with helpful directions so that they do not get stuck when blocking them.
|
|
@@ -1,54 +0,0 @@
|
|
|
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
|
-
Beads is available for task tracking. Use `mcp__beads__*` tools to manage issues (the user interacts via `bd` commands).
|
|
15
|
-
|
|
16
|
-
Create a concise summary of the current conversation suitable for transferring context to a new conversation.
|
|
17
|
-
|
|
18
|
-
Additional info: $ARGUMENTS
|
|
19
|
-
|
|
20
|
-
## Summary Structure
|
|
21
|
-
|
|
22
|
-
Provide a summary with these sections:
|
|
23
|
-
|
|
24
|
-
### What We Did
|
|
25
|
-
|
|
26
|
-
- Key accomplishments and changes made
|
|
27
|
-
- Important decisions or discoveries
|
|
28
|
-
- Files created, modified, or analyzed
|
|
29
|
-
|
|
30
|
-
### What We're Doing Next
|
|
31
|
-
|
|
32
|
-
- Immediate next steps
|
|
33
|
-
- Pending tasks or work in progress
|
|
34
|
-
- Goals or objectives to continue
|
|
35
|
-
|
|
36
|
-
### Blockers & User Input Needed
|
|
37
|
-
|
|
38
|
-
- Any issues requiring user intervention
|
|
39
|
-
- Decisions that need to be made
|
|
40
|
-
- Missing information or clarifications needed
|
|
41
|
-
|
|
42
|
-
## Output Format
|
|
43
|
-
|
|
44
|
-
Keep the summary concise and actionable - suitable for pasting into a new conversation to quickly restore context without needing the full conversation history.
|
|
45
|
-
|
|
46
|
-
## Beads Integration
|
|
47
|
-
|
|
48
|
-
If Beads MCP is available, check for task tracking status and ask if the user wants to:
|
|
49
|
-
|
|
50
|
-
1. Review current task status
|
|
51
|
-
2. Update task states based on conversation progress
|
|
52
|
-
3. Include Beads context in the summary
|
|
53
|
-
|
|
54
|
-
Use AskUserQuestion to confirm Beads integration preferences.
|