---
name: keeping-repository-file-maps-and-architecture-docs
description: "Audits repository file hierarchies against architecture documentation, flags new, moved, or deleted paths, and drafts concise updates. Use when a push or pull request changes the project's file structure."
license: CC-BY-4.0
compatibility: "Needs access to: GitHub, Terminal, Docs."
metadata:
  author: "BotBento Editorial"
  version: "2026-10-15"
  source: "https://botbento.com/usecases/keeping-repository-file-maps-and-architecture-docs/"
  kind: workflow
  hermes:
    tags: ["documentation", "git", "architecture", "codebase", "ci"]
    category: coding
    requires_toolsets: ["terminal", "file"]
---
# Keeping repository file maps and architecture docs in sync

Audit repository file hierarchies against documentation and detect missing or stale descriptions

## When to use

When project files change, move, or get deleted, repository maps and architecture overviews quickly become outdated. This workflow inspects repository directory trees, compares them against documented file descriptors, identifies untracked or deleted paths, and drafts updates to keep architectural documentation accurate.

## Inputs

- `repository`: The repository whose directory tree and documentation should be scanned and compared
- `branch`: The repository branch to scan for the active file layout
- `documentation_files` (optional): Existing repository map or architecture documentation files holding path descriptions

## Steps

1. When something happens: Code push or pull request opened (A code push or pull request opened that changes repository files)
2. Scan file tree and diff path docs
3. Report drift and propose doc updates

## Instructions

Run directory scans on repository branches using terminal commands. Compare the active file layout against existing path descriptions in documentation files. Flag any untracked new files, moved paths, or obsolete entries. Draft concise explanations for new paths and present a diff report. Always ask for user approval before committing changes or submitting a pull request.

## Approvals

- Committing documentation changes to the repository
- Submitting a pull request with the proposed updates

## Output

Drift report listing untracked, moved, or deleted paths with proposed documentation updates and a diff (format: markdown)

## Source

Summarized in our own words from [Show HN: Treedocs: Documentation that automatically checks for staleness](https://news.ycombinator.com/item?id=48646209) (Hacker News, checked 2026-10-15). Any results described there are the authors’ own.

From the BotBento use-case directory: https://botbento.com/usecases/keeping-repository-file-maps-and-architecture-docs/. Licence: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
