@hustle-together/api-dev-tools 3.10.1 → 3.11.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 (96) hide show
  1. package/.claude/api-dev-state.json +159 -0
  2. package/.claude/commands/README.md +185 -0
  3. package/.claude/commands/add-command.md +209 -0
  4. package/.claude/commands/api-create.md +499 -0
  5. package/.claude/commands/api-env.md +50 -0
  6. package/.claude/commands/api-interview.md +331 -0
  7. package/.claude/commands/api-research.md +331 -0
  8. package/.claude/commands/api-status.md +259 -0
  9. package/.claude/commands/api-verify.md +231 -0
  10. package/.claude/commands/beepboop.md +97 -0
  11. package/.claude/commands/busycommit.md +112 -0
  12. package/.claude/commands/commit.md +83 -0
  13. package/.claude/commands/cycle.md +142 -0
  14. package/.claude/commands/gap.md +86 -0
  15. package/.claude/commands/green.md +142 -0
  16. package/.claude/commands/issue.md +192 -0
  17. package/.claude/commands/plan.md +168 -0
  18. package/.claude/commands/pr.md +122 -0
  19. package/.claude/commands/red.md +142 -0
  20. package/.claude/commands/refactor.md +142 -0
  21. package/.claude/commands/spike.md +142 -0
  22. package/.claude/commands/summarize.md +94 -0
  23. package/.claude/commands/tdd.md +144 -0
  24. package/.claude/commands/worktree-add.md +315 -0
  25. package/.claude/commands/worktree-cleanup.md +281 -0
  26. package/.claude/hooks/api-workflow-check.py +227 -0
  27. package/.claude/hooks/enforce-deep-research.py +185 -0
  28. package/.claude/hooks/enforce-disambiguation.py +155 -0
  29. package/.claude/hooks/enforce-documentation.py +192 -0
  30. package/.claude/hooks/enforce-environment.py +253 -0
  31. package/.claude/hooks/enforce-external-research.py +328 -0
  32. package/.claude/hooks/enforce-interview.py +421 -0
  33. package/.claude/hooks/enforce-refactor.py +189 -0
  34. package/.claude/hooks/enforce-research.py +159 -0
  35. package/.claude/hooks/enforce-schema.py +186 -0
  36. package/.claude/hooks/enforce-scope.py +160 -0
  37. package/.claude/hooks/enforce-tdd-red.py +250 -0
  38. package/.claude/hooks/enforce-verify.py +186 -0
  39. package/.claude/hooks/periodic-reground.py +154 -0
  40. package/.claude/hooks/session-startup.py +151 -0
  41. package/.claude/hooks/track-tool-use.py +626 -0
  42. package/.claude/hooks/verify-after-green.py +282 -0
  43. package/.claude/hooks/verify-implementation.py +225 -0
  44. package/.claude/research/index.json +6 -0
  45. package/.claude/settings.json +93 -0
  46. package/.claude/settings.local.json +11 -0
  47. package/.claude-plugin/marketplace.json +112 -0
  48. package/.skills/README.md +291 -0
  49. package/.skills/_shared/convert-commands.py +192 -0
  50. package/.skills/_shared/hooks/api-workflow-check.py +227 -0
  51. package/.skills/_shared/hooks/enforce-deep-research.py +185 -0
  52. package/.skills/_shared/hooks/enforce-disambiguation.py +155 -0
  53. package/.skills/_shared/hooks/enforce-documentation.py +192 -0
  54. package/.skills/_shared/hooks/enforce-environment.py +253 -0
  55. package/.skills/_shared/hooks/enforce-external-research.py +328 -0
  56. package/.skills/_shared/hooks/enforce-interview.py +421 -0
  57. package/.skills/_shared/hooks/enforce-refactor.py +189 -0
  58. package/.skills/_shared/hooks/enforce-research.py +159 -0
  59. package/.skills/_shared/hooks/enforce-schema.py +186 -0
  60. package/.skills/_shared/hooks/enforce-scope.py +160 -0
  61. package/.skills/_shared/hooks/enforce-tdd-red.py +250 -0
  62. package/.skills/_shared/hooks/enforce-verify.py +186 -0
  63. package/.skills/_shared/hooks/periodic-reground.py +154 -0
  64. package/.skills/_shared/hooks/session-startup.py +151 -0
  65. package/.skills/_shared/hooks/track-tool-use.py +626 -0
  66. package/.skills/_shared/hooks/verify-after-green.py +282 -0
  67. package/.skills/_shared/hooks/verify-implementation.py +225 -0
  68. package/.skills/_shared/install.sh +114 -0
  69. package/.skills/_shared/settings.json +93 -0
  70. package/.skills/add-command/SKILL.md +222 -0
  71. package/.skills/api-create/SKILL.md +512 -0
  72. package/.skills/api-env/SKILL.md +63 -0
  73. package/.skills/api-interview/SKILL.md +344 -0
  74. package/.skills/api-research/SKILL.md +344 -0
  75. package/.skills/api-status/SKILL.md +272 -0
  76. package/.skills/api-verify/SKILL.md +244 -0
  77. package/.skills/beepboop/SKILL.md +110 -0
  78. package/.skills/busycommit/SKILL.md +125 -0
  79. package/.skills/commit/SKILL.md +96 -0
  80. package/.skills/cycle/SKILL.md +155 -0
  81. package/.skills/gap/SKILL.md +99 -0
  82. package/.skills/green/SKILL.md +155 -0
  83. package/.skills/issue/SKILL.md +205 -0
  84. package/.skills/plan/SKILL.md +181 -0
  85. package/.skills/pr/SKILL.md +135 -0
  86. package/.skills/red/SKILL.md +155 -0
  87. package/.skills/refactor/SKILL.md +155 -0
  88. package/.skills/spike/SKILL.md +155 -0
  89. package/.skills/summarize/SKILL.md +107 -0
  90. package/.skills/tdd/SKILL.md +157 -0
  91. package/.skills/update-todos/SKILL.md +228 -0
  92. package/.skills/worktree-add/SKILL.md +328 -0
  93. package/.skills/worktree-cleanup/SKILL.md +294 -0
  94. package/CHANGELOG.md +97 -0
  95. package/README.md +58 -17
  96. package/package.json +22 -11
@@ -0,0 +1,142 @@
1
+ ---
2
+ description: Execute TDD Spike Phase - exploratory coding to understand problem space before TDD
3
+ argument-hint: <exploration description>
4
+ ---
5
+
6
+ SPIKE PHASE! Apply the below to the info given by user input here:
7
+
8
+ $ARGUMENTS
9
+
10
+ ## General Guidelines
11
+
12
+ ### Output Style
13
+
14
+ - **Never explicitly mention TDD** in code, comments, commits, PRs, or issues
15
+ - Write natural, descriptive code without meta-commentary about the development process
16
+ - The code should speak for itself - TDD is the process, not the product
17
+
18
+ (If there was no info above, fallback to the context of the conversation)
19
+
20
+ ## TDD Fundamentals
21
+
22
+ ### The TDD Cycle
23
+
24
+ The foundation of TDD is the Red-Green-Refactor cycle:
25
+
26
+ 1. **Red Phase**: Write ONE failing test that describes desired behavior
27
+
28
+ - The test must fail for the RIGHT reason (not syntax/import errors)
29
+ - Only one test at a time - this is critical for TDD discipline
30
+ - 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.
31
+ - **Adding a single test to a test file is ALWAYS allowed** - no prior test output needed
32
+ - Starting TDD for a new feature is always valid, even if test output shows unrelated work
33
+ - For DOM-based tests, use `data-testid` attributes to select elements rather than CSS classes, tag names, or text content
34
+ - 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
35
+
36
+ 2. **Green Phase**: Write MINIMAL code to make the test pass
37
+
38
+ - Implement only what's needed for the current failing test
39
+ - No anticipatory coding or extra features
40
+ - Address the specific failure message
41
+
42
+ 3. **Refactor Phase**: Improve code structure while keeping tests green
43
+ - Only allowed when relevant tests are passing
44
+ - Requires proof that tests have been run and are green
45
+ - Applies to BOTH implementation and test code
46
+ - No refactoring with failing tests - fix them first
47
+
48
+ ### Core Violations
49
+
50
+ 1. **Multiple Test Addition**
51
+
52
+ - Adding more than one new test at once
53
+ - Exception: Initial test file setup or extracting shared test utilities
54
+
55
+ 2. **Over-Implementation**
56
+
57
+ - Code that exceeds what's needed to pass the current failing test
58
+ - Adding untested features, methods, or error handling
59
+ - Implementing multiple methods when test only requires one
60
+
61
+ 3. **Premature Implementation**
62
+ - Adding implementation before a test exists and fails properly
63
+ - Adding implementation without running the test first
64
+ - Refactoring when tests haven't been run or are failing
65
+
66
+ ### Critical Principle: Incremental Development
67
+
68
+ Each step in TDD should address ONE specific issue:
69
+
70
+ - Test fails "not defined" → Create empty stub/class only
71
+ - Test fails "not a function" → Add method stub only
72
+ - Test fails with assertion → Implement minimal logic only
73
+
74
+ ### Optional Pre-Phase: Spike Phase
75
+
76
+ In rare cases where the problem space, interface, or expected behavior is unclear, a **Spike Phase** may be used **before the Red Phase**.
77
+ This phase is **not part of the regular TDD workflow** and must only be applied under exceptional circumstances.
78
+
79
+ - The goal of a Spike is **exploration and learning**, not implementation.
80
+ - The code written during a Spike is **disposable** and **must not** be merged or reused directly.
81
+ - Once sufficient understanding is achieved, all spike code is discarded, and normal TDD resumes starting from the **Red Phase**.
82
+ - A Spike is justified only when it is impossible to define a meaningful failing test due to technical uncertainty or unknown system behavior.
83
+
84
+ ### General Information
85
+
86
+ - 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.
87
+ - 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.
88
+ - 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.
89
+ - Adding types, interfaces, or a constant in order to replace magic values is perfectly fine during refactoring.
90
+ - Provide the agent with helpful directions so that they do not get stuck when blocking them.
91
+
92
+
93
+ ## 🛡 Project Rules (Injected into every command)
94
+
95
+ 1. **NO BROKEN BUILDS:**
96
+ - Run `pnpm test` before every `/commit`
97
+ - Ensure all tests pass
98
+ - Fix any type errors immediately
99
+
100
+ 2. **API DEVELOPMENT:**
101
+ - All new APIs MUST have Zod request/response schemas
102
+ - All APIs MUST be documented in both:
103
+ - OpenAPI spec ([src/lib/openapi/](src/lib/openapi/))
104
+ - API test manifest ([src/app/api-test/api-tests-manifest.json](src/app/api-test/api-tests-manifest.json))
105
+ - Test ALL parameters and edge cases
106
+ - Include code examples and real-world outputs
107
+
108
+ 3. **TDD WORKFLOW:**
109
+ - ALWAYS use /red → /green → /refactor cycle
110
+ - NEVER write implementation without failing test first
111
+ - Use /cycle for feature development
112
+ - Use characterization tests for refactoring
113
+
114
+ 4. **API KEY MANAGEMENT:**
115
+ - Support three loading methods:
116
+ - Server environment variables
117
+ - NEXT_PUBLIC_ variables (client-side)
118
+ - Custom headers (X-OpenAI-Key, X-Anthropic-Key, etc.)
119
+ - Never hardcode API keys
120
+ - Always validate key availability before use
121
+
122
+ 5. **COMPREHENSIVE TESTING:**
123
+ - When researching APIs, read actual implementation code
124
+ - Discover ALL possible parameters (not just documented ones)
125
+ - Test with various parameter combinations
126
+ - Document custom headers, query params, request/response schemas
127
+ - Include validation rules and testing notes
128
+
129
+ 6. **NO UI BLOAT:**
130
+ - This is an API project with minimal frontend
131
+ - Only keep necessary test/documentation interfaces
132
+ - Delete unused components immediately
133
+ - No unnecessary UI libraries or features
134
+
135
+ 7. **DOCUMENTATION:**
136
+ - If you change an API, you MUST update:
137
+ - OpenAPI spec
138
+ - api-tests-manifest.json
139
+ - Code examples
140
+ - Testing notes
141
+ - Document expected behavior and edge cases
142
+ - Include real-world output examples
@@ -0,0 +1,94 @@
1
+ ---
2
+ description: Summarize conversation progress and next steps
3
+ argument-hint: [optional additional info]
4
+ ---
5
+
6
+ ## General Guidelines
7
+
8
+ ### Output Style
9
+
10
+ - **Never explicitly mention TDD** in code, comments, commits, PRs, or issues
11
+ - Write natural, descriptive code without meta-commentary about the development process
12
+ - The code should speak for itself - TDD is the process, not the product
13
+
14
+ Create a concise summary of the current conversation suitable for transferring context to a new conversation.
15
+
16
+ Additional info: $ARGUMENTS
17
+
18
+ ## Summary Structure
19
+
20
+ Provide a summary with these sections:
21
+
22
+ ### What We Did
23
+
24
+ - Key accomplishments and changes made
25
+ - Important decisions or discoveries
26
+ - Files created, modified, or analyzed
27
+
28
+ ### What We're Doing Next
29
+
30
+ - Immediate next steps
31
+ - Pending tasks or work in progress
32
+ - Goals or objectives to continue
33
+
34
+ ### Blockers & User Input Needed
35
+
36
+ - Any issues requiring user intervention
37
+ - Decisions that need to be made
38
+ - Missing information or clarifications needed
39
+
40
+ ## Output Format
41
+
42
+ Keep the summary concise and actionable - suitable for pasting into a new conversation to quickly restore context without needing the full conversation history.
43
+
44
+
45
+ ## 🛡 Project Rules (Injected into every command)
46
+
47
+ 1. **NO BROKEN BUILDS:**
48
+ - Run `pnpm test` before every `/commit`
49
+ - Ensure all tests pass
50
+ - Fix any type errors immediately
51
+
52
+ 2. **API DEVELOPMENT:**
53
+ - All new APIs MUST have Zod request/response schemas
54
+ - All APIs MUST be documented in both:
55
+ - OpenAPI spec ([src/lib/openapi/](src/lib/openapi/))
56
+ - API test manifest ([src/app/api-test/api-tests-manifest.json](src/app/api-test/api-tests-manifest.json))
57
+ - Test ALL parameters and edge cases
58
+ - Include code examples and real-world outputs
59
+
60
+ 3. **TDD WORKFLOW:**
61
+ - ALWAYS use /red → /green → /refactor cycle
62
+ - NEVER write implementation without failing test first
63
+ - Use /cycle for feature development
64
+ - Use characterization tests for refactoring
65
+
66
+ 4. **API KEY MANAGEMENT:**
67
+ - Support three loading methods:
68
+ - Server environment variables
69
+ - NEXT_PUBLIC_ variables (client-side)
70
+ - Custom headers (X-OpenAI-Key, X-Anthropic-Key, etc.)
71
+ - Never hardcode API keys
72
+ - Always validate key availability before use
73
+
74
+ 5. **COMPREHENSIVE TESTING:**
75
+ - When researching APIs, read actual implementation code
76
+ - Discover ALL possible parameters (not just documented ones)
77
+ - Test with various parameter combinations
78
+ - Document custom headers, query params, request/response schemas
79
+ - Include validation rules and testing notes
80
+
81
+ 6. **NO UI BLOAT:**
82
+ - This is an API project with minimal frontend
83
+ - Only keep necessary test/documentation interfaces
84
+ - Delete unused components immediately
85
+ - No unnecessary UI libraries or features
86
+
87
+ 7. **DOCUMENTATION:**
88
+ - If you change an API, you MUST update:
89
+ - OpenAPI spec
90
+ - api-tests-manifest.json
91
+ - Code examples
92
+ - Testing notes
93
+ - Document expected behavior and edge cases
94
+ - Include real-world output examples
@@ -0,0 +1,144 @@
1
+ ---
2
+ description: Remind agent about TDD approach and continue conversation
3
+ argument-hint: [optional-response-to-last-message]
4
+ ---
5
+
6
+ # TDD Reminder
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
+ ## TDD Fundamentals
17
+
18
+ ### The TDD Cycle
19
+
20
+ The foundation of TDD is the Red-Green-Refactor cycle:
21
+
22
+ 1. **Red Phase**: Write ONE failing test that describes desired behavior
23
+
24
+ - The test must fail for the RIGHT reason (not syntax/import errors)
25
+ - Only one test at a time - this is critical for TDD discipline
26
+ - 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.
27
+ - **Adding a single test to a test file is ALWAYS allowed** - no prior test output needed
28
+ - Starting TDD for a new feature is always valid, even if test output shows unrelated work
29
+ - For DOM-based tests, use `data-testid` attributes to select elements rather than CSS classes, tag names, or text content
30
+ - 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
31
+
32
+ 2. **Green Phase**: Write MINIMAL code to make the test pass
33
+
34
+ - Implement only what's needed for the current failing test
35
+ - No anticipatory coding or extra features
36
+ - Address the specific failure message
37
+
38
+ 3. **Refactor Phase**: Improve code structure while keeping tests green
39
+ - Only allowed when relevant tests are passing
40
+ - Requires proof that tests have been run and are green
41
+ - Applies to BOTH implementation and test code
42
+ - No refactoring with failing tests - fix them first
43
+
44
+ ### Core Violations
45
+
46
+ 1. **Multiple Test Addition**
47
+
48
+ - Adding more than one new test at once
49
+ - Exception: Initial test file setup or extracting shared test utilities
50
+
51
+ 2. **Over-Implementation**
52
+
53
+ - Code that exceeds what's needed to pass the current failing test
54
+ - Adding untested features, methods, or error handling
55
+ - Implementing multiple methods when test only requires one
56
+
57
+ 3. **Premature Implementation**
58
+ - Adding implementation before a test exists and fails properly
59
+ - Adding implementation without running the test first
60
+ - Refactoring when tests haven't been run or are failing
61
+
62
+ ### Critical Principle: Incremental Development
63
+
64
+ Each step in TDD should address ONE specific issue:
65
+
66
+ - Test fails "not defined" → Create empty stub/class only
67
+ - Test fails "not a function" → Add method stub only
68
+ - Test fails with assertion → Implement minimal logic only
69
+
70
+ ### Optional Pre-Phase: Spike Phase
71
+
72
+ In rare cases where the problem space, interface, or expected behavior is unclear, a **Spike Phase** may be used **before the Red Phase**.
73
+ This phase is **not part of the regular TDD workflow** and must only be applied under exceptional circumstances.
74
+
75
+ - The goal of a Spike is **exploration and learning**, not implementation.
76
+ - The code written during a Spike is **disposable** and **must not** be merged or reused directly.
77
+ - Once sufficient understanding is achieved, all spike code is discarded, and normal TDD resumes starting from the **Red Phase**.
78
+ - A Spike is justified only when it is impossible to define a meaningful failing test due to technical uncertainty or unknown system behavior.
79
+
80
+ ### General Information
81
+
82
+ - 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.
83
+ - 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.
84
+ - 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.
85
+ - Adding types, interfaces, or a constant in order to replace magic values is perfectly fine during refactoring.
86
+ - Provide the agent with helpful directions so that they do not get stuck when blocking them.
87
+
88
+ ## Continue Conversation
89
+
90
+ User response to the last message: $ARGUMENTS
91
+
92
+ Please continue with TDD approach based on the above response.
93
+
94
+
95
+ ## 🛡 Project Rules (Injected into every command)
96
+
97
+ 1. **NO BROKEN BUILDS:**
98
+ - Run `pnpm test` before every `/commit`
99
+ - Ensure all tests pass
100
+ - Fix any type errors immediately
101
+
102
+ 2. **API DEVELOPMENT:**
103
+ - All new APIs MUST have Zod request/response schemas
104
+ - All APIs MUST be documented in both:
105
+ - OpenAPI spec ([src/lib/openapi/](src/lib/openapi/))
106
+ - API test manifest ([src/app/api-test/api-tests-manifest.json](src/app/api-test/api-tests-manifest.json))
107
+ - Test ALL parameters and edge cases
108
+ - Include code examples and real-world outputs
109
+
110
+ 3. **TDD WORKFLOW:**
111
+ - ALWAYS use /red → /green → /refactor cycle
112
+ - NEVER write implementation without failing test first
113
+ - Use /cycle for feature development
114
+ - Use characterization tests for refactoring
115
+
116
+ 4. **API KEY MANAGEMENT:**
117
+ - Support three loading methods:
118
+ - Server environment variables
119
+ - NEXT_PUBLIC_ variables (client-side)
120
+ - Custom headers (X-OpenAI-Key, X-Anthropic-Key, etc.)
121
+ - Never hardcode API keys
122
+ - Always validate key availability before use
123
+
124
+ 5. **COMPREHENSIVE TESTING:**
125
+ - When researching APIs, read actual implementation code
126
+ - Discover ALL possible parameters (not just documented ones)
127
+ - Test with various parameter combinations
128
+ - Document custom headers, query params, request/response schemas
129
+ - Include validation rules and testing notes
130
+
131
+ 6. **NO UI BLOAT:**
132
+ - This is an API project with minimal frontend
133
+ - Only keep necessary test/documentation interfaces
134
+ - Delete unused components immediately
135
+ - No unnecessary UI libraries or features
136
+
137
+ 7. **DOCUMENTATION:**
138
+ - If you change an API, you MUST update:
139
+ - OpenAPI spec
140
+ - api-tests-manifest.json
141
+ - Code examples
142
+ - Testing notes
143
+ - Document expected behavior and edge cases
144
+ - Include real-world output examples