@wbern/claude-instructions 1.20.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.
Files changed (79) hide show
  1. package/README.md +5 -25
  2. package/bin/cli.js +345 -196
  3. package/package.json +2 -3
  4. package/src/README.md +279 -0
  5. package/src/fragments/aaa-pattern.md +7 -0
  6. package/src/fragments/beads-awareness.md +1 -0
  7. package/src/fragments/beads-integration.md +8 -0
  8. package/{downloads/without-beads/commit.md → src/fragments/commit-process.md} +0 -17
  9. package/src/fragments/consistency-check.md +1 -0
  10. package/src/fragments/discovery-phase.md +22 -0
  11. package/src/fragments/fallback-arguments-beads.md +3 -0
  12. package/src/fragments/fallback-arguments.md +1 -0
  13. package/src/fragments/fullwidth-dollar-note.md +1 -0
  14. package/src/fragments/gap-beads.md +1 -0
  15. package/src/fragments/git-host-detection.md +19 -0
  16. package/src/fragments/github-issue-fetch.md +10 -0
  17. package/src/fragments/peeping-tom-warning.md +9 -0
  18. package/src/fragments/plan-beads-context-hint.md +1 -0
  19. package/src/fragments/plan-beads-details.md +49 -0
  20. package/src/fragments/plan-beads-integration.md +2 -0
  21. package/src/fragments/summarize-beads.md +8 -0
  22. package/{downloads/without-beads/summarize.md → src/fragments/summarize-structure.md} +0 -20
  23. package/{downloads/without-beads/tdd.md → src/fragments/tdd-fundamentals.md} +0 -21
  24. package/src/fragments/test-quality-criteria.md +24 -0
  25. package/src/fragments/universal-guidelines.md +6 -0
  26. package/{downloads/without-beads → src/sources}/add-command.md +11 -25
  27. package/{downloads/without-beads → src/sources}/ask.md +11 -6
  28. package/{downloads/without-beads → src/sources}/beepboop.md +7 -6
  29. package/{downloads/without-beads → src/sources}/busycommit.md +9 -36
  30. package/{downloads/without-beads → src/sources}/code-review.md +16 -30
  31. package/src/sources/commit.md +20 -0
  32. package/src/sources/cycle.md +23 -0
  33. package/{downloads/without-beads → src/sources}/gap.md +11 -8
  34. package/src/sources/green.md +23 -0
  35. package/src/sources/issue.md +42 -0
  36. package/{downloads/without-beads → src/sources}/kata.md +10 -9
  37. package/{downloads/without-beads → src/sources}/plan.md +18 -39
  38. package/{downloads/without-beads → src/sources}/pr.md +10 -6
  39. package/src/sources/red.md +26 -0
  40. package/src/sources/refactor.md +27 -0
  41. package/{downloads/without-beads → src/sources}/ship.md +11 -6
  42. package/{downloads/without-beads → src/sources}/show.md +11 -6
  43. package/src/sources/spike.md +23 -0
  44. package/src/sources/summarize.md +23 -0
  45. package/{downloads/without-beads → src/sources}/tdd-review.md +11 -31
  46. package/src/sources/tdd.md +24 -0
  47. package/{downloads/without-beads → src/sources}/worktree-add.md +13 -31
  48. package/{downloads/without-beads → src/sources}/worktree-cleanup.md +9 -27
  49. package/downloads/with-beads/add-command.md +0 -159
  50. package/downloads/with-beads/ask.md +0 -144
  51. package/downloads/with-beads/beepboop.md +0 -47
  52. package/downloads/with-beads/busycommit.md +0 -78
  53. package/downloads/with-beads/code-review.md +0 -263
  54. package/downloads/with-beads/commands-metadata.json +0 -155
  55. package/downloads/with-beads/commit.md +0 -49
  56. package/downloads/with-beads/cycle.md +0 -95
  57. package/downloads/with-beads/gap.md +0 -38
  58. package/downloads/with-beads/green.md +0 -95
  59. package/downloads/with-beads/issue.md +0 -152
  60. package/downloads/with-beads/kata.md +0 -444
  61. package/downloads/with-beads/plan.md +0 -186
  62. package/downloads/with-beads/pr.md +0 -82
  63. package/downloads/with-beads/red.md +0 -103
  64. package/downloads/with-beads/refactor.md +0 -105
  65. package/downloads/with-beads/ship.md +0 -98
  66. package/downloads/with-beads/show.md +0 -114
  67. package/downloads/with-beads/spike.md +0 -95
  68. package/downloads/with-beads/summarize.md +0 -54
  69. package/downloads/with-beads/tdd-review.md +0 -102
  70. package/downloads/with-beads/tdd.md +0 -94
  71. package/downloads/with-beads/worktree-add.md +0 -357
  72. package/downloads/with-beads/worktree-cleanup.md +0 -250
  73. package/downloads/without-beads/commands-metadata.json +0 -155
  74. package/downloads/without-beads/cycle.md +0 -90
  75. package/downloads/without-beads/green.md +0 -90
  76. package/downloads/without-beads/issue.md +0 -140
  77. package/downloads/without-beads/red.md +0 -98
  78. package/downloads/without-beads/refactor.md +0 -100
  79. package/downloads/without-beads/spike.md +0 -90
@@ -1,444 +0,0 @@
1
- ---
2
- description: Generate a TDD practice challenge with boilerplate test setup
3
- argument-hint: (no arguments - interactive)
4
- ---
5
-
6
- # Kata: TDD Practice Challenge Generator
7
-
8
- Generate a complete TDD practice setup:
9
-
10
- - `CHALLENGE.md` - Problem description
11
- - Test file with first test placeholder
12
- - Implementation file with empty function
13
-
14
- ## General Guidelines
15
-
16
- ### Output Style
17
-
18
- - **Never explicitly mention TDD** in code, comments, commits, PRs, or issues
19
- - Write natural, descriptive code without meta-commentary about the development process
20
- - The code should speak for itself - TDD is the process, not the product
21
-
22
- Beads is available for task tracking. Use `mcp__beads__*` tools to manage issues (the user interacts via `bd` commands).
23
-
24
- ## Input
25
-
26
- $ARGUMENTS
27
-
28
- (This command is interactive - arguments are ignored)
29
-
30
- ## Data Source
31
-
32
- Exercises from [cyber-dojo](https://github.com/cyber-dojo/exercises-start-points) (60 exercises, stable 10+ years).
33
-
34
- - **List:** `https://api.github.com/repos/cyber-dojo/exercises-start-points/contents/start-points`
35
- - **Fetch:** `https://raw.githubusercontent.com/cyber-dojo/exercises-start-points/master/start-points/{NAME}/readme.txt`
36
-
37
- ## Kata Categories
38
-
39
- <kata_categories>
40
- <by_difficulty>
41
- <beginner description="Simple logic, single function">
42
- Fizz_Buzz, Leap_Years, Prime_Factors, Word_Wrap, Closest_To_Zero,
43
- Remove_Duplicates, Array_Shuffle, Friday_13th, Five_Weekends,
44
- Number_Names, Print_Diamond, LCD_Digits, Fisher_Yates_Shuffle
45
- </beginner>
46
- <intermediate description="Multiple rules, edge cases">
47
- Roman_Numerals, Reverse_Roman, Bowling_Game, Tennis, Anagrams,
48
- ISBN, Balanced_Parentheses, Calc_Stats, Recently_Used_List,
49
- Phone_Numbers, Combined_Number, Group_Neighbours, Longest_Common_Prefix,
50
- Yatzy, Yatzy_Cutdown, Harry_Potter, Vending_Machine, Count_Coins,
51
- 100_doors, Haiku_Review, ABC_Problem, Align_Columns, Best_Shuffle,
52
- Filename_Range, Unsplice, 12_Days_of_Xmas
53
- </intermediate>
54
- <advanced description="Complex algorithms, state management">
55
- Game_of_Life, Mars_Rover, Mine_Sweeper, Mine_Field, Eight_Queens,
56
- Knights_Tour, Reversi, Poker_Hands, Levenshtein_Distance,
57
- Magic_Square, Saddle_Points, Tiny_Maze, Gray_Code, Monty_Hall,
58
- Number_Chains, Wonderland_Number, Zeckendorf_Number,
59
- Diff_Selector, Diversion, Reordering, Fizz_Buzz_Plus
60
- </advanced>
61
- </by_difficulty>
62
-
63
- <by_type>
64
- <string_text description="String/Text manipulation">
65
- Anagrams, Word_Wrap, Align_Columns, Best_Shuffle, Haiku_Review,
66
- Phone_Numbers, 12_Days_of_Xmas, Longest_Common_Prefix, Unsplice
67
- </string_text>
68
- <math_numbers description="Math & Numbers">
69
- Fizz_Buzz, Fizz_Buzz_Plus, Prime_Factors, Roman_Numerals, Reverse_Roman,
70
- Zeckendorf_Number, Number_Names, Combined_Number, Closest_To_Zero,
71
- Count_Coins, ISBN, LCD_Digits, Leap_Years, Five_Weekends, Friday_13th
72
- </math_numbers>
73
- <data_structures description="Data Structures & Algorithms">
74
- Recently_Used_List, Balanced_Parentheses, Calc_Stats, Remove_Duplicates,
75
- Array_Shuffle, Fisher_Yates_Shuffle, Levenshtein_Distance, Gray_Code,
76
- Number_Chains, Wonderland_Number, 100_doors, Magic_Square, Saddle_Points,
77
- Diff_Selector, Diversion, Reordering
78
- </data_structures>
79
- <game_logic description="Game Logic & Simulation">
80
- Game_of_Life, Bowling_Game, Tennis, Yatzy, Yatzy_Cutdown,
81
- Mine_Sweeper, Mine_Field, Mars_Rover, Reversi, Poker_Hands,
82
- Harry_Potter, Eight_Queens, Knights_Tour, Tiny_Maze, Monty_Hall,
83
- Vending_Machine, Print_Diamond, ABC_Problem, Group_Neighbours, Filename_Range
84
- </game_logic>
85
- </by_type>
86
- </kata_categories>
87
-
88
- ## Process
89
-
90
- Use conversational AskUserQuestion flow. User can skip to suggestions at any point.
91
-
92
- <execution_steps>
93
-
94
- <step_1>
95
- <description>Ask about difficulty preference</description>
96
- <prompt>
97
- <message>What difficulty level interests you?</message>
98
- <options>
99
- <option value="beginner">
100
- <label>Beginner</label>
101
- <description>Simple logic, single function (Fizz_Buzz, Leap_Years, Prime_Factors...)</description>
102
- </option>
103
- <option value="intermediate">
104
- <label>Intermediate</label>
105
- <description>Multiple rules, edge cases (Roman_Numerals, Bowling_Game, Tennis...)</description>
106
- </option>
107
- <option value="advanced">
108
- <label>Advanced</label>
109
- <description>Complex algorithms, state (Game_of_Life, Mars_Rover, Mine_Sweeper...)</description>
110
- </option>
111
- <option value="skip">
112
- <label>Just show me suggestions!</label>
113
- <description>Skip questions and see kata recommendations</description>
114
- </option>
115
- </options>
116
- </prompt>
117
- <if value="skip">Jump to step_suggest</if>
118
- <set_variable>$DIFFICULTY = selected value</set_variable>
119
- </step_1>
120
-
121
- <step_2>
122
- <description>Ask about challenge type</description>
123
- <prompt>
124
- <message>What kind of challenge interests you?</message>
125
- <options>
126
- <option value="string_text">
127
- <label>String/Text</label>
128
- <description>Text manipulation, parsing, formatting</description>
129
- </option>
130
- <option value="math_numbers">
131
- <label>Math & Numbers</label>
132
- <description>Calculations, conversions, number theory</description>
133
- </option>
134
- <option value="data_structures">
135
- <label>Data Structures</label>
136
- <description>Lists, algorithms, transformations</description>
137
- </option>
138
- <option value="game_logic">
139
- <label>Game Logic</label>
140
- <description>Games, simulations, state machines</description>
141
- </option>
142
- <option value="skip">
143
- <label>Show me suggestions now!</label>
144
- <description>Skip remaining questions</description>
145
- </option>
146
- </options>
147
- </prompt>
148
- <if value="skip">Jump to step_suggest</if>
149
- <set_variable>$TYPE = selected value</set_variable>
150
- </step_2>
151
-
152
- <step_suggest>
153
- <description>Show kata suggestions based on filters</description>
154
- <logic>
155
- - Filter kata_categories by $DIFFICULTY (if set)
156
- - Filter by $TYPE (if set)
157
- - If no filters, pick 3 varied suggestions
158
- - Select 3 katas that match criteria
159
- - For each kata, fetch a preview or use the descriptions below
160
- </logic>
161
- <kata_descriptions>
162
- <!-- Beginner -->
163
- Fizz_Buzz: Print 1-100 replacing multiples of 3/5 with Fizz/Buzz
164
- Leap_Years: Determine if a year is a leap year (divisibility rules)
165
- Prime_Factors: Find prime factors of a number
166
- Word_Wrap: Wrap text to fit within a column width
167
- Closest_To_Zero: Find the number closest to zero from a list
168
- Remove_Duplicates: Remove duplicate elements from a list
169
- Array_Shuffle: Randomly shuffle array elements
170
- Friday_13th: Count Friday the 13ths in a given year
171
- Five_Weekends: Find months with 5 Fridays, Saturdays, and Sundays
172
- Number_Names: Convert numbers to English words (one, two, three...)
173
- Print_Diamond: Print a diamond shape of letters
174
- LCD_Digits: Display numbers as LCD-style digits
175
- Fisher_Yates_Shuffle: Implement the Fisher-Yates shuffle algorithm
176
-
177
- <!-- Intermediate -->
178
- Roman_Numerals: Convert Arabic numbers to Roman numerals
179
- Reverse_Roman: Convert Roman numerals back to Arabic numbers
180
- Bowling_Game: Score a 10-pin bowling game with spares/strikes
181
- Tennis: Track tennis game score with deuce/advantage
182
- Anagrams: Find all anagrams of a word from a dictionary
183
- ISBN: Validate ISBN-10 check digits
184
- Balanced_Parentheses: Check if brackets are properly balanced
185
- Calc_Stats: Calculate min/max/count/average from numbers
186
- Recently_Used_List: Implement a most-recently-used list
187
- Phone_Numbers: Convert phone numbers to words using keypad letters
188
- Combined_Number: Arrange numbers to form the largest combined number
189
- Group_Neighbours: Group adjacent equal elements in a list
190
- Longest_Common_Prefix: Find longest common prefix among strings
191
- Yatzy: Score a Yatzy dice game (full version)
192
- Yatzy_Cutdown: Simplified Yatzy scoring
193
- Harry_Potter: Calculate discounts for Harry Potter book sets
194
- Vending_Machine: Calculate change for vending machine purchases
195
- Count_Coins: Count ways to make change with given coins
196
- 100_doors: Toggle 100 doors puzzle (open/close pattern)
197
- Haiku_Review: Validate haiku syllable structure (5-7-5)
198
- ABC_Problem: Spell words using lettered blocks
199
- Align_Columns: Align text into formatted columns
200
- Best_Shuffle: Shuffle string so no character stays in place
201
- Filename_Range: Generate filename sequences (file001, file002...)
202
- Unsplice: Reverse a string splice operation
203
- 12_Days_of_Xmas: Generate "12 Days of Christmas" lyrics
204
-
205
- <!-- Advanced -->
206
- Game_of_Life: Conway's cellular automaton simulation
207
- Mars_Rover: Navigate a rover on a grid with commands (L/R/M)
208
- Mine_Sweeper: Generate numbers for a minesweeper grid
209
- Mine_Field: Place mines randomly on a grid
210
- Eight_Queens: Place 8 queens on a chessboard without conflicts
211
- Knights_Tour: Find a path visiting all squares on a chessboard
212
- Reversi: Implement Reversi/Othello game logic
213
- Poker_Hands: Compare and rank poker hands
214
- Levenshtein_Distance: Calculate edit distance between strings
215
- Magic_Square: Generate magic squares (rows/cols/diags sum equal)
216
- Saddle_Points: Find saddle points in a matrix
217
- Tiny_Maze: Solve a small maze pathfinding problem
218
- Gray_Code: Generate Gray code sequences
219
- Monty_Hall: Simulate the Monty Hall probability problem
220
- Number_Chains: Find chains where numbers link by digits
221
- Wonderland_Number: Find 6-digit number with multiplication property
222
- Zeckendorf_Number: Represent as sum of non-consecutive Fibonacci numbers
223
- Diff_Selector: Select differences between data sets
224
- Diversion: Route around obstacles
225
- Reordering: Reorder elements based on rules
226
- Fizz_Buzz_Plus: Extended FizzBuzz with additional rules
227
- </kata_descriptions>
228
- <prompt>
229
- <message>Here are 3 katas that match your criteria:</message>
230
- <options>
231
- <option value="kata_1">
232
- <label>{Kata_Name_1}</label>
233
- <description>{Description from kata_descriptions}</description>
234
- </option>
235
- <option value="kata_2">
236
- <label>{Kata_Name_2}</label>
237
- <description>{Description from kata_descriptions}</description>
238
- </option>
239
- <option value="kata_3">
240
- <label>{Kata_Name_3}</label>
241
- <description>{Description from kata_descriptions}</description>
242
- </option>
243
- <option value="more_suggestions">
244
- <label>Show me 3 different ones</label>
245
- <description>Same criteria, different suggestions</description>
246
- </option>
247
- <option value="more_questions">
248
- <label>Ask me more questions...</label>
249
- <description>Refine my preferences further</description>
250
- </option>
251
- </options>
252
- </prompt>
253
- <if value="more_suggestions">Pick 3 different katas matching same criteria, repeat step_suggest</if>
254
- <if value="more_questions">
255
- - If user skipped from step_1: Jump to step_1 (ask difficulty)
256
- - If user answered step_1 but skipped step_2: Jump to step_2 (ask type)
257
- - If user answered both: Jump to step_1 to reconsider from start
258
- </if>
259
- <set_variable>$SELECTED_KATA = selected kata name</set_variable>
260
- </step_suggest>
261
-
262
- <step_fetch>
263
- <description>Fetch kata content from cyber-dojo</description>
264
- <action>
265
- Use WebFetch to get:
266
- https://raw.githubusercontent.com/cyber-dojo/exercises-start-points/master/start-points/{$SELECTED_KATA}/readme.txt
267
- </action>
268
- <store>$KATA_CONTENT = fetched readme content</store>
269
- </step_fetch>
270
-
271
- <step_confirm>
272
- <description>Show full kata details and ask for language</description>
273
- <display>
274
- Present the full kata content to the user:
275
-
276
- ## {$SELECTED_KATA}
277
-
278
- **Difficulty:** {$DIFFICULTY_STARS based on category - ⭐ Beginner, ⭐⭐ Intermediate, ⭐⭐⭐ Advanced}
279
-
280
- ### Problem Description
281
- {$KATA_CONTENT from readme.txt}
282
- </display>
283
- <prompt>
284
- <message>What language will you use for this kata?</message>
285
- <options>
286
- <option value="typescript">
287
- <label>TypeScript + Vitest</label>
288
- <description>Modern test runner with great DX</description>
289
- </option>
290
- <option value="javascript">
291
- <label>JavaScript + Vitest</label>
292
- <description>Same great runner, no types</description>
293
- </option>
294
- <option value="python">
295
- <label>Python + pytest</label>
296
- <description>Simple and powerful testing</description>
297
- </option>
298
- <option value="back">
299
- <label>Show me other katas</label>
300
- <description>Go back to suggestions</description>
301
- </option>
302
- </options>
303
- </prompt>
304
- <note>User can also select "Other" to type a custom language/framework</note>
305
- <if value="back">Jump back to step_suggest</if>
306
- <set_variable>$LANGUAGE = selected value (or custom input)</set_variable>
307
- </step_confirm>
308
-
309
- <step_generate>
310
- <description>Generate kata files based on language</description>
311
- <action>Create the following files based on $LANGUAGE:</action>
312
-
313
- <file name="CHALLENGE.md">
314
- # Kata: {$SELECTED_KATA}
315
-
316
- ## Difficulty
317
-
318
- {$DIFFICULTY_STARS based on category}
319
-
320
- ## Problem
321
-
322
- {$KATA_CONTENT from readme.txt}
323
-
324
- ## TDD Approach
325
-
326
- Work through this kata using the red-green-refactor cycle:
327
-
328
- 1. **Red**: Write a failing test for the simplest case
329
- 2. **Green**: Write minimal code to pass
330
- 3. **Refactor**: Clean up while keeping tests green
331
- 4. **Repeat**: Add the next test case
332
-
333
- ## Source
334
-
335
- [cyber-dojo: {$SELECTED_KATA}](https://cyber-dojo.org)
336
- </file>
337
-
338
- <file name="kata.ts" condition="$LANGUAGE == typescript">
339
- /**
340
- * {$SELECTED_KATA}
341
- * See CHALLENGE.md for requirements
342
- */
343
- export function solve(input: unknown): unknown {
344
- throw new Error("Not implemented - start with a failing test!");
345
- }
346
- </file>
347
-
348
- <file name="kata.test.ts" condition="$LANGUAGE == typescript">
349
- import { describe, it, expect } from "vitest";
350
- import { solve } from "./kata";
351
-
352
- describe("{$SELECTED_KATA}", () => {
353
- it.todo("should handle the simplest case");
354
-
355
- // Add your first real test here using the red-green-refactor cycle
356
- });
357
- </file>
358
-
359
- <file name="kata.js" condition="$LANGUAGE == javascript">
360
- /**
361
- * {$SELECTED_KATA}
362
- * See CHALLENGE.md for requirements
363
- */
364
- export function solve(input) {
365
- throw new Error("Not implemented - start with a failing test!");
366
- }
367
- </file>
368
-
369
- <file name="kata.test.js" condition="$LANGUAGE == javascript">
370
- import { describe, it, expect } from "vitest";
371
- import { solve } from "./kata.js";
372
-
373
- describe("{$SELECTED_KATA}", () => {
374
- it.todo("should handle the simplest case");
375
-
376
- // Add your first real test here using the red-green-refactor cycle
377
- });
378
- </file>
379
-
380
- <file name="kata.py" condition="$LANGUAGE == python">
381
- """
382
- {$SELECTED_KATA}
383
- See CHALLENGE.md for requirements
384
- """
385
-
386
- def solve(input):
387
- raise NotImplementedError("Start with a failing test!")
388
- </file>
389
-
390
- <file name="test_kata.py" condition="$LANGUAGE == python">
391
- import pytest
392
- from kata import solve
393
-
394
- class TestKata:
395
- def test_placeholder(self):
396
- """Remove this and add your first real test"""
397
- pytest.skip("Start with a failing test!")
398
-
399
- # Add your first real test here using the red-green-refactor cycle
400
- </file>
401
-
402
- <custom_language condition="$LANGUAGE is custom input (user typed via 'Other')">
403
- Generate appropriate boilerplate based on user's specified language:
404
- - CHALLENGE.md (always)
405
- - Implementation file with idiomatic naming and empty function
406
- - Test file using common test framework for that language
407
-
408
- Examples:
409
- - "Go" → kata.go + kata_test.go (testing package)
410
- - "Rust" → src/lib.rs + tests/kata_test.rs (cargo test)
411
- - "Java" → Kata.java + KataTest.java (JUnit)
412
- - "C#" → Kata.cs + KataTests.cs (xUnit/NUnit)
413
- - "Ruby" → kata.rb + kata_spec.rb (RSpec)
414
- - "Elixir" → kata.ex + kata_test.exs (ExUnit)
415
- - "Haskell" → Kata.hs + KataSpec.hs (Hspec)
416
- - "Clojure" → kata.clj + kata_test.clj (clojure.test)
417
-
418
- Use your knowledge of the language's conventions and popular test frameworks.
419
- Follow the same pattern: empty function that throws/raises "not implemented".
420
- </custom_language>
421
-
422
- <message>
423
- Kata setup complete!
424
-
425
- Created files:
426
- - CHALLENGE.md (problem description)
427
- {if $LANGUAGE != other}
428
- - Implementation file with empty solve() function
429
- - Test file with placeholder test
430
- {endif}
431
-
432
- Start practicing with `/red` to write your first failing test!
433
- </message>
434
- </step_generate>
435
-
436
- </execution_steps>
437
-
438
- ## Notes
439
-
440
- - Kata content is fetched at runtime from cyber-dojo's GitHub repository
441
- - The cyber-dojo project has been maintained for 10+ years with stable URLs
442
- - All exercises are designed for TDD practice
443
- - User can always go back to refine their preferences
444
- - Boilerplate uses `solve()` as the main function - rename as needed for clarity
@@ -1,186 +0,0 @@
1
- ---
2
- description: Create implementation plan from feature/requirement with PRD-style discovery and TDD acceptance criteria
3
- argument-hint: <feature/requirement description or GitHub issue URL/number>
4
- ---
5
-
6
- # Plan: PRD-Informed Task Planning for TDD
7
-
8
- Create structured implementation plan that bridges product thinking (PRD) with test-driven development.
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
- ## Input
21
-
22
- $ARGUMENTS
23
-
24
- (If no input provided, check conversation context or run `bd ready` to see existing work)
25
-
26
- ## Input Processing
27
-
28
- The input can be one of:
29
-
30
- 1. **GitHub Issue URL** (e.g., `https://github.com/owner/repo/issues/123`)
31
- 2. **GitHub Issue Number** (e.g., `#123` or `123`)
32
- 3. **Feature Description** (e.g., "Add user authentication")
33
- 4. **Empty** - use conversation context
34
-
35
- ### GitHub Issue Integration
36
-
37
- If input looks like a GitHub issue:
38
-
39
- **Step 1: Extract Issue Number**
40
-
41
- - From URL: extract owner/repo/number
42
- - From number: try to infer repo from git remote
43
- - From branch name: check patterns like `issue-123`, `123-feature`, `feature/123`
44
-
45
- **Step 2: Fetch Issue**
46
- Try GitHub MCP first:
47
-
48
- - If available: use `mcp__github__issue_read` to fetch issue details
49
- - If not available: show message and try `gh issue view <number>`
50
-
51
- ```
52
- GitHub MCP not configured!
53
- See: https://github.com/modelcontextprotocol/servers/tree/main/src/github
54
- Trying GitHub CLI fallback...
55
- ```
56
-
57
- **Step 3: Use Issue as Discovery Input**
58
-
59
- - Title → Feature name
60
- - Description → Problem statement and context
61
- - Labels → Type/priority hints
62
- - Comments → Additional requirements and discussion
63
- - Linked issues → Dependencies
64
-
65
- Extract from GitHub issue:
66
-
67
- - Problem statement and context
68
- - Acceptance criteria (if present)
69
- - Technical notes (if present)
70
- - Related issues/dependencies
71
-
72
- ## Process
73
-
74
- ## Discovery Phase
75
-
76
- Understand the requirement by asking (use AskUserQuestion if needed):
77
-
78
- **Problem Statement**
79
-
80
- - What problem does this solve?
81
- - Who experiences this problem?
82
- - What's the current pain point?
83
-
84
- **Desired Outcome**
85
-
86
- - What should happen after this is built?
87
- - How will users interact with it?
88
- - What does success look like?
89
-
90
- **Scope & Constraints**
91
-
92
- - What's in scope vs. out of scope?
93
- - Any technical constraints?
94
- - Dependencies on other systems/features?
95
-
96
- **Context Check**
97
-
98
- - Search codebase for related features/modules
99
- - Check for existing test files that might be relevant
100
-
101
- ### Create Beads Issues
102
-
103
- For each task, create a bd issue with:
104
-
105
- ```bash
106
- bd create "Task title" \
107
- --type [feature|bug|task|chore] \
108
- --priority [1-3] \
109
- --description "Context and what needs to be built" \
110
- --design "Technical approach, architecture notes" \
111
- --acceptance "Given-When-Then acceptance criteria"
112
- ```
113
-
114
- **Issue Structure Best Practices:**
115
-
116
- **Title**: Action-oriented, specific
117
-
118
- - ✅ "Add JWT token validation middleware"
119
- - ❌ "Authentication stuff"
120
-
121
- **Description**: Provide context
122
-
123
- - Why this task exists
124
- - How it fits into the larger feature
125
- - Links to related issues/docs
126
-
127
- **Design**: Technical approach
128
-
129
- - Key interfaces/types needed
130
- - Algorithm or approach
131
- - Libraries or patterns to use
132
- - Known gotchas or considerations
133
-
134
- **Acceptance Criteria**: Test-ready scenarios
135
-
136
- - Given-When-Then format
137
- - Concrete, verifiable conditions
138
- - Cover main case + edge cases
139
- - Map 1:1 to future tests
140
-
141
- **Dependencies**: Link related issues
142
-
143
- ```bash
144
- bd dep add ISSUE-123 ISSUE-456 --type blocks
145
- ```
146
-
147
- ### Validation
148
-
149
- After creating issues, verify:
150
-
151
- - ✅ Each issue has clear acceptance criteria
152
- - ✅ Dependencies are mapped (use `bd dep add`)
153
- - ✅ Issues are ordered by implementation sequence
154
- - ✅ First few issues are ready to start (`bd ready` shows them)
155
- - ✅ Each issue is small enough for TDD (if too big, break down more)
156
-
157
- ## Key Principles
158
-
159
- **From PRD World:**
160
-
161
- - Start with user problems, not solutions
162
- - Define success criteria upfront
163
- - Understand constraints and scope
164
-
165
- **From TDD World:**
166
-
167
- - Make acceptance criteria test-ready
168
- - Break work into small, testable pieces
169
- - Each task should map to test(s)
170
-
171
- ### Beads Integration
172
-
173
- Use Beads MCP to:
174
-
175
- - Track work with `bd ready` to find next task
176
- - Create issues with `bd create "description"`
177
- - Track dependencies with `bd dep add`
178
-
179
- See <https://github.com/steveyegge/beads> for more information.
180
-
181
- ## Integration with Other Commands
182
-
183
- - **Before /plan**: Use `/spike` if you need technical exploration first
184
- - **After /plan**: Use `/red` to start TDD on first task
185
- - **During work**: Use `bd update` to add notes/findings back to issues
186
- - **When stuck**: Check `bd show ISSUE-ID` to review acceptance criteria