My Digital Garden

O3-Mini Is Really Good at Writing Internal Documentation

O3-Mini Is Really Good at Writing Internal Documentation

Metadata

  • Author: Simon Willison
  • Full Title: O3-Mini Is Really Good at Writing Internal Documentation
  • Category: #articles
  • Document Note: Simon Willison demonstrates using o3-mini to generate extensive developer documentation about how a feature works based on the contents of the relevant source files.
  • Summary: Simon Willison explored using the o3-mini LLM to generate documentation for the Datasette permissions system from its source code. He found that the results were impressive and confirmed his understanding of the system, despite already having his own documentation. This method of quickly producing up-to-date documentation from code is a valuable tool for developers.
  • Document Tags: #ai #code #developer-tools
  • URL: https://simonwillison.net/2025/Feb/5/o3-mini-documentation/#atom-everything

Highlights

  • The files-to-prompt command is fed the datasette subdirectory, which contains just the source code for the application - omitting tests (in tests/) and documentation (in docs/). The -e py option causes it to only include files with a .py extension - skipping all of the HTML and JavaScript files in that hierarchy. The -c option causes it to output Claude's XML-ish format - a format that works great with other LLMs too. (View Highlight)
    • Note: Features use of files-to-prompt, Willison's own utility that concatenates the content of a folder-worth of files into a prompt for a LLM
  • He pipes that result into LLM (View Highlight)
    • Note: Uses Willison's own LLM library, a command line tool to easily integrate with a range of LLM models
  • system prompt:

    write extensive documentation for how the permissions system works, as markdown (View Highlight)

  • The prompt used 99,348 input tokens and produced 3,118 output tokens (320 of those were invisible reasoning tokens). That's a cost of 12.3 cents. (View Highlight)