DEV Community

Abid Ali
Abid Ali

Posted on

I Got Tired of Writing Documentation. So I Built a Tool to Do It For Me.

Every project I ship has the same problem at the end.

The code works. The tests pass. And then I have to write the README.

Not a bad README — a real one. Architecture decisions, API endpoints, setup instructions, module breakdown. The kind of documentation that makes someone else's first hour with your codebase not a nightmare.

I kept putting it off. Then I'd come back to my own projects two weeks later and spend 20 minutes remembering how my own code worked.

So I built a tool to generate it automatically.


What it does

repo2docs points at a GitHub repo or a local directory and generates three documents:

  • README.md — setup, usage, what the project does
  • ARCHITECTURE.md — how the codebase is structured, entry points, module breakdown
  • API.md — HTTP endpoints, routes, request/response shapes

One command. Three documents. Done.

# Point at a GitHub repo
repo2docs https://github.com/owner/repository

# Or a local directory
repo2docs .

# Custom output folder
repo2docs ../my-service --output ./docs-output/my-service
Enter fullscreen mode Exit fullscreen mode

Output goes to repo2docs-output/<repo-name>/ by default. No flags required, no config files, no setup beyond install.


What it actually detects

The part I'm most proud of is that it doesn't generate generic documentation. It reads the actual codebase.

It picks up:

  • Entry points and important modules
  • Package manager, build tools, test setup, linting, CI signals
  • Framework detection — Express routes, mounted router prefixes composed into full paths like /api/users not just raw router-local paths
  • Environment files and notable repository patterns
  • Language distribution across the project

That last one matters. A generic documentation generator will tell you "this project uses JavaScript." This one tells you which files are entry points, which modules are doing the heavy work, and how the HTTP layer is structured.


The problem it solves

Documentation debt is one of those things that compounds silently. You skip the README on Monday because you're shipping. You skip the architecture doc on Tuesday because the code is obvious. By Friday you have a codebase that works perfectly and is completely opaque to anyone who didn't write it — including you in three weeks.

The real cost isn't the time it takes to write docs. It's the time every future reader spends reconstructing understanding that already existed in your head when you wrote the code.

repo2docs captures that understanding at the moment it's cheapest — right after you've shipped — and turns it into documents that stay with the codebase.


How to try it

npm install
npm run build
repo2docs https://github.com/your-repo
Enter fullscreen mode Exit fullscreen mode

It runs against any public GitHub repo, so you can try it on something you already know well and see how accurately it captures the architecture.

Repo: github.com/BuildWithAbid/repo2docs

Curious what the output looks like on your codebase — drop a comment if you try it.


Built with Claude Code. Part of a suite of open-source developer tools at github.com/BuildWithAbid

Top comments (0)