ghost-repo-context — скилл для Claude Code: карта репозитория
Сканирует кодовую базу, находит проекты и записывает карту архитектуры в repo.md. Нужен перед анализом безопасности или знакомством с новым репозиторием.
npx skills add ghostsecurity/skills --skill ghost-repo-context -a claude-code
npx skills add ghostsecurity/skills --skill repo-context -a claude-codeЧто делает ghost-repo-context
Скилл разбирает дерево каталогов, определяет проекты и собирает сведения о языках, фреймворках и файлах зависимостей. Для каждого найденного проекта он добавляет в repo.md архитектурное резюме, типы чувствительных данных, критичность компонентов и карту частей кода.
В аргументах задаются repo_path и при необходимости cache_dir. Если каталог кэша не передан, скилл вычисляет путь в ~/.ghost/repos/<repo_id>/cache. Он использует локальные файлы через Read, Write, Edit, Glob, Grep и Bash; поиск в интернете не выполняется.
При наличии <cache_dir>/repo.md скилл пропускает сканирование и возвращает путь к готовому файлу. Поэтому перед повторным анализом стоит проверить, актуален ли кэшированный контекст.
Какие задачи решает
- составить карту структуры репозитория
- выявить проекты в кодовой базе
- зафиксировать зависимости и фреймворки в
repo.md - подготовить контекст перед анализом безопасности
Примеры запросов агенту
- Запусти
ghost-repo-contextдляrepo_path=.. - Используй
ghost-repo-contextсrepo_path=./service cache_dir=/tmp/repo-cache. - Собери контекст репозитория перед анализом безопасности через
ghost-repo-contextдляrepo_path=..
Как установить ghost-repo-context
1Через Skills CLI (Vercel)
npx skills add ghostsecurity/skills --skill ghost-repo-context -a claude-codenpx skills add ghostsecurity/skills --skill repo-context -a claude-code2Вручную: положить файлы
~/.claude/skills/repo-context/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/repo-context/
1Через Skills CLI (Vercel)
npx skills add ghostsecurity/skills --skill repo-context -a codex2Вручную: положить файлы
.agents/skills/repo-context/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add ghostsecurity/skills --skill repo-context -a cursor2Вручную: положить файлы
.cursor/skills/repo-context/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install ghostsecurity/skills repo-context2Вручную: положить файлы
.github/skills/repo-context/SKILL.md1Через Skills CLI (Vercel)
npx skills add ghostsecurity/skills --skill repo-context -a gemini-cli2Командой платформы
gemini skills install https://github.com/ghostsecurity/skills --path plugins/ghost/skills/repo-contextВручную: положить файлы
.devin/skills/repo-context/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add ghostsecurity/skills --skill repo-context -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о ghost-repo-context
Как установить ghost-repo-context в Claude Code?
Выполните npx skills add ghostsecurity/skills --skill ghost-repo-context -a claude-code. Скилл размещается в ~/.claude/skills/repo-context/SKILL.md.
Что делает ghost-repo-context?
Он исследует локальную структуру репозитория, находит проекты и создаёт repo.md с данными о зависимостях, архитектуре и компонентах.
Что произойдёт, если repo.md уже есть в кэше?
Скилл не будет повторно сканировать репозиторий. Он вернёт путь к существующему <cache_dir>/repo.md.
Исходный текст
SKILL.md · Apache-2.0
---
name: "ghost-repo-context"
description: "Scans directory structure, detects projects, maps dependencies, and documents code organization into a repo.md file. Use when the user needs a codebase overview, project structure map, or repository context before security analysis."
allowed-tools: Read, Write, Edit, Glob, Grep, Bash
license: apache-2.0
metadata:
version: 1.1.0
---
# Repository Context Builder
You gather repository context by detecting projects, summarizing their architecture, and writing the results to `repo.md`. Do all work yourself — do not spawn subagents or delegate.
## Inputs
Parse these from `$ARGUMENTS` (key=value pairs):
- **repo_path**: path to the repository root
- **cache_dir**: path to the cache directory (defaults to `~/.ghost/repos/<repo_id>/cache`)
$ARGUMENTS
If `cache_dir` is not provided, compute it:
```bash
repo_name=$(basename "$(pwd)") && remote_url=$(git remote get-url origin 2>/dev/null || pwd) && short_hash=$(printf '%s' "$remote_url" | git hash-object --stdin | cut -c1-8) && repo_id="${repo_name}-${short_hash}" && cache_dir="$HOME/.ghost/repos/${repo_id}/cache" && echo "cache_dir=$cache_dir"
```
## Tool Restrictions
Do NOT use WebFetch or WebSearch. All work must use only local files in the repository.
## Setup
Discover this skill's own directory so you can reference agent files:
```bash
skill_dir=$(find . -path '*/skills/repo-context/SKILL.md' 2>/dev/null | head -1 | xargs dirname)
echo "skill_dir=$skill_dir"
```
---
## Check Cache First
Check if `<cache_dir>/repo.md` already exists. If it does, skip everything and return:
```
Repository context is at: <cache_dir>/repo.md
```
If it does not exist, run `mkdir -p <cache_dir>` and continue.
---
## Workflow
1. **Detect Projects** — Read `<skill_dir>/detector.md` and follow its instructions against `<repo_path>`. Save the full detection output (project details needed for step 2). If detection finds no projects, write a minimal `repo.md` noting "No projects detected" and skip to step 4.
2. **Summarize Each Project** — Read `<skill_dir>/summarizer.md`. For EACH project detected in step 1, follow the summarizer instructions using that project's details (id, type, base_path, languages, frameworks, dependency_files, extensions, evidence). Collect the summary for each project. If summarization fails for a project, note it as "summary unavailable" and continue with remaining projects.
3. **Write repo.md** — Combine detection and summary results into `<cache_dir>/repo.md` using the format in `<skill_dir>/template-repo.md`. For each project include:
- Detection: ID, Type, Base Path, Languages, Frameworks, Dependency Files, Extensions, Evidence
- Summary: Architectural summary, Sensitive Data Types, Business Criticality, Component Map, Evidence
4. **Validate** — Read `<cache_dir>/repo.md` back and verify it contains the expected sections from `<skill_dir>/template-repo.md` (e.g., project entries with Detection and Summary fields). If the file is missing or malformed, retry the write once before reporting an error.
5. **Output** — Return: `Repository context is at: <cache_dir>/repo.md`
© ghostsecurity · Apache-2.0 · ghostsecurity/skills