Skip to content
Back to skills

Project Index

ASecurity

Generate and maintain a project structure index for fast AI navigation. Creates docs/structure.md with an AI-friendly map + tree. Use when starting a new project, after major changes, or when docs/structure.md is stale.

  • 18 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 5, 2026
developmenttypescriptpythongobashnodegitdocumentation

Works with

  • vscode
  • terminal

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 5, 2026

npx -y skills add CongDon1207/AGENTS.md --skill project-index --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Project Index?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Project Index
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/congdon1207-project-index-ab8494b3/badge)](https://www.skillsdirectory.com/skills/congdon1207-project-index-ab8494b3)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: project-index
description: Generate and maintain a project structure index for fast AI navigation. Creates docs/structure.md with an AI-friendly map + tree. Use when starting a new project, after major changes, or when docs/structure.md is stale.
---

# Project Index Skill

Generate an AI-friendly `docs/structure.md` so agents can understand project layout quickly without scanning the whole repo.

## When to Use

- First time: project has no `docs/structure.md`
- After major changes: added/removed modules, moved folders, renamed domains/features
- When `docs/structure.md` looks stale or misleading
- On demand: user says "update structure", "refresh index", "scan project"

## Output

- File: `docs/structure.md`
- Content: **Top-Level Map** (purpose hints) + directory tree + entry points + config/key files + file-type distribution

## Scripts (Recommended)

### Python (recommended default)
```bash
python .opencode/skills/project-index/scripts/scan_structure.py . 4 > docs/structure.md
```

### Node.js
```bash
node .opencode/skills/project-index/scripts/scan-structure.js . 4 > docs/structure.md
```

### Flags

- `json`: output JSON instead of Markdown
- `--no-gitignore`: ignore `.gitignore` rules and scan everything (not recommended)

## Script Behavior (What "optimized" means)

- Respects `.gitignore` patterns by default (simplified matching)
- Has built-in ignores for common noise:
  - dependencies/build outputs: `node_modules/`, `dist/`, `build/`, `coverage/`, `.next/`, `.nuxt/`, `.turbo/`
  - virtualenv/caches: `venv/`, `.venv/`, `.tox/`, `__pycache__/`, `.pytest_cache/`, `.mypy_cache/`, `.ruff_cache/`
  - IDE: `.vscode/`, `.idea/`
  - typical build outputs: `bin/`, `obj/`, `target/`
  - secrets files: `.env*`
- Uses ASCII tree connectors (`|--`, ``--`) to avoid encoding issues on Windows terminals
- Generates a **Top-Level Map** with heuristic purpose descriptions (fast navigation)

## Expected Structure File Format

```markdown
# Project Structure Index
> Auto-generated by project-index. Last updated: YYYY-MM-DD HH:mm

## Quick Stats
- Total files: X
- Total directories: Y
- Main language: TypeScript/Python/etc

## Top-Level Map
| Path | Type | Purpose |
|:---|:---:|:---|
| src/ | dir | Main application source code |
| apps/ | dir | Application(s) (often runnable targets) |
| packages/ | dir | Packages (shared modules/libraries) |
| docs/ | dir | Documentation |
| README.md | file | Project overview and getting started |

## Directory Tree
```
repo/
|-- src/
|   `-- ...
`-- README.md
```

## Entry Points
- src/index.ts

## Config Files
- package.json

## Key Files
- README.md

## File Distribution
| Category | Count |
|:---|---:|
| typescript | 120 |
```

## Integration Notes

- Agents should **read `docs/structure.md` first** for large/broad tasks, then use `rg` for precise lookup.
- A stale `docs/structure.md` is worse than none; refresh it after restructures.

Files in this skill

  • SKILL.md2.9 KB
  • scripts/scan-structure.js12 KB
  • scripts/scan_structure.py14.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.