openspec-agent-apply
Delegate OpenSpec implementation tasks from any AI agent harness (AGY, Claude Code, Codex, etc.) to headless OpenCode using the spec-coder primary agent.
- License 许可
- MIT
- 最近更新
- 2026-09-05
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- openspec-agent-apply
- license
- MIT
- description
- Delegate OpenSpec implementation tasks from any AI agent harness (AGY, Claude Code, Codex, etc.) to headless OpenCode using the spec-coder primary agent.
- compatibility
- Requires openspec CLI and opencode CLI.
03 SKILL.md 正文
Delegate OpenSpec task implementation to the low-cost headless OpenCode agent (spec-coder).
Input: Optionally specify a change name. If omitted, infer from context or list active changes.
Steps
-
Select the change
- If provided, use it. Otherwise run
openspec list --jsonto inspect active changes. - Announce: "Using change: <name>".
- If provided, use it. Otherwise run
-
Get apply instructions
openspec instructions apply --change "<name>" --jsonInspect total tasks, complete tasks, remaining tasks, and
contextFiles. -
Delegate Implementation to Headless OpenCode
spec-coderExecute headless OpenCode using thespec-coderprimary agent profile:opencode run --agent spec-coder --auto "Implement pending tasks for OpenSpec change '<name>'. Work through remaining tasks in tasks.md sequentially, perform minimal code modifications, run verification commands, and update checkboxes from - [ ] to - [x]."⚡ Agent Model Hierarchy & Fallback Protocol:
- Default (OpenCode Go Subsidized): Standard execution via
opencode run --agent spec-coder ...(runsopencode-go/deepseek-v4-flash). - Fallback 1 (Direct DeepSeek API Pay-As-You-Go): If OpenCode Go quota or rate limit (
429) is hit, re-execute with direct DeepSeek API:opencode run --agent spec-coder --model deepseek/deepseek-v4-flash --auto "Implement pending tasks for OpenSpec change '<name>'. Work through remaining tasks in tasks.md sequentially, perform minimal code modifications, run verification commands, and update checkboxes from - [ ] to - [x]." - Fallback 2 (Free Zero-Cost Tier): If direct DeepSeek API limits are reached, re-execute with free model:
opencode run --agent spec-coder --model opencode/deepseek-v4-flash-free --auto "Implement pending tasks for OpenSpec change '<name>'. Work through remaining tasks in tasks.md sequentially, perform minimal code modifications, run verification commands, and update checkboxes from - [ ] to - [x]."
💡 Developer Tip: Agent Monitoring & Debugging To inspect live agent progress, tool execution, and code diffs:
- Mini TUI (Terminal):
opencode --mini --continue - Full TUI (Terminal):
opencode --continue - Web GUI (Browser):
opencode web - Formatted Log Stream:
tail -f <log-path> | glow -(orbat -l markdown)
- Default (OpenCode Go Subsidized): Standard execution via
-
Verify & Sync Specs
- Once
spec-codercompletes execution, automatically run verification using theopenspec-verify-changeskill (or/opsx:verify). - If verification passes with no CRITICAL issues:
- Sync specs:
openspec specs apply --change "<name>" - Suggest archiving via
openspec archive <name>.
- Sync specs:
- Once
-
Single-Pass Automated Repair (Max Retries = 1)
- If CRITICAL issues or failed test verification errors are detected on the first pass:
- Announce: "Verification failed on initial pass. Attempting a single bounded repair pass..."
- Execute a single-pass repair agent with the verification failure context:
opencode run --agent spec-coder --auto "Fix the specific verification failures and test errors reported for change '<name>'. Refer to the error log, make minimal targeted patches to resolve the failures, run verification commands, and update tasks.md." - Re-run verification (
openspec-verify-change). - If verification passes after repair:
- Sync specs:
openspec specs apply --change "<name>" - Suggest archiving via
openspec archive <name>.
- Sync specs:
- If verification STILL fails after the single repair pass:
- HALT: Do NOT loop or execute again. Present the Verification Report and remaining blockers to the user for manual guidance.
- If CRITICAL issues or failed test verification errors are detected on the first pass:
04 同仓库更多 Skills
visual-playground
Create and configure interactive or static design playgrounds (sandboxes) for playtesting visual features, layouts, animations, sound effects, or font choices. Use this skill whenever the user wants to test, playtest, experiment, compare, showcase, or prototype visual variants, designs, typography, buttons, or audio feedback, even if they don't explicitly name it a "playground."
teach
Teach the user a new skill or concept, within this workspace.
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
setup-matt-pocock-skills
Configure this repo for the engineering skills — set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.
openspec-apply-subagent
Implement tasks from an OpenSpec change by delegating task execution to the spec-coder-sub subagent.
improve-codebase-architecture
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.