agentleFS
fbsmna-coderfbsmna-coder/karpathy-pro-max/skills/think-before-coding/SKILL.md

think-before-coding

Skill0 starsChanged 8 months agoMITView on GitHub

Surface assumptions and ambiguity before writing code. Use when a request has multiple valid interpretations, requires non-obvious assumptions, or when proceeding on a guess would cost more to undo than to clarify upfront.

3 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. 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 5

    Distinctive

    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:

    Stop before the first tool call that writes or runs code.

    line 30
  2. Distinctive:

    If ≥2 interpretations exist: list them as a numbered choice, ≤2 sentences each.

    line 32
  3. Distinctive:

    Ask which one — or proceed only if the user has already answered in the same turn.

    line 33
  4. Distinctive:

    If the contradiction is with stored context (CLAUDE.md / memory), name it.

    line 34
  5. Distinctive:

    Do not turn this into ceremonial hedging.

    line 49

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “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

Think Before Coding

LLMs default to picking one interpretation silently and running with it. This is the single biggest source of wasted work: you build the wrong thing competently. This skill blocks that.

When to apply

Apply when any of these are true:

  • The request has ≥2 reasonable interpretations and they would lead to different code.
  • You need to assume something about data shape, naming, scope, or behavior that is not visible in the context.
  • You are about to invent a name, path, or value the user did not provide.
  • You notice a contradiction between what the user said now and what is in CLAUDE.md, prior messages, or visible code.

When NOT to apply

Skip on trivial / reversible tasks:

  • Renaming a single variable, fixing a typo, adding a log line.
  • Operations the user has already authorized in durable instructions.
  • Cases where the answer is obvious from one glance at the file.

Theatrical "let me clarify" questions on obvious tasks are the failure mode this skill creates if applied indiscriminately. Do not perform them.

How to apply

  1. Stop before the first tool call that writes or runs code.
  2. State the assumption in one line: "Assuming X means Y because Z."
  3. If ≥2 interpretations exist: list them as a numbered choice, ≤2 sentences each.
  4. Ask which one — or proceed only if the user has already answered in the same turn.
  5. If the contradiction is with stored context (CLAUDE.md / memory), name it. Do not silently override.

Example

Bad:

User: "Add caching to the user lookup." Agent immediately writes Redis-based cache with 5-minute TTL. User: "I meant in-memory, this is a CLI tool."

Good:

User: "Add caching to the user lookup." Agent: "Two reasonable defaults — (1) in-process LRU (functools.lru_cache-style, no infra), (2) Redis (needs running redis, persists across processes). I'll go with (1) unless you need cross-process. Confirm?"

Anti-pattern

Do not turn this into ceremonial hedging. If a senior engineer would just do it, just do it.

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.