/asser-toolkit:index-repo [--tools claude,codex,copilot,cursor,windsurf,gemini,all] [--benchmark] [--subdirs]from asser-toolkit
Generate universal LLM index files for efficient AI-assisted codebase navigation across all major tools (Claude Code, Codex, Copilot, Cursor, Windsurf, Gemini CLI)
Ships in asser-toolkit. 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.
Optionally generates a benchmark to quantify indexing effectiveness.
Parse $ARGUMENTS for these flags: - `--tools `: Comma-separated tool targets. Options: claude, codex, copilot, cursor, windsurf, gemini, all. Default: claude,codex - `--benchmark`: Generate benchmark questions and estimated efficiency scores - `--subdirs`: Generate per-module subdirectory indexes in `.llm-index/modules/` - `--size `: Override auto-detected size tier (small, medium, large, huge) - `--merge`: Auto-merge with existing config files (no user prompt) - `--force`: Overwrite existing config files (no user prompt) - `--target `: Target repo path. Default: current working directoryIf no arguments, use defaults: --tools claude,codex, auto-detect size, prompt on conflicts.
TARGET_DIR = $ARGUMENTS --target value, or current working directory
Run Bash:
cd "$TARGET_DIR"
# Count source files (exclude node_modules, vendor, dist, build, .git, __pycache__, .next, .nuxt)
find . -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" -o -name "*.vue" -o -name "*.py" -o -name "*.rs" -o -name "*.go" -o -name "*.java" -o -name "*.kt" -o -name "*.swift" -o -name "*.rb" -o -name "*.php" -o -name "*.cs" -o -name "*.cpp" -o -name "*.c" -o -name "*.h" \) \
-not -path "*/node_modules/*" -not -path "*/vendor/*" -not -path "*/dist/*" \
-not -path "*/build/*" -not -path "*/.git/*" -not -path "*/__pycache__/*" \
-not -path "*/.next/*" -not -path "*/.nuxt/*" -not -path "*/generated/*" \
| wc -l
# Count LOC
find . -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" -o -name "*.vue" -o -name "*.py" -o -name "*.rs" -o -name "*.go" \) \
-not -path "*/node_modules/*" -not -path "*/vendor/*" -not -path "*/dist/*" \
-not -path "*/build/*" -not -path "*/.git/*" \
-exec cat {} + 2>/dev/null | wc -l
| Tier | Source Files | Strategy |
|---|---|---|
| Small | <30 | All symbols, flat table, no subdirs |
| Medium | 30-300 | Top 10 concepts, module indexes if --subdirs |
| Large | 300-2000 | Parallel Agent scanning, top 20 concepts |
| Huge | >2000 | Entry points only, module stubs |
Override with --size flag if provided.
Read these files (whichever exist): package.json, Cargo.toml, go.mod, pyproject.toml, pom.xml, build.gradle, Makefile. Determine: primary language, framework, package manager, build/test/lint commands.
Check for: pnpm-workspace.yaml, rush.json, lerna.json, nx.json, Cargo.toml [workspace], go.work. If found, enumerate workspace packages.
Glob for: CLAUDE.md, AGENTS.md, GEMINI.md, .cursor/rules/.mdc, .github/copilot-instructions.md, .windsurf/rules/.md. If found and neither --merge nor --force:
## LLM Index section to existing files.
If --force: will overwrite.Report findings to user before proceeding.
TypeScript/JavaScript repos:
Python repos:
Rust repos:
Go repos:
Use Grep to find exports. For each exported symbol, record:
TypeScript/JavaScript patterns:
Grep: ^export\s+(function|class|const|type|interface|enum|default)
Grep: ^export\s+\{ (re-exports from barrel files)
For barrel files (index.ts), follow re-exports to find actual source files.
Python patterns:
Grep: ^(def|class|async def)\s+\w+ in __init__.py or files listed in __all__
Rust patterns:
Grep: ^pub\s+(fn|struct|enum|trait|type|const|mod)
Go patterns:
Grep: ^func\s+[A-Z] or ^type\s+[A-Z] (exported = capitalized)
Cap extraction:
Single-package repos: each immediate subdirectory under src/ = one module. Monorepos: each workspace package = one module.
For each module, record:
Group symbols into concepts using these rules (in priority order):
Each concept gets:
Sort concepts by importance: entry-point concepts first, then by export count descending.
Grep for patterns to detect conventions:
createXxx, defineXxx, buildXxx@injectable, provide/inject, ServiceKeyRecord top 5 patterns found.
.llm-index/INDEX.mdThis is the CORE artifact. Use this template:
# Repository Index
> Auto-generated by /index-repo on {DATE}.
> Concept-to-file lookup for LLM-assisted development.
> Regenerate after major refactors: `/index-repo`
## Quick Reference
| Command | Purpose |
|---------|---------|
| `{build_cmd}` | Build |
| `{test_cmd}` | Run tests |
| `{lint_cmd}` | Lint |
| `{dev_cmd}` | Dev server |
## Architecture
{ASCII_DIAGRAM — 10-20 lines showing module/layer structure}
{LAYER_RULE — e.g., "Dependency direction: L4 -> L2 -> L1 -> L0, never upward"}
## Concept Index
### {ConceptName}
> {one-line description}
| Symbol | Kind | Location | Signature |
|--------|------|----------|-----------|
| `{name}` | {kind} | `{file}:{line}` | `{signature}` |
{repeat for each concept}
## Entry Points
| Entry | File | Purpose |
|-------|------|---------|
| {name} | `{path}` | {description} |
## Module Map
| Module | Path | Exports | Depends On |
|--------|------|---------|------------|
| {name} | `{dir}/` | {count} | {deps} |
## Key Patterns
- **{pattern}**: {one-line explanation}
Constraints:
.llm-index/ARCHITECTURE.md (~80-120 lines)Module dependency graph, data flow diagrams, layer rules, key design decisions. Only generated for medium+ repos.
.llm-index/API-SURFACE.md (~100-200 lines)Every public export with full type signature, grouped by module. Only generated for medium+ repos.
Each wrapper is intentionally thin (30-60 lines). It provides:
.llm-index/INDEX.md for detailed navigationThis is the emerging cross-tool standard (Codex, Gemini CLI, Zed read this).
# {repo-name}
## Overview
{1-2 sentence description}
## Commands
- Build: `{build_cmd}`
- Test: `{test_cmd}`
- Lint: `{lint_cmd}`
## Architecture
{3-5 line summary}
## Navigation
For concept-to-file lookup: see `.llm-index/INDEX.md`
For architecture details: see `.llm-index/ARCHITECTURE.md`
For full API surface: see `.llm-index/API-SURFACE.md`
## Conventions
{3-5 key coding conventions}
If existing CLAUDE.md found:
## LLM Index section at the endClaude Code auto-loads this file. Include slightly more inline content than AGENTS.md:
# CLAUDE.md
## Overview
{description}
## Commands
{build/test/lint in code blocks}
## Architecture
{inline ASCII diagram, 15-20 lines}
## Key Patterns
{top 5 patterns, inline}
## LLM Index
Concept-to-file lookup: `.llm-index/INDEX.md`
Full API: `.llm-index/API-SURFACE.md`
Architecture: `.llm-index/ARCHITECTURE.md`
GEMINI.md: Same structure as AGENTS.md.
.cursor/rules/llm-index.mdc:
---
description: Codebase index for navigation
globs: "**/*"
alwaysApply: true
---
# {repo-name} Index
{commands}
For concept-to-file lookup: .llm-index/INDEX.md
.github/copilot-instructions.md: Standard Copilot format, similar to AGENTS.md.
.windsurf/rules/llm-index.md: Standard Windsurf format, similar to AGENTS.md.
Triggered by: --subdirs flag, or automatically for large/huge repos.
For each detected module, create .llm-index/modules/{module-name}.md:
# Module: {name}
> {one-line purpose}
## Exports
| Symbol | Kind | Line | Signature |
|--------|------|------|-----------|
{all exports from this module}
## Internal Structure
{directory tree, 5-10 lines}
## Dependencies
- Depends on: {list}
- Used by: {list}
## Key Files
| File | Purpose |
|------|---------|
{3-5 most important files in the module}
Triggered by: --benchmark flag.
Auto-generate 12-15 questions based on Phase 1 findings:
Easy (5 questions) — answerable from INDEX.md alone:
Medium (5 questions) — INDEX.md + 1 file read:
Hard (2-5 questions) — cross-file reasoning:
For each question, estimate:
.llm-index/benchmark/questions.json:
{
"repo": "{repo-name}",
"generated": "{DATE}",
"questions": [
{
"id": "E1",
"difficulty": "easy",
"question": "What file contains the GraphModel interface?",
"gold_answer": "src/core/model/types.ts",
"gold_line": 125,
"verification": "exact_file_match",
"estimated_tools_without_index": 2,
"estimated_tools_with_index": 1
}
]
}
.llm-index/benchmark/BENCHMARK-RESULTS.md:
# Index Benchmark Results
## Methodology
**Efficiency Score** = sum(tools_without) / sum(tools_with)
- Score > 2.0 = significant improvement
- Score > 3.0 = excellent
## Estimated Results
| ID | Difficulty | Question | Without | With | Savings |
|----|-----------|----------|---------|------|---------|
| E1 | Easy | What file contains GraphModel? | 2 | 1 | 50% |
{all questions}
**Overall Efficiency Score: {score}x**
## Manual Verification Protocol
To verify with actual LLM sessions:
1. Rename `.llm-index/` to `.llm-index.bak/` and hide wrapper files
2. Open a fresh LLM session in this repo
3. Ask each question from questions.json, record actual tool calls used
4. Restore `.llm-index/` and wrapper files
5. Open a new fresh LLM session
6. Ask the same questions, record tool calls
7. Compare: actual_without / actual_with = measured efficiency score
After all phases complete, report to user:
/index-repo after major refactors"Suggest adding to .gitignore (uncommitted tool-specific files):
# Uncomment tools your team doesn't use:
# .cursor/rules/llm-index.mdc
# .windsurf/rules/llm-index.md
# GEMINI.md
Recommend committing: .llm-index/, AGENTS.md, CLAUDE.md
<success_criteria>
.llm-index/INDEX.md generated with at least 5 conceptsAGENTS.md generated (always)What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (asserhong/asser-toolkit) — no native marketplace selected
npx claudepluginhub p/asserhong-asser-toolkitOther plugins' skills for the same job
4 skills in this plugin
/excalidraw-diagram-generatorGenerate Excalidraw diagrams from natural language descriptions. Use when asked to "create a diagram", "make a flowchart", "visualize a process", "draw a system architecture", "create a mind map", or "generate an Excalidraw file". Supports flowcharts, relationship diagrams, mind maps, and system architecture diagrams. Outputs .excalidraw JSON files that can be opened directly in Excalidraw./self-checkVerify AI output for hallucinations using MARCH-inspired multi-agent checking with information asymmetry/skill-storeBrowse, search, and install community skills from alirezarezvani/claude-skills. Use when you need new capabilities like engineering workflows, marketing automation, project management, compliance frameworks, or any specialized agent skill.