Treat the model like a stateless function:
- You control the inputs
- It returns a result
- It does not reliably “remember” beyond what you provide
Break problems into small units:
- One function
- One handler + test
- One query
Avoid:
- Dumping entire codebases or long documents
Include:
- Relevant code
- Inputs/outputs
- Errors
Exclude:
- Boilerplate
- Unrelated files
- Repetition
Guide attention:
- “Focus on error handling”
- “Only analyze the database interaction”
Don’t aim for one-shot answers.
Pattern:
- Analyze
- Fix
- Refactor
- Validate
Compress context as you go:
- Restate key facts
- Drop unnecessary detail
Keep important context outside the model:
- Notes
- Architecture summaries
- Relationships between components
Then re-inject only what’s needed.
Avoid re-pasting everything:
- “Using the handler above…”
- Only include changed or relevant parts
Best use cases:
- Refactor this code
- Convert to table-driven tests
- Simplify logic
Avoid vague, open-ended prompts.
Be explicit:
- “Be concise”
- “Only return the function”
- “Show a diff”
Chain multiple small prompts:
- Each step = focused input + output
- Build solutions incrementally
Don’t ask:
“How do I fit everything into the model?”
Ask:
“What is the smallest useful slice of this problem?”