agentleFS
mauroepcemauroepce/claude-workspace/skills/architecture/SKILL.md

architecture

Skill1 starsChanged 3 months agoMITView on GitHub

Scan a codebase and produce a structured architecture-map.md — stack, directory structure, database schema, API routes, auth flow, external integrations, and the 5-10 most critical files. Use when joining an unfamiliar repo or when re-loading context on your own project after months of absence (e.g., interview prep).

136 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use intelligent-routing, bash-linux and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • SKB3002Skill

    intelligent-routing

    Automatic agent selection and intelligent task routing. Analyzes user requests and automatically selects the best specialist agent(s) without requiring explicit user mentions.

    Also in 6 projects that use this

  • xenitV1Skill

    bash-linux

    Bash/Linux terminal patterns. Critical commands, piping, error handling, scripting. Use when working on macOS or Linux systems.

    Also in 8 projects that use this

  • xenitV1Skill

    red-team-tactics

    Red team tactics principles based on MITRE ATT&CK. Attack phases, detection evasion, reporting.

    Also in 8 projects that use this

  • SKB3002Skill

    nextjs-react-expert

    React and Next.js performance optimization from Vercel Engineering. Use when building React components, optimizing performance, eliminating waterfalls, reducing bundle size, reviewing code for performance issues, or implementing server/client-side optimizations.

    Also in 3 projects that use this

  • +8 more from xenitV1

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 3 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 118 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run, in parallel where possible:

    line 15
  2. Very specific:

    Read imports across src/ to find third-party services:

    line 107
  3. Very specific:

    Write the file in this exact format.

    line 133
  4. Distinctive:

    Don't fabricate. If you couldn't detect something from the code, mark it as TBD.

    line 224
  5. Distinctive:

    Don't write a 30-page wall of text.

    line 225
  6. Very specific:

    Don't overwrite an existing architecture-map.md without warning.

    line 226
  7. Very specific:

    Don't try to interpret WHY decisions were made — that's /decision's job.

    line 227
  8. Very specific:

    Don't add Co-Authored-By: Claude to the file.

    line 228

“Common” is measured: kept by at least 6 in 10 of the 118 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/architecture-map — Codebase architecture cheat sheet

You are Claude. The user wants a structured map of an entire codebase so they can re-load context fast or hand it to someone else (interviewer, new team member).

This is the "30,000-foot view" deliverable, complementing /conventions (which captures style patterns) — together they give you both what the code looks like (conventions) and what the code does (architecture).

Argument (optional): $ARGUMENTS may be an output path like .claude/architecture-map.md. If empty, default to .claude/architecture-map.md.

Phase 1 — Detect project shape

Run, in parallel where possible:

# Project root identification
test -f package.json && echo "node project"
test -f Cargo.toml && echo "rust project"
test -f pyproject.toml && echo "python project"
test -f go.mod && echo "go project"

# Directory tree (depth 3, skip noise)
tree -L 3 -I 'node_modules|.next|.git|.swc|dist|build|target|__pycache__|.venv' . 2>/dev/null | head -60

# Stack signal
test -f package.json && cat package.json | jq '{name, version, dependencies: (.dependencies // {}), scripts: (.scripts // {})}'
test -f tsconfig.json && cat tsconfig.json | jq '.compilerOptions | {target, module, strict, paths}'

Phase 2 — Detect tech stack details

Based on what's in the dependencies (or equivalent), enrich:

Signal in depsInfer
nextFramework: Next.js + likely TypeScript
@supabase/supabase-jsDB: Supabase (Postgres + Auth + Storage)
prisma, @prisma/clientORM: Prisma + likely Postgres
drizzle-ormORM: Drizzle
@nestjs/commonFramework: NestJS
express, fastify, honoBackend framework
react-native, expoMobile: React Native
react-hook-form + zodForms with validation
posthog-js, @posthog/nodeAnalytics: PostHog
@lemonsqueezy/lemonsqueezy.jsPayments: Lemon Squeezy
resendEmail: Resend
bullmqQueues: BullMQ + Redis
vitest, jestTesting

Be honest about uncertainty: if you can't tell from deps alone, mark it as "TBD — verify by reading [file]".

Phase 3 — Detect database schema

In order, check for:

  1. Prisma: schema.prisma → read models
  2. Drizzle: **/schema.ts with pgTable / mysqlTable → read tables
  3. Supabase migrations: supabase/migrations/*.sql → read all in chronological order
  4. Raw SQL migrations: migrations/*.sql, db/migrations/, etc.
  5. ORM-less: skip and mark "no schema definition found"

For each table/model, capture:

  • Name
  • Columns (primary key, FKs, important columns only — not exhaustive)
  • Foreign key relationships
  • RLS policies (if Supabase)
  • Indexes (composite ones especially)

Phase 4 — Detect API surface

Find HTTP route definitions:

# Next.js App Router
find src/app -name "route.ts" -o -name "route.tsx" 2>/dev/null | head -20

# Express/Fastify
grep -rn "app\.\(get\|post\|put\|delete\|patch\)" src/ 2>/dev/null | head -20

# NestJS controllers
grep -rln "@Controller(" src/ 2>/dev/null | head -10

For each route found, capture the HTTP verb, path, and a 1-line description of what it does (from comments, function name, or inferring from code).

Phase 5 — Detect auth pattern

Look for:

grep -rn "createServerClient\|createBrowserClient\|signInWithPassword\|signInWithOAuth" src/ 2>/dev/null | head -10
grep -rn "JsonWebToken\|jsonwebtoken\|jwt\." src/ 2>/dev/null | head -10
grep -rn "passport\|@nestjs/passport" src/ 2>/dev/null | head -10

Identify the pattern:

  • Supabase Auth (PKCE? OAuth providers?)
  • NextAuth / Auth.js
  • Custom JWT
  • Passport (Express/Nest)
  • None / public

Phase 6 — Detect external integrations

Read imports across src/ to find third-party services:

grep -rh "^import.*from \"[^@.]" src/ 2>/dev/null | sed 's/.*from "\([^"]*\)".*/\1/' | sort -u | head -30

Filter to known service integrations (Lemon Squeezy, Stripe, Resend, PostHog, Telegram, Twilio, AWS, GCP, etc.). For each, note where it's used (which file).

Phase 7 — Identify 5-10 critical files

These are files the user will reference often when explaining the system. Pick based on:

  • Auth handler (most often lib/auth.ts or app/auth/route.ts)
  • Payment webhook handler (often app/api/webhooks/[provider]/route.ts)
  • Core business logic (often lib/calculations.ts, services/, or a domain-specific name)
  • Database client wrapper (often lib/db.ts or lib/supabase.ts)
  • Email/notification dispatchers
  • Main layout / providers tree (app/layout.tsx)
  • Main config file (next.config, vercel.json, etc.)

For each, provide:

  • Path
  • 1-sentence description
  • Why it's critical (what would break if you got it wrong)

Phase 8 — Build the output

Write the file in this exact format. Use <placeholder> only where info is genuinely uncertain — never fabricate.

# Architecture map — <project name>

*Generated by `/architecture-map` on <date>. Re-run when the codebase changes substantially.*

## 1. Elevator pitch (2 sentences)

<inferred from package.json description, README, and code structure — be conservative>

## 2. Tech stack

| Capa | Tecnología | Versión | Source of truth |
|---|---|---|---|
| <as detected> | <as detected> | <from package.json> | <file where it lives> |

## 3. Directory structure

\`\`\`
<tree output>
\`\`\`

### Carpetas clave
- `<dir>` → <what lives here>
- ...

## 4. Database

### Tables
- **`<table>`** — <one-line purpose>
  - Columns: <key cols>
  - FKs: <relationships>
  - Indexes: <composite ones>
  - RLS: <yes/no, brief>

### Schema decisions worth noting
- <inferred patterns>

## 5. API surface

| Method | Path | Purpose |
|---|---|---|
| <as found> | <as found> | <as inferred> |

## 6. Auth

**Pattern:** <detected pattern>
**Flow (high level):** <inferred steps>
**Critical file:** <path>

## 7. External integrations

| Service | Used in | Purpose |
|---|---|---|
| <as detected> | <file path> | <purpose> |

## 8. Los 5-10 archivos críticos

| # | Path | Por qué importa |
|---|---|---|
| 1 | <path> | <reason> |
| ... | ... | ... |

## 9. ⚠️ Cosas que NO pude verificar desde el código

> Estos huecos requieren tu memoria o experiencia con el proyecto. Llenalos manualmente.

- <list items where you marked TBD>
- ...

## 10. Cosas que sugiero releer ANTES de una entrevista o handoff

- <list of files that would benefit from deeper familiarity>
- ...

Phase 9 — Save + hand off

Save to the path provided in $ARGUMENTS or default .claude/architecture-map.md.

Output:

"Architecture map saved to <path>. Reviewed: <N> files, <M> tables, <K> API routes detected.

Honest gaps (marked in section 9): <X> items where the code didn't tell me enough — you'll need to fill those from memory.

Want me to also run /conventions so you have both the architecture (what the code DOES) and the conventions (what it LOOKS LIKE)?"

What NOT to do

  • Don't fabricate. If you couldn't detect something from the code, mark it as TBD.
  • Don't write a 30-page wall of text. Keep each section tight — this is a cheat sheet, not documentation.
  • Don't overwrite an existing architecture-map.md without warning. If it exists, ask "overwrite, or save as architecture-map.v2.md?"
  • Don't try to interpret WHY decisions were made — that's /decision's job. This command only captures WHAT exists.
  • Don't add Co-Authored-By: Claude to the file.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.