Skip to content
index-docs logo

Index Documentation and Code Skill

index-docs

Create searchable knowledge base from existing documentation and code for fast context lookup in brownfield projects. Indexes .md files with sections/keywords, maps code exports to documentation, generates search.json, quick-ref.md, and glossary.md in .claude/index/. Use when onboarding to brownf...

SKILL.md

Full skill instructions

Index Documentation and Code Skill

Purpose

Create a searchable, structured knowledge base from existing documentation and codebase. This enables fast context lookup during task planning and implementation in brownfield projects through semantic search, documentation-to-code mapping, and quick reference systems.

Core Principle: In brownfield projects, context discovery is the bottleneck—indexing eliminates repeated searching.

Prerequisites

  • Existing documentation in docs/ directory
  • Structured, readable codebase
  • Write access to .claude/​index/ location
  • Optional: document-project skill completed first

Workflow

1. Load Configuration and Validate

Check prerequisites and configuration:

# .claude/​config.yaml
brownfield:
  docsPath: docs/
  codebasePath: src/
  indexLocation: .claude/​index/
  includeCode: true
  maxDepth: 3

Validate:

  • Documentation directory exists with files
  • Index location is writable
  • Check if index exists (offer refresh vs rebuild)

2. Index Documentation

Parse and structure documentation content:

  1. Scan documentation files (.md files in docs/)
  2. Extract structure:
    • Headings and sections
    • Code blocks and examples
    • Keywords and concepts (API names, domain terms, technologies)
  3. Build document index with sections, keywords, line numbers
  4. Create cross-references between documents

Output: Documentation indexed (file count), sections extracted, keywords identified, cross-references created

See: references/​templates.md#step-2-output for complete format and index structure


3. Index Codebase (Optional)

Map code to documentation:

  1. Scan key code files:
    • Models, schemas, types
    • Routes, controllers, services
  2. Extract code elements:
    • Exports, imports, functions
    • Map to line numbers
  3. Build code-to-docs mapping:
    • Find code mentions in docs
    • Create bidirectional links

Output: Code files indexed, exports/​functions mapped, code-to-docs links created

See: references/​templates.md#step-3-output for complete format and code-mapping.md for strategies


4. Build Searchable Index

Create fast lookup structures:

  1. Create search index:
    • Keyword → Documents
    • Concept → Sections
    • Code → Documentation
  2. Generate quick reference:
    • Data models with file locations
    • API endpoints with docs links
    • Patterns and where documented
  3. Create glossary:
    • Terms and definitions
    • Links to detailed documentation

Output: search.json (searchable index), quick-ref.md (quick reference), glossary.md (term definitions) created in .claude/​index/

See: references/​templates.md#step-4-output for complete file formats and examples


Using the Index

Quick searches: grep for keywords in search.json | Look up endpoints in quick-ref.md | Find term definitions in glossary.md

Integration: create-task-spec loads relevant docs | implement-feature looks up patterns | document-project refreshes index

See: references/​templates.md#search-examples for complete search commands and #integration-examples for workflows


Index Maintenance

When to refresh: Documentation updated | New code modules | Architecture changes | Quarterly maintenance

Refresh vs Rebuild: Refresh=incremental update (faster, preserves customizations) | Rebuild=full re-index (slower, clean slate)

See: references/​templates.md#index-maintenance for detailed refresh process and output examples


Best Practices

Index early (before implementation) | Keep docs updated (refresh after changes) | Use quick ref (faster than full docs) | Maintain glossary (project-specific terms) | Include code selectively (key files only)


Reference Files

Detailed documentation in references/:

  • templates.md: All output formats (Steps 1-4), search.json structure, quick-ref.md format, glossary.md format, search examples, integration workflows, index maintenance, JSON output format

  • indexing-format.md: Index structure details (comprehensive in templates.md)

  • code-mapping.md: Code-to-docs mapping strategies


When to Escalate

  • Documentation is sparse or missing (run document-project first)
  • Codebase structure is unclear or chaotic
  • Index becomes too large (>100MB)
  • Search performance degrades

Part of BMAD Enhanced Brownfield Suite

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View