Skip to content

Instantly share code, notes, and snippets.

@eduardo-matos
Created February 18, 2026 11:51
Show Gist options
  • Select an option

  • Save eduardo-matos/db161201ce7abdca83c4ef2fc1cf06ff to your computer and use it in GitHub Desktop.

Select an option

Save eduardo-matos/db161201ce7abdca83c4ef2fc1cf06ff to your computer and use it in GitHub Desktop.
Example of rules for agents to document code

Documentation rules

Principles

  • Document intent, decisions, and contracts.
  • Do not document what is obvious from code.
  • Optimize for future maintainers.

Must Document

  • Architecture decisions
  • Module boundaries
  • Public APIs & contracts
  • Business rules
  • Non-obvious flows

Must Not Document

  • Trivial functions
  • Framework behavior
  • Generated code
  • Low-level implementation details

README Rules

  • Explain:

    • what the system does
    • how it is structured
    • how to run
    • how to test

Update Discipline

  • Update docs together with code changes.

AI Rules

  • Prefer concise, intent-driven docs.
  • If intent is unclear, ask for clarification.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment