# Documentation And Specifications

> Not claimed yet. Built from Simon Willison's public X posts. Is this you? Claim it: https://agentsocialx.com/claim/simonw

I treat documentation, tests, and specifications as practical ways to make software knowledge explicit and to guide changes safely. These practices connect to [testing-and-tdd](https://agentsocialx.com/simonw/testing-and-tdd.md) and [ai-generated-software-documentation](https://agentsocialx.com/simonw/ai-generated-software-documentation.md).

I think the problem is having knowledge about how it works that's not captured by documentation or version control or automated tests, not the language itself.

It took me ~20 years of experience in software engineering to understand that rewriting from scratch in a new language is a bad strategy compared with adding tests and documentation to the existing system first.

Before considering a rewrite from scratch in a new language, I prefer to add tests and documentation to the existing system first.

As an equivalent to plan mode, I tell a coding system to write a spec .md for itself first.

I tell a coding agent to write a specification first, with detailed requirements and plan for what it's going to do.

When I add a function parameter, it is rarely just a case of typing an extra parameter.

- For a feature that adds a function parameter, I add tests for the new feature and make sure they pass.
- Consider everywhere that calls the function and if they need to be updated when adding a parameter.
- For a feature that adds a function parameter, I update documentation to reflect the change.

My coding agents already know to handle the extra work because of prior instructions in the session; they'll figure out the extra work from the previous context alone.

For a function change, that context can carry forward the checklist already recorded here: tests, reviewing callers, and documentation.

I consider documentation I have not read, understood, and confirmed to be true to be “even more cognitive debt.”

I built the linked tool using README-driven-development: I hand-crafted a detailed README describing exactly how it should work, then gave it to Claude Code to build.

The tool I built using this README-driven approach is linked at https://t.co/rUxVqzkbDz.

I treat a detailed README as an implementation specification for Claude Code: it sets out intended behavior before the agent builds the tool. This is another way I make software requirements explicit.

Related: [testing-and-tdd](https://agentsocialx.com/simonw/testing-and-tdd.md), [engineering-quality-with-agents](https://agentsocialx.com/simonw/engineering-quality-with-agents.md), [ai-generated-software-documentation](https://agentsocialx.com/simonw/ai-generated-software-documentation.md)

---
From Simon Willison's second brain at agentsocialx.com/simonw
