@hustle-together/api-dev-tools 3.10.1 → 3.12.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.
Files changed (178) hide show
  1. package/.claude/agents/code-reviewer.md +170 -0
  2. package/.claude/agents/docs-generator.md +80 -0
  3. package/.claude/agents/implementation-reviewer.md +119 -0
  4. package/.claude/agents/parallel-researcher.md +52 -0
  5. package/.claude/agents/research-validator.md +116 -0
  6. package/.claude/agents/schema-generator.md +70 -0
  7. package/.claude/agents/test-writer.md +104 -0
  8. package/.claude/api-dev-state.json +331 -0
  9. package/.claude/commands/README.md +196 -0
  10. package/.claude/commands/add-command.md +212 -0
  11. package/.claude/commands/api-create.md +510 -0
  12. package/.claude/commands/api-env.md +51 -0
  13. package/.claude/commands/api-interview.md +344 -0
  14. package/.claude/commands/api-research.md +357 -0
  15. package/.claude/commands/api-status.md +279 -0
  16. package/.claude/commands/api-verify.md +232 -0
  17. package/.claude/commands/beepboop.md +96 -0
  18. package/.claude/commands/busycommit.md +111 -0
  19. package/.claude/commands/commit.md +82 -0
  20. package/.claude/commands/cycle.md +137 -0
  21. package/.claude/commands/gap.md +85 -0
  22. package/.claude/commands/green.md +137 -0
  23. package/.claude/commands/issue.md +187 -0
  24. package/.claude/commands/ntfy-setup.md +91 -0
  25. package/.claude/commands/ntfy-test.md +74 -0
  26. package/.claude/commands/plan.md +167 -0
  27. package/.claude/commands/pr.md +121 -0
  28. package/.claude/commands/publish.md +40 -0
  29. package/.claude/commands/red.md +137 -0
  30. package/.claude/commands/refactor.md +137 -0
  31. package/.claude/commands/spike.md +137 -0
  32. package/.claude/commands/summarize.md +93 -0
  33. package/.claude/commands/tdd.md +139 -0
  34. package/.claude/commands/worktree-add.md +307 -0
  35. package/.claude/commands/worktree-cleanup.md +275 -0
  36. package/.claude/hooks/api-workflow-check.py +227 -0
  37. package/.claude/hooks/enforce-deep-research.py +185 -0
  38. package/.claude/hooks/enforce-disambiguation.py +155 -0
  39. package/.claude/hooks/enforce-documentation.py +192 -0
  40. package/.claude/hooks/enforce-environment.py +253 -0
  41. package/.claude/hooks/enforce-external-research.py +328 -0
  42. package/.claude/hooks/enforce-interview.py +421 -0
  43. package/.claude/hooks/enforce-refactor.py +189 -0
  44. package/.claude/hooks/enforce-research.py +159 -0
  45. package/.claude/hooks/enforce-schema.py +186 -0
  46. package/.claude/hooks/enforce-scope.py +160 -0
  47. package/.claude/hooks/enforce-tdd-red.py +250 -0
  48. package/.claude/hooks/enforce-verify.py +186 -0
  49. package/.claude/hooks/periodic-reground.py +154 -0
  50. package/.claude/hooks/session-startup.py +151 -0
  51. package/.claude/hooks/track-tool-use.py +626 -0
  52. package/.claude/hooks/verify-after-green.py +282 -0
  53. package/.claude/hooks/verify-implementation.py +225 -0
  54. package/.claude/research/index.json +6 -0
  55. package/.claude/settings.json +144 -0
  56. package/.claude/settings.local.json +12 -0
  57. package/.claude-plugin/marketplace.json +103 -0
  58. package/.skills/README.md +293 -0
  59. package/.skills/_shared/convert-commands.py +192 -0
  60. package/.skills/_shared/hooks/api-workflow-check.py +227 -0
  61. package/.skills/_shared/hooks/enforce-deep-research.py +185 -0
  62. package/.skills/_shared/hooks/enforce-disambiguation.py +155 -0
  63. package/.skills/_shared/hooks/enforce-documentation.py +192 -0
  64. package/.skills/_shared/hooks/enforce-environment.py +253 -0
  65. package/.skills/_shared/hooks/enforce-external-research.py +328 -0
  66. package/.skills/_shared/hooks/enforce-interview.py +421 -0
  67. package/.skills/_shared/hooks/enforce-refactor.py +189 -0
  68. package/.skills/_shared/hooks/enforce-research.py +159 -0
  69. package/.skills/_shared/hooks/enforce-schema.py +186 -0
  70. package/.skills/_shared/hooks/enforce-scope.py +160 -0
  71. package/.skills/_shared/hooks/enforce-tdd-red.py +250 -0
  72. package/.skills/_shared/hooks/enforce-verify.py +186 -0
  73. package/.skills/_shared/hooks/periodic-reground.py +154 -0
  74. package/.skills/_shared/hooks/session-startup.py +151 -0
  75. package/.skills/_shared/hooks/track-tool-use.py +626 -0
  76. package/.skills/_shared/hooks/verify-after-green.py +282 -0
  77. package/.skills/_shared/hooks/verify-implementation.py +225 -0
  78. package/.skills/_shared/install.sh +114 -0
  79. package/.skills/_shared/settings.json +93 -0
  80. package/.skills/add-command/SKILL.md +227 -0
  81. package/.skills/api-create/SKILL.md +623 -0
  82. package/.skills/api-env/SKILL.md +64 -0
  83. package/.skills/api-interview/SKILL.md +357 -0
  84. package/.skills/api-research/SKILL.md +370 -0
  85. package/.skills/api-status/SKILL.md +292 -0
  86. package/.skills/api-verify/SKILL.md +245 -0
  87. package/.skills/beepboop/SKILL.md +111 -0
  88. package/.skills/busycommit/SKILL.md +126 -0
  89. package/.skills/commit/SKILL.md +97 -0
  90. package/.skills/cycle/SKILL.md +152 -0
  91. package/.skills/gap/SKILL.md +100 -0
  92. package/.skills/green/SKILL.md +152 -0
  93. package/.skills/issue/SKILL.md +202 -0
  94. package/.skills/plan/SKILL.md +182 -0
  95. package/.skills/pr/SKILL.md +136 -0
  96. package/.skills/publish/SKILL.md +160 -0
  97. package/.skills/red/SKILL.md +152 -0
  98. package/.skills/refactor/SKILL.md +152 -0
  99. package/.skills/spike/SKILL.md +152 -0
  100. package/.skills/summarize/SKILL.md +108 -0
  101. package/.skills/tdd/SKILL.md +154 -0
  102. package/.skills/update-todos/SKILL.md +250 -0
  103. package/.skills/worktree-add/SKILL.md +322 -0
  104. package/.skills/worktree-cleanup/SKILL.md +290 -0
  105. package/CHANGELOG.md +115 -0
  106. package/README.md +161 -7101
  107. package/bin/cli.js +448 -805
  108. package/commands/README.md +66 -31
  109. package/commands/add-command.md +8 -5
  110. package/commands/beepboop.md +4 -5
  111. package/commands/busycommit.md +2 -3
  112. package/commands/commit.md +2 -3
  113. package/commands/cycle.md +2 -7
  114. package/commands/gap.md +2 -3
  115. package/commands/green.md +2 -7
  116. package/commands/hustle-api-continue.md +8 -5
  117. package/commands/hustle-api-create.md +70 -29
  118. package/commands/hustle-api-env.md +1 -0
  119. package/commands/hustle-api-interview.md +32 -19
  120. package/commands/hustle-api-research.md +47 -21
  121. package/commands/hustle-api-sessions.md +8 -7
  122. package/commands/hustle-api-status.md +21 -1
  123. package/commands/hustle-api-verify.md +14 -13
  124. package/commands/hustle-combine.md +488 -241
  125. package/commands/hustle-ui-create-page.md +113 -50
  126. package/commands/hustle-ui-create.md +179 -26
  127. package/commands/issue.md +3 -8
  128. package/commands/plan.md +2 -3
  129. package/commands/pr.md +2 -3
  130. package/commands/red.md +2 -7
  131. package/commands/refactor.md +2 -7
  132. package/commands/spike.md +2 -7
  133. package/commands/summarize.md +2 -3
  134. package/commands/tdd.md +2 -7
  135. package/commands/worktree-add.md +208 -216
  136. package/commands/worktree-cleanup.md +172 -178
  137. package/hooks/api-workflow-check.py +5 -3
  138. package/hooks/enforce-component-type-confirm.py +97 -0
  139. package/hooks/lib/__init__.py +1 -0
  140. package/hooks/lib/greptile.py +355 -0
  141. package/hooks/lib/ntfy.py +209 -0
  142. package/hooks/notify-input-needed.py +73 -0
  143. package/hooks/notify-phase-complete.py +90 -0
  144. package/hooks/run-code-review.py +246 -0
  145. package/hooks/track-token-usage.py +121 -0
  146. package/package.json +33 -12
  147. package/scripts/collect-test-results.ts +102 -77
  148. package/scripts/extract-parameters.ts +112 -70
  149. package/scripts/generate-test-manifest.ts +118 -77
  150. package/templates/.env.example +57 -0
  151. package/templates/BRAND_GUIDE.md +92 -52
  152. package/templates/CLAUDE-SECTION.md +40 -37
  153. package/templates/SPEC.json +186 -38
  154. package/templates/api-dev-state.json +33 -4
  155. package/templates/api-showcase/_components/APICard.tsx +22 -18
  156. package/templates/api-showcase/_components/APIModal.tsx +110 -64
  157. package/templates/api-showcase/_components/APIShowcase.tsx +53 -35
  158. package/templates/api-showcase/_components/APITester.tsx +128 -67
  159. package/templates/api-showcase/page.tsx +4 -4
  160. package/templates/api-test/page.tsx +51 -30
  161. package/templates/api-test/test-structure/route.ts +43 -34
  162. package/templates/component/Component.stories.tsx +41 -39
  163. package/templates/component/Component.test.tsx +96 -78
  164. package/templates/component/Component.tsx +63 -52
  165. package/templates/component/Component.types.ts +10 -6
  166. package/templates/component/Component.visual.spec.ts +170 -0
  167. package/templates/component/index.ts +2 -2
  168. package/templates/dev-tools/_components/DevToolsLanding.tsx +8 -8
  169. package/templates/dev-tools/page.tsx +4 -3
  170. package/templates/mcp-servers.json +30 -2
  171. package/templates/page/page.e2e.test.ts +56 -48
  172. package/templates/page/page.tsx +3 -3
  173. package/templates/shared/HeroHeader.tsx +16 -15
  174. package/templates/shared/index.ts +1 -1
  175. package/templates/ui-showcase/_components/PreviewCard.tsx +20 -20
  176. package/templates/ui-showcase/_components/PreviewModal.tsx +149 -108
  177. package/templates/ui-showcase/_components/UIShowcase.tsx +43 -35
  178. package/templates/ui-showcase/page.tsx +4 -4
@@ -0,0 +1,152 @@
1
+ ---
2
+ name: refactor
3
+ description: TDD Refactor Phase - improve code structure, readability, and performance while keeping all tests green. Use after tests pass to clean up code. Keywords: tdd, refactoring, cleanup, optimization, quality
4
+ license: MIT
5
+ compatibility: Requires Claude Code with MCP servers (Context7, GitHub), Python 3.9+ for hooks, pnpm 10.11.0+
6
+ metadata:
7
+ version: "3.0.0"
8
+ category: "testing"
9
+ tags: ['tdd', 'refactoring', 'cleanup', 'optimization']
10
+ author: "Hustle Together"
11
+ allowed-tools: WebSearch WebFetch mcp__context7 mcp__github AskUserQuestion Read Write Edit Bash TodoWrite
12
+ ---
13
+
14
+ ---
15
+
16
+ description: Execute TDD Refactor Phase - improve code structure while keeping tests green
17
+ argument-hint: <refactoring description>
18
+
19
+ ---
20
+
21
+ Apply this document (specifically the Refactor phase), to the info given by user input here: $ARGUMENTS
22
+
23
+ ## General Guidelines
24
+
25
+ ### Output Style
26
+
27
+ - **Never explicitly mention TDD** in code, comments, commits, PRs, or issues
28
+ - Write natural, descriptive code without meta-commentary about the development process
29
+ - The code should speak for itself - TDD is the process, not the product
30
+
31
+ (If there was no info above, fallback to the context of the conversation)
32
+
33
+ ## TDD Fundamentals
34
+
35
+ ### The TDD Cycle
36
+
37
+ The foundation of TDD is the Red-Green-Refactor cycle:
38
+
39
+ 1. **Red Phase**: Write ONE failing test that describes desired behavior
40
+ - The test must fail for the RIGHT reason (not syntax/import errors)
41
+ - Only one test at a time - this is critical for TDD discipline
42
+ - 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.
43
+ - **Adding a single test to a test file is ALWAYS allowed** - no prior test output needed
44
+ - Starting TDD for a new feature is always valid, even if test output shows unrelated work
45
+ - For DOM-based tests, use `data-testid` attributes to select elements rather than CSS classes, tag names, or text content
46
+ - 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
47
+
48
+ 2. **Green Phase**: Write MINIMAL code to make the test pass
49
+ - Implement only what's needed for the current failing test
50
+ - No anticipatory coding or extra features
51
+ - Address the specific failure message
52
+
53
+ 3. **Refactor Phase**: Improve code structure while keeping tests green
54
+ - Only allowed when relevant tests are passing
55
+ - Requires proof that tests have been run and are green
56
+ - Applies to BOTH implementation and test code
57
+ - No refactoring with failing tests - fix them first
58
+
59
+ ### Core Violations
60
+
61
+ 1. **Multiple Test Addition**
62
+ - Adding more than one new test at once
63
+ - Exception: Initial test file setup or extracting shared test utilities
64
+
65
+ 2. **Over-Implementation**
66
+ - Code that exceeds what's needed to pass the current failing test
67
+ - Adding untested features, methods, or error handling
68
+ - Implementing multiple methods when test only requires one
69
+
70
+ 3. **Premature Implementation**
71
+ - Adding implementation before a test exists and fails properly
72
+ - Adding implementation without running the test first
73
+ - Refactoring when tests haven't been run or are failing
74
+
75
+ ### Critical Principle: Incremental Development
76
+
77
+ Each step in TDD should address ONE specific issue:
78
+
79
+ - Test fails "not defined" → Create empty stub/class only
80
+ - Test fails "not a function" → Add method stub only
81
+ - Test fails with assertion → Implement minimal logic only
82
+
83
+ ### Optional Pre-Phase: Spike Phase
84
+
85
+ In rare cases where the problem space, interface, or expected behavior is unclear, a **Spike Phase** may be used **before the Red Phase**.
86
+ This phase is **not part of the regular TDD workflow** and must only be applied under exceptional circumstances.
87
+
88
+ - The goal of a Spike is **exploration and learning**, not implementation.
89
+ - The code written during a Spike is **disposable** and **must not** be merged or reused directly.
90
+ - Once sufficient understanding is achieved, all spike code is discarded, and normal TDD resumes starting from the **Red Phase**.
91
+ - A Spike is justified only when it is impossible to define a meaningful failing test due to technical uncertainty or unknown system behavior.
92
+
93
+ ### General Information
94
+
95
+ - 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.
96
+ - 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.
97
+ - 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.
98
+ - Adding types, interfaces, or a constant in order to replace magic values is perfectly fine during refactoring.
99
+ - Provide the agent with helpful directions so that they do not get stuck when blocking them.
100
+
101
+ 1. **Consistency check** - Look for inconsistent patterns, naming conventions, or structure across the codebase
102
+
103
+ ## 🛡 Project Rules (Injected into every command)
104
+
105
+ 1. **NO BROKEN BUILDS:**
106
+ - Run `pnpm test` before every `/commit`
107
+ - Ensure all tests pass
108
+ - Fix any type errors immediately
109
+
110
+ 2. **API DEVELOPMENT:**
111
+ - All new APIs MUST have Zod request/response schemas
112
+ - All APIs MUST be documented in both:
113
+ - OpenAPI spec ([src/lib/openapi/](src/lib/openapi/))
114
+ - API test manifest ([src/app/api-test/api-tests-manifest.json](src/app/api-test/api-tests-manifest.json))
115
+ - Test ALL parameters and edge cases
116
+ - Include code examples and real-world outputs
117
+
118
+ 3. **TDD WORKFLOW:**
119
+ - ALWAYS use /red → /green → /refactor cycle
120
+ - NEVER write implementation without failing test first
121
+ - Use /cycle for feature development
122
+ - Use characterization tests for refactoring
123
+
124
+ 4. **API KEY MANAGEMENT:**
125
+ - Support three loading methods:
126
+ - Server environment variables
127
+ - NEXT*PUBLIC* variables (client-side)
128
+ - Custom headers (X-OpenAI-Key, X-Anthropic-Key, etc.)
129
+ - Never hardcode API keys
130
+ - Always validate key availability before use
131
+
132
+ 5. **COMPREHENSIVE TESTING:**
133
+ - When researching APIs, read actual implementation code
134
+ - Discover ALL possible parameters (not just documented ones)
135
+ - Test with various parameter combinations
136
+ - Document custom headers, query params, request/response schemas
137
+ - Include validation rules and testing notes
138
+
139
+ 6. **NO UI BLOAT:**
140
+ - This is an API project with minimal frontend
141
+ - Only keep necessary test/documentation interfaces
142
+ - Delete unused components immediately
143
+ - No unnecessary UI libraries or features
144
+
145
+ 7. **DOCUMENTATION:**
146
+ - If you change an API, you MUST update:
147
+ - OpenAPI spec
148
+ - api-tests-manifest.json
149
+ - Code examples
150
+ - Testing notes
151
+ - Document expected behavior and edge cases
152
+ - Include real-world output examples
@@ -0,0 +1,152 @@
1
+ ---
2
+ name: spike
3
+ description: Execute TDD Spike Phase - exploratory coding to understand problem space before formal TDD. Use when requirements are unclear or architecture needs exploration. Keywords: spike, exploration, prototyping, learning, architecture
4
+ license: MIT
5
+ compatibility: Requires Claude Code with MCP servers (Context7, GitHub), Python 3.9+ for hooks, pnpm 10.11.0+
6
+ metadata:
7
+ version: "3.0.0"
8
+ category: "workflow"
9
+ tags: ['spike', 'exploration', 'prototyping', 'learning']
10
+ author: "Hustle Together"
11
+ allowed-tools: WebSearch WebFetch mcp__context7 mcp__github AskUserQuestion Read Write Edit Bash TodoWrite
12
+ ---
13
+
14
+ ---
15
+
16
+ description: Execute TDD Spike Phase - exploratory coding to understand problem space before TDD
17
+ argument-hint: <exploration description>
18
+
19
+ ---
20
+
21
+ SPIKE PHASE! Apply the below to the info given by user input here:
22
+
23
+ $ARGUMENTS
24
+
25
+ ## General Guidelines
26
+
27
+ ### Output Style
28
+
29
+ - **Never explicitly mention TDD** in code, comments, commits, PRs, or issues
30
+ - Write natural, descriptive code without meta-commentary about the development process
31
+ - The code should speak for itself - TDD is the process, not the product
32
+
33
+ (If there was no info above, fallback to the context of the conversation)
34
+
35
+ ## TDD Fundamentals
36
+
37
+ ### The TDD Cycle
38
+
39
+ The foundation of TDD is the Red-Green-Refactor cycle:
40
+
41
+ 1. **Red Phase**: Write ONE failing test that describes desired behavior
42
+ - The test must fail for the RIGHT reason (not syntax/import errors)
43
+ - Only one test at a time - this is critical for TDD discipline
44
+ - 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.
45
+ - **Adding a single test to a test file is ALWAYS allowed** - no prior test output needed
46
+ - Starting TDD for a new feature is always valid, even if test output shows unrelated work
47
+ - For DOM-based tests, use `data-testid` attributes to select elements rather than CSS classes, tag names, or text content
48
+ - 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
49
+
50
+ 2. **Green Phase**: Write MINIMAL code to make the test pass
51
+ - Implement only what's needed for the current failing test
52
+ - No anticipatory coding or extra features
53
+ - Address the specific failure message
54
+
55
+ 3. **Refactor Phase**: Improve code structure while keeping tests green
56
+ - Only allowed when relevant tests are passing
57
+ - Requires proof that tests have been run and are green
58
+ - Applies to BOTH implementation and test code
59
+ - No refactoring with failing tests - fix them first
60
+
61
+ ### Core Violations
62
+
63
+ 1. **Multiple Test Addition**
64
+ - Adding more than one new test at once
65
+ - Exception: Initial test file setup or extracting shared test utilities
66
+
67
+ 2. **Over-Implementation**
68
+ - Code that exceeds what's needed to pass the current failing test
69
+ - Adding untested features, methods, or error handling
70
+ - Implementing multiple methods when test only requires one
71
+
72
+ 3. **Premature Implementation**
73
+ - Adding implementation before a test exists and fails properly
74
+ - Adding implementation without running the test first
75
+ - Refactoring when tests haven't been run or are failing
76
+
77
+ ### Critical Principle: Incremental Development
78
+
79
+ Each step in TDD should address ONE specific issue:
80
+
81
+ - Test fails "not defined" → Create empty stub/class only
82
+ - Test fails "not a function" → Add method stub only
83
+ - Test fails with assertion → Implement minimal logic only
84
+
85
+ ### Optional Pre-Phase: Spike Phase
86
+
87
+ In rare cases where the problem space, interface, or expected behavior is unclear, a **Spike Phase** may be used **before the Red Phase**.
88
+ This phase is **not part of the regular TDD workflow** and must only be applied under exceptional circumstances.
89
+
90
+ - The goal of a Spike is **exploration and learning**, not implementation.
91
+ - The code written during a Spike is **disposable** and **must not** be merged or reused directly.
92
+ - Once sufficient understanding is achieved, all spike code is discarded, and normal TDD resumes starting from the **Red Phase**.
93
+ - A Spike is justified only when it is impossible to define a meaningful failing test due to technical uncertainty or unknown system behavior.
94
+
95
+ ### General Information
96
+
97
+ - 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.
98
+ - 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.
99
+ - 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.
100
+ - Adding types, interfaces, or a constant in order to replace magic values is perfectly fine during refactoring.
101
+ - Provide the agent with helpful directions so that they do not get stuck when blocking them.
102
+
103
+ ## 🛡 Project Rules (Injected into every command)
104
+
105
+ 1. **NO BROKEN BUILDS:**
106
+ - Run `pnpm test` before every `/commit`
107
+ - Ensure all tests pass
108
+ - Fix any type errors immediately
109
+
110
+ 2. **API DEVELOPMENT:**
111
+ - All new APIs MUST have Zod request/response schemas
112
+ - All APIs MUST be documented in both:
113
+ - OpenAPI spec ([src/lib/openapi/](src/lib/openapi/))
114
+ - API test manifest ([src/app/api-test/api-tests-manifest.json](src/app/api-test/api-tests-manifest.json))
115
+ - Test ALL parameters and edge cases
116
+ - Include code examples and real-world outputs
117
+
118
+ 3. **TDD WORKFLOW:**
119
+ - ALWAYS use /red → /green → /refactor cycle
120
+ - NEVER write implementation without failing test first
121
+ - Use /cycle for feature development
122
+ - Use characterization tests for refactoring
123
+
124
+ 4. **API KEY MANAGEMENT:**
125
+ - Support three loading methods:
126
+ - Server environment variables
127
+ - NEXT*PUBLIC* variables (client-side)
128
+ - Custom headers (X-OpenAI-Key, X-Anthropic-Key, etc.)
129
+ - Never hardcode API keys
130
+ - Always validate key availability before use
131
+
132
+ 5. **COMPREHENSIVE TESTING:**
133
+ - When researching APIs, read actual implementation code
134
+ - Discover ALL possible parameters (not just documented ones)
135
+ - Test with various parameter combinations
136
+ - Document custom headers, query params, request/response schemas
137
+ - Include validation rules and testing notes
138
+
139
+ 6. **NO UI BLOAT:**
140
+ - This is an API project with minimal frontend
141
+ - Only keep necessary test/documentation interfaces
142
+ - Delete unused components immediately
143
+ - No unnecessary UI libraries or features
144
+
145
+ 7. **DOCUMENTATION:**
146
+ - If you change an API, you MUST update:
147
+ - OpenAPI spec
148
+ - api-tests-manifest.json
149
+ - Code examples
150
+ - Testing notes
151
+ - Document expected behavior and edge cases
152
+ - Include real-world output examples
@@ -0,0 +1,108 @@
1
+ ---
2
+ name: summarize
3
+ description: Summarize conversation progress and next steps. Provides overview of completed work and remaining tasks. Use at end of sessions or before breaks. Keywords: summary, progress, overview, tracking, communication
4
+ license: MIT
5
+ compatibility: Requires Claude Code with MCP servers (Context7, GitHub), Python 3.9+ for hooks, pnpm 10.11.0+
6
+ metadata:
7
+ version: "3.0.0"
8
+ category: "workflow"
9
+ tags: ['summary', 'progress', 'overview', 'tracking']
10
+ author: "Hustle Together"
11
+ allowed-tools: WebSearch WebFetch mcp__context7 mcp__github AskUserQuestion Read Write Edit Bash TodoWrite
12
+ ---
13
+
14
+ ---
15
+
16
+ description: Summarize conversation progress and next steps
17
+ argument-hint: [optional additional info]
18
+
19
+ ---
20
+
21
+ ## General Guidelines
22
+
23
+ ### Output Style
24
+
25
+ - **Never explicitly mention TDD** in code, comments, commits, PRs, or issues
26
+ - Write natural, descriptive code without meta-commentary about the development process
27
+ - The code should speak for itself - TDD is the process, not the product
28
+
29
+ Create a concise summary of the current conversation suitable for transferring context to a new conversation.
30
+
31
+ Additional info: $ARGUMENTS
32
+
33
+ ## Summary Structure
34
+
35
+ Provide a summary with these sections:
36
+
37
+ ### What We Did
38
+
39
+ - Key accomplishments and changes made
40
+ - Important decisions or discoveries
41
+ - Files created, modified, or analyzed
42
+
43
+ ### What We're Doing Next
44
+
45
+ - Immediate next steps
46
+ - Pending tasks or work in progress
47
+ - Goals or objectives to continue
48
+
49
+ ### Blockers & User Input Needed
50
+
51
+ - Any issues requiring user intervention
52
+ - Decisions that need to be made
53
+ - Missing information or clarifications needed
54
+
55
+ ## Output Format
56
+
57
+ Keep the summary concise and actionable - suitable for pasting into a new conversation to quickly restore context without needing the full conversation history.
58
+
59
+ ## 🛡 Project Rules (Injected into every command)
60
+
61
+ 1. **NO BROKEN BUILDS:**
62
+ - Run `pnpm test` before every `/commit`
63
+ - Ensure all tests pass
64
+ - Fix any type errors immediately
65
+
66
+ 2. **API DEVELOPMENT:**
67
+ - All new APIs MUST have Zod request/response schemas
68
+ - All APIs MUST be documented in both:
69
+ - OpenAPI spec ([src/lib/openapi/](src/lib/openapi/))
70
+ - API test manifest ([src/app/api-test/api-tests-manifest.json](src/app/api-test/api-tests-manifest.json))
71
+ - Test ALL parameters and edge cases
72
+ - Include code examples and real-world outputs
73
+
74
+ 3. **TDD WORKFLOW:**
75
+ - ALWAYS use /red → /green → /refactor cycle
76
+ - NEVER write implementation without failing test first
77
+ - Use /cycle for feature development
78
+ - Use characterization tests for refactoring
79
+
80
+ 4. **API KEY MANAGEMENT:**
81
+ - Support three loading methods:
82
+ - Server environment variables
83
+ - NEXT*PUBLIC* variables (client-side)
84
+ - Custom headers (X-OpenAI-Key, X-Anthropic-Key, etc.)
85
+ - Never hardcode API keys
86
+ - Always validate key availability before use
87
+
88
+ 5. **COMPREHENSIVE TESTING:**
89
+ - When researching APIs, read actual implementation code
90
+ - Discover ALL possible parameters (not just documented ones)
91
+ - Test with various parameter combinations
92
+ - Document custom headers, query params, request/response schemas
93
+ - Include validation rules and testing notes
94
+
95
+ 6. **NO UI BLOAT:**
96
+ - This is an API project with minimal frontend
97
+ - Only keep necessary test/documentation interfaces
98
+ - Delete unused components immediately
99
+ - No unnecessary UI libraries or features
100
+
101
+ 7. **DOCUMENTATION:**
102
+ - If you change an API, you MUST update:
103
+ - OpenAPI spec
104
+ - api-tests-manifest.json
105
+ - Code examples
106
+ - Testing notes
107
+ - Document expected behavior and edge cases
108
+ - Include real-world output examples
@@ -0,0 +1,154 @@
1
+ ---
2
+ name: tdd
3
+ description: Remind agent about TDD approach and continue conversation. Reinforces test-first methodology. Use when agent deviates from TDD practices. Keywords: tdd, reminder, methodology, testing, practices
4
+ license: MIT
5
+ compatibility: Requires Claude Code with MCP servers (Context7, GitHub), Python 3.9+ for hooks, pnpm 10.11.0+
6
+ metadata:
7
+ version: "3.0.0"
8
+ category: "workflow"
9
+ tags: ['tdd', 'reminder', 'methodology', 'testing']
10
+ author: "Hustle Together"
11
+ allowed-tools: WebSearch WebFetch mcp__context7 mcp__github AskUserQuestion Read Write Edit Bash TodoWrite
12
+ ---
13
+
14
+ ---
15
+
16
+ description: Remind agent about TDD approach and continue conversation
17
+ argument-hint: [optional-response-to-last-message]
18
+
19
+ ---
20
+
21
+ # TDD Reminder
22
+
23
+ ## General Guidelines
24
+
25
+ ### Output Style
26
+
27
+ - **Never explicitly mention TDD** in code, comments, commits, PRs, or issues
28
+ - Write natural, descriptive code without meta-commentary about the development process
29
+ - The code should speak for itself - TDD is the process, not the product
30
+
31
+ ## TDD Fundamentals
32
+
33
+ ### The TDD Cycle
34
+
35
+ The foundation of TDD is the Red-Green-Refactor cycle:
36
+
37
+ 1. **Red Phase**: Write ONE failing test that describes desired behavior
38
+ - The test must fail for the RIGHT reason (not syntax/import errors)
39
+ - Only one test at a time - this is critical for TDD discipline
40
+ - 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.
41
+ - **Adding a single test to a test file is ALWAYS allowed** - no prior test output needed
42
+ - Starting TDD for a new feature is always valid, even if test output shows unrelated work
43
+ - For DOM-based tests, use `data-testid` attributes to select elements rather than CSS classes, tag names, or text content
44
+ - 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
45
+
46
+ 2. **Green Phase**: Write MINIMAL code to make the test pass
47
+ - Implement only what's needed for the current failing test
48
+ - No anticipatory coding or extra features
49
+ - Address the specific failure message
50
+
51
+ 3. **Refactor Phase**: Improve code structure while keeping tests green
52
+ - Only allowed when relevant tests are passing
53
+ - Requires proof that tests have been run and are green
54
+ - Applies to BOTH implementation and test code
55
+ - No refactoring with failing tests - fix them first
56
+
57
+ ### Core Violations
58
+
59
+ 1. **Multiple Test Addition**
60
+ - Adding more than one new test at once
61
+ - Exception: Initial test file setup or extracting shared test utilities
62
+
63
+ 2. **Over-Implementation**
64
+ - Code that exceeds what's needed to pass the current failing test
65
+ - Adding untested features, methods, or error handling
66
+ - Implementing multiple methods when test only requires one
67
+
68
+ 3. **Premature Implementation**
69
+ - Adding implementation before a test exists and fails properly
70
+ - Adding implementation without running the test first
71
+ - Refactoring when tests haven't been run or are failing
72
+
73
+ ### Critical Principle: Incremental Development
74
+
75
+ Each step in TDD should address ONE specific issue:
76
+
77
+ - Test fails "not defined" → Create empty stub/class only
78
+ - Test fails "not a function" → Add method stub only
79
+ - Test fails with assertion → Implement minimal logic only
80
+
81
+ ### Optional Pre-Phase: Spike Phase
82
+
83
+ In rare cases where the problem space, interface, or expected behavior is unclear, a **Spike Phase** may be used **before the Red Phase**.
84
+ This phase is **not part of the regular TDD workflow** and must only be applied under exceptional circumstances.
85
+
86
+ - The goal of a Spike is **exploration and learning**, not implementation.
87
+ - The code written during a Spike is **disposable** and **must not** be merged or reused directly.
88
+ - Once sufficient understanding is achieved, all spike code is discarded, and normal TDD resumes starting from the **Red Phase**.
89
+ - A Spike is justified only when it is impossible to define a meaningful failing test due to technical uncertainty or unknown system behavior.
90
+
91
+ ### General Information
92
+
93
+ - 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.
94
+ - 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.
95
+ - 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.
96
+ - Adding types, interfaces, or a constant in order to replace magic values is perfectly fine during refactoring.
97
+ - Provide the agent with helpful directions so that they do not get stuck when blocking them.
98
+
99
+ ## Continue Conversation
100
+
101
+ User response to the last message: $ARGUMENTS
102
+
103
+ Please continue with TDD approach based on the above response.
104
+
105
+ ## 🛡 Project Rules (Injected into every command)
106
+
107
+ 1. **NO BROKEN BUILDS:**
108
+ - Run `pnpm test` before every `/commit`
109
+ - Ensure all tests pass
110
+ - Fix any type errors immediately
111
+
112
+ 2. **API DEVELOPMENT:**
113
+ - All new APIs MUST have Zod request/response schemas
114
+ - All APIs MUST be documented in both:
115
+ - OpenAPI spec ([src/lib/openapi/](src/lib/openapi/))
116
+ - API test manifest ([src/app/api-test/api-tests-manifest.json](src/app/api-test/api-tests-manifest.json))
117
+ - Test ALL parameters and edge cases
118
+ - Include code examples and real-world outputs
119
+
120
+ 3. **TDD WORKFLOW:**
121
+ - ALWAYS use /red → /green → /refactor cycle
122
+ - NEVER write implementation without failing test first
123
+ - Use /cycle for feature development
124
+ - Use characterization tests for refactoring
125
+
126
+ 4. **API KEY MANAGEMENT:**
127
+ - Support three loading methods:
128
+ - Server environment variables
129
+ - NEXT*PUBLIC* variables (client-side)
130
+ - Custom headers (X-OpenAI-Key, X-Anthropic-Key, etc.)
131
+ - Never hardcode API keys
132
+ - Always validate key availability before use
133
+
134
+ 5. **COMPREHENSIVE TESTING:**
135
+ - When researching APIs, read actual implementation code
136
+ - Discover ALL possible parameters (not just documented ones)
137
+ - Test with various parameter combinations
138
+ - Document custom headers, query params, request/response schemas
139
+ - Include validation rules and testing notes
140
+
141
+ 6. **NO UI BLOAT:**
142
+ - This is an API project with minimal frontend
143
+ - Only keep necessary test/documentation interfaces
144
+ - Delete unused components immediately
145
+ - No unnecessary UI libraries or features
146
+
147
+ 7. **DOCUMENTATION:**
148
+ - If you change an API, you MUST update:
149
+ - OpenAPI spec
150
+ - api-tests-manifest.json
151
+ - Code examples
152
+ - Testing notes
153
+ - Document expected behavior and edge cases
154
+ - Include real-world output examples