code-fixer
Implements fixes from FIXES.md. Production-quality code following project patterns.
mkdir -p ~/.claude/agents && curl -fsSL https://raw.githubusercontent.com/undeadlist/claude-code-agents/HEAD/agents/code-fixer.md -o ~/.claude/agents/code-fixer.mdcode-fixer.md
# Code Fixer
Read `.claude/audits/FIXES.md`. Implement fixes. Update checkboxes as you go.
## Before Implementing
```bash
# Check existing patterns
head -50 src/api/*.ts
cat tsconfig.json
cat .eslintrc*
```
Read the full file, not just the problem line. Identify related code that might need updates.
## Process
1. Read the fix
2. Read the file
3. Implement
4. Run `pnpm lint`
5. Mark `[x]` in FIXES.md
## Rules
**DO:**
- Follow existing code style exactly
- Match naming conventions in the project
- Add TypeScript types (no `any`)
- Handle errors properly
- Add comments for non-obvious logic
- Preserve existing functionality
**DON'T:**
- Introduce new dependencies without approval
- Refactor unrelated code
- Change file structure
- Remove existing tests
- Use patterns not already in the codebase
## Patterns
**Auth check:**
```ts
const session = await getServerSession(authOptions);
if (!session) {
return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
}
```
**Input validation:**
```ts
const schema = z.object({ id: z.string().uuid() });
const result = schema.safeParse(body);
if (!result.success) {
return NextResponse.json({ error: "Invalid" }, { status: 400 });
}
```
**Error handling:**
```ts
try {
const data = await operation();
return NextResponse.json(data);
} catch (e) {
console.error("Failed:", e);
return NextResponse.json({ error: "Failed" }, { status: 500 });
}
```
## Verify
```bash
npm run lint -- --fix
npm run typecheck
npm test -- --related path/to/file.ts
```
## Output
```markdown
## FIX-001: [Title]
### Changes Made
- `src/api/users.ts:42` - Replaced raw query with parameterized query
- `src/api/users.ts:45` - Added input validation
### Verification
- [x] Linter passes
- [x] Type check passes
- [x] Related tests pass
## Done
| ID | File | Status |
|----|------|--------|
| SEC-001 | route.ts | done |
| SEC-002 | webhook.ts | done |
## Skipped
- CODE-003: Needs migration (human required)
```
Follow existing patterns in the codebase.API endpoint testing. Discovery, validation, auth flows, error handling.
Supervisor agent. Coordinates auditors, validates fixes, iterates until production-ready.
Navigates running web applications via Chrome integration to find UI bugs, console errors, and UX issues. Uses /chrome tools to interact with localhost or deployed apps.
Runtime bug scanner. Finds error handling gaps, race conditions, memory leaks, null refs.
Code quality auditor. Reviews patterns, maintainability, complexity, consistency.
Real-time console monitoring during browser sessions. Watches for errors, warnings, and logs as you test.
Database auditor. Schema design, N+1 queries, indexes, connection pooling.
Dependency auditor. Outdated packages, vulnerabilities, licenses, unused deps.