code-execution
Code Execution
Overview
Execute coding subtasks with self-review and quality validation. Runs in isolated coder-agent context with pre-loaded standards.
Announce at start: "I'm using the code-execution skill to implement [subtask title]."
The Process
Step 1: Read Subtask JSON
Load the subtask file specified in $ARGUMENTS:
Read: .tmp/tasks/{feature}/subtask_{seq}.json
Extract:
title— What to implementacceptance_criteria— What defines successdeliverables— Files/endpoints to createcontext_files— Standards to applyreference_files— Existing code to study
Step 2: Load Context Files
Read each file in context_files:
Read: .opencode/context/core/standards/code-quality.md
Read: .opencode/context/core/standards/security-patterns.md
Understand:
- Project coding standards
- Naming conventions
- Security patterns
- Code quality requirements
Step 3: Load Reference Files
Read each file in reference_files:
Read: src/middleware/auth.middleware.ts
Study:
- Existing patterns
- Code structure
- Conventions in use
Step 4: Update Status to In Progress
Edit subtask JSON:
"status": "in_progress",
"agent_id": "coder-agent",
"started_at": "2026-02-16T00:00:00Z"
Step 5: Implement Deliverables
For each deliverable:
- Create or modify the specified file
- Follow acceptance criteria EXACTLY
- Apply standards from context_files
- Use patterns from reference_files
- Write clean, modular, functional code
Step 6: Run Self-Review (MANDATORY)
Type & Import Validation:
- ✅ Function signatures match usage
- ✅ All imports/exports exist
- ✅ No missing type annotations
- ✅ No circular dependencies
Anti-Pattern Scan:
grep "console.log" deliverables # NO debug statements
grep "TODO\|FIXME" deliverables # NO unfinished work
grep "api[_-]key\|secret" deliverables # NO hardcoded secrets
Acceptance Criteria Check:
- Re-read
acceptance_criteriaarray - Confirm EACH criterion met
- Fix unmet criteria before proceeding
Step 7: Mark Complete
Update subtask status:
bash .opencode/skills/task-management/router.sh complete {feature} {seq} "{summary}"
Verify:
bash .opencode/skills/task-management/router.sh status {feature}
Step 8: Return Report
✅ Subtask {feature}-{seq} COMPLETED
Self-Review: ✅ Types | ✅ Imports | ✅ No debug code | ✅ Criteria met
Deliverables:
- src/auth/jwt.service.ts
- src/auth/jwt.service.test.ts
Summary: JWT service with RS256 signing and 15min token expiry
Error Handling
Missing subtask JSON:
- Main agent must create subtask before invoking this skill
Context files not found:
- Main agent must run
/context-discoveryfirst
Acceptance criteria unmet:
- DO NOT mark complete—fix issues first
Red Flags
If you think any of these, STOP and re-read this skill:
- "I know the pattern, I don't need to read the context files"
- "I'll do the self-review quickly at the end"
- "The acceptance criteria are obvious, I don't need to check them"
- "I'll mark it done and fix the edge cases later"
Common Rationalizations
| Excuse | Reality |
|---|---|
| "I've seen this pattern before, context files will just confirm what I know" | Projects diverge from common patterns. One wrong assumption = rework. Read the files. |
| "Self-review is just checking my own work" | Self-review catches type errors, missing imports, and debug code before the main agent sees it. |
| "The criteria are implied by the task title" | Implied criteria are unverifiable. If it's not written, it's not a gate. |
| "I'll handle edge cases in a follow-up" | Edge cases left for follow-up become bugs in production. Handle them now. |
Remember
- Context FIRST, code SECOND—always read context_files before implementing
- One subtask at a time—complete fully before moving on
- Self-review is MANDATORY—quality gate before marking done
- Functional, declarative, modular—clean code patterns only
- Return results to main agent—report completion for orchestration
Related
- context-discovery
- task-breakdown
- test-generation
- code-review
Task: Execute coding subtask: $ARGUMENTS
More from darrenhinde/opencode-agents
context7
Retrieve up-to-date documentation for software libraries, frameworks, and components via the Context7 API. This skill should be used when looking up documentation for any programming library or framework, finding code examples for specific APIs or features, verifying correct usage of library functions, or obtaining current information about library APIs that may have changed since training.
1debugger
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
1context-manager
Context management skill providing discovery, fetching, harvesting, extraction, compression, organization, cleanup, and guided workflows for project context
1code-review
Use when code has been written and needs validation before committing, or when the user asks for a code review or security check.
1context-setup
Install context files from registry. Use when user runs /install-context, says "install context", "setup context", or when context is missing and the user needs to get started.
1task-management
Task management CLI for tracking and managing feature subtasks with status, dependencies, and validation
1