DEV Community

Cover image for grow-hack: An AI That Reads Your Code and Writes the Docs You Never Got Around To
Ganesh Bora
Ganesh Bora

Posted on

grow-hack: An AI That Reads Your Code and Writes the Docs You Never Got Around To

Every developer has been there: you clone a repo, open the README, and it's either missing, three years stale, or just says "WIP, docs coming soon." Even when the README is decent, you still end up reading thousands of lines of code to understand the architecture, the entry points, the dependencies, and how the modules actually fit together. Writing good documentation is slow, boring, and nobody wants to do it — especially for side projects.

grow-hack is an open-source tool that automates that pain away. Paste a public GitHub URL, and in about a minute you get a professional README plus full developer documentation — architecture, features, folder tree, install commands, dependency list, API overview, FAQ — exported as both Markdown and a styled PDF. And it doesn't just skim the README; it actually reads your code.

What It Produces

The output is a complete documentation package, not a single file. For any repo you feed it, grow-hack generates:

  • A clean, professional README
  • A project overview and purpose statement
  • Features inferred from the actual source code
  • An architecture overview with patterns
  • A folder structure tree
  • Installation and quick-start commands — it auto-detects npm, pip, poetry, go, or cargo
  • Explanations of configuration files
  • A full dependency list
  • A "how it works" narrative grounded in real source files
  • Key modules with their paths and roles
  • An API overview when one is detected
  • Best practices and suggested future improvements
  • An FAQ

All of that is exported as both Markdown and a styled PDF, so you can drop it straight into your repo or share it with a team.

The Pipeline: From URL to Docs

The app is a Flask web application that orchestrates an agent pipeline built on LangGraph. The flow looks like this:

Flask UI → LangGraph workflow → GitHub fetch → Parser → Analyzer →
Knowledge object → Documentation generator → Reviewer → Markdown/PDF
Enter fullscreen mode Exit fullscreen mode

Let's break that down:

  1. GitHub fetch — The GitHubAgent validates the URL, fetches metadata via the GitHub REST API (using PyGithub), and clones the repo with GitPython.
  2. Parser — The parser.py service reads the README, configuration files, dependency manifests, and source files. It intelligently ignores generated directories and binary files, so the LLM isn't drowning in noise.
  3. Analyzer — The analysis_agent.py infers the language, framework, package manager, entry points, and overall architecture. It uses tiered prompts that adapt to the size of the codebase, with token estimation to keep costs down.
  4. Knowledge object — All of this is assembled into a RepositoryContext Pydantic model. This is a key design decision: the knowledge object is reusable by future modules. The README notes this is the first module of a larger content creation platform — the same object could feed blog posts, LinkedIn updates, X threads, tutorials, or presentations.
  5. Documentation generator — The documentation_agent.py takes the knowledge object and produces the actual docs via the LLM.
  6. Reviewer — The review_agent.py does a quality pass, catching gaps and inconsistencies before the final export.
  7. Export — The markdown_service.py and pdf_service.py handle the final output formats.

Design Choices Worth Stealing

Three things stand out in how this project is built.

1. Multi-Provider LLM Support

The default is DeepSeek, which is cheap — the author claims about $0.50 per 100 repos. But you can swap in any OpenAI-compatible provider by setting LLM_API_KEY, LLM_BASE_URL, and LLM_MODEL. That means OpenAI, Groq, or a self-hosted model all work with zero code changes. The llm_service.py abstracts the provider so the rest of the app doesn't care what's behind the API.

2. Deterministic Mock Mode

If you don't configure an LLM key, the app runs in a deterministic mock mode. This is huge for testing and demos — you can run the entire pipeline without spending a cent or even having an API key. The test suite (pytest) exercises the full flow with mocks, so CI doesn't need secrets.

3. The Meta Angle: It Dogfoods the Content-Agent Pattern

The most interesting part might be agents/content_agent.py. This module implements the exact same autonomous content-agent contract that the tool is designed to produce content for. It classifies input (repo vs. topic), does a research pass, drafts content, runs a self-review pass, and returns a JSON object with keys like input_type, interpreted_as, title, content_markdown, image_prompts, tags, and notes_for_judge. It even has defensive JSON parsing and a contract-shaped fallback so the pipeline never returns an error or an empty response.

In other words, grow-hack isn't just a tool that generates docs — it's a working example of how to build a robust, production-grade content agent. The pattern it uses is directly reusable for any LLM-powered content pipeline.

Getting Started

If you want to try it yourself, the setup is straightforward:

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
Enter fullscreen mode Exit fullscreen mode

Then set DEEPSEEK_API_KEY (or LLM_API_KEY/LLM_BASE_URL/LLM_MODEL for another provider) and optionally GITHUB_TOKEN in .env. Run it with:

python app.py
Enter fullscreen mode Exit fullscreen mode

Open http://localhost:5000, paste a repo URL, and watch the docs generate. The included Dockerfile and render.yaml make deployment to Render a one-click affair.

The Takeaway

Documentation is the bottleneck for most projects — it's the first thing to get cut when deadlines hit, and the last thing anyone wants to write. grow-hack makes it cheap and automatic by having an LLM read the actual code, not just the README. And the architecture is a clean template for building LLM-powered content pipelines: separate agents for orchestration, services for infrastructure, prompts for instructions, and a reusable knowledge object in the middle.

If you've ever looked at a repo and wished the docs were better, this is the tool that writes them for you.


Written by ganesh · bora@gmail.com

Top comments (0)