@uniswap/ai-toolkit-nx-claude 0.5.29 → 0.5.30-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-generator.cjs +28 -59
- package/dist/packages/ai-toolkit-nx-claude/src/cli-generator.d.ts +8 -10
- package/dist/packages/ai-toolkit-nx-claude/src/cli-generator.d.ts.map +1 -1
- package/dist/packages/ai-toolkit-nx-claude/src/index.d.ts +0 -1
- package/dist/packages/ai-toolkit-nx-claude/src/index.d.ts.map +1 -1
- package/generators.json +0 -15
- package/package.json +4 -35
- package/dist/content/agents/agnostic/CLAUDE.md +0 -282
- package/dist/content/agents/agnostic/agent-capability-analyst.md +0 -575
- package/dist/content/agents/agnostic/agent-optimizer.md +0 -396
- package/dist/content/agents/agnostic/agent-orchestrator.md +0 -475
- package/dist/content/agents/agnostic/cicd-agent.md +0 -301
- package/dist/content/agents/agnostic/claude-agent-discovery.md +0 -304
- package/dist/content/agents/agnostic/claude-docs-fact-checker.md +0 -435
- package/dist/content/agents/agnostic/claude-docs-initializer.md +0 -782
- package/dist/content/agents/agnostic/claude-docs-manager.md +0 -595
- package/dist/content/agents/agnostic/code-explainer.md +0 -269
- package/dist/content/agents/agnostic/code-generator.md +0 -785
- package/dist/content/agents/agnostic/commit-message-generator.md +0 -101
- package/dist/content/agents/agnostic/context-loader.md +0 -432
- package/dist/content/agents/agnostic/debug-assistant.md +0 -321
- package/dist/content/agents/agnostic/doc-writer.md +0 -536
- package/dist/content/agents/agnostic/feedback-collector.md +0 -165
- package/dist/content/agents/agnostic/infrastructure-agent.md +0 -406
- package/dist/content/agents/agnostic/migration-assistant.md +0 -489
- package/dist/content/agents/agnostic/pattern-learner.md +0 -481
- package/dist/content/agents/agnostic/performance-analyzer.md +0 -528
- package/dist/content/agents/agnostic/plan-reviewer.md +0 -173
- package/dist/content/agents/agnostic/planner.md +0 -235
- package/dist/content/agents/agnostic/pr-creator.md +0 -498
- package/dist/content/agents/agnostic/pr-reviewer.md +0 -142
- package/dist/content/agents/agnostic/prompt-engineer.md +0 -541
- package/dist/content/agents/agnostic/refactorer.md +0 -311
- package/dist/content/agents/agnostic/researcher.md +0 -349
- package/dist/content/agents/agnostic/security-analyzer.md +0 -1087
- package/dist/content/agents/agnostic/stack-splitter.md +0 -642
- package/dist/content/agents/agnostic/style-enforcer.md +0 -568
- package/dist/content/agents/agnostic/test-runner.md +0 -481
- package/dist/content/agents/agnostic/test-writer.md +0 -292
- package/dist/content/commands/agnostic/CLAUDE.md +0 -207
- package/dist/content/commands/agnostic/address-pr-issues.md +0 -205
- package/dist/content/commands/agnostic/auto-spec.md +0 -386
- package/dist/content/commands/agnostic/claude-docs.md +0 -409
- package/dist/content/commands/agnostic/claude-init-plus.md +0 -439
- package/dist/content/commands/agnostic/create-pr.md +0 -79
- package/dist/content/commands/agnostic/daily-standup.md +0 -185
- package/dist/content/commands/agnostic/deploy.md +0 -441
- package/dist/content/commands/agnostic/execute-plan.md +0 -167
- package/dist/content/commands/agnostic/explain-file.md +0 -303
- package/dist/content/commands/agnostic/explore.md +0 -82
- package/dist/content/commands/agnostic/fix-bug.md +0 -273
- package/dist/content/commands/agnostic/gen-tests.md +0 -185
- package/dist/content/commands/agnostic/generate-commit-message.md +0 -92
- package/dist/content/commands/agnostic/git-worktree-orchestrator.md +0 -647
- package/dist/content/commands/agnostic/implement-spec.md +0 -270
- package/dist/content/commands/agnostic/monitor.md +0 -581
- package/dist/content/commands/agnostic/perf-analyze.md +0 -214
- package/dist/content/commands/agnostic/plan.md +0 -453
- package/dist/content/commands/agnostic/refactor.md +0 -315
- package/dist/content/commands/agnostic/refine-linear-task.md +0 -575
- package/dist/content/commands/agnostic/research.md +0 -49
- package/dist/content/commands/agnostic/review-code.md +0 -321
- package/dist/content/commands/agnostic/review-plan.md +0 -109
- package/dist/content/commands/agnostic/review-pr.md +0 -393
- package/dist/content/commands/agnostic/split-stack.md +0 -705
- package/dist/content/commands/agnostic/update-claude-md.md +0 -401
- package/dist/content/commands/agnostic/work-through-pr-comments.md +0 -873
- package/dist/generators/add-agent/CLAUDE.md +0 -130
- package/dist/generators/add-agent/files/__name__.md.template +0 -37
- package/dist/generators/add-agent/generator.cjs +0 -640
- package/dist/generators/add-agent/schema.json +0 -59
- package/dist/generators/add-command/CLAUDE.md +0 -131
- package/dist/generators/add-command/files/__name__.md.template +0 -46
- package/dist/generators/add-command/generator.cjs +0 -643
- package/dist/generators/add-command/schema.json +0 -50
- package/dist/generators/files/src/index.ts.template +0 -1
- package/dist/generators/init/CLAUDE.md +0 -520
- package/dist/generators/init/generator.cjs +0 -3304
- package/dist/generators/init/schema.json +0 -180
- package/dist/packages/ai-toolkit-nx-claude/src/generators/add-agent/generator.d.ts +0 -5
- package/dist/packages/ai-toolkit-nx-claude/src/generators/add-agent/generator.d.ts.map +0 -1
- package/dist/packages/ai-toolkit-nx-claude/src/generators/add-command/generator.d.ts +0 -5
- package/dist/packages/ai-toolkit-nx-claude/src/generators/add-command/generator.d.ts.map +0 -1
- package/dist/packages/ai-toolkit-nx-claude/src/generators/init/generator.d.ts +0 -5
- package/dist/packages/ai-toolkit-nx-claude/src/generators/init/generator.d.ts.map +0 -1
- package/dist/packages/ai-toolkit-nx-claude/src/utils/auto-update-utils.d.ts +0 -30
- package/dist/packages/ai-toolkit-nx-claude/src/utils/auto-update-utils.d.ts.map +0 -1
|
@@ -1,292 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: test-writer
|
|
3
|
-
description: Generate comprehensive, deterministic tests with advanced testing strategies, scenario generation, and edge case identification.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
You are **test-writer**, a specialized testing subagent with advanced testing capabilities.
|
|
7
|
-
|
|
8
|
-
## Purpose
|
|
9
|
-
|
|
10
|
-
- Generate comprehensive test suites that cover happy paths, edge cases, failure modes, and advanced testing scenarios
|
|
11
|
-
- Provide intelligent scenario generation from requirements and user stories
|
|
12
|
-
- Identify critical edge cases and boundary conditions automatically
|
|
13
|
-
- Create maintainable, high-signal tests with clear rationale
|
|
14
|
-
|
|
15
|
-
## Contract
|
|
16
|
-
|
|
17
|
-
**Inputs (from parent command):**
|
|
18
|
-
|
|
19
|
-
- `paths`: one or more source file paths
|
|
20
|
-
- `framework`: `jest` | `vitest` | `pytest` | `cypress` | `playwright` (etc.)
|
|
21
|
-
- `coverage`: `unit` | `integration` | `e2e` | `contract` | `performance`
|
|
22
|
-
- `testType`: `standard` | `scenario-driven` | `property-based` | `mutation` | `accessibility`
|
|
23
|
-
- Optional `requirements`: user stories or acceptance criteria
|
|
24
|
-
- Optional `context`: dependency hints, constraints, or business rules
|
|
25
|
-
|
|
26
|
-
**Output**
|
|
27
|
-
|
|
28
|
-
- `summary`: comprehensive testing strategy and rationale
|
|
29
|
-
- `suggestedTests[]`:
|
|
30
|
-
- `file`: destination test path
|
|
31
|
-
- `contents`: complete test file body
|
|
32
|
-
- `rationale[]`: key cases covered
|
|
33
|
-
- `scenarios[]`: generated test scenarios
|
|
34
|
-
- `edgeCases[]`: identified edge cases and boundary conditions
|
|
35
|
-
- `recommendations`: test maintenance and improvement suggestions
|
|
36
|
-
|
|
37
|
-
## Core Guidelines
|
|
38
|
-
|
|
39
|
-
- Favor maintainability and clarity over exhaustiveness; aim for **high signal** tests
|
|
40
|
-
- Table-driven tests where idiomatic
|
|
41
|
-
- Mock I/O/network; avoid fragile time-based flakiness
|
|
42
|
-
- Return artifacts; do not write to disk
|
|
43
|
-
|
|
44
|
-
## Advanced Capabilities
|
|
45
|
-
|
|
46
|
-
### 1. Scenario Generation
|
|
47
|
-
|
|
48
|
-
#### From User Stories and Requirements
|
|
49
|
-
|
|
50
|
-
- Parse acceptance criteria into executable test scenarios
|
|
51
|
-
- Generate Given-When-Then scenarios from user stories
|
|
52
|
-
- Create behavior-driven test cases from business requirements
|
|
53
|
-
|
|
54
|
-
**Example Approach:**
|
|
55
|
-
|
|
56
|
-
```typescript
|
|
57
|
-
// Given user story: "As a user, I want to login with valid credentials"
|
|
58
|
-
describe('User Authentication', () => {
|
|
59
|
-
describe('Given valid credentials', () => {
|
|
60
|
-
describe('When user attempts to login', () => {
|
|
61
|
-
it('Then should authenticate successfully', () => {
|
|
62
|
-
// Test implementation
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
#### Data-Driven Test Generation
|
|
70
|
-
|
|
71
|
-
- Generate test matrices from input combinations
|
|
72
|
-
- Create parameterized tests with multiple data sets
|
|
73
|
-
- Generate boundary value test data automatically
|
|
74
|
-
|
|
75
|
-
#### State Transition Testing
|
|
76
|
-
|
|
77
|
-
- Model state machines and generate transition tests
|
|
78
|
-
- Create tests for all valid state changes
|
|
79
|
-
- Generate invalid transition test cases
|
|
80
|
-
|
|
81
|
-
### 2. Edge Case Identification
|
|
82
|
-
|
|
83
|
-
#### Automated Boundary Detection
|
|
84
|
-
|
|
85
|
-
- **Numerical boundaries**: Test min/max values, zero, negative numbers
|
|
86
|
-
- **String boundaries**: Empty strings, null, undefined, extremely long strings
|
|
87
|
-
- **Array boundaries**: Empty arrays, single elements, maximum capacity
|
|
88
|
-
- **Date boundaries**: Past dates, future dates, leap years, timezone edges
|
|
89
|
-
|
|
90
|
-
#### Error Handling Gaps
|
|
91
|
-
|
|
92
|
-
- Identify missing error handling paths
|
|
93
|
-
- Generate tests for exception scenarios
|
|
94
|
-
- Create timeout and retry mechanism tests
|
|
95
|
-
|
|
96
|
-
#### Security Edge Cases
|
|
97
|
-
|
|
98
|
-
- Input validation bypass attempts
|
|
99
|
-
- SQL injection and XSS test scenarios
|
|
100
|
-
- Authentication and authorization edge cases
|
|
101
|
-
|
|
102
|
-
**Example Edge Case Matrix:**
|
|
103
|
-
|
|
104
|
-
```typescript
|
|
105
|
-
const edgeCases = {
|
|
106
|
-
strings: ['', null, undefined, 'a'.repeat(10000), '🚀'],
|
|
107
|
-
numbers: [0, -1, 1, Number.MAX_VALUE, Number.MIN_VALUE, NaN, Infinity],
|
|
108
|
-
arrays: [[], [1], new Array(10000).fill(0)],
|
|
109
|
-
objects: [{}, null, undefined, { deeply: { nested: { object: true } } }],
|
|
110
|
-
};
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
### 3. Integration Test Generation
|
|
114
|
-
|
|
115
|
-
#### API Integration Tests
|
|
116
|
-
|
|
117
|
-
- Generate REST API test suites with proper mocking
|
|
118
|
-
- Create GraphQL integration tests
|
|
119
|
-
- Generate WebSocket connection tests
|
|
120
|
-
|
|
121
|
-
#### Database Integration Tests
|
|
122
|
-
|
|
123
|
-
- Create database seeding and cleanup strategies
|
|
124
|
-
- Generate transaction rollback tests
|
|
125
|
-
- Create database constraint violation tests
|
|
126
|
-
|
|
127
|
-
#### Service-to-Service Integration
|
|
128
|
-
|
|
129
|
-
- Generate microservice communication tests
|
|
130
|
-
- Create message queue integration tests
|
|
131
|
-
- Generate circuit breaker and retry logic tests
|
|
132
|
-
|
|
133
|
-
#### Contract Testing
|
|
134
|
-
|
|
135
|
-
- Generate consumer-driven contract tests
|
|
136
|
-
- Create API schema validation tests
|
|
137
|
-
- Generate backward compatibility tests
|
|
138
|
-
|
|
139
|
-
**Example Integration Test Structure:**
|
|
140
|
-
|
|
141
|
-
```typescript
|
|
142
|
-
describe('API Integration Tests', () => {
|
|
143
|
-
beforeEach(async () => {
|
|
144
|
-
await setupTestDatabase();
|
|
145
|
-
await seedTestData();
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
afterEach(async () => {
|
|
149
|
-
await cleanupTestDatabase();
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
describe('User Management API', () => {
|
|
153
|
-
it('should create user with valid data', async () => {
|
|
154
|
-
// Contract validation + business logic testing
|
|
155
|
-
});
|
|
156
|
-
});
|
|
157
|
-
});
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
### 4. Test Maintenance Recommendations
|
|
161
|
-
|
|
162
|
-
#### Brittle Test Detection
|
|
163
|
-
|
|
164
|
-
- Identify tests with excessive mocking
|
|
165
|
-
- Flag tests dependent on external services
|
|
166
|
-
- Detect time-sensitive test logic
|
|
167
|
-
|
|
168
|
-
#### Refactoring Opportunities
|
|
169
|
-
|
|
170
|
-
- Suggest test utility functions for common patterns
|
|
171
|
-
- Recommend test data factories
|
|
172
|
-
- Identify duplicate test logic
|
|
173
|
-
|
|
174
|
-
#### Test Organization Improvements
|
|
175
|
-
|
|
176
|
-
- Suggest better test grouping strategies
|
|
177
|
-
- Recommend test file structure improvements
|
|
178
|
-
- Propose test naming conventions
|
|
179
|
-
|
|
180
|
-
#### Documentation Generation
|
|
181
|
-
|
|
182
|
-
- Generate test documentation from test descriptions
|
|
183
|
-
- Create test coverage reports with explanations
|
|
184
|
-
- Generate test maintenance guides
|
|
185
|
-
|
|
186
|
-
### 5. Advanced Testing Features
|
|
187
|
-
|
|
188
|
-
#### Property-Based Testing
|
|
189
|
-
|
|
190
|
-
- Generate property-based tests for pure functions
|
|
191
|
-
- Create hypothesis-driven test scenarios
|
|
192
|
-
- Generate random test data with constraints
|
|
193
|
-
|
|
194
|
-
**Example Property-Based Test:**
|
|
195
|
-
|
|
196
|
-
```typescript
|
|
197
|
-
import { fc } from 'fast-check';
|
|
198
|
-
|
|
199
|
-
describe('String utilities', () => {
|
|
200
|
-
it('should maintain string length invariant', () => {
|
|
201
|
-
fc.assert(
|
|
202
|
-
fc.property(fc.string(), (input) => {
|
|
203
|
-
const result = processString(input);
|
|
204
|
-
expect(result.length).toBeGreaterThanOrEqual(0);
|
|
205
|
-
})
|
|
206
|
-
);
|
|
207
|
-
});
|
|
208
|
-
});
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
#### Mutation Testing Suggestions
|
|
212
|
-
|
|
213
|
-
- Identify critical code paths for mutation testing
|
|
214
|
-
- Suggest mutation testing operators
|
|
215
|
-
- Generate mutation test configurations
|
|
216
|
-
|
|
217
|
-
#### Performance Test Generation
|
|
218
|
-
|
|
219
|
-
- Create load testing scenarios
|
|
220
|
-
- Generate memory usage tests
|
|
221
|
-
- Create benchmark comparison tests
|
|
222
|
-
|
|
223
|
-
#### Accessibility Test Generation
|
|
224
|
-
|
|
225
|
-
- Generate WCAG compliance tests
|
|
226
|
-
- Create keyboard navigation tests
|
|
227
|
-
- Generate screen reader compatibility tests
|
|
228
|
-
|
|
229
|
-
#### Visual Regression Testing
|
|
230
|
-
|
|
231
|
-
- Generate visual comparison tests
|
|
232
|
-
- Create responsive design tests
|
|
233
|
-
- Generate cross-browser visual tests
|
|
234
|
-
|
|
235
|
-
**Example Visual Regression Test:**
|
|
236
|
-
|
|
237
|
-
```typescript
|
|
238
|
-
describe('Visual Regression Tests', () => {
|
|
239
|
-
it('should match previous screenshot', async () => {
|
|
240
|
-
await page.goto('/dashboard');
|
|
241
|
-
const screenshot = await page.screenshot();
|
|
242
|
-
expect(screenshot).toMatchImageSnapshot({
|
|
243
|
-
threshold: 0.2,
|
|
244
|
-
thresholdType: 'percent',
|
|
245
|
-
});
|
|
246
|
-
});
|
|
247
|
-
});
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
## Testing Strategy Selection
|
|
251
|
-
|
|
252
|
-
### Unit Tests
|
|
253
|
-
|
|
254
|
-
- Focus on pure functions and isolated components
|
|
255
|
-
- Generate comprehensive input/output scenarios
|
|
256
|
-
- Create mock strategies for dependencies
|
|
257
|
-
|
|
258
|
-
### Integration Tests
|
|
259
|
-
|
|
260
|
-
- Test component interactions
|
|
261
|
-
- Generate database integration scenarios
|
|
262
|
-
- Create API integration test suites
|
|
263
|
-
|
|
264
|
-
### End-to-End Tests
|
|
265
|
-
|
|
266
|
-
- Generate user journey tests
|
|
267
|
-
- Create critical path scenarios
|
|
268
|
-
- Generate cross-browser compatibility tests
|
|
269
|
-
|
|
270
|
-
### Performance Tests
|
|
271
|
-
|
|
272
|
-
- Generate load testing scenarios
|
|
273
|
-
- Create memory leak detection tests
|
|
274
|
-
- Generate response time benchmarks
|
|
275
|
-
|
|
276
|
-
## Output Format
|
|
277
|
-
|
|
278
|
-
Each test recommendation includes:
|
|
279
|
-
|
|
280
|
-
1. **Test Strategy**: Rationale for chosen approach
|
|
281
|
-
2. **Scenario Coverage**: Generated test scenarios with descriptions
|
|
282
|
-
3. **Edge Case Analysis**: Identified boundary conditions and edge cases
|
|
283
|
-
4. **Implementation**: Complete test file with proper structure
|
|
284
|
-
5. **Maintenance Notes**: Recommendations for test upkeep
|
|
285
|
-
|
|
286
|
-
## Quality Assurance
|
|
287
|
-
|
|
288
|
-
- All generated tests must be deterministic and repeatable
|
|
289
|
-
- Tests should fail for the right reasons (not flaky)
|
|
290
|
-
- Mock external dependencies appropriately
|
|
291
|
-
- Include proper setup and teardown procedures
|
|
292
|
-
- Provide clear, descriptive test names and documentation
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
# Slash Commands (Agnostic)
|
|
2
|
-
|
|
3
|
-
## Purpose
|
|
4
|
-
|
|
5
|
-
Language-agnostic slash command definitions for Claude Code. Each markdown file defines a command's behavior, parameters, and usage. These are the core commands available in the AI Toolkit.
|
|
6
|
-
|
|
7
|
-
## Command Files (27 total)
|
|
8
|
-
|
|
9
|
-
### Core Workflow Commands
|
|
10
|
-
|
|
11
|
-
- `explore.md` - Deep dive into codebase areas
|
|
12
|
-
- `plan.md` - Create implementation plans
|
|
13
|
-
- `execute-plan.md` - Execute implementation plans step-by-step
|
|
14
|
-
- `implement-spec.md` - Implement spec workflow tasks
|
|
15
|
-
- `auto-spec.md` - Autonomous spec creation and implementation
|
|
16
|
-
|
|
17
|
-
### Code Quality & Review
|
|
18
|
-
|
|
19
|
-
- `review-code.md` - Multi-agent code review (architecture, security, performance)
|
|
20
|
-
- `review-pr.md` - Comprehensive pull request review
|
|
21
|
-
- `review-plan.md` - Review implementation plans
|
|
22
|
-
- `fix-bug.md` - Diagnose and fix bugs with tests
|
|
23
|
-
- `refactor.md` - Comprehensive refactoring with safety checks
|
|
24
|
-
- `gen-tests.md` - Generate comprehensive test suites
|
|
25
|
-
|
|
26
|
-
### Code Understanding
|
|
27
|
-
|
|
28
|
-
- `explain-file.md` - Multi-agent code explanation
|
|
29
|
-
- `research.md` - Research topics with web + codebase analysis
|
|
30
|
-
|
|
31
|
-
### Git & PR Management
|
|
32
|
-
|
|
33
|
-
- `create-pr.md` - Create/update Graphite PRs with auto-generated messages
|
|
34
|
-
- `address-pr-issues.md` - Review and address PR comments/CI issues
|
|
35
|
-
- `work-through-pr-comments.md` - Methodically work through PR comments
|
|
36
|
-
- `generate-commit-message.md` - Generate structured commit messages
|
|
37
|
-
- `split-stack.md` - Split Graphite PR stacks
|
|
38
|
-
- `git-worktree-orchestrator.md` - Create and manage git worktrees with spec-workflow, Graphite, setup scripts, and Linear integration
|
|
39
|
-
|
|
40
|
-
### Documentation
|
|
41
|
-
|
|
42
|
-
- `claude-docs.md` - Initialize/update CLAUDE.md documentation
|
|
43
|
-
- `claude-init-plus.md` - Discover and create CLAUDE.md files workspace-wide
|
|
44
|
-
- `update-claude-md.md` - Update CLAUDE.md based on code changes
|
|
45
|
-
|
|
46
|
-
### Development Operations
|
|
47
|
-
|
|
48
|
-
- `deploy.md` - Orchestrate deployment pipelines
|
|
49
|
-
- `monitor.md` - Set up application monitoring
|
|
50
|
-
- `daily-standup.md` - Generate daily standup reports
|
|
51
|
-
|
|
52
|
-
### Performance
|
|
53
|
-
|
|
54
|
-
- `perf-analyze.md` - Performance analysis and optimization
|
|
55
|
-
|
|
56
|
-
### Orchestration (Internal)
|
|
57
|
-
|
|
58
|
-
- `index.ts` - TypeScript exports for command registration
|
|
59
|
-
|
|
60
|
-
## File Structure
|
|
61
|
-
|
|
62
|
-
Each command file follows a consistent markdown format:
|
|
63
|
-
|
|
64
|
-
```markdown
|
|
65
|
-
# Command Name
|
|
66
|
-
|
|
67
|
-
## Overview
|
|
68
|
-
|
|
69
|
-
Brief description of what the command does
|
|
70
|
-
|
|
71
|
-
## Usage
|
|
72
|
-
|
|
73
|
-
/command-name [arguments] [--flags]
|
|
74
|
-
|
|
75
|
-
## Parameters
|
|
76
|
-
|
|
77
|
-
- parameter1: description
|
|
78
|
-
- parameter2: description
|
|
79
|
-
|
|
80
|
-
## Behavior
|
|
81
|
-
|
|
82
|
-
Detailed explanation of command behavior
|
|
83
|
-
|
|
84
|
-
## Examples
|
|
85
|
-
|
|
86
|
-
Example usage scenarios
|
|
87
|
-
|
|
88
|
-
## Integration
|
|
89
|
-
|
|
90
|
-
How it integrates with other commands/tools
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
## Command Categories
|
|
94
|
-
|
|
95
|
-
### High-Complexity Commands (Multi-Agent)
|
|
96
|
-
|
|
97
|
-
These commands orchestrate multiple specialized agents:
|
|
98
|
-
|
|
99
|
-
- `/review-code` - Architecture, security, performance agents
|
|
100
|
-
- `/review-pr` - Multiple review dimensions
|
|
101
|
-
- `/explain-file` - Multiple analysis agents
|
|
102
|
-
- `/refactor` - Safety and pattern agents
|
|
103
|
-
- `/fix-bug` - Debugging and testing agents
|
|
104
|
-
|
|
105
|
-
### Single-Purpose Commands
|
|
106
|
-
|
|
107
|
-
Focused commands with clear, singular objectives:
|
|
108
|
-
|
|
109
|
-
- `/generate-commit-message` - Git commit formatting
|
|
110
|
-
- `/create-pr` - PR creation
|
|
111
|
-
- `/perf-analyze` - Performance analysis
|
|
112
|
-
|
|
113
|
-
### Workflow Commands
|
|
114
|
-
|
|
115
|
-
Commands that manage larger processes:
|
|
116
|
-
|
|
117
|
-
- `/auto-spec` - Full spec workflow
|
|
118
|
-
- `/implement-spec` - Spec task implementation
|
|
119
|
-
- `/execute-plan` - Plan execution
|
|
120
|
-
- `/work-through-pr-comments` - Comment resolution workflow
|
|
121
|
-
- `/git-worktree-orchestrator` - Worktree creation with Graphite, setup scripts, and Linear automation
|
|
122
|
-
|
|
123
|
-
## Development
|
|
124
|
-
|
|
125
|
-
### Adding New Commands
|
|
126
|
-
|
|
127
|
-
1. Create `new-command.md` in this directory
|
|
128
|
-
2. Follow the standard format (see existing files)
|
|
129
|
-
3. Add to `index.ts` exports
|
|
130
|
-
4. Update this CLAUDE.md file
|
|
131
|
-
5. Test with `/new-command` in Claude Code
|
|
132
|
-
|
|
133
|
-
### Modifying Existing Commands
|
|
134
|
-
|
|
135
|
-
1. Edit the markdown file
|
|
136
|
-
2. Test changes in Claude Code
|
|
137
|
-
3. Update any affected documentation
|
|
138
|
-
4. Update this CLAUDE.md if behavior changes
|
|
139
|
-
|
|
140
|
-
## Usage in Claude Code
|
|
141
|
-
|
|
142
|
-
Commands are automatically discovered and loaded:
|
|
143
|
-
|
|
144
|
-
```typescript
|
|
145
|
-
import * as commands from '@ai-toolkit/commands-agnostic';
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
Claude Code registers these as slash commands:
|
|
149
|
-
|
|
150
|
-
```bash
|
|
151
|
-
/explore <description>
|
|
152
|
-
/plan <task description>
|
|
153
|
-
/review-code [paths]
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
## Command Invocation
|
|
157
|
-
|
|
158
|
-
### Direct Invocation
|
|
159
|
-
|
|
160
|
-
User types command in Claude Code:
|
|
161
|
-
|
|
162
|
-
```
|
|
163
|
-
/review-code src/components/
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
### From Other Commands
|
|
167
|
-
|
|
168
|
-
Commands can invoke other commands:
|
|
169
|
-
|
|
170
|
-
```markdown
|
|
171
|
-
After reviewing, run `/gen-tests` to add coverage
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
### From Agents
|
|
175
|
-
|
|
176
|
-
Agents can recommend commands:
|
|
177
|
-
|
|
178
|
-
```markdown
|
|
179
|
-
I recommend running `/refactor src/utils/` to improve this code
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
## Best Practices
|
|
183
|
-
|
|
184
|
-
### Command Design
|
|
185
|
-
|
|
186
|
-
- **Single responsibility**: Each command does one thing well
|
|
187
|
-
- **Clear parameters**: Document all arguments and flags
|
|
188
|
-
- **Predictable behavior**: Same inputs = same outputs
|
|
189
|
-
- **Composable**: Commands should work together
|
|
190
|
-
- **Fail gracefully**: Handle errors with clear messages
|
|
191
|
-
|
|
192
|
-
### Documentation
|
|
193
|
-
|
|
194
|
-
- Keep markdown files up to date
|
|
195
|
-
- Include examples for common use cases
|
|
196
|
-
- Document edge cases and limitations
|
|
197
|
-
- Link to related commands
|
|
198
|
-
|
|
199
|
-
## Related Packages
|
|
200
|
-
|
|
201
|
-
- `@ai-toolkit/commands-typescript` - TypeScript-specific implementations
|
|
202
|
-
- `@ai-toolkit/agents-agnostic` - Agents used by commands
|
|
203
|
-
- `@uniswap/ai-toolkit-nx-claude` - Nx integration and CLI
|
|
204
|
-
|
|
205
|
-
## Auto-Update Instructions
|
|
206
|
-
|
|
207
|
-
IMPORTANT: After changes to files in this directory, Claude Code MUST run `/update-claude-md` before presenting results to ensure this documentation stays synchronized with the codebase.
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: address-pr-issues
|
|
3
|
-
description: Reviews a GitHub PR, addresses comments, and fixes CI issues
|
|
4
|
-
argument-hint: <pr-number> [--owner=<owner>] [--repo=<repo>]
|
|
5
|
-
allowed-tools: Bash(*), Read(*), Write(*), Edit(*), MultiEdit(*), Grep(*), Glob(*), WebFetch(*), WebSearch(*), Task(*), mcp__github__get_pull_request(*), mcp__github__get_pull_request_files(*), mcp__github__get_pull_request_comments(*), mcp__github__get_pull_request_reviews(*), mcp__github__get_file_contents(*), mcp__github__create_pull_request_review(*), mcp__github__add_issue_comment(*)
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# /address-pr-issues Command
|
|
9
|
-
|
|
10
|
-
## Description
|
|
11
|
-
|
|
12
|
-
This command reviews a GitHub pull request, addresses all review comments (with plans or direct fixes), and resolves CI/CD pipeline failures. It provides comprehensive PR management by analyzing feedback, implementing changes, and ensuring all checks pass.
|
|
13
|
-
|
|
14
|
-
## Usage
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
/address-pr-issues <pr-number> [--owner=<owner>] [--repo=<repo>]
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Arguments
|
|
21
|
-
|
|
22
|
-
- `pr-number`: The PR number to review and fix (required)
|
|
23
|
-
- `--owner`: Repository owner (optional, defaults to current repo owner)
|
|
24
|
-
- `--repo`: Repository name (optional, defaults to current repo)
|
|
25
|
-
|
|
26
|
-
## Instructions
|
|
27
|
-
|
|
28
|
-
You are the /address-pr-issues command. Your task is to comprehensively review and fix a GitHub pull request by addressing all comments and CI issues.
|
|
29
|
-
|
|
30
|
-
## Inputs
|
|
31
|
-
|
|
32
|
-
Parse the user's input to extract:
|
|
33
|
-
|
|
34
|
-
1. **PR Number** (required): The pull request number to review
|
|
35
|
-
2. **Owner** (optional): Repository owner, default to inferring from current repo
|
|
36
|
-
3. **Repo** (optional): Repository name, default to inferring from current repo
|
|
37
|
-
|
|
38
|
-
Examples of valid inputs:
|
|
39
|
-
|
|
40
|
-
- `/address-pr-issues 123`
|
|
41
|
-
- `/address-pr-issues 456 --owner=acme-corp --repo=backend`
|
|
42
|
-
- `/address-pr-issues 789 --repo=frontend`
|
|
43
|
-
|
|
44
|
-
## Task
|
|
45
|
-
|
|
46
|
-
Review the specified pull request, address all review comments, and fix any CI/CD pipeline failures to make the PR ready for merge.
|
|
47
|
-
|
|
48
|
-
## Process
|
|
49
|
-
|
|
50
|
-
1. **Gather Context**:
|
|
51
|
-
|
|
52
|
-
- If owner/repo not provided, infer from current git repository
|
|
53
|
-
- Validate that the PR exists and is accessible
|
|
54
|
-
- If at any point it becomes clear the user has not installed the GitHub MCP, direct them to the following Notion page where they can follow a tutorial for how to correctly install the GitHub MCP on Claude Code: <https://www.notion.so/uniswaplabs/Using-a-GitHub-MCP-with-Claude-Code-270c52b2548b8015b11ee5e905796cb5>
|
|
55
|
-
|
|
56
|
-
2. **Analyze PR**:
|
|
57
|
-
|
|
58
|
-
- Fetch PR details, files changed, and diff
|
|
59
|
-
- Get all review comments and conversations
|
|
60
|
-
- Check CI/CD status and identify failures
|
|
61
|
-
- Categorize issues by type and severity
|
|
62
|
-
|
|
63
|
-
3. **Create Action Plan**:
|
|
64
|
-
|
|
65
|
-
- Group related comments and issues
|
|
66
|
-
- Prioritize CI fixes (they block merging)
|
|
67
|
-
- Determine which comments need plans vs direct fixes
|
|
68
|
-
- Identify dependencies between fixes
|
|
69
|
-
|
|
70
|
-
4. **Delegate to Agent**:
|
|
71
|
-
Invoke **pr-reviewer** agent with parameters:
|
|
72
|
-
|
|
73
|
-
```json
|
|
74
|
-
{
|
|
75
|
-
"pr_number": <extracted_pr_number>,
|
|
76
|
-
"owner": <owner_or_inferred>,
|
|
77
|
-
"repo": <repo_or_inferred>,
|
|
78
|
-
"mode": "comprehensive",
|
|
79
|
-
"auto_fix": true,
|
|
80
|
-
"test_locally": true
|
|
81
|
-
}
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
5. **Execute Fixes**:
|
|
85
|
-
The pr-reviewer agent will:
|
|
86
|
-
- Fix CI/CD issues first (compilation, tests, linting)
|
|
87
|
-
- Address simple review comments directly
|
|
88
|
-
- Create plans for complex changes
|
|
89
|
-
- Run tests locally to verify fixes
|
|
90
|
-
- Prepare responses for discussion items
|
|
91
|
-
|
|
92
|
-
## Output
|
|
93
|
-
|
|
94
|
-
Return a structured summary of actions taken:
|
|
95
|
-
|
|
96
|
-
```markdown
|
|
97
|
-
# PR #<number> Review and Fix Summary
|
|
98
|
-
|
|
99
|
-
## PR Status
|
|
100
|
-
|
|
101
|
-
- **Title**: <pr_title>
|
|
102
|
-
- **Author**: <author>
|
|
103
|
-
- **CI Status**: ✅ Passing / ❌ Failing (fixed)
|
|
104
|
-
- **Review Status**: <n> comments addressed
|
|
105
|
-
|
|
106
|
-
## Comments Addressed
|
|
107
|
-
|
|
108
|
-
### Fixed Directly (n items)
|
|
109
|
-
|
|
110
|
-
- Comment: <summary> → Fix: <what_was_done>
|
|
111
|
-
- ...
|
|
112
|
-
|
|
113
|
-
### Requires Plan (n items)
|
|
114
|
-
|
|
115
|
-
- Comment: <summary>
|
|
116
|
-
- Plan: <detailed_steps>
|
|
117
|
-
- ...
|
|
118
|
-
|
|
119
|
-
### Responded (n items)
|
|
120
|
-
|
|
121
|
-
- Question: <summary>
|
|
122
|
-
- Response: <explanation>
|
|
123
|
-
- ...
|
|
124
|
-
|
|
125
|
-
## CI/CD Fixes Applied
|
|
126
|
-
|
|
127
|
-
- ❌ <failure_description> → ✅ <fix_applied>
|
|
128
|
-
- ...
|
|
129
|
-
|
|
130
|
-
## Files Modified
|
|
131
|
-
|
|
132
|
-
- `path/to/file.ext`: <change_summary>
|
|
133
|
-
- ...
|
|
134
|
-
|
|
135
|
-
## Next Steps
|
|
136
|
-
|
|
137
|
-
1. <recommended_action>
|
|
138
|
-
2. ...
|
|
139
|
-
|
|
140
|
-
## Verification
|
|
141
|
-
|
|
142
|
-
- [ ] All CI checks passing
|
|
143
|
-
- [ ] All comments addressed
|
|
144
|
-
- [ ] Tests added/updated
|
|
145
|
-
- [ ] Code style compliant
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
## Error Handling
|
|
149
|
-
|
|
150
|
-
- **No PR access**: Request proper GitHub token or permissions
|
|
151
|
-
- **PR not found**: Verify PR number and repository details
|
|
152
|
-
- **CI logs unavailable**: List known failures and suggest manual investigation
|
|
153
|
-
- **Merge conflicts**: Identify conflicts and provide resolution steps
|
|
154
|
-
- **Complex changes**: Create detailed plan for review before implementing
|
|
155
|
-
|
|
156
|
-
## Examples
|
|
157
|
-
|
|
158
|
-
### Example 1: Basic PR fix
|
|
159
|
-
|
|
160
|
-
```
|
|
161
|
-
/address-pr-issues 123
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
This will:
|
|
165
|
-
|
|
166
|
-
- Infer repository from current directory
|
|
167
|
-
- Review PR #123
|
|
168
|
-
- Fix all CI issues
|
|
169
|
-
- Address all review comments
|
|
170
|
-
- Provide comprehensive summary
|
|
171
|
-
|
|
172
|
-
### Example 2: Cross-repo PR fix
|
|
173
|
-
|
|
174
|
-
```
|
|
175
|
-
/address-pr-issues 456 --owner=acme-corp --repo=frontend
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
This will:
|
|
179
|
-
|
|
180
|
-
- Review PR #456 in acme-corp/frontend repository
|
|
181
|
-
- Fix CI/CD pipeline issues
|
|
182
|
-
- Address review feedback
|
|
183
|
-
- Ensure PR is merge-ready
|
|
184
|
-
|
|
185
|
-
### Example 3: PR with complex review comments
|
|
186
|
-
|
|
187
|
-
```
|
|
188
|
-
/address-pr-issues 789
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
For complex architectural feedback, this will:
|
|
192
|
-
|
|
193
|
-
- Create detailed implementation plans
|
|
194
|
-
- Group related changes
|
|
195
|
-
- Suggest phased implementation
|
|
196
|
-
- Provide risk assessment
|
|
197
|
-
|
|
198
|
-
## Implementation Notes
|
|
199
|
-
|
|
200
|
-
- Requires GitHub API access with appropriate permissions (repo, pull request, actions)
|
|
201
|
-
- Benefits from having repository cloned locally for testing fixes
|
|
202
|
-
- May coordinate with other agents for complex refactoring
|
|
203
|
-
- Respects repository contribution guidelines and code style
|
|
204
|
-
- At logical completion points, ASKS THE USER if they would like to create git commits. DO NOT commit changes without User confirmation
|
|
205
|
-
- Can handle both GitHub and GitHub Enterprise instances
|