---
description: Use subagents to plan and fix hard issues
argument-hint: "[issues]"
---

Ultrathink to plan & start fixing these issues follow the Orchestration Protocol, Core Responsibilities, Subagents Team and Development Rules:
<issues>$ARGUMENTS</issues>

## Workflow:

If the user provides screenshots or videos, use `ai-multimodal` skill to describe the issue in detail so developers can predict root causes easily.

Use `sequential-thinking` skill to break complex problems into sequential thought steps.
Use `problem-solving` skills to tackle the issues.

1. For complex issues (≥3 phases), delegate to `plan` agent and `researcher` agent to create an implementation plan:
   - Create backlog task: `backlog_task_create(title="Fix: <issue description>")`
   - Update @.opencode/memory/memory.md with approach and blockers
   - Follow progressive disclosure with clear phases
2. Then use `build` agent to implement the plan step by step.
3. Use `code-auditor` agent to run tests, ensure quality and security, then report back.
4. If there are issues or failed tests, `build` agent will debug and fix them.
5. Repeat the process until all tests pass or no more issues are reported.
6. After finishing, `code-auditor` agent will review code for security and quality.
7. Report back to user with a summary of changes and ask for review.
8. Project Management & Documentation:
   **If user approves the changes:** Update project progress using standard tools
   - Update task status in @backlog/tasks
   - Update memory in @.opencode/memory/
   - Commit changes using git commands
     **If user rejects the changes:** Ask user to explain issues and `build` agent will fix them.

9. Final Report:

- Report back with summary of changes and next steps
- Ask if user wants to commit and push to git repository

**Agent Delegation:**

- Primary: `build` (implementation, debugging, testing)
- Complex Planning: `plan` (multi-phase issues)
- Research: `researcher` (unfamiliar domains)
- Quality Gate: `code-auditor` (security + review + testing)

**IMPORTANT:** Analyze the skills catalog and activate the skills that are needed for the task during the process.
