One-Shot Mode
One-shot mode enables end-to-end autonomous task execution from requirements to completion.
What is One-Shot?
One-shot mode is an autonomous agent that:
- Gathers requirements interactively
- Creates detailed implementation plans
- Executes tasks with dynamic agent selection
- Runs quality gates until all pass
- Performs multi-level verification
- Auto-recovers from failures
- Generates completion proof
When to Use
Use one-shot mode for:
- check_circle Straightforward, well-defined tasks
- check_circle Features with clear requirements
- check_circle Bug fixes with known solutions
- check_circle Tasks that can be broken down into clear sub-tasks
Avoid for:
- cancel Complex, ambiguous requirements
- cancel Tasks requiring extensive domain knowledge
- cancel Multi-day features
- cancel Tasks needing user approvals
Workflow
Phase 1: Requirements
- Gather task type - Feature, bug fix, refactor, etc.
- Clarify scope - What to include/exclude
- Identify dependencies - Other tasks or systems
- Define success criteria - How to verify completion
Example:
> @one-shot Add user login with JWT
# One-shot asks:
# 1. What authentication method? (password, OAuth, etc.)
# 2. What JWT library to use?
# 3. Any existing auth code to integrate?
# 4. Success criteria?
Phase 2: Planning
- Research - Use @scout to find patterns
- Analyze complexity - Estimate time, files, lines of code
- Create plan - Break down into sub-tasks
- Recommend skills/tools - Suggest workflows
Complexity Analysis:
- Small task:
< 30min, < 10 files, < 500 lines - Medium task:
30-60min, 10-25 files, 500-2000 lines - Large task:
> 60min, > 25 files, > 2000 lines
Large tasks are automatically split into smaller tasks.
Phase 3: Execution
- Dynamic agent selection - Choose right agent for each sub-task
- Parallel execution - Run independent tasks together
- Agent delegation - Agents delegate as needed
- Progress tracking - Update status as tasks complete
Agent Flow:
@planner → @scout → @build → @review → @vision
Phase 4: Testing
Run quality gates (must ALL pass):
- check_circle
npm run typecheck- No type errors - check_circle
npm run test- All tests pass - check_circle
npm run lint- No linting errors - check_circle
npm run build- Build succeeds
Auto-fix attempts:
- Try
--fixflags for type errors - Try
--fixflags for lint errors - Run gates up to 3 times
Phase 5: Verification
Multi-level verification:
- Gate verification - All quality gates pass
- Manual verification - User can review changes
- Deployment verification - If applicable, verify deployment
Phase 6: Completion
- Generate proof - Summary of what was done
- Update tracking - Mark task as complete in Beads
- Collect feedback - Ask for user feedback
Error Recovery
Level 1: Auto-fix
Automatically attempt fixes for:
- Type errors
- Lint errors
- Simple syntax issues
// Auto-fix attempt
npm run typecheck
// Fails
npm run typecheck --fix
// Re-check
Level 2: Alternative Approach
If auto-fix fails, use @review to analyze:
> @review Analyze the failure and suggest alternative approach
Level 3: User Intervention
If Level 2 fails:
- Stop execution
- Report issue to user
- Create follow-up task
- Ask for guidance
Example
> @one-shot Add user logout button
# Phase 1: Requirements
User input:
- Logout should clear JWT token
- Redirect to login page
- Show confirmation dialog
# Phase 2: Planning
Plan created:
1. Create LogoutButton component
2. Add logout API endpoint
3. Add confirmation dialog
4. Implement JWT clearing logic
5. Add tests
# Phase 3: Execution
- @build creates component
- @build implements API
- @review checks code
# Phase 4: Testing
Running quality gates...
- <MaterialIcon name="check_circle" className="icon-success" /> typecheck: PASSED
- <MaterialIcon name="check_circle" className="icon-success" /> test: PASSED
- <MaterialIcon name="check_circle" className="icon-success" /> lint: PASSED
- <MaterialIcon name="check_circle" className="icon-success" /> build: PASSED
# Phase 5: Verification
- <MaterialIcon name="check_circle" className="icon-success" /> Logout button clears token
- <MaterialIcon name="check_circle" className="icon-success" /> Redirects to login
- <MaterialIcon name="check_circle" className="icon-success" /> Shows confirmation
# Phase 5: Verification
✅ Logout button clears token
✅ Redirects to login
✅ Shows confirmation
# Phase 6: Completion
Task completed!
Changes:
- src/components/LogoutButton.tsx
- src/api/logout.ts
- src/utils/auth.ts
- tests/LogoutButton.test.tsx
Configuration
Enable one-shot in .aikit/aikit.json:
{
"agents": {
"enabled": true
}
}
Best Practices
- Start simple - Use one-shot for straightforward tasks first
- Be specific - Clear requirements = better results
- Review changes - Always review before final approval
- Use /plan for complex - For complex features, use
/plan+/implementinstead - Provide feedback - Help one-shot learn from mistakes
Limitations
- warning Beta feature - Still under development
- warning May not handle edge cases
- warning Requires clear requirements
- warning May need manual intervention for complex tasks
Comparison: One-Shot vs Manual
| Aspect | One-Shot | Manual |
|---|---|---|
| Speed | Faster (autonomous) | Slower (step-by-step) |
| Control | Less control | Full control |
| Complexity | Simple tasks only | Any complexity |
| Understanding | Less transparent | More transparent |
| Best for | Quick wins | Complex features |
CLI
# One-shot is accessed via @one-shot agent in OpenCode
> @one-shot Your task here
Next Steps
- Quick Start - Get started with basic workflows
- Agents - Learn about all agents
- Skills - Learn about skills