Back to Examples
The Scratchpad Discipline Pattern
Why every serious agent session should start by writing to scratch/ and how to do it well.
Patterns•Beginner•markdown
Example Code
Rule: Before you touch any source file or run any command that has side effects, create or update scratch/current.md with:
- The user request (verbatim)
- Your current understanding / assumptions
- The plan (even if rough)
- What you will do first
This externalizes reasoning, makes recovery trivial when the agent gets confused, and gives humans full visibility.
Many of the highest-performing teams treat the scratch directory as sacred.
When to use this
Why every serious agent session should start by writing to scratch/ and how to do it well.
Quick Info
Difficulty: Beginner
Language: markdown
Copy the block above and adapt it to your project.
Related Examples
Complete AGENTS.md for Next.js + TypeScript
A production-grade AGENTS.md used by real teams. Covers principles, skills, workflows, and review standards.
Real Grok Build Skill Definition (advanced-code-reviewer)
A complete, production-ready skill definition you can download and use.
Research → Implement → Review → Ship Workflow
A complete multi-step workflow used for feature development with agents.