Agent skill
code
Implements features, fixes bugs, refactors code, and writes unit and integration tests. Use when asked to "implement", "fix a bug", "refactor", "add a feature", "write tests", "add test coverage", or "update code".
Install this agent skill to your Project
npx add-skill https://github.com/jiyeol-lee/dotfiles/tree/main/.opencode/skills/code
SKILL.md
Quick Start
- Implements features and fixes bugs based on requirements
- Writes unit tests and integration tests for implemented code
- Follows existing project conventions and quality standards
- Reports blockers and ambiguities to orchestrator — does NOT guess
Workflow
- Understand the requirement — read relevant existing code first
- Plan the approach — identify files to modify, edge cases, dependencies
- Implement — make changes following existing project patterns
- Verify — run through the completion checklist below
- Report — summarize what was done and any concerns
Example: Adding Error Handling to an API Endpoint
Requirement: Add proper error handling to the /users/:id endpoint
Step 1 — Read existing code:
Read src/routes/users.ts and src/middleware/errorHandler.ts
Identified: Project uses custom AppError class with status codes
Step 2 — Plan:
- Wrap handler in try/catch
- Return 404 for missing user (not generic 500)
- Validate ID parameter format before DB query
- Add unit test for each error case
Step 3 — Implement:
Edit src/routes/users.ts:
- Add ID format validation (return 400 for non-numeric)
- Add null check after DB query (return 404)
- Wrap in try/catch using existing AppError pattern
Edit src/routes/__tests__/users.test.ts:
- Add test: "returns 400 for non-numeric ID"
- Add test: "returns 404 for nonexistent user"
Step 4 — Verify:
✓ No syntax errors
✓ Edge cases handled (bad ID, missing user, DB error)
✓ Error handling uses project's AppError pattern
✓ No hardcoded values
✓ Tests cover error paths
Error Handling
| Error Type | Action |
|---|---|
| Build/Compile failure | Include error output, attempt fix up to 2x |
| File conflicts | Stop and report to orchestrator |
| Unclear requirements | Report ambiguity, do NOT guess |
| Missing dependencies | Report which dependencies are needed |
| Large files (>500 LOC) | Warn orchestrator before modifying |
| Large files (>1000 LOC) | Report as blocker, recommend splitting |
Completion Checklist
Before reporting completion, verify ALL of the following:
- Code compiles/parses without syntax errors
- Edge cases are handled appropriately
- Error handling is in place (no silent failures)
- Inline comments explain complex logic
- Code follows existing project conventions (naming, patterns, structure)
- No hardcoded credentials or secrets
- Tests cover the new/changed behavior (when applicable)
Constraints (Never Allowed)
- Git config modifications
- Hardcoded credentials or secrets
- Silent failures (every error must be caught and handled or propagated)
- Using sed/perl/awk/tr for multi-file replacements (use grep + edit)
- Guessing when requirements are unclear — ask instead
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
pull-request
Analyzes branch diffs, drafts PR titles and bodies following Conventional Commits, and creates or updates pull requests via GitHub CLI. Use when user asks to "create a PR", "open a pull request", "update PR description", "draft a PR", or "submit changes for review".
commit
Analyzes repository state, proposes commit messages following Conventional Commits, and applies commits after user approval. Use when asked to "commit", "commit changes", "save my work", "create a commit", or "stage and commit".
review
Performs code review analysis across Quality, Regression, Documentation, and Performance focus areas with severity-classified findings. Use when user asks to "review code", "review this PR", "check code quality", "review changes", or "do a code review".
check
Verifies code quality through linting, type-checking, formatting, and testing. Use when asked to "run checks", "validate code", "lint this", "check for errors", "run tests", or "verify code quality" before or after changes.
task-breakdown
Decomposes complex goals into atomic, dependency-aware work items with execution plans. Use when asked to "break down this task", "create a task plan", "decompose this goal", "split this work", "plan the implementation", "what are the steps", or "create an execution plan".
grill-me
Conducts thorough interviews to deeply understand user needs, requirements, and context before any implementation begins. Use when requirements are unclear, assumptions need validation, edge cases need exploration, when the user says "grill me", "ask me questions", "help me think through this", or when the underlying problem isn't fully understood.
Didn't find tool you were looking for?