agentleFS
fatih-developerfatih-developer/fth-skills/skills/plan-implement-verify-recover/SKILL.md

plan-implement-verify-recover

Skill7 starsChanged 43 days agoMITView on GitHub

Execute repository code changes through risk-adaptive planning, targeted context reading, scoped implementation, verification, and a bounded evidence-driven correction loop. Use when the agent is asked to modify an existing codebase, fix a bug, implement a feature, refactor code, integrate an API, change a database, perform a migration, or make architectural or security-sensitive changes. Do not use for read-only explanations, analysis without changes, research, content writing, prompt creation, document summarization, or standalone examples that will not be applied to a repository.

The file

Show its rules and text

We split this skill into the rules it gives an agent

37 rules. About 0 are common, 36 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈36

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not expose private reasoning.

    line 10
  2. Distinctive:

    Read applicable AGENTS.md and repository instructions.

    line 17
  3. Distinctive:

    Use targeted discovery; do not read the entire repository when a smaller context is sufficient.

    line 21
  4. Distinctive:

    Do not modify files during initial discovery.

    line 23
  5. Distinctive:

    Use repository-provided build, test, lint, formatting, and validation commands.

    line 25
  6. Distinctive:

    Do not invent project commands when existing instructions are available.

    line 26
  7. Distinctive:

    Keep this internal for small, clear changes.

    line 37
  8. Distinctive:

    Use for clear, low-risk, localized, easily reversible changes that do not affect public contracts, data models, authentication, …

    line 44
  9. Distinctive:

    Read the directly relevant implementation and nearby test or example.

    line 48
  10. Distinctive:

    Run the fastest relevant validation.

    line 50
  11. Distinctive:

    Do not create a written plan artifact.

    line 54
  12. Distinctive:

    Use for normal multi-file features, bug fixes, and refactoring where the architecture remains stable.

    line 58
  13. Distinctive:

    Create a concise implementation plan.

    line 61
  14. Distinctive:

    Read relevant implementation, callers, and tests.

    line 63
  15. Distinctive:

    Run targeted checks, then broader checks when justified.

    line 65
  16. Distinctive:

    Do not add a plan file to the repository unless repository instructions, the user, or the task explicitly requires one.

    line 69
  17. Distinctive:

    Use for architecture, security, authentication, authorization, payments, personal data, migrations, public API changes, difficult rollback, …

    line 74
  18. Distinctive:

    Run verification appropriate to every affected risk domain.

    line 83
  19. Distinctive:

    Use an independent review only when explicitly requested or when applicable project instructions require and permit it.

    line 85
  20. Distinctive:

    Run this state loop:

    line 110
  21. Distinctive:

    Do not repeat an unchanged command, action, hypothesis, or fix.

    line 126
  22. Distinctive:

    Do not reload unchanged files unless new evidence requires it.

    line 130
  23. Distinctive:

    Stop the loop when:

    line 133
  24. Distinctive:

    No new testable hypothesis remains.

    line 137
  25. Distinctive:

    Prefer the smallest safe solution.

    line 145
  26. Distinctive:

    Avoid speculative code for possible future requirements.

    line 148
  27. Distinctive:

    Do not hide failures with silent fallbacks.

    line 152
  28. Distinctive:

    Do not hardcode credentials, environment values, URLs, mutable policies, domain limits, or repeated unexplained literals.

    line 154
  29. Distinctive:

    Do not create configuration or abstraction for local, stable, self-explanatory literals.

    line 156
  30. Distinctive:

    Do not overwrite or discard unrelated user changes.

    line 158
  31. Distinctive:

    Stop for direction when work requires new authority, expands product scope, changes an external contract, unexpectedly changes the data …

    line 161
  32. Distinctive:

    Treat git diff --stat as scope evidence, not functional verification.

    line 179
  33. Distinctive:

    Never claim completion without relevant evidence.

    line 181
  34. Very specific:

    When verification succeeds, continue to review.

    line 185
  35. Distinctive:

    Add or update a regression test when appropriate.

    line 198
  36. Distinctive:

    Do not apply unrelated speculative fixes.

    line 201
  37. Distinctive:

    Keep the report proportional to the change.

    line 217

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Plan, Implement, Verify, Recover

Apply the smallest workflow that safely completes the requested code change.

Do not expose private reasoning. Communicate only decisions, plans, risks, blockers, verification evidence, and concise progress useful to the user.

Inspect Project Instructions

Before editing:

  1. Read applicable AGENTS.md and repository instructions.
  2. Inspect repository status and preserve unrelated user changes.
  3. Locate relevant entrypoints, implementation files, nearby patterns, configuration, callers, and tests.
  4. Use targeted discovery; do not read the entire repository when a smaller context is sufficient.
  5. Do not modify files during initial discovery.

Use repository-provided build, test, lint, formatting, and validation commands. Do not invent project commands when existing instructions are available.

Define the Change

Establish:

  • A one-sentence goal.
  • In-scope and out-of-scope behavior.
  • Observable completion criteria.
  • Primary risks and affected boundaries.

Keep this internal for small, clear changes. Present it when ambiguity, risk, or scope makes user confirmation materially useful.

Select One Route

Fast

Use for clear, low-risk, localized, easily reversible changes that do not affect public contracts, data models, authentication, authorization, security, payments, or infrastructure.

  1. Read the directly relevant implementation and nearby test or example.
  2. Make the smallest correct change.
  3. Run the fastest relevant validation.
  4. Review the diff.
  5. Report evidence.

Do not create a written plan artifact.

Standard

Use for normal multi-file features, bug fixes, and refactoring where the architecture remains stable.

  1. Create a concise implementation plan.
  2. Identify files, sequence, risks, and verification.
  3. Read relevant implementation, callers, and tests.
  4. Implement the plan in scoped increments.
  5. Run targeted checks, then broader checks when justified.
  6. Review the complete diff.
  7. Report evidence and remaining limitations.

Do not add a plan file to the repository unless repository instructions, the user, or the task explicitly requires one.

Deep

Use for architecture, security, authentication, authorization, payments, personal data, migrations, public API changes, difficult rollback, large refactors, major dependencies, or high ambiguity.

  1. Perform targeted architectural discovery.
  2. Prepare a written plan with alternatives, tradeoffs, affected boundaries, rollback considerations, and a verification strategy.
  3. Resolve product decisions or missing authority before implementation.
  4. Implement in reviewable checkpoints.
  5. Run verification appropriate to every affected risk domain.
  6. Perform a fresh semantic review of the complete diff.
  7. Use an independent review only when explicitly requested or when applicable project instructions require and permit it.
  8. Report evidence, residual risks, and proof gaps.

Run the Bounded Execution Loop

Track these internal state values:

  • route: fast, standard, or deep.
  • state: discover, plan, implement, verify, review, recover, complete, or blocked.
  • correction_cycles: completed Recovery-to-Verification cycles.
  • replans: plan replacements caused by new evidence.
  • last_failure: latest distinct failure.
  • last_hypothesis: latest tested causal hypothesis.
  • evidence: compact list of checks and results.

Apply these route budgets:

RouteMaximum correction cyclesMaximum replans
Fast10
Standard31
Deep52

Run this state loop:

  1. discover: Gather only enough relevant context to act safely.
  2. plan: Produce only the plan detail required by the selected route.
  3. implement: Apply the smallest planned increment.
  4. verify: Run the fastest relevant check before broader checks.
  5. Move from verify to review when checks pass.
  6. Move from verify or review to recover when evidence shows a defect.
  7. In recover, form and test a new causal hypothesis, correct the cause, increment correction_cycles, and return to verify.
  8. Return to plan and increment replans only when evidence invalidates the current plan.
  9. Move from review to complete when the diff is clean and completion criteria have evidence.
  10. Move to blocked when a stop condition applies.

Do not repeat an unchanged command, action, hypothesis, or fix. Treat the same failure after the same attempted correction as no progress. Change the hypothesis or stop.

Do not reload unchanged files unless new evidence requires it. Maintain a compact state summary instead of restating the full history each cycle.

Stop the loop when:

  • Completion criteria have sufficient evidence.
  • The selected route budget is exhausted.
  • No new testable hypothesis remains.
  • Required access, credentials, or external availability is missing.
  • New authority or a user-owned product decision is required.
  • Scope materially expands or an external contract changes unexpectedly.
  • Continuing could overwrite unrelated user work or make recovery unsafe.

Apply Implementation Principles

  1. Prefer the smallest safe solution.
  2. Apply KISS and YAGNI before introducing abstractions.
  3. Reuse established project patterns when they fit.
  4. Avoid speculative code for possible future requirements.
  5. Stay within the accepted user-visible and architectural scope.
  6. Match nearby naming, structure, comments, and idioms.
  7. Preserve backward compatibility unless the request requires otherwise.
  8. Do not hide failures with silent fallbacks.
  9. Make necessary fallbacks observable, bounded, and justified.
  10. Do not hardcode credentials, environment values, URLs, mutable policies, domain limits, or repeated unexplained literals.
  11. Do not create configuration or abstraction for local, stable, self-explanatory literals.
  12. Do not overwrite or discard unrelated user changes.

Allow technical implementation details to evolve within the accepted scope. Stop for direction when work requires new authority, expands product scope, changes an external contract, unexpectedly changes the data model, or introduces a material architectural decision.

Verify

Select checks by change type and risk. Read references/verification-matrix.md when the right checks are unclear or the change affects multiple domains.

Prefer this order:

  1. Syntax or formatting check.
  2. Targeted test for changed behavior.
  3. Module-level typecheck, lint, or test.
  4. Build or broader integration checks when justified.
  5. Semantic diff review.

Treat git diff --stat as scope evidence, not functional verification.

Never claim completion without relevant evidence. When a check cannot run, report the exact unverified behavior, why it could not be verified, available evidence, and the next check required.

When verification succeeds, continue to review. When it fails, preserve the failure evidence and enter recover.

Recover from Failure

Enter Recovery when implementation or verification produces an unexpected failure. Read references/debugging-protocol.md, then:

  1. Reproduce or isolate the failure.
  2. Record expected and observed behavior.
  3. Form a testable root-cause hypothesis.
  4. Gather evidence before applying a fix.
  5. Apply the smallest causal correction.
  6. Add or update a regression test when appropriate.
  7. Increment correction_cycles and return to verify.

Do not apply unrelated speculative fixes.

Obey the correction and replan budgets for the selected route. Stop earlier when the loop makes no progress or any global stop condition applies.

Report Completion

Report:

  • What changed.
  • Why it was the smallest suitable solution.
  • Files or components affected.
  • Checks executed and their results.
  • Checks not executed and why.
  • Remaining risks, limitations, or proof gaps.

Keep the report proportional to the change.

🔗 Next Steps & Handoffs

<!-- BEGIN GENERATED: handoffs (generated from the ecosystem workflow map by build_ecosystems.py — do not edit by hand) -->

Ecosystem: @ecosystem-orchestration — Agent Orchestration.

Workflows:

  • Repository Change Flow (orch-code-change, step 2 of 3): next → @checkpoint-guardian (optional).

Handoff contract: pass results to the next skill through an inline Handoff block in your reply with the fields skill, workflow, created_at, inputs, summary, and next (the handoff contract of @ecosystem-orchestration). If a next skill is not installed, continue with its step from the ecosystem map, or install it with npx skills add fatih-developer/fth-skills --skill <name> after the user agrees.

<!-- END GENERATED: handoffs -->

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.