agentleFS
sssemilsssemil/SKILLS/skills/misc/opencode-delegate/SKILL.md

opencode-delegate

Skill2 starsChanged 4 months agoMITView on GitHub

Delegate coding work to OpenCode through safe-opencode. Use when Codex should plan, route the job to a suitable DeepSeek model, review git diff, and validate instead of writing the main code itself.

5 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

31 rules. 0 are common, 25 are distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 25

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when the user wants Codex to orchestrate coding work while OpenCode performs the implementation inside the safe-claude …

    line 8
  2. Distinctive:

    Run OpenCode only through:

    line 14
  3. Very specific:

    Do not use plain opencode for delegated implementation.

    line 20
  4. Distinctive:

    Do not write the main implementation yourself.

    line 24
  5. Distinctive:

    Use the smallest useful DeepSeek model.

    line 51
  6. Distinctive:

    Use DeepSeek v4 Flash for simple, bounded, low-risk jobs:

    line 55
  7. Distinctive:

    add a small test

    line 61
  8. Distinctive:

    do a narrow rename or cleanup

    line 65
  9. Distinctive:

    Use DeepSeek v4 Pro for heavier work:

    line 75
  10. Distinctive:

    If a Fast job returns a weak, broad, or confused patch, do not keep pushing it.

    line 93
  11. Distinctive:

    If either model ID is wrong, discover the installed DeepSeek model names:

    line 95
  12. Very specific:

    If safe-opencode is missing, check:

    line 103
  13. Very specific:

    If it is not installed, report that blocker.

    line 110
  14. Distinctive:

    Do not delegate blind.

    line 131
  15. Distinctive:

    Use this prompt shape:

    line 147
  16. Distinctive:

    Read the diff yourself.

    line 199
  17. Distinctive:

    If the diff is too broad, do not fix it manually first.

    line 214
  18. Distinctive:

    Run the smallest useful validation command.

    line 218
  19. Distinctive:

    Only say validation passed when the command actually passed.

    line 234
  20. Distinctive:

    If validation fails because of the OpenCode patch, send one narrow follow-up.

    line 238
  21. Distinctive:

    Use Fast for obvious, local failures.

    line 240
  22. Distinctive:

    Use at most two OpenCode repair passes before doing a tiny Codex cleanup or reporting the blocker.

    line 264
  23. Very specific:

    Do not take over the main implementation unless safe-opencode fails.

    line 277
  24. Very specific:

    Always use safe-opencode, not opencode.

    line 293
  25. Distinctive:

    Prefer DeepSeek v4 Flash for simple bounded jobs.

    line 294
  26. Distinctive:

    Use DeepSeek v4 Pro for multi-file, risky, or ambiguous work.

    line 295
  27. Distinctive:

    Never accept OpenCode output without reading git diff.

    line 296
  28. Distinctive:

    Never claim tests passed unless they passed.

    line 297
  29. Very specific:

    Never hide safe-opencode failures.

    line 298
  30. Distinctive:

    Never delegate validation judgment.

    line 299
  31. Distinctive:

    Never let OpenCode broaden scope.

    line 300

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Safe OpenCode Delegate

Use this skill when the user wants Codex to orchestrate coding work while OpenCode performs the implementation inside the safe-claude sandbox.

Codex is the planner, operator, reviewer, and validator.

OpenCode is the implementer.

Run OpenCode only through:

safe-opencode run

Do not use plain opencode for delegated implementation.

Default stance

Do not write the main implementation yourself.

Use safe-opencode for:

  • finding relevant code
  • tracing behavior
  • implementation
  • refactors
  • migrations
  • bug fixes
  • test generation
  • repetitive edits
  • boilerplate
  • mechanical cleanup

Codex remains responsible for:

  • understanding the request
  • choosing scope
  • choosing the model
  • writing the OpenCode job
  • reviewing the diff
  • running validation
  • deciding whether the patch is acceptable

Model routing

Use the smallest useful DeepSeek model.

Fast path

Use DeepSeek v4 Flash for simple, bounded, low-risk jobs:

  • find where something is implemented
  • inspect a small area of the repo
  • explain a local behavior
  • make a one-file or very small edit
  • add a small test
  • fix an obvious typo, import, or error handling issue
  • triage a test failure
  • produce boilerplate inside an existing pattern
  • do a narrow rename or cleanup

Fast command:

safe-opencode run --model deepseek/deepseek-v4-flash --title "codex-delegate: <short-task-name>" "<single focused job>"

Pro path

Use DeepSeek v4 Pro for heavier work:

  • multi-file changes
  • architecture-sensitive changes
  • unclear bugs
  • migrations
  • public API changes
  • security-sensitive logic
  • database or persistence changes
  • complicated test failures
  • work where a bad patch would be costly to unwind

Pro command:

safe-opencode run --model deepseek/deepseek-v4-pro --title "codex-delegate: <short-task-name>" "<single focused job>"

If a Fast job returns a weak, broad, or confused patch, do not keep pushing it. Escalate once to Pro with a sharper prompt.

If either model ID is wrong, discover the installed DeepSeek model names:

safe-opencode models deepseek

Then rerun with the exact provider/model value shown.

If safe-opencode is missing, check:

command -v safe-opencode
safe-opencode --help

If it is not installed, report that blocker. Do not silently fall back to plain opencode.

Operating loop

1. Inspect first

Before delegation, run:

git status --short

Then inspect enough of the repo to know:

  • likely edit locations
  • existing patterns
  • tests
  • package scripts
  • validation commands
  • user changes already present

Do not delegate blind.

2. Send one focused OpenCode job

The OpenCode prompt must be narrow and operational.

Include:

  • the goal
  • files or directories to inspect
  • constraints
  • expected tests
  • what not to touch
  • instruction to keep the diff minimal
  • instruction to stop after the requested patch

Use this prompt shape:

You are implementing one focused change in this repository.

Goal:
<specific goal>

Scope:
- Inspect: <files/directories>
- Edit only files needed for the goal.
- Keep the diff minimal.
- Preserve public APIs unless the task requires changing them.
- Follow existing project style.

Tests:
- Add or update tests if useful.
- Use the existing test framework.
- Do not invent a new test setup.

Do not:
- Rewrite unrelated code.
- Reformat whole files.
- Rename things unnecessarily.
- Change dependency versions unless required.
- Touch secrets, env files, generated files, vendored files, or lockfiles unless required.
- Run destructive commands.

Stop after the patch.

For simple jobs, run the Fast command:

safe-opencode run --model deepseek/deepseek-v4-flash --title "codex-delegate: <short-task-name>" "<prompt>"

For heavier jobs, run the Pro command:

safe-opencode run --model deepseek/deepseek-v4-pro --title "codex-delegate: <short-task-name>" "<prompt>"

3. Review the patch

Always run:

git diff --stat
git diff

Read the diff yourself.

Reject or repair patches with:

  • unrelated edits
  • broad rewrites
  • formatting churn
  • fake tests
  • missing edge cases
  • dependency churn
  • hardcoded local paths
  • swallowed errors
  • accidental lockfile changes
  • changes to user work that existed before this task

If the diff is too broad, do not fix it manually first. Send a narrower corrective OpenCode job.

4. Validate

Run the smallest useful validation command.

Prefer project-native commands:

npm test
npm run test
npm run typecheck
npm run lint
pnpm test
pnpm typecheck
pytest
go test ./...
cargo test

Only say validation passed when the command actually passed.

5. Repair loop

If validation fails because of the OpenCode patch, send one narrow follow-up.

Use Fast for obvious, local failures. Use Pro for failures that require reasoning across several files.

Repair prompt:

Fix only this validation failure from the previous patch:

<error output>

Constraints:
- Keep the current approach unless clearly wrong.
- Make the smallest change.
- Do not rewrite unrelated code.
- Do not add dependencies.
- Stop after the fix.

Then rerun:

git diff
<validation command>

Use at most two OpenCode repair passes before doing a tiny Codex cleanup or reporting the blocker.

Direct Codex edits

Codex may edit directly only for:

  • tiny fixes after OpenCode’s patch
  • reverting unrelated changes
  • import cleanup
  • typo fixes
  • one small missing assertion
  • validation command adjustments

Do not take over the main implementation unless safe-opencode fails.

Reporting

End with:

  • which model was used
  • what OpenCode changed
  • what Codex changed, if anything
  • files touched
  • validation commands run
  • failures or skipped validation
  • remaining risks

Hard rules

  • Always use safe-opencode, not opencode.
  • Prefer DeepSeek v4 Flash for simple bounded jobs.
  • Use DeepSeek v4 Pro for multi-file, risky, or ambiguous work.
  • Never accept OpenCode output without reading git diff.
  • Never claim tests passed unless they passed.
  • Never hide safe-opencode failures.
  • Never delegate validation judgment.
  • Never let OpenCode broaden scope.
  • Preserve existing user changes.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.