# I built an AI code documentation tool to clean messy code with zero documentation.

> Source: <https://dev.to/iqbii/i-built-an-ai-code-documentation-tool-to-clean-messy-code-with-zero-documentation-1dhm>
> Published: 2026-06-28 22:17:24+00:00

If you've ever inherited someone else's code with zero documentation, you know the pain. You spend hours just figuring out what a function does before you can even touch it.

I built legacydoc to fix that.

legacydoc is a tool that takes any undocumented code and generates clean, professional documentation for it instantly. You paste your code, click a button, and get structured docs back in seconds.

No setup. No configuration. Just paste and go.

👉 Try it here: [https://legacydoc.io](https://legacydoc.io)

You paste your code into the input box. The code gets sent to an API running on AWS Lambda, which processes it and returns structured documentation. The whole round trip takes a few seconds.

Here's a simple example. You paste this:

``` python
def calculate_discount(price, percentage):
    return price - (price * percentage / 100)
```

And you get back something like this:

**Overview**

Calculates the final price after applying a percentage discount.

**Parameters**

**Returns**

The discounted price as a float

**Example**

calculate_discount(100, 20) → 80.0

Deploying to AWS Lambda for the first time was intimidating. I kept running into CORS errors and IAM permission issues. But once it clicked, it clicked. The free tier covers everything for a small tool like this.

The biggest lesson: ship early. I spent too long trying to make it perfect before anyone had even used it. The first version was rough. That's fine.

I'm working on adding usage tracking and eventually a paid tier for teams who want unlimited documentation. If you're interested in following along, I'm building this in public.

Try legacydoc at [https://legacydoc.io](https://legacydoc.io) and let me know what you think in the comments.
