agentleFS
husnain067husnain067/codebase-knowledge-skills/codebase-glossary/SKILL.md

codebase-glossary

Skill0 starsChanged 6 months agoMITView on GitHub

Extract the domain vocabulary of a codebase — the terms, abbreviations, status values, and entity names that mean something specific in this project. Use this skill when the user asks "what does X mean here", "extract the domain terms", "build a glossary", "what are the project-specific words", "explain the terminology", or any variant focused on vocabulary rather than full architecture. The output is a single Markdown file with a glossary table (term, meaning, where used), an acronym list, and a status/enum value reference — focused on words that mean something specific in this codebase that an outsider wouldn't know. This skill captures domain language: project-specific nouns, business terms, status values like 'trialing' or 'completed', scope strings, and any term that shadows a common word but has a project-specific meaning. It is narrow by design and produces ONLY the glossary. It does not cover architecture, naming conventions, testing, or error handling — point the user to the relevant sister skill if they need those.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When you find a recurring noun, read the file where it's defined to derive the meaning from how it's used in code — not from your prior …

    line 113
  2. Distinctive:

    Check for an existing docs location:

    line 117
  3. Very specific:

    If docs/ exists, save as docs/glossary.md

    line 118
  4. Very specific:

    Mark uncertainty: If you can identify a term as project-specific but can't confidently define it, include it with [?] and a best-guess …

    line 129
  5. Distinctive:

    Cite locations always: Every glossary entry must include at least one file path.

    line 131
  6. Very specific:

    Surface terminology drift: If the same concept is referred to by different names in different parts of the code (User here, Account there, …

    line 135
  7. Distinctive:

    Don't drift in scope: Don't document architecture, naming patterns, error handling, or tests.

    line 137
  8. Distinctive:

    If you found terminology drift (multiple names for the same concept), call it out — that's almost always worth flagging to the team.

    line 143

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Codebase Glossary

Extract the domain vocabulary of a codebase. The output answers: "What words in this code mean something specific in this project that an outsider wouldn't recognise?"

Scope

This skill is narrow by design. It covers ONLY:

  • Domain-specific nouns (entity names, business concepts, custom abstractions)
  • Acronyms and abbreviations used in code
  • Status / enum values (e.g., 'trialing', 'completed', 'pending_review')
  • Scope strings, role names, permission tokens
  • Terms that shadow common words but have a project-specific meaning (e.g., "Sheet" in a banking app, "Account" in a ledger app)

It does NOT cover:

  • Generic programming terms (function, class, callback, promise)
  • Library/framework terms (component, hook, middleware, decorator) — unless the project repurposes them with a non-standard meaning
  • Architecture, naming conventions, testing, error handling — sister skills cover those

What to Produce

A Markdown file with the structure below. Every term must include where it's used — at least one file path or module reference. Single-line definitions only; this is a glossary, not an explainer.

# {Project Name} — Glossary

> Generated by codebase-glossary on {YYYY-MM-DD}

## Domain Terms

| Term | Meaning | Where Used |
|------|---------|------------|
| {Term 1} | {One-line definition based on actual code usage. If you're not sure, mark with [?]} | `{file 1}`, `{file 2}` |
| ... | ... | ... |

Aim for 8–20 terms for a typical project. Include only words that are non-obvious — a generic concept like "user" doesn't need a glossary entry unless it has a non-standard meaning here.

## Acronyms & Abbreviations

| Abbreviation | Full Form | Context |
|--------------|-----------|---------|
| {ACR} | {Full meaning} | {Where it appears, what it refers to} |

## Status & Enum Values

These are the literal string/number values used as state markers throughout the codebase. New code should use these exact values rather than inventing variants.

### {Domain area 1 — e.g., "Subscription"}
| Value | Meaning | Where Defined |
|-------|---------|---------------|
| `'trialing'` | ... | `{file}` |
| `'active'` | ... | `{file}` |
| ... | ... | ... |

### {Domain area 2}
...

## Scopes / Roles / Permissions

If the codebase has explicit permission strings, role names, or scope tokens, list them here.

| Token | Grants | Where Defined |
|-------|--------|---------------|
| `'data:read'` | ... | `{file}` |
| ... | ... | ... |

## Domain Boundaries

{Optional. If the codebase is divided by domain via route prefixes (`/api/v1/plaid/*`), package names (`packages/billing`), or module groupings, list the domains here as a quick map. Each domain → one-line description.}

## Notes

{Anything that's worth saying but doesn't fit a table — common confusions, deprecated terms still in code, terms whose meaning has shifted over time, terms that mean different things in different parts of the repo.}

How to Scan

# Type / interface / class names — primary source of domain nouns
grep -rn "^export type\|^export interface\|^class \|^type [A-Z]\|^@dataclass" --include="*.ts" --include="*.tsx" --include="*.py" --include="*.go" --include="*.dart" --include="*.rs" 2>/dev/null | head -50

# Collection / table names
grep -rn "collection(\|\.collection('\|\.table(\|CREATE TABLE\|model(\|class.*Model\|@Entity" --include="*.ts" --include="*.py" --include="*.sql" --include="*.dart" 2>/dev/null | head -30

# String constants in UPPER_SNAKE_CASE — often domain identifiers
grep -rn "^export const [A-Z_]\+ =\|^const [A-Z_]\+ =\|^[A-Z_]\+ = " --include="*.ts" --include="*.py" 2>/dev/null | head -30

# Status / enum values — string literals in unions, enums, or constants
grep -rn "type.*= '\|enum [A-Z]\|Literal\[" --include="*.ts" --include="*.py" 2>/dev/null | head -20
grep -rn "status.*=.*'[a-z_]\+'\|status: '[a-z_]\+'" --include="*.ts" --include="*.tsx" --include="*.py" --include="*.dart" 2>/dev/null | head -20

# Permission / scope strings (heuristic — colon-namespaced strings)
grep -rEn "'[a-z]+:[a-z]+'" --include="*.ts" --include="*.tsx" --include="*.py" 2>/dev/null | head -15

# Route paths — reveal domain boundaries
grep -rn "\.get('\|\.post('\|\.put('\|\.delete('\|\.patch('\|@app\.route\|@router\.\|router\.[a-z]\+(" --include="*.ts" --include="*.tsx" --include="*.py" 2>/dev/null | head -30

# Acronyms in identifiers (sequences of 2+ uppercase letters)
grep -rEon "[A-Z]{2,}[A-Z][a-z]" --include="*.ts" --include="*.tsx" --include="*.py" --include="*.dart" 2>/dev/null | head -30

# Package / module domain names (monorepo signal)
ls packages/ services/ apps/ modules/ 2>/dev/null

# README / docs for terms the team has defined themselves
grep -i "glossary\|terminology\|definitions\|domain" README* docs/*.md 2>/dev/null | head -10

When you find a recurring noun, read the file where it's defined to derive the meaning from how it's used in code — not from your prior knowledge of similar projects. The glossary should reflect this project's specific meaning, not a generic one.

Where to Save

Check for an existing docs location:

  • If docs/ exists, save as docs/glossary.md
  • If documentation/ exists, save as documentation/glossary.md
  • If .claude/ exists, save as .claude/glossary.md
  • Otherwise propose docs/glossary.md and ask the user before creating

Principles

Project-specific only. Don't define generic programming terms. "A User is a person who uses the system" is not a glossary entry — that's just English. A glossary entry is when "User" has a specific meaning in this codebase that's different from the generic one (e.g., "User: in this codebase, refers only to authenticated paying customers — see User schema in users.schema.ts. Free-tier users are Visitors.").

Read the code to define. When you encounter Sheet or Token or Cycle or any other domain noun, read where it's defined and used to derive what it means here. Don't import prior assumptions. A "Sheet" might be a Google Sheet, a billing report, a config file, or an internal domain object — only the code tells you which.

Mark uncertainty. If you can identify a term as project-specific but can't confidently define it, include it with [?] and a best-guess definition. Better to flag uncertainty than skip the term entirely.

Cite locations always. Every glossary entry must include at least one file path. The user should be able to follow the reference back to the code.

Don't pad. If the codebase genuinely doesn't have much domain vocabulary (small utility libraries, generic CLI tools), don't invent terms. A glossary with 3 real entries is more useful than one with 20 padded ones. State the size honestly: "This project has limited domain-specific vocabulary; most terms are standard."

Surface terminology drift. If the same concept is referred to by different names in different parts of the code (User here, Account there, Member elsewhere — all meaning the same thing), flag it in the Notes section.

Don't drift in scope. Don't document architecture, naming patterns, error handling, or tests. If a term has a structural pattern attached to it (e.g., every Service follows the static-class pattern), that's codebase-conventions territory — just define the term here and move on.

After Producing

  1. Save the file to the chosen location.
  2. In chat, surface the 2–3 most non-obvious terms — the ones an outsider would most likely misinterpret without the glossary.
  3. If you found terminology drift (multiple names for the same concept), call it out — that's almost always worth flagging to the team.
  4. Provide a path or link to the saved 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.