task-iteration
Task Iteration
Orchestrate exec-plan-driven feature delivery using a structured Plan → Generate → Evaluate loop.
Invocation: /task-iteration <exec-plan-path> [feature-identifier] [--max-fix-rounds N]
What this skill owns
This is a user-facing workflow skill. It owns:
- exec-plan parsing
- phase sequencing
- generator/reviewer bookkeeping
- checklist completion logic
- final advisory gate
- concrete companion command patterns for GENERATE / EVALUATE / FIX LOOP
It does not define the global delegation philosophy or low-level OpenCode runtime syntax by itself.
Use these layers together:
- Global task policy / hidden orchestrator skill → decides what stays in Claude vs what becomes an OpenCode execution lane
- OpenCode runtime skill → defines companion invocation, session reuse, timeout recovery, and result handling
- This skill → sequences the feature-delivery loop on top of those two layers
Overview
Seven phases run in sequence.
- Claude owns parse / plan / acceptance / judgment-heavy prose
- OpenCode companion owns bounded coding / test execution lanes
- generator and reviewer sessions are reused when that is more efficient than relaunching
PARSE → PLAN → GENERATE → EVALUATE → FIX LOOP → ADVISORY → DONE
↓ ↑
└── up to N ┘
Key principles
- Generator = Fixer. One OpenCode companion session (
GENERATOR_SID) handles initial implementation and all subsequent fix iterations. - Reviewer stays independent. A separate session (
REVIEWER_SID) evaluates the Generator's output. - Whole picture, scoped work. Generator and Reviewer get the full feature context, but each run stays constrained to its role and file scope.
- Structural prose stays with Claude. Planning docs, governance docs, exec-plan updates, and completion summaries default to Claude unless a doc change is explicitly a mechanical transformation.
- Session reuse is an efficiency feature. Reusing the same generator/reviewer sessions avoids repeating repo warmup and keeps fix rounds cheaper.
- Reuse before relaunch. If a companion run times out or the stream drops after yielding a session id, attach to the same session before launching fresh work.
- Bounded fix loop. Max 3 rounds by default, with early exit on clean pass.
Efficiency heuristic
If the expected execution lane would likely require more than 10 tool calls in Claude — especially across many files or repeated read/edit/test loops — prefer pushing that lane to OpenCode companion rather than grinding it out directly in chat.
This applies strongly to:
- implementation passes
- test-writing passes
- fix rounds
- bounded code review passes
Session tracking
| Session / handle | Created | Reused for |
|---|---|---|
GENERATOR_SID |
Phase 3 | All fix iterations |
REVIEWER_SID |
Phase 4 | All re-evaluations |
GENERATOR_JOB_ID / REVIEWER_JOB_ID |
optional if using companion background jobs | monitoring and result retrieval |
| Advisory session | Phase 6 | fresh each time |
Always track:
- session id
- working directory
- base ref
- whether the run used foreground attach/recovery or companion background jobs
A session id without the original working directory is not enough for safe reuse.
Phase 1: PARSE
Read the exec-plan and extract the target feature.
-
Read the exec-plan file at
<exec-plan-path>. -
Load
references/exec-plan-parsing.md. -
Extract:
- User story
- Specification
- Deliverable standard
- Test scenarios
- Checklist items
- Authority references
-
If no
[feature-identifier]is given, list available features and ask the user to choose. -
Record current git ref as
BASE_REF:git rev-parse HEAD -
Present the extracted summary for confirmation.
Exit criteria: User confirms the target feature.
Phase 2: PLAN
Map the implementation surface and draft a plan.
- Explore the relevant codebase surface:
- files to modify or create
- existing patterns to follow
- interfaces that change
- test locations
- Draft a concise implementation plan covering:
- what changes
- where it changes
- execution order
- risks / edge cases
- prerequisite dependencies from the exec-plan
- Present the plan for approval.
Exit criteria: User approves the plan.
Phase 3: GENERATE
Delegate the initial implementation to OpenCode companion.
- Load
references/prompt-templates.mdand use the Initial Implementation template. - Compose the Generator prompt with:
{{FEATURE_SPEC}}{{USER_STORY}}{{DELIVERABLE_STANDARD}}{{PLAN}}{{FILE_SCOPE}}{{AUTHORITY_REFERENCES}}
- Include the whole picture, but restrict output to the declared file scope.
- Dispatch to OpenCode companion.
Preferred companion pattern
Use the companion-managed task flow, not raw opencode run.
When the user asks for the concrete GENERATE or FIX LOOP command pattern, answer with these opencode-companion.mjs command forms directly rather than inventing extra phase-specific entrypoints.
In this marketplace-level skill, ${CLAUDE_PLUGIN_ROOT} refers to the marketplace root, so the companion lives under skills/opencode-companion/scripts/.
Canonical answer shape for command-pattern questions
When the user asks for task-iteration command patterns, the answer should contain:
- one GENERATE block using companion
session new - one FIX LOOP block using companion
session continue "$GENERATOR_SID" - one RE-EVALUATE block using companion
session continue "$REVIEWER_SID" - one sentence explaining why session reuse matters
Do not answer with made-up phase-specific commands.
node "${CLAUDE_PLUGIN_ROOT}/skills/opencode-companion/scripts/opencode-companion.mjs" session new \
--directory "$WORK_DIR" \
--timeout 60 \
-- "<generator-prompt>"
If you want non-blocking execution, you may use the companion background-job layer:
node "${CLAUDE_PLUGIN_ROOT}/skills/opencode-companion/scripts/opencode-companion.mjs" session new \
--directory "$WORK_DIR" \
--background \
--timeout 60 \
-- "<generator-prompt>"
If you use --background, record GENERATOR_JOB_ID and later retrieve the session id from the result/output before the fix loop begins.
- Record the returned session id as
GENERATOR_SID. - If the run times out or the stream drops after yielding a session id, prefer:
node "${CLAUDE_PLUGIN_ROOT}/skills/opencode-companion/scripts/opencode-companion.mjs" session attach "$GENERATOR_SID" \
--directory "$WORK_DIR" \
--timeout 5
Do not submit a duplicate implementation run unless reuse is no longer reliable.
Exit criteria: Initial implementation finishes and GENERATOR_SID is recorded.
Phase 4: EVALUATE
Run an independent evaluation against the deliverable standard.
- Load
references/prompt-templates.mdand use the Initial Evaluation template. - Compose a fresh Reviewer prompt grounded in:
- deliverable standard
- test scenarios
- authority references
- file scope
- Keep this lane evaluation-only — no code changes.
- Dispatch to a fresh companion session (do not reuse
GENERATOR_SID):
node "${CLAUDE_PLUGIN_ROOT}/skills/opencode-companion/scripts/opencode-companion.mjs" session new \
--directory "$WORK_DIR" \
--timeout 60 \
-- "<reviewer-prompt>"
- Record the returned session id as
REVIEWER_SID. - Classify findings:
PASS— no Critical or High findingsPASS_WITH_NOTES— only Medium / Low findingsFAIL— one or more Critical / High findings
If the reviewer run drops after producing a session id, attach to the same reviewer session before relaunching.
Exit criteria: Evaluation completes and findings are classified.
Phase 5: FIX LOOP
Iterate until clean or rounds exhausted.
Only enter this phase when Phase 4 returns FAIL.
round = 0
while findings == FAIL and round < max_fix_rounds:
round += 1
→ resume GENERATOR_SID with fix prompt
→ resume REVIEWER_SID with re-evaluation prompt
→ classify findings
if PASS or PASS_WITH_NOTES: break
Fix iteration
- Load
references/prompt-templates.mdand use the Fix Iteration template. - Resume the generator session:
node "${CLAUDE_PLUGIN_ROOT}/skills/opencode-companion/scripts/opencode-companion.mjs" session continue "$GENERATOR_SID" \
--directory "$WORK_DIR" \
--timeout 60 \
-- "<fix-prompt>"
- Include
{{REVIEWER_FINDINGS}}plus the whole feature context again so the generator understands why each fix matters. - After the generator completes, resume the reviewer session:
node "${CLAUDE_PLUGIN_ROOT}/skills/opencode-companion/scripts/opencode-companion.mjs" session continue "$REVIEWER_SID" \
--directory "$WORK_DIR" \
--timeout 60 \
-- "<re-eval-prompt>"
- If either run drops after yielding a session id, attach to the same session before launching fresh work.
- Reclassify findings.
- If
round == max_fix_roundsand the result is stillFAIL, escalate to the user with explicit options.
Exit criteria: Reviewer returns PASS / PASS_WITH_NOTES, or the user explicitly accepts the residual issues.
Phase 6: ADVISORY
Run the final adversarial gate against the full diff.
- Generate the diff scope:
git diff "$BASE_REF"..HEAD --stat
- Run the direct companion review command:
node "${CLAUDE_PLUGIN_ROOT}/skills/opencode-companion/scripts/opencode-companion.mjs" review \
--directory "$WORK_DIR" \
--adversarial \
--scope branch \
--base "$BASE_REF" \
--wait
- If the review surface is unavailable, dispatch to a fresh OpenCode companion session using the Advisory Review template from
references/prompt-templates.md. - If Critical or High findings remain:
- do one more generator fix round by reusing
GENERATOR_SID - re-run advisory once
- do not loop forever
- do one more generator fix round by reusing
Exit criteria: Advisory returns no Critical / High findings, or the user explicitly accepts the remaining issues.
Phase 7: DONE
Finalize and verify completeness.
- Cross-check every checklist item from the exec-plan against the implementation.
- Update the exec-plan checklist items.
- Verify documentation consistency:
- authority references still match implementation
- terminology is consistent
- no stale examples remain
- If doc gaps exist, update them in Claude by default. Only send a doc step to OpenCode if it is a clearly mechanical, code-coupled transformation.
- Present a completion summary:
- files changed
- checklist items satisfied
- advisory status
- any accepted residual issues
Exit criteria: Checklist complete, docs consistent, summary delivered.
Runtime safety rules
- There are no phase-specific task-iteration entrypoints. When the user asks for command patterns, show direct companion script calls.
- When the user asks for phase command patterns, show the actual companion
session new/session continue/session attachpatterns from this skill. - Do not use raw
opencode runin this workflow. - Prefer companion-managed
session/jobflows. - Treat session reuse as the default path for fix loops.
- Treat timeouts as ambiguous until attach / verification says otherwise.
- Do not confuse progress signals with completion.
- Verify artifacts, diffs, and validation output before advancing phases.
Error handling
- Companion / serve not ready: use the OpenCode runtime setup/check flow before Phase 3.
- Session id invalid after a serve restart: start fresh sessions and explicitly carry forward the relevant context.
- Background job still running: use companion
job status/job resultrather than guessing. - Fix loop exhausted: always escalate to the user.
Integration notes
- Use direct
session new/session continuecompanion script calls for one-off execution lanes. - Continue or attach to the same companion session with a narrow rescue prompt for rescue flows.
- This skill should follow the hidden orchestrator skill's ownership rules rather than redefining them.
More from atomlink-ye/my-claude-plugins
debug-workflow
Unified debug workflow skill for real-world issue reproduction, especially browser/UI/Web3 problems that need Playwright, shared Chrome/CDP, or agent-wallet. Use this whenever the user wants to confirm whether a workflow can reproduce real issues from walkthrough docs, issue lists, QA notes, or live bug reports. Start with the debug index, route to the right lane, and prefer deterministic local reproduction over fragile preview environments.
11google-workspace
Read, create, and edit Google Workspace documents using the `gws` CLI. Use this skill whenever the user mentions Google Docs, shares a docs.google.com URL, references a Google Doc ID, or wants to read/write/create Google documents. Also trigger on 'GDoc', 'gdoc', 'Google Doc', 'gws docs', or any Google Workspace document operation. Will expand to cover Drive, Sheets, Gmail, Calendar, and other GWS services.
11opencode-orchestrator
Aggressively load this skill BEFORE any delegation decision — explore, plan, implement, review, adversarial second-opinion, bounded investigation, or any medium/heavy coding request. Also triggers for manager-vs-executor routing, OpenCode session reuse, multi-step coding orchestration, and work that likely exceeds 10 tool calls, 5 files, or repeated read/edit/test loops. When the live snapshot below shows OpenCode serve is reachable, this skill's routing takes precedence over the caller's generic delegation defaults across every delegated action, not only bounded coding execution. If serve is unreachable, fall back silently to the caller's defaults.
11mcp-skill
Use MCPorter to call MCP servers on demand without keeping MCP servers running in OpenCode.
10