Bodega

Skills › Tecnología

frontier-plan-opencode-executor

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.\

Descargar .zipVer en GitHub
Departamento
Tecnología
Fuente
Comunidad · alexdcd/Mafia-Claude-Skills
Autor
alexdcd
Licencia
Apache-2.0
Idioma
Inglés
Riesgo
Bajo

Cómo instalarla en Claude

  1. Descargue el .zip sin descomprimirlo.
  2. En Claude active Configuración › Capacidades › Crear y editar archivos.
  3. Vaya a Personalizar › Skills › Crear skill › Subir una skill y elija el archivo.

Instrucciones completas (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

Do NOT use for:

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:

Dangerous state detection:

Checkpoint recommendation:

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:

If there are pre-existing uncommitted changes:

Commit only after:

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:

| Check | Question | |-------|----------| | Files | Do referenced files exist in the repo? | | Libraries | Are referenced libraries in package.json? | | Patterns | Does the repo already have an equivalent utility/component? | | Commands | Are the plan's verification commands available? | | Dependencies | Does this step depend on a previous step? | | Risk | Low / 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):

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.

4. VERIFY: Tiered Verification

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

| Change Type | Minimum Verification | Stronger Verification | |---|---|---| | New file/component | lint or typecheck | affected typecheck | | Type/interface change | typecheck | affected tests | | Logic/function change | targeted unit test | full test suite | | API/server change | targeted integration test | build + endpoint check | | UI change | typecheck + build | visual/manual smoke check | | Config/build change | build | clean install/build if needed | | Database/schema change | dry-run/check command | user 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:

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:

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:

7. FINAL: Full Verification + Report

After all steps:

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:

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

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:

Critical rules:

Forbidden Without Explicit User Approval

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

Destructive:

Installation (changes lockfiles):

Database / Infrastructure:

Configuration:

Mass changes:

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

Common Mistakes

| Mistake | Reality | |---------|---------| | "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

Quick Reference

| Phase | Action | Tool | |-------|--------|------| | Preflight | git status, detect commands, baseline check | Bash | | Parse + Reality Check | Read plan, validate each step against repo | Read + Glob | | Track | Create todowrite or markdown checklist | todowrite | | Implement | One step, minimal change, existing patterns | Read + Edit/Write | | Verify | Tiered check per change type | Bash | | Diff | git diff --stat, confirm scope | Bash | | Confirm | Mark complete, summarize, next step | todowrite | | Final | Full verification + summary report | Bash |

Model-Specific Notes

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

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