deepseek-goal
Context. Built in October 2026 as a personal project, in the phase when I build tools to production standards with coding agents (Claude Code, opencode), shortly after I started as AI Engineer at Inditex. It packages how I delegate paid, scoped work to a second model while the orchestrating agent keeps the review, and it ships with CI, tests and a plugin manifest.

An agent skill for AI coding agents that carries a goal end to end while the orchestrating agent keeps the judgement and delegates the work to paid DeepSeek Flash subagents through opencode. It works in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode, Windsurf, ZCode and any agent that reads the open SKILL.md format. It is for anyone who wants an agent to implement, review and verify a real goal in a repo with a second model doing the hands-on work, while the orchestrating agent plans, scopes, reviews every diff and reports the cost.
What it does
- Frames the goal first. The orchestrating agent reads the source of the goal, turns it into a verifiable exit criterion (commands that pass, an artefact, observed behaviour), maps the repo and writes a delegation table (
task | files | who | why) before touching anything.
- Delegates by default. Every implementation and every review goes to
deepseek/deepseek-flash; doing a task in the orchestrator needs one of three written causes (fewer than about 20 lines, a design decision only it can take, or Flash failing twice on that task).
- Writes one prompt per task. Scope, files it may not touch, facts it cannot discover, hard rules and the done criterion, from
task-template.md, capped at about 70 lines.
- Runs the subagent in the background.
ds.py opens an opencode session pinned to deepseek/deepseek-flash, waits for it to settle, reports the outcome and the cost, and tells timeout, quota and permission stalls apart by exit code.
- Reviews what came back. The orchestrator reads the diff, reruns the commands itself and breaks the code to check that the tests fail. A read-only
revisor agent does the cross review of the final diff before any merge.
- Closes with the numbers. The report compares the result with the exit criterion, lists what the orchestrator decided and where it stopped to ask, and gives the total DeepSeek cost.
It never runs another model. deepseek/deepseek-flash is hardcoded in scripts/ds.py, and a subagent cannot start further subagents.
What it sends and where
ds.py makes no network calls itself. It runs opencode api against the local opencode server, or the one in OC_SERVER.
- opencode sends each task file, and every file or command output the subagent reads or runs, to DeepSeek's API as
deepseek/deepseek-flash, billed to your DeepSeek key. DeepSeek's own terms govern that data.
- What a subagent reads is not confined to the target directory, and the same goes for any subsession it opens: implementation tasks run opencode's default agent with its normal permissions, and the
revisor agent limits the shell but not file reads.
ds.py adds no telemetry and calls no other endpoint. The default agent can still reach the network on its own (web fetch, curl, package installs) under opencode's permissions; the revisor agent cannot.
ds.py stores no task data. probe leaves an empty oc-probe folder in the system temp dir, run creates the target directory if it is missing, and opencode keeps the session history on the machine that runs the opencode server, which is another host if you set OC_SERVER.
- Do not run it on a repo whose contents you may not send to DeepSeek.
Requirements
- An agent that supports Agent Skills and can run shell commands in the background, such as any of the agents listed below.
- opencode with the
opencode api command, tested on 2.2.3. ds.py talks to the local opencode server; OC_SERVER=http://host:port points it at another one, and a server with a password needs OPENCODE_PASSWORD in the environment.
- A DeepSeek provider authenticated in opencode (
opencode auth login) with deepseek/deepseek-flash available. This is your paid DeepSeek API: every run costs money, and the skill reports the cost per task and in total.
- The
revisor opencode agent for read-only reviews, installed as described in Set up the subagents.
- Python 3, standard library only, for
ds.py. CI tests on Python 3.12.
git, to read the status and the diff of the target repo.
bash for install.sh, and Node.js 22.20 or later with npx for the skills CLI, or the GitHub CLI with the skill command in preview for gh skill.
Quick start