본문으로 건너뛰기
cccskills
무료GitHub에 공개

codebase-context-generator

Generates comprehensive AI context, AGENTS.md, and structured documentation in a context/ directory for any brownfield codebase using Tree-sitter AST extraction, dependency analysis, predefined python scripts, and orchestrated subagents.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

larchanka/skills스타 30(GitHub 30 + cccskills 0)

실행 점수 미검증

설치 방법 보기

포함된 파일(13)

  • SKILL.md8.4 KB
  • README.md11.7 KB
  • references/agents_template.md4.5 KB
  • references/context_templates.md4.2 KB
  • scripts/ast_scanner.py20.5 KB
  • scripts/common.py5.7 KB
  • scripts/dependency_graph.py6.6 KB
  • scripts/symbol_graph.py10.1 KB
  • scripts/verify_context.py7.7 KB
  • tests/test_ast_scanner.py3.8 KB
  • tests/test_dependency_graph.py2.4 KB
  • tests/test_symbol_graph.py4.1 KB
  • tests/test_verify_context.py2.2 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Codebase Context Generator

This skill transforms any brownfield or non-AI-adapted codebase into an AI-ready repository. It generates:

  1. AGENTS.md: The primary operational instruction manual for AI agents operating in the repository.
  2. context/: A structured documentation directory detailing architecture, modules, dependencies, and engineering conventions.

The skill combines deterministic Tree-sitter AST parsing via predefined Python scripts with semantic multi-agent synthesis to produce accurate, information-dense documentation without blowing token budgets.

flowchart TD
    TargetRepo["Target Codebase"] --> Phase1["Phase 1: Deterministic AST & Graph Extraction<br/>(ast_scanner.py, dependency_graph.py, symbol_graph.py)"]
    Phase1 --> Cache[".context_cache/<br/>ast_manifest.json, dependency_graph.json, symbol_graph.json"]
    Phase1 --> SigDoc["context/signatures.md<br/>(Full function signatures & argument types)"]
    
    Cache --> Phase2["Phase 2: Environment & Commands Discovery<br/>(Subagent: repo-inspector)"]
    Cache --> Phase3["Phase 3: Domain & Architecture Analysis<br/>(Subagent: domain-architect)"]
    
    Phase2 --> Phase4["Phase 4: Context & AGENTS.md Synthesis<br/>(Subagent: context-synthesizer)"]
    Phase3 --> Phase4
    SigDoc --> Phase4
    
    Phase4 --> Docs["Generated AGENTS.md & context/*.md"]
    Docs --> Phase5["Phase 5: Automated Verification & Audit<br/>(scripts/verify_context.py & Subagent: context-auditor)"]
    Phase5 --> VerificationCheck{"Verification Passed?"}
    VerificationCheck -- No (Errors / Broken links) --> Phase4
    VerificationCheck -- Yes --> Complete["Complete: Repository is AI-Ready"]

Workflow Execution Steps

Phase 1: Deterministic AST & Dependency Extraction

Run the predefined Python helper scripts to scan the codebase using Tree-sitter and build the structural manifests.

# 1. Run Tree-sitter AST scanner across target codebase
python3 codebase-context-generator/scripts/ast_scanner.py --root <target-repo-path> --summary

# 2. Build internal import and dependency graph
python3 codebase-context-generator/scripts/dependency_graph.py --manifest <target-repo-path>/.context_cache/ast_manifest.json

# 3. Build symbol & call graph, and export signatures cheat sheet
python3 codebase-context-generator/scripts/symbol_graph.py \
  --manifest <target-repo-path>/.context_cache/ast_manifest.json \
  --save-graph <target-repo-path>/.context_cache/symbol_graph.json \
  --export-signatures <target-repo-path>/context/signatures.md

Artifacts Generated:

  • .context_cache/ast_manifest.json: Complete file-by-file AST symbol index (classes, methods, functions, interfaces, structs, imports, exports).
  • .context_cache/dependency_graph.json: Internal topological graph, hub modules, entrypoints, and third-party dependencies.
  • .context_cache/symbol_graph.json: Function-level and method-level call and reference graph with argument types and caller/callee cross-references.
  • context/signatures.md: Searchable signature cheat sheet by file and module.

Fast Symbol & Signature Navigation for Agents

During any subsequent coding or investigation task, agents can instantly query function signatures and trace call hierarchies without opening multiple files:

# Find function signature, argument types, return type, and location
python3 codebase-context-generator/scripts/symbol_graph.py --find "function_name"

# Trace who calls this function
python3 codebase-context-generator/scripts/symbol_graph.py --callers "function_name"

# Trace what this function calls
python3 codebase-context-generator/scripts/symbol_graph.py --callees "function_name"

Phase 2: Environment & Commands Discovery

Spawn a subagent (or inspect configuration manifests) to discover the verified developer toolchain.

Subagent Role: Repo Inspector Prompt Template:

Inspect the repository configurations, build files, and package manifests (e.g. package.json, pyproject.toml, Cargo.toml, go.mod, Makefile, Dockerfile, etc.) in the workspace.
Identify and verify:
1. Exact package manager and runtime versions.
2. Build commands.
3. Test commands (full suite and single test file).
4. Lint and type-check commands.
5. Primary application entry point.

Return a concise YAML summary of these verified commands.

Phase 3: Subsystem & Domain Analysis

Use the AST manifest and dependency graph to identify core system boundaries without reading raw files.

Subagent Role: Domain Architect Prompt Template:

Review `.context_cache/ast_manifest.json` and `.context_cache/dependency_graph.json`.
Analyze:
1. Core entrypoints (e.g., CLI binaries, web routers, server bootstraps).
2. Key hub modules (files with high in-degree that serve as shared utilities or state).
3. The layered architecture (presentation, domain logic, data persistence, integrations).
4. Major data models and primary business workflows.

Synthesize an architectural summary describing how data flows through the application from entry to completion.

(For large multi-service or monorepo projects, spawn parallel subagents per package or directory.)


Phase 4: Context & AGENTS.md Synthesis

Generate the target documentation using the templates in codebase-context-generator/references/:

  • codebase-context-generator/references/agents_template.md
  • codebase-context-generator/references/context_templates.md

Subagent Role: Context Synthesizer Prompt Template:

Generate the following files for the target repository:
1. `AGENTS.md` at repository root (following references/agents_template.md).
2. `context/index.md` (Table of contents and navigation map).
3. `context/architecture.md` (System design, Mermaid diagram, subsystem layers, request lifecycle).
4. `context/modules.md` (Module-by-module breakdown using AST symbols, classes, functions, and interfaces).
5. `context/dependencies.md` (Internal call graph, hubs, and third-party package inventory).
6. `context/conventions.md` (Code style, error handling patterns, invariants, testing strategy).

Ensure all markdown links use relative paths, all code blocks have valid syntax, and no placeholder text remains.

Phase 5: Automated Verification & Quality Audit

Run the validation script to verify link integrity, section completeness, and AST symbol coverage.

python3 codebase-context-generator/scripts/verify_context.py --root <target-repo-path>

Quality Gates:

  • AGENTS.md exists and contains all required sections (Overview, Commands, Architecture, Invariants).
  • context/ exists with index.md, architecture.md, modules.md, dependencies.md, and conventions.md.
  • Zero broken local markdown links.
  • No unresolved placeholders (TODO, <insert...>, etc.).
  • All hub files and key entrypoints are documented in context/modules.md.

If any check fails, loop back to Phase 4 to fix errors until verify_context.py outputs PASS.


Post-Change Maintenance (Incremental Updates)

Whenever an AI agent modifies existing code or adds new files in the codebase, the symbol and call graphs must not go stale. As instructed in AGENTS.md, agents should either rerun the scripts directly or invoke a lightweight maintenance subagent:

Maintenance Subagent Role: Context Maintainer Prompt Template:

Recent code edits were made in the repository. Refresh the codebase context:
1. Run ast_scanner.py, dependency_graph.py, and symbol_graph.py to rebuild .context_cache/ and context/signatures.md.
2. If new components, APIs, or architectural flows were introduced, incrementally update context/modules.md and context/architecture.md.
3. Run verify_context.py to ensure zero broken links and full coverage.

Reference Guide

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Orchestrates a multi-agent loop involving planning, development, review, and publishing sub-agents to implement and publish features test-first and with high standards compliance.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

larchanka/skills302026년 10월 27일 업데이트

Conducts multi-axis code review. Use before merging any change. Use when reviewing code written by yourself, another agent, or a human. Use when you need to assess code quality across multiple dimensions before it enters the main branch.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

larchanka/skills302026년 10월 27일 업데이트

Manual browser testing and automation using Chrome DevTools MCP server. Handles port management, app launch, browser automation, login, and end-to-end testing.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

larchanka/skills302026년 10월 27일 업데이트

Breaks work into ordered tasks. Use when you have a spec or clear requirements and need to break work into implementable tasks. Use when a task feels too large to start, when you need to estimate scope, or when parallel work is possible.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

larchanka/skills302026년 10월 27일 업데이트

Progressively investigate PRs, commits, releases, and project evolution. Start with a lightweight assessment, dynamically deepen analysis based on complexity and risk, use subagents for independent investigations, and maintain evidence-backed project knowledge.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

larchanka/skills302026년 10월 27일 업데이트

Creates a new feature branch from current git changes, commits them, pushes to the remote, and opens a github pull request using the `gh` cli. Use this skill when asked to create a github pull request

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

larchanka/skills302026년 10월 27일 업데이트

larchanka의 스킬 모두 보기

이 스킬의 문제 신고