@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,187 @@
1
+ ---
2
+ description: Analyze GitHub issue and create TDD implementation plan
3
+ argument-hint: [optional-issue-number]
4
+ ---
5
+
6
+ Analyze GitHub issue and create TDD implementation plan.
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
+ Process:
17
+
18
+ 1. Get Issue Number
19
+
20
+ - Either from branch name use that issue number
21
+ - Patterns: issue-123, 123-feature, feature/123, fix/123
22
+ - Or from this bullet point with custom info: $ARGUMENTS
23
+ - If not found: ask user
24
+
25
+ 1. Fetch Issue
26
+
27
+ Try to fetch the issue using GitHub MCP (mcp**github**issue_read tool).
28
+
29
+ If GitHub MCP is not configured, show:
30
+
31
+ ```
32
+ GitHub MCP not configured!
33
+ See: https://github.com/modelcontextprotocol/servers/tree/main/src/github
34
+ Trying GitHub CLI fallback...
35
+ ```
36
+
37
+ Then try using `gh issue view [ISSUE_NUMBER] --json` as fallback.
38
+
39
+ 1. Analyze and Plan
40
+
41
+ Summarize the issue and requirements, then:
42
+
43
+ ## Discovery Phase
44
+
45
+ Understand the requirement by asking (use AskUserQuestion if needed):
46
+
47
+ **Problem Statement**
48
+
49
+ - What problem does this solve?
50
+ - Who experiences this problem?
51
+ - What's the current pain point?
52
+
53
+ **Desired Outcome**
54
+
55
+ - What should happen after this is built?
56
+ - How will users interact with it?
57
+ - What does success look like?
58
+
59
+ **Scope & Constraints**
60
+
61
+ - What's in scope vs. out of scope?
62
+ - Any technical constraints?
63
+ - Dependencies on other systems/features?
64
+
65
+ **Context Check**
66
+
67
+ - Search codebase for related features/modules
68
+ - Check for existing test files that might be relevant
69
+
70
+ ## TDD Fundamentals
71
+
72
+ ### The TDD Cycle
73
+
74
+ The foundation of TDD is the Red-Green-Refactor cycle:
75
+
76
+ 1. **Red Phase**: Write ONE failing test that describes desired behavior
77
+ - The test must fail for the RIGHT reason (not syntax/import errors)
78
+ - Only one test at a time - this is critical for TDD discipline
79
+ - 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.
80
+ - **Adding a single test to a test file is ALWAYS allowed** - no prior test output needed
81
+ - Starting TDD for a new feature is always valid, even if test output shows unrelated work
82
+ - For DOM-based tests, use `data-testid` attributes to select elements rather than CSS classes, tag names, or text content
83
+ - 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
84
+
85
+ 2. **Green Phase**: Write MINIMAL code to make the test pass
86
+ - Implement only what's needed for the current failing test
87
+ - No anticipatory coding or extra features
88
+ - Address the specific failure message
89
+
90
+ 3. **Refactor Phase**: Improve code structure while keeping tests green
91
+ - Only allowed when relevant tests are passing
92
+ - Requires proof that tests have been run and are green
93
+ - Applies to BOTH implementation and test code
94
+ - No refactoring with failing tests - fix them first
95
+
96
+ ### Core Violations
97
+
98
+ 1. **Multiple Test Addition**
99
+ - Adding more than one new test at once
100
+ - Exception: Initial test file setup or extracting shared test utilities
101
+
102
+ 2. **Over-Implementation**
103
+ - Code that exceeds what's needed to pass the current failing test
104
+ - Adding untested features, methods, or error handling
105
+ - Implementing multiple methods when test only requires one
106
+
107
+ 3. **Premature Implementation**
108
+ - Adding implementation before a test exists and fails properly
109
+ - Adding implementation without running the test first
110
+ - Refactoring when tests haven't been run or are failing
111
+
112
+ ### Critical Principle: Incremental Development
113
+
114
+ Each step in TDD should address ONE specific issue:
115
+
116
+ - Test fails "not defined" → Create empty stub/class only
117
+ - Test fails "not a function" → Add method stub only
118
+ - Test fails with assertion → Implement minimal logic only
119
+
120
+ ### Optional Pre-Phase: Spike Phase
121
+
122
+ In rare cases where the problem space, interface, or expected behavior is unclear, a **Spike Phase** may be used **before the Red Phase**.
123
+ This phase is **not part of the regular TDD workflow** and must only be applied under exceptional circumstances.
124
+
125
+ - The goal of a Spike is **exploration and learning**, not implementation.
126
+ - The code written during a Spike is **disposable** and **must not** be merged or reused directly.
127
+ - Once sufficient understanding is achieved, all spike code is discarded, and normal TDD resumes starting from the **Red Phase**.
128
+ - A Spike is justified only when it is impossible to define a meaningful failing test due to technical uncertainty or unknown system behavior.
129
+
130
+ ### General Information
131
+
132
+ - 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.
133
+ - 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.
134
+ - 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.
135
+ - Adding types, interfaces, or a constant in order to replace magic values is perfectly fine during refactoring.
136
+ - Provide the agent with helpful directions so that they do not get stuck when blocking them.
137
+
138
+ ## 🛡 Project Rules (Injected into every command)
139
+
140
+ 1. **NO BROKEN BUILDS:**
141
+ - Run `pnpm test` before every `/commit`
142
+ - Ensure all tests pass
143
+ - Fix any type errors immediately
144
+
145
+ 2. **API DEVELOPMENT:**
146
+ - All new APIs MUST have Zod request/response schemas
147
+ - All APIs MUST be documented in both:
148
+ - OpenAPI spec ([src/lib/openapi/](src/lib/openapi/))
149
+ - API test manifest ([src/app/api-test/api-tests-manifest.json](src/app/api-test/api-tests-manifest.json))
150
+ - Test ALL parameters and edge cases
151
+ - Include code examples and real-world outputs
152
+
153
+ 3. **TDD WORKFLOW:**
154
+ - ALWAYS use /red → /green → /refactor cycle
155
+ - NEVER write implementation without failing test first
156
+ - Use /cycle for feature development
157
+ - Use characterization tests for refactoring
158
+
159
+ 4. **API KEY MANAGEMENT:**
160
+ - Support three loading methods:
161
+ - Server environment variables
162
+ - NEXT*PUBLIC* variables (client-side)
163
+ - Custom headers (X-OpenAI-Key, X-Anthropic-Key, etc.)
164
+ - Never hardcode API keys
165
+ - Always validate key availability before use
166
+
167
+ 5. **COMPREHENSIVE TESTING:**
168
+ - When researching APIs, read actual implementation code
169
+ - Discover ALL possible parameters (not just documented ones)
170
+ - Test with various parameter combinations
171
+ - Document custom headers, query params, request/response schemas
172
+ - Include validation rules and testing notes
173
+
174
+ 6. **NO UI BLOAT:**
175
+ - This is an API project with minimal frontend
176
+ - Only keep necessary test/documentation interfaces
177
+ - Delete unused components immediately
178
+ - No unnecessary UI libraries or features
179
+
180
+ 7. **DOCUMENTATION:**
181
+ - If you change an API, you MUST update:
182
+ - OpenAPI spec
183
+ - api-tests-manifest.json
184
+ - Code examples
185
+ - Testing notes
186
+ - Document expected behavior and edge cases
187
+ - Include real-world output examples
@@ -0,0 +1,91 @@
1
+ ---
2
+ description: Configure NTFY push notifications for workflow updates
3
+ ---
4
+
5
+ # NTFY Setup
6
+
7
+ Configure push notifications via [ntfy.sh](https://ntfy.sh) to receive workflow updates on your phone.
8
+
9
+ ## Step 1: Install NTFY App
10
+
11
+ Download the NTFY app:
12
+
13
+ - **iOS**: [App Store](https://apps.apple.com/app/ntfy/id1625396347)
14
+ - **Android**: [Google Play](https://play.google.com/store/apps/details?id=io.heckel.ntfy) or [F-Droid](https://f-droid.org/packages/io.heckel.ntfy/)
15
+
16
+ ## Step 2: Choose a Topic
17
+
18
+ Pick a unique, hard-to-guess topic name for your notifications:
19
+
20
+ ```
21
+ your-name-api-dev-2024
22
+ ```
23
+
24
+ **Important:** Topics are public on ntfy.sh. Use a unique name!
25
+
26
+ ## Step 3: Subscribe in App
27
+
28
+ 1. Open the NTFY app
29
+ 2. Tap the + button
30
+ 3. Enter your topic name
31
+ 4. Tap Subscribe
32
+
33
+ ## Step 4: Configure Environment
34
+
35
+ Add to your project's `.env` file:
36
+
37
+ ```env
38
+ NTFY_ENABLED=true
39
+ NTFY_SERVER=https://ntfy.sh
40
+ NTFY_TOPIC=your-unique-topic-name
41
+ ```
42
+
43
+ Or copy from the template:
44
+
45
+ ```bash
46
+ cp templates/.env.example .env
47
+ # Then edit .env with your topic
48
+ ```
49
+
50
+ ## Step 5: Test Notification
51
+
52
+ Run this command to test:
53
+
54
+ ```bash
55
+ /ntfy-test
56
+ ```
57
+
58
+ You should receive a test notification on your phone.
59
+
60
+ ## What You'll Receive
61
+
62
+ - 📋 Phase completion updates
63
+ - ⏳ "Input needed" alerts when interview questions are waiting
64
+ - 📊 Token usage summaries
65
+ - ✅ Workflow completion notifications
66
+
67
+ ## Self-Hosted Option
68
+
69
+ If you prefer to self-host NTFY:
70
+
71
+ ```bash
72
+ docker run -d -p 8080:80 binwiederhier/ntfy serve
73
+ ```
74
+
75
+ Then set:
76
+
77
+ ```env
78
+ NTFY_SERVER=http://localhost:8080
79
+ ```
80
+
81
+ ## Troubleshooting
82
+
83
+ **Not receiving notifications?**
84
+
85
+ 1. Check NTFY_ENABLED=true in .env
86
+ 2. Verify topic name matches exactly
87
+ 3. Check app notification permissions
88
+ 4. Run `/ntfy-test` to verify connection
89
+
90
+ **Rate limited?**
91
+ ntfy.sh has rate limits. Consider self-hosting for heavy use.
@@ -0,0 +1,74 @@
1
+ ---
2
+ description: Send a test notification via NTFY
3
+ ---
4
+
5
+ # NTFY Test
6
+
7
+ Send a test notification to verify your NTFY setup is working.
8
+
9
+ ## Steps
10
+
11
+ 1. **Read environment configuration**:
12
+
13
+ ```bash
14
+ grep NTFY .env 2>/dev/null || echo "No .env file found"
15
+ ```
16
+
17
+ 2. **Send test notification**:
18
+
19
+ ```bash
20
+ # Get config
21
+ source .env 2>/dev/null
22
+
23
+ if [ "$NTFY_ENABLED" = "true" ] && [ -n "$NTFY_TOPIC" ]; then
24
+ curl -s \
25
+ -H "Title: 🧪 API Dev Tools Test" \
26
+ -H "Priority: default" \
27
+ -H "Tags: test,rocket" \
28
+ -d "Test notification from API Dev Tools. If you see this, NTFY is configured correctly!" \
29
+ "${NTFY_SERVER:-https://ntfy.sh}/$NTFY_TOPIC"
30
+ echo ""
31
+ echo "✅ Test notification sent to topic: $NTFY_TOPIC"
32
+ else
33
+ echo "❌ NTFY not configured. Run /ntfy-setup first."
34
+ echo ""
35
+ echo "Required in .env:"
36
+ echo " NTFY_ENABLED=true"
37
+ echo " NTFY_TOPIC=your-topic-name"
38
+ fi
39
+ ```
40
+
41
+ 3. **Verify on phone**:
42
+
43
+ Check your NTFY app - you should see the test notification within a few seconds.
44
+
45
+ ## Expected Result
46
+
47
+ You should receive a notification with:
48
+
49
+ - Title: "🧪 API Dev Tools Test"
50
+ - Message: "Test notification from API Dev Tools..."
51
+ - Tags: test, rocket emojis
52
+
53
+ ## Troubleshooting
54
+
55
+ **"NTFY not configured" error:**
56
+
57
+ - Run `/ntfy-setup` to configure
58
+ - Or manually add to .env:
59
+ ```env
60
+ NTFY_ENABLED=true
61
+ NTFY_TOPIC=your-unique-topic
62
+ ```
63
+
64
+ **No notification received:**
65
+
66
+ 1. Check topic name matches your app subscription
67
+ 2. Verify phone has internet connection
68
+ 3. Check NTFY app notification permissions
69
+ 4. Try visiting https://ntfy.sh/your-topic in browser
70
+
71
+ **curl error:**
72
+
73
+ - Ensure you have internet connection
74
+ - Check if ntfy.sh is accessible: `curl -I https://ntfy.sh`
@@ -0,0 +1,167 @@
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
+ ## Input
19
+
20
+ $ARGUMENTS
21
+
22
+ (If no input provided, check conversation context)
23
+
24
+ ## Input Processing
25
+
26
+ The input can be one of:
27
+
28
+ 1. **GitHub Issue URL** (e.g., `https://github.com/owner/repo/issues/123`)
29
+ 2. **GitHub Issue Number** (e.g., `#123` or `123`)
30
+ 3. **Feature Description** (e.g., "Add user authentication")
31
+ 4. **Empty** - use conversation context
32
+
33
+ ### GitHub Issue Integration
34
+
35
+ If input looks like a GitHub issue:
36
+
37
+ **Step 1: Extract Issue Number**
38
+
39
+ - From URL: extract owner/repo/number
40
+ - From number: try to infer repo from git remote
41
+ - From branch name: check patterns like `issue-123`, `123-feature`, `feature/123`
42
+
43
+ **Step 2: Fetch Issue**
44
+ Try GitHub MCP first:
45
+
46
+ - If available: use `mcp__github__issue_read` to fetch issue details
47
+ - If not available: show message and try `gh issue view <number>`
48
+
49
+ ```
50
+ GitHub MCP not configured!
51
+ See: https://github.com/modelcontextprotocol/servers/tree/main/src/github
52
+ Trying GitHub CLI fallback...
53
+ ```
54
+
55
+ **Step 3: Use Issue as Discovery Input**
56
+
57
+ - Title → Feature name
58
+ - Description → Problem statement and context
59
+ - Labels → Type/priority hints
60
+ - Comments → Additional requirements and discussion
61
+ - Linked issues → Dependencies
62
+
63
+ Extract from GitHub issue:
64
+
65
+ - Problem statement and context
66
+ - Acceptance criteria (if present)
67
+ - Technical notes (if present)
68
+ - Related issues/dependencies
69
+
70
+ ## Process
71
+
72
+ ## Discovery Phase
73
+
74
+ Understand the requirement by asking (use AskUserQuestion if needed):
75
+
76
+ **Problem Statement**
77
+
78
+ - What problem does this solve?
79
+ - Who experiences this problem?
80
+ - What's the current pain point?
81
+
82
+ **Desired Outcome**
83
+
84
+ - What should happen after this is built?
85
+ - How will users interact with it?
86
+ - What does success look like?
87
+
88
+ **Scope & Constraints**
89
+
90
+ - What's in scope vs. out of scope?
91
+ - Any technical constraints?
92
+ - Dependencies on other systems/features?
93
+
94
+ **Context Check**
95
+
96
+ - Search codebase for related features/modules
97
+ - Check for existing test files that might be relevant
98
+
99
+ ## Key Principles
100
+
101
+ **From PRD World:**
102
+
103
+ - Start with user problems, not solutions
104
+ - Define success criteria upfront
105
+ - Understand constraints and scope
106
+
107
+ **From TDD World:**
108
+
109
+ - Make acceptance criteria test-ready
110
+ - Break work into small, testable pieces
111
+ - Each task should map to test(s)
112
+
113
+ ## Integration with Other Commands
114
+
115
+ - **Before /plan**: Use `/spike` if you need technical exploration first
116
+ - **After /plan**: Use `/red` to start TDD on first task
117
+
118
+ ## 🛡 Project Rules (Injected into every command)
119
+
120
+ 1. **NO BROKEN BUILDS:**
121
+ - Run `pnpm test` before every `/commit`
122
+ - Ensure all tests pass
123
+ - Fix any type errors immediately
124
+
125
+ 2. **API DEVELOPMENT:**
126
+ - All new APIs MUST have Zod request/response schemas
127
+ - All APIs MUST be documented in both:
128
+ - OpenAPI spec ([src/lib/openapi/](src/lib/openapi/))
129
+ - API test manifest ([src/app/api-test/api-tests-manifest.json](src/app/api-test/api-tests-manifest.json))
130
+ - Test ALL parameters and edge cases
131
+ - Include code examples and real-world outputs
132
+
133
+ 3. **TDD WORKFLOW:**
134
+ - ALWAYS use /red → /green → /refactor cycle
135
+ - NEVER write implementation without failing test first
136
+ - Use /cycle for feature development
137
+ - Use characterization tests for refactoring
138
+
139
+ 4. **API KEY MANAGEMENT:**
140
+ - Support three loading methods:
141
+ - Server environment variables
142
+ - NEXT*PUBLIC* variables (client-side)
143
+ - Custom headers (X-OpenAI-Key, X-Anthropic-Key, etc.)
144
+ - Never hardcode API keys
145
+ - Always validate key availability before use
146
+
147
+ 5. **COMPREHENSIVE TESTING:**
148
+ - When researching APIs, read actual implementation code
149
+ - Discover ALL possible parameters (not just documented ones)
150
+ - Test with various parameter combinations
151
+ - Document custom headers, query params, request/response schemas
152
+ - Include validation rules and testing notes
153
+
154
+ 6. **NO UI BLOAT:**
155
+ - This is an API project with minimal frontend
156
+ - Only keep necessary test/documentation interfaces
157
+ - Delete unused components immediately
158
+ - No unnecessary UI libraries or features
159
+
160
+ 7. **DOCUMENTATION:**
161
+ - If you change an API, you MUST update:
162
+ - OpenAPI spec
163
+ - api-tests-manifest.json
164
+ - Code examples
165
+ - Testing notes
166
+ - Document expected behavior and edge cases
167
+ - Include real-world output examples
@@ -0,0 +1,121 @@
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
+ Create a pull request for the current branch using GitHub MCP tools.
17
+
18
+ ## Workflow
19
+
20
+ Current branch status:
21
+ !`git status`
22
+
23
+ Recent commits:
24
+ !`git log --oneline -5`
25
+
26
+ Arguments: $ARGUMENTS
27
+
28
+ **Process:**
29
+
30
+ 1. **Ensure Branch is Ready**:
31
+ !`git status`
32
+ - Commit all changes
33
+ - Push to remote: `git push origin [branch-name]`
34
+
35
+ 2. **Create PR**: Create a well-formatted pull request
36
+
37
+ Title: conventional commits format, like `feat(#123): add user authentication`
38
+
39
+ Description template:
40
+
41
+ ```markdown
42
+ <!--
43
+ Are there any relevant issues / PRs / mailing lists discussions?
44
+ Please reference them here.
45
+ -->
46
+
47
+ ## References
48
+
49
+ - [links to github issues referenced in commit messages]
50
+
51
+ ## Summary
52
+
53
+ [Brief description of changes]
54
+
55
+ ## Test Plan
56
+
57
+ - [ ] Tests pass
58
+ - [ ] Manual testing completed
59
+ ```
60
+
61
+ 3. **Set Base Branch**: Default to main unless specified otherwise
62
+
63
+ 4. **Link Issues**: Reference related issues found in commit messages
64
+
65
+ ## Use GitHub MCP Tools
66
+
67
+ 1. Check current branch and ensure it's pushed
68
+ 2. Create a well-formatted pull request with proper title and description
69
+ 3. Set the base branch (default: main)
70
+ 4. Include relevant issue references if found in commit messages
71
+
72
+ ## 🛡 Project Rules (Injected into every command)
73
+
74
+ 1. **NO BROKEN BUILDS:**
75
+ - Run `pnpm test` before every `/commit`
76
+ - Ensure all tests pass
77
+ - Fix any type errors immediately
78
+
79
+ 2. **API DEVELOPMENT:**
80
+ - All new APIs MUST have Zod request/response schemas
81
+ - All APIs MUST be documented in both:
82
+ - OpenAPI spec ([src/lib/openapi/](src/lib/openapi/))
83
+ - API test manifest ([src/app/api-test/api-tests-manifest.json](src/app/api-test/api-tests-manifest.json))
84
+ - Test ALL parameters and edge cases
85
+ - Include code examples and real-world outputs
86
+
87
+ 3. **TDD WORKFLOW:**
88
+ - ALWAYS use /red → /green → /refactor cycle
89
+ - NEVER write implementation without failing test first
90
+ - Use /cycle for feature development
91
+ - Use characterization tests for refactoring
92
+
93
+ 4. **API KEY MANAGEMENT:**
94
+ - Support three loading methods:
95
+ - Server environment variables
96
+ - NEXT*PUBLIC* variables (client-side)
97
+ - Custom headers (X-OpenAI-Key, X-Anthropic-Key, etc.)
98
+ - Never hardcode API keys
99
+ - Always validate key availability before use
100
+
101
+ 5. **COMPREHENSIVE TESTING:**
102
+ - When researching APIs, read actual implementation code
103
+ - Discover ALL possible parameters (not just documented ones)
104
+ - Test with various parameter combinations
105
+ - Document custom headers, query params, request/response schemas
106
+ - Include validation rules and testing notes
107
+
108
+ 6. **NO UI BLOAT:**
109
+ - This is an API project with minimal frontend
110
+ - Only keep necessary test/documentation interfaces
111
+ - Delete unused components immediately
112
+ - No unnecessary UI libraries or features
113
+
114
+ 7. **DOCUMENTATION:**
115
+ - If you change an API, you MUST update:
116
+ - OpenAPI spec
117
+ - api-tests-manifest.json
118
+ - Code examples
119
+ - Testing notes
120
+ - Document expected behavior and edge cases
121
+ - Include real-world output examples
@@ -0,0 +1,40 @@
1
+ ---
2
+ description: Publish npm package with incremental versioning (patch/minor/major)
3
+ argument-hint: [patch|minor|major|X.Y.Z]
4
+ ---
5
+
6
+ Publish the npm package with safe, incremental versioning.
7
+
8
+ ## Arguments
9
+ - `patch` (default) - Bug fixes (1.0.0 → 1.0.1)
10
+ - `minor` - New features (1.0.0 → 1.1.0)
11
+ - `major` - Breaking changes (1.0.0 → 2.0.0)
12
+ - `X.Y.Z` - Specific version
13
+
14
+ $ARGUMENTS
15
+
16
+ ## Process
17
+
18
+ 1. **Pre-flight checks**
19
+ - Verify clean git status
20
+ - Check npm login (`npm whoami`)
21
+ - Compare local vs published version
22
+
23
+ 2. **Version bump**
24
+ - Calculate new version based on argument
25
+ - Update package.json
26
+ - Commit: `chore: bump version to X.Y.Z`
27
+ - Push to remote
28
+
29
+ 3. **Publish**
30
+ - Run `npm publish --access public`
31
+ - If 2FA required, show: `npm publish --access public --otp=CODE`
32
+
33
+ 4. **Verify**
34
+ - Confirm new version on npm registry
35
+
36
+ ## Safety Rules
37
+ - Always commit before publish
38
+ - Always push before publish
39
+ - Never skip version comparison
40
+ - Incremental bumps only (no big jumps without confirmation)