plan-before-code
A planning-first workflow for coding tasks that validates assumptions and verifies logic before modifying files.
Install
mkdir -p .claude/skills/plan-before-code && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14704" && unzip -o skill.zip -d .claude/skills/plan-before-code && rm skill.zipInstalls to .claude/skills/plan-before-code
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Plan before editing code. Use this skill for multi-step implementation, debugging, refactors, release work, or any coding task where sequencing, assumptions, or validation matter. It enforces a short plan first, validates assumptions before edits, and verifies results before close-out.Key capabilities
- →Restate the goal of a coding task
- →Identify likely files or components for changes
- →Create a multi-step plan for implementation
- →Validate critical assumptions before editing
- →Verify results after code changes
How it works
This skill enforces a planning pass before code edits, requiring the user to restate goals, identify components, create a plan, validate assumptions, and verify results to improve sequencing and reduce avoidable edits.
Inputs & outputs
When to use plan-before-code
- →Multi-file refactoring
- →Complex bug fix planning
- →Release packaging work
About this skill
Plan Before Code
Use this skill to force a planning pass before coding. The goal is not paperwork. The goal is to improve sequencing, reduce avoidable edits, and catch bad assumptions before touching files.
When to use
- Multi-file changes
- Bug fixes with unclear root cause
- Refactors
- Release or packaging work
- Tests or docs that depend on code behavior
- Any task where validation matters before execution
Skip only for trivial tasks
You may skip an explicit visible plan only when all of these are true:
- the task is local and obvious
- one file is affected
- the edit is mechanically safe
- failure impact is negligible
Even then, still make a private micro-plan before editing.
Modes
Choose one mode before editing.
Lightweight mode
Use for bounded work with low ambiguity.
- Restate the goal in one sentence
- Identify likely files or components
- Make a 2-4 step plan
- Validate the critical assumption
- Edit
- Run targeted verification
Strict mode
Use for risky or multi-step work.
- Inspect the current implementation first
- Identify touch points and likely blast radius
- Produce an ordered plan
- Validate assumptions before the first edit
- Execute one step at a time
- Re-plan if facts change
- Verify each critical change
- Summarize residual risk at the end
Required workflow
-
Understand the real task.
- Separate the user request from the likely root problem.
- If the task mentions a symptom, inspect the cause before proposing edits.
-
Inspect before proposing a fix.
- Read the relevant files.
- Check logs, failing tests, or current behavior when available.
- Do not start editing from memory.
- For operational plans such as "next move", "ready for release", "release it",
or "sync HF", inspect the current workflow/tooling files before proposing
sequencing. In AGILAB release work, check
./dev --print-only release,.github/workflows/pypi-publish.yaml, andtools/release_plan.pybefore deciding which steps are local preflight, GitHub workflow jobs, or manual follow-ups.
-
Create the plan before coding.
- Use a short visible plan for substantial work.
- For complex work, use the planning tool if available.
- The plan should be ordered, concrete, and testable.
- In
agilab, runuv --preview-features extra-build-dependencies run python tools/impact_validate.py --stagedor--files ...if a diff already exists, and use its output to shape the plan.
-
Validate assumptions before execution.
- Confirm the file path, call site, dependency, config source, or failing case.
- If a key assumption is unverified and easy to check, check it first.
- Do not code around uncertainty when inspection can remove it.
-
Execute in sequence.
- Change one logical unit at a time.
- Keep the write scope aligned with the plan.
- If reality diverges from the plan, stop and re-plan before continuing.
-
Verify before declaring success.
- Prefer targeted tests first.
- Use the narrowest validation that proves the fix.
- If validation was not possible, say so explicitly.
- In
agilab, prefer the validations and artifact refreshes reported bytools/impact_validate.pyover ad hoc guesses.
-
Close with outcome and remaining risk.
- What changed
- What was verified
- What is still unverified or risky
Planning quality bar
A good plan:
- names the concrete files or modules likely involved
- separates inspection from editing
- includes at least one validation step
- is short enough to execute without drift
- can be updated when facts change
A bad plan:
- repeats the user request without sequencing
- skips inspection
- assumes the cause before checking
- lumps unrelated edits together
- has no validation step
Guardrails
- Do not code first and invent the plan afterwards.
- Do not jump to a core/shared fix when an app-local fix may be enough.
- In
agilab, do not skiptools/impact_validate.pyfor multi-file diffs or risky bug fixes when it can clarify shared-core, installer, badge, or skill-index impact. - Do not treat “I know this codebase” as evidence.
- Do not present an operational plan from memory when the repository has an authoritative script, workflow, or generated plan that can be inspected first.
- Do not let a plan become stale after new evidence appears.
- Do not over-plan tiny work; choose the lightest mode that still protects quality.
Expected visible behavior
For substantial tasks, the user should see:
- a short statement of what is being checked first
- a concise plan before edits
- an update when the diagnosis changes
- validation before final close-out
- an explicit interruption checkpoint: if a guard, approval boundary, ambiguity, or environmental limitation blocks the planned fix, state the blocker and the required decision, ask for it, and resume after approval rather than silently substituting a workaround or stopping with a known residual defect
- close-out must state the outcome as fixed, validated, awaiting approval, or blocked, plus the recurrence guard or regression used when the task exposed a reusable failure class
References
- Read
references/workflow.mdwhen you need the strict checklist or examples of lightweight versus strict planning.
When not to use it
- →When the task is local, obvious, affects one file, is mechanically safe, and has negligible failure impact
- →When the user wants to code first and invent the plan afterwards
- →When the user wants to skip inspection and assume the cause
Limitations
- →Requires inspection of current implementation before proposing a fix.
- →Requires validation of assumptions before execution.
- →Requires verification before declaring success.
How it compares
This skill formalizes the planning process with distinct modes and required steps before any code modification, preventing impulsive edits and ensuring a structured approach to complex tasks.
Compared to similar skills
plan-before-code side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| plan-before-code (this skill) | 0 | 2mo | No flags | Beginner |
| vc-execute | 0 | 2mo | No flags | Intermediate |
| sdd-apply | 0 | 3mo | No flags | Advanced |
| software-architecture | 333 | 6mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by ThalesGroup
View all by ThalesGroup →You might also like
vc-execute
Mithilyaganti
Execute a clear plan, issue, or agent brief with workspace safety, TDD, scoped subagent coordination, continuous verification, and tiered review gates. Use when implementing approved work, running an AFK loop, or turning a plan/issue into tested code.
sdd-apply
jose-matos-9281
>
software-architecture
davila7
Guide for quality focused software architecture. This skill should be used when users want to write code, design architecture, analyze code, in any case that relates to software development.
oracle
openclaw
Best practices for using the oracle CLI (prompt + file bundling, engines, sessions, and file attachment patterns).
clojure-write
metabase
Guide Clojure and ClojureScript development using REPL-driven workflow, coding conventions, and best practices. Use when writing, developing, or refactoring Clojure/ClojureScript code.
add-uint-support
pytorch
Add unsigned integer (uint) type support to PyTorch operators by updating AT_DISPATCH macros. Use when adding support for uint16, uint32, uint64 types to operators, kernels, or when user mentions enabling unsigned types, barebones unsigned types, or uint support.