Agent skill

scan-docs-index

[Documentation] Scan project and populate/sync docs/project-reference/docs-index-reference.md with documentation tree, file counts, category breakdown, doc relationships, and lookup table.

Stars 6
Forks 1

Install this agent skill to your Project

npx add-skill https://github.com/duc01226/EasyPlatform/tree/main/.claude/skills/scan-docs-index

SKILL.md

[IMPORTANT] Use TaskCreate to break ALL work into small tasks BEFORE starting.

Prerequisites: MUST READ before executing:

Scan & Update Reference Doc — Read existing doc first, scan codebase for current state, diff against doc content, update only changed sections, preserve manual annotations. MUST READ .claude/skills/shared/scan-and-update-reference-doc-protocol.md for full protocol and checklists.

Quick Summary

Goal: Scan the project's docs/ directory and populate docs/project-reference/docs-index-reference.md with accurate documentation tree, file counts by category, doc relationships, and a keyword-to-doc lookup table.

Workflow:

  1. Read — Load current target doc, detect init vs sync mode
  2. Scan — Count docs by category, discover doc tree structure, trace relationships
  3. Generate — Build/update the reference doc with verified counts and paths
  4. Verify — Spot-check file counts against actual directory contents

Key Rules:

  • Generic — discover everything dynamically, never hardcode project-specific values
  • Use docs/project-config.json for hints if available, fall back to filesystem scanning
  • All file counts must be verified via glob, not copied from existing content

Scan Docs Index

Phase 0: Read & Assess

  1. Read docs/project-reference/docs-index-reference.md
  2. Detect mode: init (placeholder only) or sync (has real content)
  3. If sync: note which sections exist and current file counts

Phase 1: Scan Documentation Tree

Root-Level Docs

  • Glob for *.md in project root (README.md, CLAUDE.md, CHANGELOG.md, etc.)
  • Count and list each with one-line purpose description

docs/ Directory

Scan each subdirectory:

Category Glob Pattern What to Extract
project-reference/ docs/project-reference/**/*.md File count, list with purposes
business-features/ docs/business-features/**/*.md Count per app, feature count
operations docs/getting-started.md, docs/deployment.md, etc. File count, list
design-system/ docs/design-system/**/*.md File count, app mapping
test-specs/ docs/test-specs/**/*.md File count, module coverage
architecture-decisions/ docs/architecture-decisions/**/*.md ADR count
templates/ docs/templates/**/*.md Template count and types
release-notes/ docs/release-notes/**/*.md File count

.claude/docs/

  • Glob for .claude/docs/**/*.md — count and categorize

Phase 2: Build Doc Relationship Map

Trace key doc relationships by grepping for markdown links between docs:

  • Which docs link to which (cross-references)
  • Entry points (README → getting-started → deployment chain)
  • CLAUDE.md → reference doc pointers

Phase 3: Build Lookup Table

For each docs/business-features/{App}/ directory:

  • Extract the app name and key business domain keywords
  • Map keywords → directory path for the lookup table

For each docs/project-reference/*.md:

  • Extract the domain covered
  • Map keywords → file path

Phase 4: Generate Reference Doc

Write to docs/project-reference/docs-index-reference.md with sections:

  1. Documentation System — Total count, last scan date
  2. Documentation Graph — ASCII tree with file counts per category
  3. Key Doc Relationships — ASCII diagram of cross-references
  4. Doc Lookup Guide — Keyword-to-path table

Phase 5: Verify

Spot-check 3 file counts:

  • docs/business-features/**/*.md count matches tree
  • docs/project-reference/*.md count matches tree
  • Root *.md count matches tree

Output Format

markdown
<!-- Last scanned: {YYYY-MM-DD} -->

# Documentation Index Reference

> Auto-generated by `/scan-docs-index`. Do not edit manually.

## Documentation System

{total} markdown files across {N} categories. Last scanned: {date}.

## Documentation Graph

{ASCII tree with counts}

## Key Doc Relationships

{ASCII relationship diagram}

## Doc Lookup Guide

{keyword → path table}

Closing Reminders

  • MUST break work into small todo tasks using TaskCreate BEFORE starting
  • MUST search codebase for 3+ similar patterns before creating new code
  • MUST cite file:line evidence for every claim (confidence >80% to act)
  • MUST add a final review todo task to verify work quality MANDATORY IMPORTANT MUST READ the following files before starting:
  • MUST READ .claude/skills/shared/scan-and-update-reference-doc-protocol.md before starting

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results