一键导入
docs-generation
Transform a knowledge graph into a human-readable /docs folder with markdown documentation that both humans and agentic workflows can reference.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Transform a knowledge graph into a human-readable /docs folder with markdown documentation that both humans and agentic workflows can reference.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
End-to-end pipeline to augment any repository for AI-assisted development. Installs opinionated engineering workflows, generates documentation, and configures Claude Code or Cursor.
Destructive command safety guardrails. Warns before dangerous operations in production and shared environments.
Systematic root-cause debugging and incident investigation. No fixes without understanding the problem first.
Architecture review before implementation. Walk through design, failure modes, scope, and test strategy before writing code.
Engineering retrospective and velocity analytics from git history. Generates weekly insights on team productivity, code quality, and contribution patterns.
Structured code and infrastructure PR review with evidence-based findings, auto-fix classification, and scope drift detection.
| name | docs-generation |
| version | 1.0.0 |
| description | Transform a knowledge graph into a human-readable /docs folder with markdown documentation that both humans and agentic workflows can reference. |
| author | iscmga |
| tags | ["documentation","markdown","knowledge-graph","onboarding","auto-docs","agent-readable"] |
| triggers | {"globs":["**/knowledge-graph.json","**/docs/README.md"],"keywords":["generate docs","auto docs","documentation","document codebase","docs folder","write documentation"]} |
Transform .understand/knowledge-graph.json into a structured /docs folder with human-readable markdown that also serves as an agentic reference. This is the "prose layer" on top of the knowledge graph — same data, optimized for reading.
codebase-understanding (knowledge graph exists)repo-augmentation pipeline (Stage 1.75).understand/knowledge-graph.json must exist. Run codebase-understanding first if it doesn't.docs/
├── README.md # Project overview + table of contents
├── architecture.md # Layers, patterns, tech stack, high-level design
├── onboarding.md # Guided tour in prose (from knowledge graph tour)
├── AGENTS.md # Agent-optimized quick reference (structured for LLM consumption)
├── modules/
│ ├── <layer-1>.md # One file per architectural layer
│ ├── <layer-2>.md
│ └── ...
└── api/ # (optional) Only if API layer detected
└── endpoints.md # API endpoint catalog
Step 1: READ knowledge graph
|
Step 2: GENERATE docs/README.md (overview + TOC)
|
Step 3: GENERATE docs/architecture.md (layers + tech stack)
|
Step 4: GENERATE docs/modules/<layer>.md (per-layer deep dives)
|
Step 5: GENERATE docs/onboarding.md (tour → prose)
|
Step 6: GENERATE docs/AGENTS.md (structured agent reference)
Load .understand/knowledge-graph.json and extract:
metadata → project name, languages, frameworks, file count
nodes[] → files with summaries, tags, complexity
edges[] → relationships between files
layers[] → architectural layers with file assignments
tour[] → guided learning steps
docs/README.mdThe entry point for all documentation. Structure:
# <Project Name>
> Auto-generated documentation from codebase analysis.
> Last generated: <analyzedAt from metadata>
> Commit: <gitCommitHash>
## Overview
<2-3 paragraph summary derived from:>
- metadata.languages and metadata.frameworks
- Number of files, nodes, layers
- Primary purpose inferred from entry point node summaries
## Tech Stack
| Category | Technologies |
|----------|-------------|
| Languages | <metadata.languages> |
| Frameworks | <metadata.frameworks> |
| Total Files | <metadata.totalFiles> |
## Architecture
This project is organized into **<N> layers**:
| Layer | Description | Files |
|-------|-------------|-------|
| <layer.name> | <layer.description> | <layer.files.length> |
→ See [Architecture](architecture.md) for details.
## Quick Links
- [Architecture Overview](architecture.md)
- [Onboarding Guide](onboarding.md)
- [Agent Reference](AGENTS.md)
- Modules:
- [<Layer 1>](modules/<layer-1>.md)
- [<Layer 2>](modules/<layer-2>.md)
- ...
docs/architecture.mdDeep dive into system architecture:
# Architecture
## System Overview
<Describe the overall architecture pattern (MVC, microservices, monolith, etc.)
inferred from layer structure and edge patterns>
## Layers
### <Layer Name>
**Purpose:** <layer.description>
**Files (<count>):**
| File | Purpose | Complexity |
|------|---------|------------|
| <node.filePath> | <node.summary> | <node.complexity> |
**Key Relationships:**
- <Summarize edges where source OR target is in this layer>
- Focus on cross-layer dependencies
<Repeat for each layer>
## Dependency Flow
<Describe how data/control flows between layers, derived from edge analysis>
<Which layers depend on which? Are there circular dependencies?>
## Key Design Decisions
<Infer from patterns observed:>
- Framework choices and why they matter
- Data flow patterns (sync vs async, event-driven, etc.)
- Configuration strategy (env vars, config files, etc.)
docs/modules/<layer>.mdOne file per architectural layer for deep exploration:
# <Layer Name>
> <layer.description>
## Files
### `<node.filePath>`
**Summary:** <node.summary>
**Complexity:** <node.complexity>
**Tags:** <node.tags joined>
**Exports/Key Functions:**
<List node.children if present, with brief descriptions>
**Dependencies:**
- Imports: <list edges where this node is source, type=imports>
- Used by: <list edges where this node is target>
<Repeat for each file in the layer, ordered by importance (fan-out count)>
## Layer Relationships
<Summarize how this layer connects to others>
<Include a count: "This layer imports from N files in <other layer>">
docs/onboarding.mdConvert the knowledge graph tour into a narrative guide:
# Onboarding Guide
Welcome to **<project name>**. This guide walks you through the codebase
step-by-step, starting from the entry point and following the natural
dependency chain.
## Before You Start
- **Languages:** <metadata.languages>
- **Frameworks:** <metadata.frameworks>
- **Total files:** <metadata.totalFiles>
- **Estimated reading time:** ~<tour.length * 3> minutes
## The Tour
### Step <tour.step>: <tour.title>
📍 **File:** `<tour.nodeId>`
<tour.description>
<Add context from the node's summary and its immediate edges:>
- What this file does
- What it connects to (list 2-3 key imports/exports)
- Why it matters in the architecture
**Next:** This leads us to [Step <next>](#step-<next>-<next-title>)...
<Repeat for each tour step>
## What's Next?
Now that you've walked through the core architecture:
- Explore individual [modules](modules/) for deeper dives
- Check the [architecture overview](architecture.md) for the big picture
- See [AGENTS.md](AGENTS.md) for a machine-readable reference
docs/AGENTS.mdStructured reference optimized for LLM/agent consumption:
# Agent Reference — <Project Name>
> Machine-readable project reference. Use this file to quickly understand
> the project structure when operating as an AI agent.
## Quick Facts
- **Name:** <metadata.projectName>
- **Languages:** <metadata.languages as comma-separated>
- **Frameworks:** <metadata.frameworks as comma-separated>
- **Files:** <metadata.totalFiles>
- **Layers:** <layers.length>
- **Analyzed:** <metadata.analyzedAt>
- **Commit:** <metadata.gitCommitHash>
## Layer Map
<For each layer, one-line summary:>
- **<layer.name>**: <layer.description> (<file count> files)
## Entry Points
<List nodes that appear as tour step 1, or nodes with highest fan-out:>
- `<filePath>` — <summary>
## Key Files (by complexity/importance)
<Top 10-15 files sorted by edge count (most connected first):>
| File | Layer | Connections | Summary |
|------|-------|-------------|---------|
| `<path>` | <layer> | <edge count> | <summary> |
## Relationship Summary
<Aggregate edge types:>
| Relationship | Count | Example |
|-------------|-------|---------|
| imports | <count> | `A` → `B` |
| calls | <count> | `A` → `B` |
| configures | <count> | `A` → `B` |
## File Index
<Complete alphabetical file list with one-line summaries:>
- `<path>` — <summary>
When the knowledge graph is updated:
docs/ existsmetadata.gitCommitHash in docs/README.md with current graphFor future optimization: only regenerate docs for layers that contain changed files. But for v1, full regeneration is fine since it's fast.
Before finalizing:
docs/README.md exists and has a valid table of contentsdocs/modules/<layer>.mddocs/onboarding.md has the same number of steps as the knowledge graph tourdocs/AGENTS.md lists all files from the knowledge graphcodebase-understanding skillThis skill REQUIRES the knowledge graph as input. Always run codebase-understanding first.
knowledge-graph-visualizer skillThe visualizer generates Mermaid diagrams that can be embedded in or linked from the docs. Run both skills to get prose + diagrams.
repo-augmentation skillThis skill is Stage 2 of the 3-stage augmentation pipeline: