โ† Back to news

Show HN: Treedocs: Documentation that automatically checks for staleness

dandylyons.github.io|22 points|16 comments|by DandyLyons|Jun 23, 2026

Introducing Treedocs: Automated Documentation Staleness Detection

Treedocs is a Swift-based CLI tool (v0.2.0) designed for macOS 13+ that helps developers grasp any codebase more efficiently by maintaining a documented map of every directory and file.

Treedocs Concept

๐ŸŒณ Visualizing the Repository

By simply executing treedocs, you get an immediate bird's-eye view of your project. The tool uses color-coding to highlight the health of your documentation:

  • Green: Current, valid files.
  • Red: Stale or invalid entries that require attention.

Example Output

โ”œโ”€โ”€ README.md           User-facing overview, installation, and command usage documentation.
โ”œโ”€โ”€ Sources/            Swift package source code for the treedocs executable.
โ”‚   โ”œโ”€โ”€ Commands/       ArgumentParser command implementations for treedocs subcommands.
โ”‚   โ””โ”€โ”€ Core/           Core services for loading, scanning, rendering, and updating treedocs data.
โ”œโ”€โ”€ site/               Static files deployed to the project GitHub Pages site.
โ”‚   โ”œโ”€โ”€ index.html      Landing page for the treedocs GitHub Pages site.
โ”‚   โ””โ”€โ”€ styles.css      Stylesheet for the treedocs GitHub Pages landing page.
โ””โ”€โ”€ old-file.swift      STALE: no matching path exists on disk.

๐Ÿš€ Why Use Treedocs?

"Documentation is only useful if it is accurate. Treedocs ensures your project map evolves alongside your code."

  1. Accelerated Onboarding: Provide new hires, your future self, or AI coding agents with the precise context needed to navigate complex folders. Stop wandering aimlessly through directories.
  2. Drift Prevention: Use automatic checks to ensure documentation doesn't rot. You can integrate a Git pre-commit hook to block any undocumented changes from being committed.
  3. Contextual Reviews: By storing human-readable summaries in a version-controlled treedocs.yaml, PR reviews become simpler and AI agents consume fewer tokens because they don't have to rediscover the project structure.

The Staleness Logic

The tool essentially evaluates the state of a file entry using a simple logical check: Status={Validifย PathyamlโˆˆDiskStaleifย Pathyamlโˆ‰Disk\text{Status} = \begin{cases} \text{Valid} & \text{if } \text{Path}_{\text{yaml}} \in \text{Disk} \\ \text{Stale} & \text{if } \text{Path}_{\text{yaml}} \notin \text{Disk} \end{cases}


๐Ÿ›  Installation & Setup

Note: Version 0.2.0 is currently source-build only. You will need a Swift 6-compatible environment (typically Xcode 16+).

MethodCommandNote
miseMISE_EXPERIMENTAL=true mise use -g spm:DandyLyons/treedocs@0.2.0Uses experimental SPM backend; builds from source.
Homebrewbrew install DandyLyons/tap/treedocsBuilds from source via the DandyLyons tap.
Mintmint install DandyLyons/treedocs@0.2.0Builds the executable from the tagged GitHub source.

Quick Start Checklist

  • Initialize the project: treedocs init (Creates treedocs.yaml)
  • Sync the structure: treedocs sync (Updates paths and checks for errors)
  • Verify integrity: treedocs check (Validates the YAML file)
  • View the tree: treedocs

๐Ÿ“‹ The treedocs.yaml Schema

The heart of the tool is the treedocs.yaml file. This is a version-controlled map that mirrors your file tree, pairing every path with a human-readable description.

Key Technical Details:

  • Standardization: The format follows a canonical JSON Schema.
  • Interoperability: Because it uses a schema, treedocs is easily understood by CI/CD pipelines, IDEs, and AI agents.
  • Automation: You can use AI agents to populate the descriptions, then verify them using treedocs check.

Workflow Diagram

To run a help command via Mint, use: mint run DandyLyons/treedocs@0.2.0 --help