agentleFS
alexdcdalexdcd/Mafia-Claude-Skills/skills/frontier-plan-opencode-executor/SKILL.md

frontier-plan-opencode-executor

Skill71 starsChanged 11 months agoApache-2.0View on GitHub

Use when given a detailed implementation plan from a frontier AI to execute inside OpenCode with non-frontier coding models. Validates the plan against the real repository, breaks it into safe steps, verifies each step, inspects diffs, and prevents destructive changes. Triggers on: receiving a multi-step plan from Claude Opus/GPT-5/etc., executing a pre-written spec, implementing a detailed PR description, or being told to \"execute this plan step by step.\"

  • Reads credentials
  • Deletes or force-pushes
  • Commits and pushes

The file

Show its rules and text

We split this skill into the rules it gives an agent

48 rules. About 0 are common, 45 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈45

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Never batch large changes.

    line 14
  2. Distinctive:

    If baseline already fails:

    line 45
  3. Distinctive:

    Do NOT attempt broad cleanup or fix unrelated issues

    line 47
  4. Distinctive:

    Do not attribute pre-existing failures to your implementation

    line 49
  5. Distinctive:

    If git status shows uncommitted changes unrelated to the plan, warn the user

    line 52
  6. Distinctive:

    If lockfiles are modified, warn the user

    line 53
  7. Distinctive:

    If the repo is in a conflicted/rebasing state, stop and ask

    line 54
  8. Distinctive:

    If the repo is clean before starting, recommend creating a checkpoint commit before implementation

    line 57
  9. Distinctive:

    Do NOT create commits unless explicitly asked by the user

    line 58
  10. Very specific:

    if on main, master, production, release, or another protected/mainline branch, create a new working branch inferred from the plan.

    line 68
  11. Distinctive:

    if already on a working branch, continue there.

    line 69
  12. Distinctive:

    never push directly to protected/mainline branches.

    line 70
  13. Distinctive:

    If there are pre-existing uncommitted changes:

    line 72
  14. Distinctive:

    do not automatically include them in agent commits.

    line 73
  15. Distinctive:

    if user changes and agent changes cannot be safely separated, stop and report the conflict.

    line 75
  16. Distinctive:

    Read the ENTIRE plan. Extract ordered steps.

    line 98
  17. Distinctive:

    If a step references missing files, nonexistent libraries, outdated patterns, or unavailable commands: adapt the step before implementing, …

    line 109
  18. Very specific:

    Use todowrite (OpenCode's task list tool) if available.

    line 113
  19. Very specific:

    If todowrite is unavailable (e.g., in subagents where it's disabled by default):

    line 115
  20. Distinctive:

    Create a visible markdown checklist in your response

    line 116
  21. Distinctive:

    Keep it updated manually after each step

    line 117
  22. Distinctive:

    Use it as the source of truth for progress

    line 118
  23. Distinctive:

    Do NOT pretend the tool was used if it wasn't

    line 119
  24. Distinctive:

    Read target files before editing

    line 127
  25. Distinctive:

    Follow existing codebase conventions (imports, naming, patterns, architecture)

    line 128
  26. Distinctive:

    Do NOT implement future steps, but keep downstream dependencies in mind when making design decisions

    line 131
  27. Distinctive:

    Do NOT perform unrelated cleanup, refactoring, or formatting

    line 132
  28. Distinctive:

    Do NOT install dependencies unless explicitly approved

    line 133
  29. Distinctive:

    If no automated verification exists for a step: perform a manual review and state precisely what you checked.

    line 149
  30. Distinctive:

    Do NOT fix pre-existing or unrelated errors

    line 155
  31. Distinctive:

    Critical: Never make verification pass by weakening assertions, deleting tests, removing behavior, changing public APIs, suppressing …

    line 160
  32. Distinctive:

    After verification passes, inspect what actually changed:

    line 164
  33. Distinctive:

    Only expected files changed

    line 172
  34. Distinctive:

    No unrelated formatting occurred

    line 173
  35. Distinctive:

    No lockfiles changed (unless explicitly intended)

    line 174
  36. Distinctive:

    No generated files were accidentally edited

    line 175
  37. Distinctive:

    No secrets, local paths, or debug logs introduced

    line 176
  38. Distinctive:

    No code was accidentally deleted

    line 177
  39. Distinctive:

    Only when implementation, verification, AND diff inspection are clean:

    line 183
  40. Distinctive:

    Run the strongest reasonable check: lint + typecheck + build + tests (using project commands)

    line 191
  41. Distinctive:

    If verification repeatedly fails for the same underlying reason, do not continue applying small blind fixes.

    line 196
  42. Distinctive:

    Stop patching: Stop making small tweaks and re-running.

    line 200
  43. Distinctive:

    Form a genuinely new hypothesis: Only retry when you have one.

    line 213
  44. Distinctive:

    Critical rule: Do not repeat the same fix strategy unless new information was discovered from:

    line 216
  45. Distinctive:

    Do NOT create new abstractions if the repo already has an equivalent primitive

    line 253
  46. Distinctive:

    Do NOT install new dependencies unless the plan explicitly requires it AND the user approves

    line 254
  47. Distinctive:

    Do NOT change architecture or patterns without justification

    line 255
  48. Distinctive:

    If unsure whether a command is safe, ask before running.

    line 289

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “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

Frontier Plan OpenCode Executor

Core Principle

The frontier plan is a strong hypothesis, not ground truth.

Execute the intent of the plan step by step, but validate every instruction against the actual repository before editing code. Frontier AI plans frequently fail on: nonexistent file names, invented imports, unavailable libraries, patterns that don't match the repo, missing tests, idealized architecture, and breaking internal APIs.

Never batch large changes. Never skip verification. Never hide uncertainty. Never perform destructive actions without explicit approval.

When to Use

  • You receive a detailed, multi-step implementation plan written by a frontier AI
  • The plan has 3+ distinct steps with specific file paths and code patterns
  • You are using a non-frontier coding model that benefits from execution discipline
  • The plan carries risk of conflicting with the actual codebase

Do NOT use for:

  • Single-file changes or trivial fixes
  • Plans with only 1-2 simple steps
  • Plans you wrote yourself during the same session
  • Rapid iteration where the user wants speed over safety

Core Workflow

0. PREFLIGHT: Establish Repository Baseline

Before touching any file, understand the repo state and detect pre-existing failures.

1. git status --short          # Is the repo clean?
2. Inspect package.json         # Available scripts, dependencies
3. Inspect AGENTS.md, README.md # Project conventions, commands
4. Detect available verification commands from package.json scripts
5. Run the cheapest baseline verification if available (lint or typecheck)

If baseline already fails:

  • Record the failure explicitly: exact command, exit status, and short error summary
  • Do NOT attempt broad cleanup or fix unrelated issues
  • Continue only if the planned change can be isolated from the existing failure
  • Do not attribute pre-existing failures to your implementation

Dangerous state detection:

  • If git status shows uncommitted changes unrelated to the plan, warn the user
  • If lockfiles are modified, warn the user
  • If the repo is in a conflicted/rebasing state, stop and ask

Checkpoint recommendation:

  • If the repo is clean before starting, recommend creating a checkpoint commit before implementation
  • Do NOT create commits unless explicitly asked by the user

Auto-Commit and Auto-Push

Auto-commit and auto-push are enabled by default unless the user explicitly disables them.

The agent should commit each verified logical unit of work and push it to the active remote working branch so the user can review the history later.

Before implementation:

  • identify the current branch;
  • if on main, master, production, release, or another protected/mainline branch, create a new working branch inferred from the plan;
  • if already on a working branch, continue there;
  • never push directly to protected/mainline branches.

If there are pre-existing uncommitted changes:

  • do not automatically include them in agent commits;
  • stage only files related to the current logical unit;
  • if user changes and agent changes cannot be safely separated, stop and report the conflict.

Commit only after:

  • the logical unit is complete;
  • verification passes;
  • the diff has been inspected;
  • the commit has one coherent purpose.

Use Conventional Commits:

type(scope): concise imperative summary

Examples:

feat(auth): add session validation helper
fix(api): handle empty webhook payload
refactor(billing): extract invoice mapper
test(auth): cover expired session flow

1. PARSE: Extract and Reality-Check the Plan

Read the ENTIRE plan. Extract ordered steps. For each step, run a reality check:

CheckQuestion
FilesDo referenced files exist in the repo?
LibrariesAre referenced libraries in package.json?
PatternsDoes the repo already have an equivalent utility/component?
CommandsAre the plan's verification commands available?
DependenciesDoes this step depend on a previous step?
RiskLow / Medium / High — how likely to break existing behavior?

If a step references missing files, nonexistent libraries, outdated patterns, or unavailable commands: adapt the step before implementing, preserving the plan's intent.

2. TRACK: Create Progress Tracker

Use todowrite (OpenCode's task list tool) if available.

If todowrite is unavailable (e.g., in subagents where it's disabled by default):

  • Create a visible markdown checklist in your response
  • Keep it updated manually after each step
  • Use it as the source of truth for progress
  • Do NOT pretend the tool was used if it wasn't

Each item must include: the implementation action, the verification method, and expected files touched.

3. IMPLEMENT: One Step at a Time

Mark the current step as in_progress. Implement ONLY that step.

  • Read target files before editing
  • Follow existing codebase conventions (imports, naming, patterns, architecture)
  • Adapt the plan to existing infrastructure (e.g., if the plan says "create a toast component" but the project uses Sonner, wrap Sonner instead of building from scratch)
  • Make the smallest coherent change
  • Do NOT implement future steps, but keep downstream dependencies in mind when making design decisions
  • Do NOT perform unrelated cleanup, refactoring, or formatting
  • Do NOT install dependencies unless explicitly approved

4. VERIFY: Tiered Verification

After each step, run the narrowest meaningful verification. Not "lint everything" every time.

Change TypeMinimum VerificationStronger Verification
New file/componentlint or typecheckaffected typecheck
Type/interface changetypecheckaffected tests
Logic/function changetargeted unit testfull test suite
API/server changetargeted integration testbuild + endpoint check
UI changetypecheck + buildvisual/manual smoke check
Config/build changebuildclean install/build if needed
Database/schema changedry-run/check commanduser approval required

If no automated verification exists for a step: perform a manual review and state precisely what you checked.

If verification fails:

First failure — fix and re-verify:

  • Fix only errors caused by the current step
  • Do NOT fix pre-existing or unrelated errors
  • Re-verify immediately

Repeated failures — do not keep patching blindly. See "Repeated Failure Handling" below.

Critical: Never make verification pass by weakening assertions, deleting tests, removing behavior, changing public APIs, suppressing errors, or hiding failures — unless the plan explicitly requires it AND the user approves. Making the alarm stop is not the same as fixing the problem.

5. DIFF: Inspect Changes

After verification passes, inspect what actually changed:

git diff --stat          # Which files changed?
git diff                 # When the diff is small enough to review

Confirm:

  • Only expected files changed
  • No unrelated formatting occurred
  • No lockfiles changed (unless explicitly intended)
  • No generated files were accidentally edited
  • No secrets, local paths, or debug logs introduced
  • No code was accidentally deleted

If the diff exceeds the expected scope, stop and correct before continuing.

6. CONFIRM: Mark Complete

Only when implementation, verification, AND diff inspection are clean:

  • Mark the step as completed
  • Summarize what changed in one sentence
  • Mark the next step as in_progress

7. FINAL: Full Verification + Report

After all steps:

  • Run the strongest reasonable check: lint + typecheck + build + tests (using project commands)
  • Report: completed steps, files changed, verification results, adaptations made, pre-existing failures (if any), anything requiring user review

Repeated Failure Handling

If verification repeatedly fails for the same underlying reason, do not continue applying small blind fixes. The goal is to detect whether you are learning something new between attempts or just thrashing randomly.

When a step fails multiple times:

  1. Stop patching. Stop making small tweaks and re-running.
  2. Re-read the error output carefully. The full stacktrace, not just the first line.
  3. Inspect the diff and surrounding code. git diff, read related types, interfaces, functions.
  4. Re-evaluate the original assumption. Is the current implementation strategy correct?
  5. Classify the failure:
    • Incorrect assumption about the codebase?
    • Repository mismatch (plan vs reality)?
    • Wrong abstraction chosen?
    • Interface or type incompatibility?
    • Missing dependency?
    • Stale generated artifacts?
    • Pre-existing issue unrelated to your change?
    • Verification command itself is misconfigured?
  6. Form a genuinely new hypothesis. Only retry when you have one.
  7. Consider reducing scope. Can the step be split into smaller pieces to isolate the failure?

Critical rule: Do not repeat the same fix strategy unless new information was discovered from:

  • Logs
  • Stack traces
  • Diffs
  • Tests
  • Repository inspection
  • Documentation

If no new strategy emerges after multiple attempts, stop and report the blocker clearly:

Blocker:
- verification command: `npm run build`
- failing file: `src/app/page.tsx`
- root issue hypothesis: React Server Component importing client-only hook
- attempted strategies:
  1. moved import to client component
  2. isolated hook into separate file
  3. checked existing patterns in repo
- reason for stopping:
  no consistent pattern in repo to resolve boundary safely
- likely next action:
  user review or architectural clarification

A clear blocker report is always better than repeating "still failing" while guessing.

Adapting Plans to Existing Code

Frontier AI plans frequently conflict with the actual codebase. When they do:

  1. Identify the conflict — "The plan says import { X } from 'uninstalled-lib' but it's not in package.json"
  2. Adapt, don't ignore — Use existing infrastructure to match the plan's intent
  3. Explain the adaptation — One sentence on what you changed and why
  4. Preserve the plan's interface — If the plan exports useToast(), your adaptation should still export useToast(), even if internals differ

Critical rules:

  • Do NOT create new abstractions if the repo already has an equivalent primitive
  • Do NOT install new dependencies unless the plan explicitly requires it AND the user approves
  • Do NOT change architecture or patterns without justification

Forbidden Without Explicit User Approval

These commands require the user to say "yes" before running:

Destructive:

  • rm -rf
  • git reset --hard
  • git clean -fd
  • git push --force

Installation (changes lockfiles):

  • npm install
  • pnpm install
  • yarn install
  • bun install
  • npm audit fix

Database / Infrastructure:

  • prisma migrate
  • prisma db push
  • supabase db push
  • docker compose down -v

Configuration:

  • Changing .env files
  • Modifying global tool config
  • Running deploy/unpublish commands

Mass changes:

  • Broad formatting (prettier/eslint --fix on entire repo)
  • Find-and-replace across many files without review

If unsure whether a command is safe, ask before running.

Common Mistakes

MistakeReality
"The frontier AI said it, so it must be right"Frontier plans are hypotheses. Validate against the real repo.
"I'll verify everything at the end"Errors compound. Verify each step with the right granularity.
"I already read the plan, I can implement it all at once"Batch implementation = batch errors + harder debugging.
"I'll fix pre-existing lint errors while I'm here"Unrelated cleanup masks what your changes actually did. Don't.
"This step is simple, I don't need to check git diff"Simple edits can accidentally delete code or format unintended files.
"I'll install the missing library the plan references"Ask first. The library may be intentionally absent or not approved.
"npm run build is the only verification that matters"Build is slow and broad. Use lint/typecheck for intermediate steps.
"If it fails, I'll just tweak and re-run until it passes"Blind patching without new information is thrashing. Re-read errors. Form a new hypothesis first.
"The same error again, let me try a different small change"Same error + same strategy = same result. Change the strategy, not the patch.

Red Flags — STOP and Re-evaluate

  • "I'll verify after the next step too" — Verify NOW.
  • "The frontier plan knows better than the repo" — The repo is the source of truth.
  • "This library isn't installed but the plan needs it" — Ask the user. Do not install silently.
  • "The diff is bigger than expected but it's probably fine" — Inspect and explain before continuing.
  • "I'll batch steps 2 and 3 since they're related" — One step = one verify + diff cycle.
  • "Pre-existing lint errors, let me fix those first" — Not your job. Record them. Stay focused.
  • "Let me format this file while I'm editing it" — Separate change = separate step. Don't mix.
  • "Still failing, let me try another quick fix" — Stop patching. Re-read the error. Form a new hypothesis first.
  • "The same error 3 times, one more tweak might work" — Same error + same strategy = thrashing. Change strategy or report blocker.
  • "I'll just rewrite the whole thing and see if that fixes it" — Throwing away work without understanding why it failed teaches nothing. Diagnose first.
  • "The user is in a hurry, I'll skip the diff check" — 5 seconds of git diff --stat prevents hours of debugging.

Quick Reference

PhaseActionTool
Preflightgit status, detect commands, baseline checkBash
Parse + Reality CheckRead plan, validate each step against repoRead + Glob
TrackCreate todowrite or markdown checklisttodowrite
ImplementOne step, minimal change, existing patternsRead + Edit/Write
VerifyTiered check per change typeBash
Diffgit diff --stat, confirm scopeBash
ConfirmMark complete, summarize, next steptodowrite
FinalFull verification + summary reportBash

Model-Specific Notes

Non-Frontier Models (Deepseek v4 Pro, GPT-4o, Gemini Flash)

  • Context window management is critical — the todowrite/checklist keeps you anchored
  • Excel at focused single tasks, drift on large context dumps
  • Step-by-step verification catches errors the model might miss in batches
  • The reality check phase prevents running with incorrect assumptions

Frontier Models (Claude Opus, GPT-5, Gemini Pro)

  • This workflow is still valuable for complex, risky, multi-file changes
  • Can handle larger steps — adjust granularity up
  • Discipline of diff inspection and tiered verification prevents overconfidence

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.