agentleFS
youcislayoucisla/Agent-Foundry/skills/core/plan-before-code/SKILL.md

plan-before-code

Skill1 starsChanged 23 days agoMITView on GitHub

No implementation without an agreed spec for non-trivial work. Brainstorm,

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not demand a second approval the user has already given.

    line 32
  2. Distinctive:

    Ask one question at a time, and only when the answer changes the design.

    line 36
  3. Distinctive:

    When approaches differ materially, name two or three with tradeoffs and a recommendation.

    line 40
  4. Distinctive:

    Ask for review when the decision is genuinely user-owned or irreversible.

    line 57
  5. Distinctive:

    Follow the steps. If reality diverges, update the spec before changing the implementation again.

    line 63

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

The gate between an idea and a change. It is proportional: the spec for a small change is a paragraph, not a document.

Procedure

1 - Decide whether the gate applies

Apply it when the work is non-trivial, has more than one reasonable approach, is hard to reverse, or the user has not already authorized the change.

Skip it when:

  • The change is a one-line typo or a trivial mechanical edit.
  • The user already provided a clear, complete spec and authorized the work.
  • The artifact is a throwaway script that will be deleted immediately.

Do not demand a second approval the user has already given.

2 - Clarify only the real gaps

Ask one question at a time, and only when the answer changes the design. If the request is clear, state your assumptions and continue. Do not dump a checklist of questions to appear thorough.

When approaches differ materially, name two or three with tradeoffs and a recommendation.

3 - Draft the spec

Save under plans/specs/ or the project's existing spec location. Sections:

  • Goal: one sentence
  • Success criteria: observable, not vibes
  • Non-goals: what is explicitly excluded
  • Approach: chosen path and rationale
  • Steps: ordered, each with a check
  • Risks: what could fail and the mitigation
  • Open questions: unresolved items

4 - Confirm when confirmation is needed

Ask for review when the decision is genuinely user-owned or irreversible. When the user already authorized the work and the spec matches their request, record the spec and proceed.

5 - Implement and keep the spec honest

Follow the steps. If reality diverges, update the spec before changing the implementation again. Report where the spec changed.

Why it works

  • Surfaces unstated assumptions before they become code.
  • Gives the work a reference when it gets fuzzy.
  • Makes a bad approach cheap to abandon.

Worked example

A spec skeleton small enough to confirm before code exists.

Spec: add cmd export --json.
Success: exit 0 and valid JSON on 3 fixtures.
Non-goals: remote upload, resumable export.
Step 1: parse args -> test parse_args.

Anti-patterns

  • Applying a heavyweight spec process to a typo.
  • Requiring approval after the user has already authorized the work.
  • Writing a spec that restates the request without success criteria.
  • Treating the spec as immutable when the source disagrees.
  • Asking ten clarifying questions whose answers do not change the design.

Verification Checklist

  • The gate was applied proportionally, or a skip reason is stated. (step 1)
  • Success criteria are observable. (step 3)
  • Non-goals are explicit. (step 3)
  • Each implementation step has a verification. (step 5)
  • The user was not asked to approve work they already authorized. (step 4)

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.