Codebase Audit & Roadmap
When a user names a project and asks "what's in it" / "what's next" / "make a PRD" / "audit this" — this skill covers the full discovery-to-plan workflow.
When to Use
- User says "check this repo" or "audit this project"
- User names a project and asks for a feature summary or to "make a PRD"
- User asks for a gap analysis before a launch/rebuild
- User references a project you haven't encountered before and needs structured analysis
Workflow
Phase 1 — Locate the Project
- Ask / clarify what they mean — get a name, repo URL, or GitHub handle
- Search locally:
find ~ -maxdepth 4 -name ".git" -type d
- Search GitHub: use web_search with
site:github.com <handle> patterns. Try known handles (S3YED, weblyfe, etc.)
- Try multi-case variations — the exact case matters on GitHub. If user says "wai", search
S3YED/wai, s3yed/WAI, etc.
- Clone private repos via SSH if SSH key is configured (
ssh -T git@github.com to verify)
- Fallback: ask for the exact URL if web search fails
Phase 2 — Codebase Analysis (Systematic)
Read in this order, top to bottom:
- README.md — overall purpose, features, stack, setup
- AGENTS.md / CLAUDE.md / SKILL.md — project-specific instructions for agents
- package.json — dependencies, build scripts, test commands (run
npm ls 2>/dev/null | head)
- Git log —
git log --oneline -10 --all — recent activity, branch structure
- Project structure —
find src -maxdepth 2 -type d | sort, or list top-level files
- Key feature files — read every component/API/hook file systematically:
api/*.ts — serverless endpoints (feature surface)
components/*.tsx — UI screens (feature surface)
utils/*.ts — shared logic
hooks/*.ts — custom hooks
migrations/*.sql — DB schema
- Types/interfaces — the data model tells you the domain
- Tests —
npm test or vitest run — test coverage is a health signal
- Docs/ directory — PRDs, architecture docs, integration guides
- Existing PRDs (
docs/*PRD*.md, docs/*PLAN*.md) — read first to compare intent vs reality
Phase 3 — Deployment Audit (SaaS projects)
For Vercel-deployed apps:
cd <project> && vercel link --yes to link the local clone to Vercel
- Read
.vercel/project.json for projectId + orgId
- Check deployments:
vercel list --prod or vercel list
- Check env vars:
vercel env ls
- If CLI is limited, use Vercel REST API:
curl -s -H "Authorization: Bearer $VERCEL_TOKEN" \
"https://api.vercel.com/v1/projects/<projectId>/env?teamId=<orgId>"
(Write response to file, parse with python3 to avoid shell quoting issues)
For Supabase projects:
- Look for
SUPABASE_URL in env files or Vercel env
- Check if
migrations/000_base_schema.sql has been run
Phase 4 — Feature Inventory + Gap Analysis
For every feature found, classify:
| Status |
Meaning |
| ✅ Complete |
Fully implemented, tested, wired |
| 🟡 Partial |
Code exists but not wired (e.g. UI component with no trigger, API without route) |
| 🔴 Missing |
Referenced in PRD/docs but no code found |
| ❌ Broken |
Code exists but has known issues (e.g. always-[] state, in-memory-only) |
Build a table with: Feature | Status | File(s) | Notes
Phase 5 — Produce PRD / Build Plan
Structure the output PRD as a markdown document in docs/:
# [Project Name] — [Launch Name] Build Plan
## 1. Current State Assessment
[Feature table from Phase 4]
## 2. [Phase Name — e.g. P2: Voice Notes]
### What already exists
[Code that exists but may not be wired]
### What to build
[Items with file paths, clear deliverables]
## 3. Build Order
Use a priority system:
- **[Phase 1 — Launch-ready]**: P0 items that must work for go-live
- **[Phase 2 — Production Hardening]**: P1 items for reliability/security
- **[Phase 3 — Scale]**: P2 items for multi-tenant scale
- **[Phase 4 — Polish]**: P3 nice-to-haves
## 4. One-Command Vision
[If applicable: describe the ideal provisioning flow]
## 5. Decisions Needed
[Questions for the user/operator]
Save to docs/<PROJECT>-LAUNCH-PLAN.md and present a concise summary in the reply.
Pitfalls
- Don't assume features work just because the code exists. A component may be dead code (no import/trigger). An API may exist but the state that feeds it may never be populated. Always trace the data flow: where is the state set, where is it consumed.
- Demo-mode == broken, not working. If an app silently falls back to fake data when env vars are missing, call it a stability bug, not a feature.
- Rate limiting on serverless is always in-memory until proven otherwise. Vercel cold starts reset in-memory Maps.
- Feature-rich does not mean deployed. A project can have massive feature surface but zero deployments on Vercel.
- Private repos won't show in web search. Try cloning with
git@github.com:<handle>/<repo>.git after verifying SSH auth.
- Shell quoting with env vars containing special chars is fragile. Write Python scripts to files for complex API calls; avoid interpolating env vars directly in shell commands.
- Verbal feature names may not match repo names. "WAI" = WhatsApp Intelligence, not a tool called "wai". Ask for clarification.===ME:codebase-audit-and-roadmap
1---2name: codebase-audit-and-roadmap3description: Audit a codebase from a user reference and produce a structured feature inventory, gap analysis, and build-plan PRD.4license: MIT5---67# Codebase Audit & Roadmap89When a user names a project and asks "what's in it" / "what's next" / "make a PRD" / "audit this" — this skill covers the full discovery-to-plan workflow.1011## When to Use1213- User says "check this repo" or "audit this project"14- User names a project and asks for a feature summary or to "make a PRD"15- User asks for a gap analysis before a launch/rebuild16- User references a project you haven't encountered before and needs structured analysis1718## Workflow1920### Phase 1 — Locate the Project21221. **Ask / clarify what they mean** — get a name, repo URL, or GitHub handle232. **Search locally**: `find ~ -maxdepth 4 -name ".git" -type d`243. **Search GitHub**: use web_search with `site:github.com <handle>` patterns. Try known handles (S3YED, weblyfe, etc.)254. **Try multi-case variations** — the exact case matters on GitHub. If user says "wai", search `S3YED/wai`, `s3yed/WAI`, etc.265. **Clone private repos via SSH** if SSH key is configured (`ssh -T git@github.com` to verify)276. **Fallback**: ask for the exact URL if web search fails2829### Phase 2 — Codebase Analysis (Systematic)3031Read in this order, top to bottom:32331. **README.md** — overall purpose, features, stack, setup342. **AGENTS.md / CLAUDE.md / SKILL.md** — project-specific instructions for agents353. **package.json** — dependencies, build scripts, test commands (run `npm ls 2>/dev/null | head`)364. **Git log** — `git log --oneline -10 --all` — recent activity, branch structure375. **Project structure** — `find src -maxdepth 2 -type d | sort`, or list top-level files386. **Key feature files** — read every component/API/hook file systematically:39 - `api/*.ts` — serverless endpoints (feature surface)40 - `components/*.tsx` — UI screens (feature surface)41 - `utils/*.ts` — shared logic42 - `hooks/*.ts` — custom hooks43 - `migrations/*.sql` — DB schema447. **Types/interfaces** — the data model tells you the domain458. **Tests** — `npm test` or `vitest run` — test coverage is a health signal469. **Docs/ directory** — PRDs, architecture docs, integration guides4710. **Existing PRDs** (`docs/*PRD*.md`, `docs/*PLAN*.md`) — read first to compare intent vs reality4849### Phase 3 — Deployment Audit (SaaS projects)5051For Vercel-deployed apps:52531. `cd <project> && vercel link --yes` to link the local clone to Vercel542. Read `.vercel/project.json` for projectId + orgId553. Check deployments: `vercel list --prod` or `vercel list`564. Check env vars: `vercel env ls`575. If CLI is limited, use Vercel REST API:58 ```59 curl -s -H "Authorization: Bearer $VERCEL_TOKEN" \60 "https://api.vercel.com/v1/projects/<projectId>/env?teamId=<orgId>"61 ```62 (Write response to file, parse with python3 to avoid shell quoting issues)6364For Supabase projects:65- Look for `SUPABASE_URL` in env files or Vercel env66- Check if `migrations/000_base_schema.sql` has been run6768### Phase 4 — Feature Inventory + Gap Analysis6970For every feature found, classify:7172| Status | Meaning |73|---|---|74| ✅ Complete | Fully implemented, tested, wired |75| 🟡 Partial | Code exists but not wired (e.g. UI component with no trigger, API without route) |76| 🔴 Missing | Referenced in PRD/docs but no code found |77| ❌ Broken | Code exists but has known issues (e.g. always-`[]` state, in-memory-only) |7879Build a table with: Feature | Status | File(s) | Notes8081### Phase 5 — Produce PRD / Build Plan8283Structure the output PRD as a markdown document in `docs/`:8485```markdown86# [Project Name] — [Launch Name] Build Plan8788## 1. Current State Assessment8990[Feature table from Phase 4]9192## 2. [Phase Name — e.g. P2: Voice Notes]9394### What already exists95[Code that exists but may not be wired]9697### What to build98[Items with file paths, clear deliverables]99100## 3. Build Order101102Use a priority system:103- **[Phase 1 — Launch-ready]**: P0 items that must work for go-live104- **[Phase 2 — Production Hardening]**: P1 items for reliability/security105- **[Phase 3 — Scale]**: P2 items for multi-tenant scale106- **[Phase 4 — Polish]**: P3 nice-to-haves107108## 4. One-Command Vision109110[If applicable: describe the ideal provisioning flow]111112## 5. Decisions Needed113114[Questions for the user/operator]115```116117Save to `docs/<PROJECT>-LAUNCH-PLAN.md` and present a concise summary in the reply.118119## Pitfalls1201211. **Don't assume features work just because the code exists.** A component may be dead code (no import/trigger). An API may exist but the state that feeds it may never be populated. Always trace the data flow: where is the state set, where is it consumed.1222. **Demo-mode == broken, not working.** If an app silently falls back to fake data when env vars are missing, call it a stability bug, not a feature.1233. **Rate limiting on serverless is always in-memory until proven otherwise.** Vercel cold starts reset in-memory Maps.1244. **Feature-rich does not mean deployed.** A project can have massive feature surface but zero deployments on Vercel.1255. **Private repos won't show in web search.** Try cloning with `git@github.com:<handle>/<repo>.git` after verifying SSH auth.1266. **Shell quoting with env vars containing special chars is fragile.** Write Python scripts to files for complex API calls; avoid interpolating env vars directly in shell commands.1277. **Verbal feature names may not match repo names.** "WAI" = WhatsApp Intelligence, not a tool called "wai". Ask for clarification.===ME:codebase-audit-and-roadmap