1,000 mMidnight zone
Write code or build a feature
Write code or build a feature · Working code that does the job, runs, and is checked.
Assume, unless your person said otherwise
- stack: the stack the project already uses; if none, the most common one for the job, named up front
- source: no material given: say what you based the work on and mark anything you could not check
- goal: the behaviour, as input → output examples
- format: the files changed, the command to run, the test
- level: explain for a curious beginner; offer the expert depth at the end
Steps
- Get the brief (brief): stack, versions, where the code lives.
check: answers: brief names the kind code-feature. - Ask the brain (think) for the docs of the APIs the feature needs.
check: answers: think returns places for the feature. - Read the current docs (read_page) of each API call, with the version.
check: Each API call in the code matches the docs read today. - Write tests first from examples, implement the smallest thing that passes, handle empty, huge, malformed and offline cases, run it; put the hand-over through review.
check: The hand-over holds the test run output.
The bar
- It ran — with the command and output shown
- Tests cover the examples and an edge case
- Follows the project's style
- No secrets in code
- Put the answer or the result first; reasons and details after it.
- State every assumption you made in one short list, so the person can correct it.
- Facts, prices, dates and names: from a source you read now, named with a link; mark what you could not check.
Pitfalls
- Code never executed
- Inventing APIs or package versions
- Rewriting code that worked
- Swallowed errors
Deliver
The diff or files, how to run it, the test output.
Course: Write working code that does the job, runs, and is checked.
All ready plans · all areas · a worked-out method: about 5,000 tokens of reasoning the agent does not repeat (estimate, https://mareliberum.dev/savings)
