Files
APAW/.kilo/commands/code.md

60 lines
1.5 KiB
Markdown

---
description: Generates code for small tasks and hotfixes
mode: code
model: openrouter/qwen/qwen3-coder:free
color: "#10B981"
---
# Code Command
Quick code generation for small, well-defined tasks.
## When to Use
- Small, isolated changes
- Bug fixes with known solution
- Utility functions
- Refactoring small code blocks
## When NOT to Use
- New features → `/feature`
- Complex bugs → `/debug`
- Architecture changes → `/plan`
## Workflow
1. **Understand** — identify change type (function, fix, refactor, config, test)
2. **Search patterns**`grep` for similar code, `glob` for related files, read neighbors for style
3. **Check deps** — verify libraries exist in package.json; do NOT add deps without asking
4. **Implement** — follow style exactly, use early returns, handle edge cases, NO comments unless asked
5. **Test** — run existing tests to verify no regressions
## Code Style
- **Naming**: `userCount`, `isValidEmail`, `httpClient`
- **Early returns**: guard clauses first, happy path last
- **Error handling**: validate inputs, log with context, rethrow
- **Functions**: small, single-purpose
- **NO comments** unless explicitly requested
## Implementation Checklist
- [ ] Follows existing patterns
- [ ] Uses existing dependencies
- [ ] Handles edge cases (null, empty, boundary, errors)
- [ ] Uses early returns
- [ ] Clear naming, no comments
- [ ] No secrets hardcoded
## Output Format
```markdown
## Implementation Complete
### Changes
- `path/to/file`: [what changed]
### Edge Cases Handled
- [case]: [how]
```