The Problem: Undocumented APIs are a Development Bottleneck
The common refrain, "the docs are in the code," is not a sustainable documentation strategy. For backend developers, this reality often translates into hours of manual effort, digging through codebases to understand how services communicate. One developer, frustrated by this inefficiency, decided to build a tool to automate the process.
The catalyst was a new team assignment: adding a feature to a billing service. Upon opening the API documentation, the developer discovered they were outdated, with half the routes rewritten and the other half lacking any documentation. The immediate recourse was to resort to grep commands: grep -r "app.get|app.post|router." src/ --include="*.js". This yielded a disorganized collection of endpoints, some working but undocumented, others documented but non-existent, and alarmingly, an unauthenticated GET /invoices/:id endpoint that had been overlooked for years.
This situation is far too common in software development. Essential internal APIs often lack proper documentation, leading to security risks, development delays, and increased technical debt. The manual process of reverse-engineering these APIs is not only time-consuming but also prone to errors, as critical details like authentication requirements can be missed.
The Solution: A Claude Code Skill for API Discovery
The core idea was to leverage an AI model, specifically Claude, to process the codebase and intelligently extract API endpoints. The goal was to create a "code skill" that could take a codebase as input and output a structured, human-readable representation of its API surface. This means transforming the implicit documentation within the code into explicit, usable documentation.
The developer envisioned a workflow where a single file, or a directory containing the codebase, could be fed into the Claude skill. The AI would then analyze the code, identifying routes defined by common web framework patterns (like app.get, app.post, etc.). Crucially, it would go beyond simply listing endpoints. The skill aims to infer details such as HTTP methods, URL paths, and potentially even request/response structures or middleware usage, although the initial implementation focused on the core endpoint discovery.
Think of it less like a static API specification document and more like a dynamic, intelligent assistant that can read your codebase and tell you exactly what doors and windows exist in your application's architecture, and how they are secured (or not secured).

Building the Claude Skill: Technical Approach
The implementation involved creating a custom tool that acts as a bridge between the developer's codebase and the Claude API. The process typically involves these steps:
- Code Ingestion: The tool takes a path to a codebase (or a specific file) as input.
- Code Chunking: Large codebases are broken down into smaller, manageable chunks that can be sent to Claude without exceeding token limits.
- Prompt Engineering: Carefully crafted prompts are designed to instruct Claude on what to look for. This includes identifying route definitions, HTTP methods, and path parameters. The prompt might look something like: "Analyze the following JavaScript code snippet. Identify all web server routes defined using Express.js (or similar frameworks). For each route, extract the HTTP method (GET, POST, PUT, DELETE, etc.), the URL path, and any path parameters (e.g.,
/:id). Format the output as a JSON object where keys are HTTP methods and values are lists of paths." - API Call: The chunks of code and the prompt are sent to the Claude API.
- Response Parsing: The AI's response, which is ideally structured (e.g., JSON), is parsed to extract the identified API endpoints.
- Aggregation and Output: Results from all code chunks are aggregated to form a comprehensive list of endpoints. This list can then be presented to the user, perhaps as a markdown file or a simple table, effectively serving as living documentation.
The developer highlighted that the "docs are in the code" approach means the code itself becomes the single source of truth. By treating the code as the primary artifact, tools like this Claude skill can automate the process of extracting and presenting that truth in a consumable format. This contrasts with traditional documentation methods that often fall out of sync with the codebase.
Implications and Future Potential
The implications of such a tool are significant for development teams. It directly addresses the pain point of undocumented or outdated APIs, which are a major cause of friction in microservices architectures and complex applications. By automating API discovery, this skill can:
- Improve Developer Onboarding: New team members can quickly understand the available services and their interfaces.
- Enhance Security: Unauthenticated or insecure endpoints, like the one found in the billing service example, can be identified proactively.
- Reduce Development Time: Less time spent on manual reverse-engineering means more time for feature development.
- Maintain Up-to-Date Documentation: As the code evolves, the documentation generated by the skill can be regenerated, ensuring it always reflects the current state of the API.
What nobody has addressed yet is how to integrate this type of AI-driven documentation generation seamlessly into CI/CD pipelines. Automatically generating and validating API documentation on every commit could prevent the very issues this tool aims to solve. Furthermore, extending the skill to infer more complex details, such as authentication schemes (API keys, OAuth tokens), request body schemas, and typical response codes, would significantly increase its value.
The success of this project demonstrates the power of leveraging large language models for practical developer tooling. It moves beyond simple code completion or generation to tackle more complex tasks like code analysis and documentation synthesis. For any team struggling with API sprawl and documentation debt, building or adopting similar tools could be a critical step towards a more efficient and secure development process.
