think-before-coding
Skill69 starsChanged 7 months agoMITView on GitHub
Forces explicit reasoning before writing any code. Surfaces assumptions, manages confusion, and prevents hallucination by demanding clarity upfront.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- choegyumin/agent-skillstheir own version, first seen Sep 19, 2026
- sarmakska/slipstreamtheir own version, first seen May 31, 2026
- fbsmna-coder/karpathy-pro-maxtheir own version, first seen Apr 15, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- sarmakska/slipstream★ 2same name
- choegyumin/agent-skills★ 1same name
- fbsmna-coder/karpathy-pro-max★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository32 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- ai-output-validationSkill
- api-designSkill
- ci-cd-pipelinesSkill
- code-explanationSkill
- code-reviewSkill
- context-loadingSkill
- debugging-methodologySkill
- documentationSkill
- error-handlingSkill
- frontend-engineeringSkill
- git-workflowSkill
- goal-driven-executionSkill
- hallucination-preventionSkill
- idea-to-specSkill
- incremental-codingSkill
- integration-testingSkill
- meeting-notes-to-tasksSkill
- multi-agent-orchestrationSkill
- observabilitySkill
- performance-optimizationSkill
- production-deploymentSkill
- prompt-injection-defenseSkill
- rag-and-memorySkill
- refactoringSkill
- research-and-summarizeSkill
- security-hardeningSkill
- simplicity-firstSkill
- surgical-changesSkill
- task-decompositionSkill
- test-driven-developmentSkill
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
- Distinctive: line 41
If genuinely ambiguous, ask a focused clarifying question — not a list of 10 questions.
- Distinctive: line 42
If multiple valid approaches exist, present 2–3 options with tradeoffs, then ask which to proceed with.
- Distinctive: line 43
If something seems wrong with the request, say so directly — don't silently work around it.
- Distinctive: line 49
Before writing code, state:
- Distinctive: line 86
Before leaving this phase, confirm:
“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.
Files
Overview
AI agents default to writing code immediately — even when the request is ambiguous, the context is incomplete, or multiple valid interpretations exist. This skill forces a deliberate thinking phase before any implementation begins.
The result: fewer rewrites, fewer wrong-direction implementations, and fewer "I assumed X" surprises.
When to Use
Activate this skill before writing any code when:
- The request is ambiguous or underspecified
- Multiple valid implementations exist
- You are unsure about an existing system's constraints
- The task touches security, data integrity, or public APIs
- You feel the urge to "just start coding" to make progress
Process
Phase 1: Understand the Request
- Read the full request — Do not skim. Re-read once.
- Identify ambiguities — List every decision you would have to make silently:
- What counts as "success"?
- What are the inputs and expected outputs?
- What should NOT change?
- Are there existing patterns to follow?
- Surface assumptions — Write them out: "I am assuming X because Y."
- Check for contradictions — Does the request contradict itself or existing code?
Verify: Can you state the goal in one clear sentence? If not, ask before proceeding.
Phase 2: Clarify Before Acting
- If genuinely ambiguous, ask a focused clarifying question — not a list of 10 questions. Pick the one blocker.
- If multiple valid approaches exist, present 2–3 options with tradeoffs, then ask which to proceed with.
- If something seems wrong with the request, say so directly — don't silently work around it.
Verify: You have a clear, agreed-upon interpretation of the task.
Phase 3: State Your Plan
- Before writing code, state:
- What you will build
- What you will NOT touch
- What success looks like (your verification criteria)
- For multi-step tasks, write a brief plan:
1. [Step] → verify: [check] 2. [Step] → verify: [check] 3. [Step] → verify: [check]
Verify: The plan is agreed upon, or you have received approval to proceed.
Phase 4: Code
- Now write the code — following the plan exactly.
Common Rationalizations (and Rebuttals)
| Excuse | Rebuttal |
| "I'll figure it out as I go" | Unknown unknowns compound. 5 minutes of thinking saves 50 minutes of rewriting. |
| "The request is clear enough" | If you can't state the goal in one sentence, it's not clear enough. |
| "Asking questions slows things down" | Wrong direction is infinitely slower than a 30-second clarifying question. |
| "I'll handle edge cases later" | Edge cases not considered upfront become bugs found in production. |
| "I can always refactor" | You almost never will. Design now. |
Red Flags
- You're already writing code and you haven't stated what success looks like
- You made a silent assumption about what the user wants
- You chose between two approaches without mentioning the tradeoff
- You're solving a problem the user didn't ask about
- You're 100 lines in and realize you misunderstood the goal
Verification
Before leaving this phase, confirm:
- The goal is stated in one clear sentence
- All major assumptions are explicitly named
- Ambiguities are resolved (or flagged for the user)
- A brief plan exists with verification criteria per step
- You know what you will NOT touch
References
- Andrej Karpathy on LLM coding pitfalls
- goal-driven-execution skill
- idea-to-spec skill
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
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.

