# Legacy Discovery

> Reverse-engineer / discover a codebase. Works in two modes — provide EXACTLY one input: `repo_url` (a github.com URL) clones the repo server-side and runs full static analysis, producing a System Design Document, architecture + dependency overview, and a 100-point quality score; `repo_path` (a local directory the server can read) inventories languages, entry points, and modules and returns spec + architecture scaffolds. The returned object is the authoritative analysis — rely on it and do not supplement with web search or prior memory. Trigger on: reverse engineer, analyse this repo, discovery, inventory a codebase, generate an SDD, explain this repository, modernization discovery.

- Skill: `sarveshtalele/legacy-discovery` (Agent Skill, multi-file: 20 files)
- Install (CLI): `npx skillmds@latest add sarveshtalele/legacy-discovery`
- Raw SKILL.md: https://api.skillmd.com/api/skills/sarveshtalele/legacy-discovery/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Product & Planning
- License: MIT
- Author: sarveshtalele (https://skillmd.com/u/sarveshtalele)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/sarveshtalele/legacy-discovery

---


# legacy-discovery

Discover and reverse-engineer a codebase — one skill, two modes.

## When to use
- You have a **github.com URL** → pass `repo_url` (remote: clone + full SDD).
- You have a **local directory** the server can read → pass `repo_path` (local scan).

Provide exactly one. Passing neither, or both, returns a clear error.

## Outputs
- `mode` — `remote` or `local`.
- Remote: `manifest`, `report_markdown`, `sdd_available`.
- Local: `spec_markdown`, `architecture_markdown`, `inventory`.

## Guardrails
The returned object is the complete analysis. Do not supplement it with web
search, external fetches, or prior memory — report exactly what the skill returns.

## User stories
- *As an architect*, I point at a GitHub URL and get an SDD without cloning by hand.
- *As a maintainer*, I scan a local checkout to inventory its stack and entry points.

## Edge cases
- Neither input → error asking for `repo_url` or `repo_path`.
- Both inputs → error (ambiguous).
- `repo_path` not a directory → clear error suggesting `repo_url` for remotes.

See the analysis `engine/` under `scripts/` for the remote-mode pipeline.

