{
  "markdown": "# scan-modules\n\n[中文](./README.zh-CN.md) | English\n\nA Claude Code plugin that scans your codebase, extracts module structure, type declarations, and function signatures, then caches everything in local `.md` files for fast context loading across sessions.\n\n## Why\n\nClaude Code loses project context between sessions. This plugin creates a lightweight, git-tracked module cache that Claude can read in seconds instead of re-exploring your codebase every time.\n\n**Before**: Claude spends 30-60s grepping around to understand project structure each session.\n**After**: Claude reads INDEX.md (~80 lines) and knows every module, file, and function.\n\n## Features\n\n- **Full scan** — Discover all modules, extract types + function signatures, generate per-module docs\n- **Incremental update** — Only re-scan modules with changed files (via git diff)\n- **Status check** — See which modules are stale vs fresh\n- **Git hook** — Auto-update module docs on every commit\n- **Multi-language** — Swift, TypeScript/JavaScript, Python, Go, Rust\n\n## Install\n\n```bash\n# From GitHub\n/plugin install <github-url>\n\n# Or test locally\nclaude --plugin-dir ./scan-modules-plugin\n```\n\n## Usage\n\n```bash\n# First time: full scan of your project\n/scan-modules:scan-modules\n\n# Check which modules need updating\n/scan-modules:scan-modules status\n\n# Update only changed modules\n/scan-modules:scan-modules update\n\n# Update a specific module\n/scan-modules:scan-modules update vision\n\n# Install git post-commit hook for auto-updates\n/scan-modules:scan-modules install-hook\n```\n\n## What it generates\n\n```\n.claude/modules/\n  INDEX.md              # Master index: all modules, dependency graph, usage\n  auth.md               # Per-module: types, function signatures, dependencies\n  blockchain.md\n  vision.md\n  ...\n```\n\n### INDEX.md (~80 lines)\n\nQuick overview of all modules with file counts and descriptions. Read this at session start.\n\n```markdown\n<!-- SCAN_META: hash=abc1234 date=2026-03-02 -->\n# Project Modules — MyApp\n> Type: iOS/macOS | Language: Swift (SwiftUI)\n> Modules: 36 | Files: 192\n\n## Modules\n| Module | Path | Files | Description |\n|--------|------|-------|-------------|\n| auth   | Services/Auth | 1 | JWT authentication and session management |\n| vision | Services/Vision | 13 | On-device AI pipeline |\n...\n```\n\n### Per-module files\n\nDetailed function-level reference for each module.\n\n```markdown\n# Module: Vision\n> Path: Services/Vision | Files: 13\n\n## Files\n\n### VisionAnalyzer.swift\n**Type**: `class VisionAnalyzer` | **Purpose**: Image classification and face detection\n\n| Visibility | Signature | Purpose |\n|------------|-----------|---------|\n| internal | `func analyze(_ image: UIImage) async -> ImageAnalysisResult` | Run Vision framework |\n\n## Dependencies\n- **Uses**: CoreML, Vision\n- **Used by**: LazyNoteView, StorybookLayoutView\n```\n\n## How it works\n\n1. **Detect project type** from marker files (Package.swift, package.json, Cargo.toml, etc.)\n2. **Discover modules** by directory hierarchy\n3. **Grep for signatures** — types, functions, published properties (never reads full files)\n4. **Generate .md files** with consistent templates\n5. **Track freshness** via git hash in SCAN_META comment\n\n## Supported languages\n\n| Language | Type patterns | Function patterns |\n|----------|--------------|-------------------|\n| Swift | `class/struct/protocol/actor/enum` | `func` |\n| TypeScript | `class/interface/type/enum` | `function`, `export const` |\n| Python | `class` | `def`, `async def` |\n| Go | `type ... struct/interface` | `func` |\n| Rust | `struct/enum/trait` | `fn`, `pub fn` |\n\n## Git hook\n\n`/scan-modules:scan-modules install-hook` installs a post-commit hook that:\n- Runs in background (doesn't slow down commits)\n- Only regenerates modules with changed files\n- Updates INDEX.md hash automatically\n\n## Tips\n\n- Add `.claude/modules/` to `.gitignore` — these are local cache files\n- Read `INDEX.md` at session start for project overview\n- Read per-module `.md` on demand when working in that area\n- Run `status` periodically to check freshness\n\n## License\n\nMIT\n",
  "bytes": 4059,
  "sha": "b3d93451c42b4410de28c7633a86b164c2d497b556c7835195af9c63d565a041",
  "repo_slug": "fengzhyuan/scan-modules-plugin",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_fengzhyuan_scan_modules_plugin_scan_modu_63a9b4e3/readme"
}