Skip to content

Instantly share code, notes, and snippets.

@zsup
Last active October 6, 2025 08:55
Show Gist options
  • Save zsup/9434452 to your computer and use it in GitHub Desktop.
Save zsup/9434452 to your computer and use it in GitHub Desktop.
Documentation-Driven Development (DDD)

Documentation-Driven Development

The philosophy behind Documentation-Driven Development is a simple: from the perspective of a user, if a feature is not documented, then it doesn't exist, and if a feature is documented incorrectly, then it's broken.

  • Document the feature first. Figure out how you're going to describe the feature to users; if it's not documented, it doesn't exist. Documentation is the best way to define a feature in a user's eyes.
  • Whenever possible, documentation should be reviewed by users (community or Spark Elite) before any development begins.
  • Once documentation has been written, development should commence, and test-driven development is preferred.
  • Unit tests should be written that test the features as described by the documentation. If the functionality ever comes out of alignment with the documentation, tests should fail.
  • When a feature is being modified, it should be modified documentation-first.
  • When documentation is modified, so should be the tests.
  • Documentation and software should both be versioned, and versions should match, so someone working with old versions of software should be able to find the proper documentation.

So, the preferred order of operations for new features:

  • Write documentation
  • Get feedback on documentation
  • Test-driven development (where tests align with documentation)
  • Push features to staging
  • Functional testing on staging, as necessary
  • Deliver feature
  • Publish documentation
  • Increment versions
@danfmaia
Copy link

danfmaia commented Apr 2, 2025

Do you have any reference about document generation tool supporting DDD ?

"document generation tool" = AI

@trkaplan
Copy link

This old discussion hits differently in the AI era!

For those who haven't experienced it, I want to share some context document files that can be fed to AI coding agents like Claude Code, Cursor, etc:

PLAN.md - current project roadmap and objectives
ARCHITECTURE.md - technical decisions and system design
TODO.md - current tasks and their status
DECISIONS.md - decision history with rationale
COLLABORATION.md - handoff notes from other tools
Source : https://news.ycombinator.com/item?id=44833651

These files help AI understand not just what the code does, but why certain choices were made and what the project goals are.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment