/claude-leverage:glossary-init [--top N] [--lang python|typescript|go|rust|auto] [--add term] [--noninteractive]from claude-leverage
Bootstraps or extends a repo's GLOSSARY.md by surfacing candidate domain terms from identifier frequency and asking the user for definitions. Idempotent; never invents meanings.
Ships in claude-leverage. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Bootstraps (or extends) GLOSSARY.md at the repo root — a human-curated
dictionary of domain terms specific to this repo. One entry per term:
1–2 sentence definition, optional aliases, optional code-path pointers.
The point: the next agent opening this repo greps GLOSSARY.md once
and stops hallucinating that "Lead" means a sales prospect when here
it means a journalist's article lead. Reading source to recover
domain meaning per session is O(N) tokens per term; a one-line glossary
entry is O(1).
This skill surfaces candidate terms (by frequency of identifier appearance in tracked code). It never invents definitions — the user types them, the skill structures the file. See ADR 0005 for the rationale.
/init-repo).Lead is a sales prospect" — no, it's a
journalist's article).Do NOT invoke for:
Resolve repo root. git rev-parse --show-toplevel. If not in a
git repo, STOP and report: "glossary needs a tracked repo; git init first or run /init-repo".
Detect mode.
GLOSSARY.md does not exist at root → bootstrap mode.GLOSSARY.md exists and $ARGUMENTS includes --add <term> →
single-add mode (skip candidate ranking, jump to step 6 for
that one term).GLOSSARY.md exists and no --add → extend mode: surface
candidates that aren't already in the existing file, propose
additions.Detect primary language by file extension counts in tracked
files (git ls-files | head -2000):
.py → Python.ts / .tsx / .js / .jsx → TypeScript / JavaScript.go → Go.rs → Rust--lang.Walk identifiers. From git ls-files (skip generated paths,
tests, vendor, node_modules, __pycache__, dist, build,
.git, bench/), extract identifiers via language-aware patterns:
class\s+([A-Z][A-Za-z0-9_]+) (classes — high signal),
def\s+([a-z_][a-z0-9_]+) (functions — medium signal). Domain
terms are usually classes / type aliases / dataclasses, not
ordinary functions.(?:class|interface|type|enum)\s+([A-Z][A-Za-z0-9_]+).type\s+([A-Z][A-Za-z0-9_]+)\s+(?:struct|interface).(?:struct|enum|trait|type)\s+([A-Z][A-Za-z0-9_]+).Count occurrences across the repo (not just declarations — also usage). The more a term is referenced, the more load-bearing.
Filter and rank. Drop:
BaseModel, Exception, HTTPException, Error,
Request, Response, Client, Config, Settings).Get, Set, Create,
Update, Delete alone).Http, Json, Sql, Db, Aws, Gcp, Azure).Rank remaining by occurrences * log(distinct_files) — terms that
appear in many places AND many files are more central than a term
used 50 times in one file.
Cap candidates at --top N (default 30).
Surface candidates (skip in --add mode):
I found these load-bearing domain terms in <repo>:
1. Tenant (47 refs across 12 files) — e.g. src/auth/tenant.py:14
2. Invoice (38 refs across 8 files) — e.g. src/billing/invoice.py:8
3. Lead (29 refs across 6 files) — e.g. src/content/lead.py:22
...
Pick which to include (numbers separated by spaces, "all", or "skip").
In --noninteractive mode, include the top 15 with <TODO: definition>
placeholders so the user fills them later. Mark such entries with
an HTML comment <!-- claude-leverage:glossary-todo --> so future
runs can spot them.
For each picked term, prompt:
In --noninteractive, fill definition with <TODO> placeholder.
Write GLOSSARY.md.
<!-- claude-leverage:glossary v1 -->
# Glossary
Domain terms specific to this repo. Hand-curated. Update via
`/glossary-init --add <term>` or by editing this file directly.
Read this **before** assuming a term means what it does elsewhere —
domain vocabulary diverges between projects.
## Tenant
A customer organization. One Tenant → many Users. Distinct from
"Account" which is the billing entity.
- Aliases: org, organization
- Code: `src/auth/tenant.py`, `src/billing/account.py`
## Invoice
<definition>
Entries are sorted alphabetically by term (case-insensitive). Each
entry is one H2 + body + optional bullet list. The H1 + intro
paragraph + claude-leverage:glossary v1 marker are written exactly
once on bootstrap; subsequent runs preserve them.
Update AGENTS.md (idempotent, ask before write). If
AGENTS.md exists at root and doesn't already mention GLOSSARY.md,
offer to append a one-line pointer at the end of the "Code
conventions" section:
### Domain glossary
Domain terms specific to this repo live in [`GLOSSARY.md`](GLOSSARY.md).
**Grep there before assuming** what a term means — domain vocabulary
diverges between projects.
Skip if --no-update-agents-md is passed.
Report. Print the new path, count of entries added, count of
<TODO> placeholders remaining. Remind the user that ranking is
just a starting point; entries can be added by hand or via
--add <term> at any time.
<TODO> placeholders
(--noninteractive). LLM-generated definitions are exactly the
problem this skill exists to prevent — see ADR 0005.GLOSSARY.md by hand.<!-- claude-leverage:glossary v1 --> is load-bearing — future
versions of this skill use it to detect format.--top N — surface top N candidates (default 30, hard cap 100).--lang python|typescript|go|rust|auto — language to scan (default
auto-detect by file count). auto runs all detected.--add <term> — skip candidate ranking; add this single term
interactively. Useful when you notice a missing term mid-session.--noninteractive — write top 15 candidates with <TODO>
placeholders for definitions; no prompts.--no-update-agents-md — skip the AGENTS.md pointer step.--target <path> — non-default file location (default
<repo-root>/GLOSSARY.md).Same SKILL.md ships in Codex via scripts/install-codex.sh. The Codex
host reads identifiers the same way and writes the same
GLOSSARY.md format. No tool-specific divergence.
/stack-check could be extended to validate GLOSSARY.md against
the v1 marker, flag entries with <TODO> placeholders, and warn on
entries whose Code: paths no longer exist. Tracked as a future
enhancement, not part of this skill./init-repo could prompt for glossary bootstrap on first run for
domain-heavy projects. Future enhancement.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
16 skills in this plugin
/adr-newUSE WHEN a load-bearing architectural decision is being made in conversation (database / framework / auth model / integration choice, or explicit rejection of an alternative) — one likely to be re-litigated in 6 months without the rationale. Bootstraps a numbered MADR ADR in `docs/adr/`, asks for context + decision + alternatives, updates the index. Immutable status once accepted. See `docs/adr/README.md` for the convention; full Do/Don't list in this SKILL body.
/arch-mapUSE WHEN setting up a repo for AI-first work, after a major directory restructure, or when an agent needs structured answers like "which modules are stable?" / "what's the public surface of X?" that the prose AGENTS.md doesn't give cheaply. Bootstraps or refreshes `architecture.yml` at repo root — machine-readable module metadata (path / role / stability / public_surface / depends_on / paired_with / owners). Hand-curated; the skill drafts, the user confirms. See ADR 0005 for why this file lives at root and why YAML over JSON.
/codex-sandboxUSE WHEN setting up Codex CLI in a project, tightening sandbox for prod/CI, or when user asks about Codex permissions. Interactive helper for per-project `.codex/config.toml`: `dev` / `prod` / `custom` profiles, idempotent via markers, preserves unmanaged config below the block. Codex-only artifact.
/conventions-initUSE WHEN setting up a repo for AI-first work (after /init-repo), or when the context-surface hook should start feeding repo conventions to agents before edits. Drafts `conventions.yml` at repo root: per-kind casing (inferred from the code), a vague-name denylist seed, directory roles, and a hand-filled house-rules block. Idempotent — never overwrites a populated file; re-running prints suggested additions for manual merge. Read-only on code; never invents house rules. After writing, run /refresh-context-map so the hook picks it up.
/dynamic-checkUSE WHEN the user explicitly asks to verify that this repo's DECLARED build/test/lint commands actually run ("does the quickstart work?", "validate the commands in AGENTS.md"), typically after /repo-doctor or /repo-doctor --semantic raised suspicion. Executes only commands the repo itself declares (AGENTS.md build/test blocks, README quickstart), with preview + explicit confirmation, denylist tripwire, and timeouts. Advisory — results never enter /repo-doctor's deterministic score (ADR 0012/0013). Opt-in by invocation; never fired by hooks or other skills.
/explain-diffUSE WHEN about to open a PR, when teammate asks "what's in this diff?", or when returning to a branch and needing self-orientation. Three modes: `--for pr|review|self`. Reads `git diff HEAD` (or passed range), returns 3–5 bullet plain-English narration. Read-only — defers security/test concerns to other skills.
npx claudepluginhub filip-podstavec/claude-leverage --plugin claude-leverageOther plugins' skills for the same job