
Index Knowledge
Regenerate or update a hierarchical AGENTS.md knowledge base so coding agents navigate a repo with complexity-scored subdirectory docs.
Overview
index-knowledge is an agent skill most often used in Build (also Ship review, Operate iterate) that generates a hierarchical AGENTS.md knowledge base with complexity-scored subdirectory documentation.
Install
npx skills add https://github.com/tursodatabase/turso --skill index-knowledgeWhat is this skill?
- Four-phase workflow: Discovery + Analysis, Score & Decide, Generate, Review—with TodoWrite gates marked in_progress to c
- Flags --create-new (wipe and regenerate) and --max-depth (default 5) for controlled AGENTS.md coverage
- Default update mode merges changes; parallel explore agents plus bash structure, LSP codemap, and existing AGENTS.md rea
- Produces root AGENTS.md first, then subdirectory files from complexity scoring
- Review step deduplicates, trims, and validates generated documentation
- Documented 4-phase workflow: Discovery + Analysis, Score & Decide, Generate, Review
- Default --max-depth=5 with optional --create-new full regeneration
- TodoWrite template lists 4 tracked phases with high-priority discovery, scoring, and generate steps
Adoption & trust: 761 installs on skills.sh; 19.1k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your coding agents wander a large repo because there is no structured, depth-aware AGENTS.md map of what matters in each directory.
Who is it for?
Solo builders maintaining agent-first repos who want repeatable AGENTS.md generation with discovery agents, LSP codemap, and review deduplication.
Skip if: One-page hobby scripts with no agent workflow, or teams that only need a human README without AGENTS.md maintenance overhead.
When should I use this skill?
Generate or refresh hierarchical AGENTS.md files for a codebase using parallel discovery, directory complexity scoring, and review deduplication.
What do I get? / Deliverables
You get an updated or fresh AGENTS.md tree (root plus scored subdirs) after a gated four-phase workflow so agents and humans share the same navigable codebase context.
- Root AGENTS.md
- Complexity-scored subdirectory AGENTS.md files
- Reviewed, deduplicated documentation set
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Canonical shelf is Build/agent-tooling because the primary artifact is machine-facing repo documentation for agents, though the same files help onboarding during Ship review and Operate iteration. Agent-tooling fits procedural generation of AGENTS.md trees, parallel explore tasks, and LSP codemap workflows rather than application feature code.
Where it fits
Bootstrap root and nested AGENTS.md after cloning a Turso-adjacent service repo for daily agent edits.
Refresh AGENTS.md before a review sprint so reviewers and agents agree on module boundaries.
Run update mode post-refactor to trim stale subdirectory docs without a full --create-new wipe.
How it compares
Skill-packaged documentation generator for agent context—not a database indexer despite the Turso repo naming.
Common Questions / FAQ
Who is index-knowledge for?
Developers using Claude Code, Cursor, or similar agents who need hierarchical AGENTS.md files maintained with scoring, parallel discovery, and review passes.
When should I use index-knowledge?
During Build agent-tooling when onboarding agents to a monorepo, after major refactors in Operate iterate, or before Ship review when reviewers rely on AGENTS.md for architecture context.
Is index-knowledge safe to install?
It instructs agents to read and rewrite repo documentation and run shell/LSP discovery; review the Security Audits panel on this Prism page and use --create-new only when you intend to delete existing AGENTS.md files.
SKILL.md
READMESKILL.md - Index Knowledge
# index-knowledge Generate hierarchical AGENTS.md files. Root + complexity-scored subdirectories. ## Usage ``` --create-new # Read existing → remove all → regenerate from scratch --max-depth=2 # Limit directory depth (default: 5) ``` Default: Update mode (modify existing + create new where warranted) --- ## Workflow (High-Level) 1. **Discovery + Analysis** (concurrent) - Launch parallel explore agents (multiple Task calls in one message) - Main session: bash structure + LSP codemap + read existing AGENTS.md 2. **Score & Decide** - Determine AGENTS.md locations from merged findings 3. **Generate** - Root first, then subdirs in parallel 4. **Review** - Deduplicate, trim, validate <critical> **TodoWrite ALL phases. Mark in_progress → completed in real-time.** ``` TodoWrite([ { id: "discovery", content: "Fire explore agents + LSP codemap + read existing", status: "pending", priority: "high" }, { id: "scoring", content: "Score directories, determine locations", status: "pending", priority: "high" }, { id: "generate", content: "Generate AGENTS.md files (root + subdirs)", status: "pending", priority: "high" }, { id: "review", content: "Deduplicate, validate, trim", status: "pending", priority: "medium" } ]) ``` </critical> --- ## Phase 1: Discovery + Analysis (Concurrent) **Mark "discovery" as in_progress.** ### Launch Parallel Explore Agents Multiple Task calls in a single message execute in parallel. Results return directly. ``` // All Task calls in ONE message = parallel execution Task( description="project structure", subagent_type="explore", prompt="Project structure: PREDICT standard patterns for detected language → REPORT deviations only" ) Task( description="entry points", subagent_type="explore", prompt="Entry points: FIND main files → REPORT non-standard organization" ) Task( description="conventions", subagent_type="explore", prompt="Conventions: FIND config files (.eslintrc, pyproject.toml, .editorconfig) → REPORT project-specific rules" ) Task( description="anti-patterns", subagent_type="explore", prompt="Anti-patterns: FIND 'DO NOT', 'NEVER', 'ALWAYS', 'DEPRECATED' comments → LIST forbidden patterns" ) Task( description="build/ci", subagent_type="explore", prompt="Build/CI: FIND .github/workflows, Makefile → REPORT non-standard patterns" ) Task( description="test patterns", subagent_type="explore", prompt="Test patterns: FIND test configs, test structure → REPORT unique conventions" ) ``` <dynamic-agents> **DYNAMIC AGENT SPAWNING**: After bash analysis, spawn ADDITIONAL explore agents based on project scale: | Factor | Threshold | Additional Agents | |--------|-----------|-------------------| | **Total files** | >100 | +1 per 100 files | | **Total lines** | >10k | +1 per 10k lines | | **Directory depth** | ≥4 | +2 for deep exploration | | **Large files (>500 lines)** | >10 files | +1 for complexity hotspots | | **Monorepo** | detected | +1 per package/workspace | | **Multiple languages** | >1 | +1 per language | ```bash # Measure project scale first total_files=$(find . -type f -not -path '*/node_modules/*' -not -path '*/.git/*' | wc -l) total_lines=$(find . -type f \( -name "*.ts" -o -name "*.py" -o -name "*.go" \) -not -path '*/node_modules/*' -exec wc -l {} + 2>/dev/null | tail -1 | awk '{print $1}') large_files=$(find . -type f \( -name "*.ts" -o -name "*.py" \) -not -path '*/node_modules/*' -exec wc -l {} + 2>/dev/null | awk '$1 > 500 {count++} END {print count+0}') max_depth=$(find . -type d -not -path '*/node_modules/*' -not -path '*/.git/*' | awk -F/ '{print NF}' | sort -rn | head -1) ``` Example spawning (all in ONE message for parallel execution): ``` // 500 files, 50k lines, depth 6, 15 large files → spawn additional agents Task( description="large files", subag