repo-docs
This skill should be used when the user asks to "generate repository documentation", "create a README", "document API", "write architecture docs", "add CONTRIBUTING guide", "update repo docs", "document codebase", or mentions repository documentation, codebase analysis, or cross-repository integration documentation.
Best use case
repo-docs is best used when you need a repeatable AI agent workflow instead of a one-off prompt. It is especially useful for teams working in multi. This skill should be used when the user asks to "generate repository documentation", "create a README", "document API", "write architecture docs", "add CONTRIBUTING guide", "update repo docs", "document codebase", or mentions repository documentation, codebase analysis, or cross-repository integration documentation.
This skill should be used when the user asks to "generate repository documentation", "create a README", "document API", "write architecture docs", "add CONTRIBUTING guide", "update repo docs", "document codebase", or mentions repository documentation, codebase analysis, or cross-repository integration documentation.
Users should expect a more consistent workflow output, faster repeated execution, and less time spent rewriting prompts from scratch.
Practical example
Example input
Use the "repo-docs" skill to help with this workflow task. Context: This skill should be used when the user asks to "generate repository documentation", "create a README", "document API", "write architecture docs", "add CONTRIBUTING guide", "update repo docs", "document codebase", or mentions repository documentation, codebase analysis, or cross-repository integration documentation.
Example output
A structured workflow result with clearer steps, more consistent formatting, and an output that is easier to reuse in the next run.
When to use this skill
- Use this skill when you want a reusable workflow rather than writing the same prompt again and again.
When not to use this skill
- Do not use this when you only need a one-off answer and do not need a reusable workflow.
- Do not use it if you cannot install or maintain the related files, repository context, or supporting tools.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/repo-docs/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How repo-docs Compares
| Feature / Agent | repo-docs | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
This skill should be used when the user asks to "generate repository documentation", "create a README", "document API", "write architecture docs", "add CONTRIBUTING guide", "update repo docs", "document codebase", or mentions repository documentation, codebase analysis, or cross-repository integration documentation.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
SKILL.md Source
# Repository Documentation Generate comprehensive, self-contained documentation for code repositories with awareness of cross-repository integration points and dependencies. ## Purpose Create and maintain repository documentation that includes README files, API documentation, contributing guides, and architecture documents. Each generated document is self-contained while explicitly documenting how the repository interacts with other repositories, services, and external dependencies. ## When to Use Trigger this skill when: - User asks to "generate documentation for this repo" - User mentions "create/update README", "document API", "write architecture docs" - User asks about "how this repo connects to other repos" - User requests "CONTRIBUTING guide" or "setup documentation" - User wants to document integration points with other repositories ## Documentation Workflow ### Phase 1: Repository Analysis Before generating documentation, analyze the codebase to understand: 1. **Repository Structure** - Use `Glob` to discover key files: `README.md`, `package.json`, `pyproject.toml`, `go.mod`, `Cargo.toml`, `pom.xml`, etc. - Identify main source directories (`src/`, `lib/`, `app/`, `internal/`, etc.) - Find configuration files (`.env.example`, `docker/`, `k8s/`, etc.) - Locate existing documentation (`docs/`, `*.md` files) 2. **Cross-Repository Integration Discovery** - Search for imports/requires referencing other repos (use `Grep` for common patterns) - Look for API client libraries pointing to internal services - Find shared dependencies or monorepo references - Identify external service integrations (databases, APIs, message queues) - Check for `.gitmodules`, `workspace` declarations, or subpackage references 3. **Technology Detection** - Identify primary programming language(s) - Find frameworks and major dependencies - Detect build systems and tooling - Note testing frameworks and CI/CD configuration ### Phase 2: Document Generation For each document type, follow the structured templates in `examples/`. Templates contain: - Section headers with placeholder content - Specific placeholders for integration points - Cross-repository dependency sections **Key Principle:** Every generated document must include an "Integrations" or "Related Repositories" section that explicitly documents: - Which other repositories this repo depends on - How this repo is consumed by other repositories - External services and dependencies - Data flow between repositories ### Phase 3: Existing Document Updates When updating existing documentation: 1. Read the current document using `Read` 2. Compare against current codebase state 3. Identify gaps (missing features, outdated integrations, stale dependencies) 4. Use `Edit` to update specific sections 5. Preserve existing voice and formatting where appropriate 6. Add newly discovered integration points ## Document Types ### README.md The primary entry point for the repository. Use `examples/README-template.md` as a starting point. Required sections: - Project title and brief description - Integration points with other repositories - Quick start / Installation - Usage examples - API/CLI reference (link to detailed docs if separate) - Contributing (link to CONTRIBUTING.md) - License ### API Documentation Document public APIs, functions, classes, and endpoints. Use `examples/API-template.md`. Required sections: - Overview - Authentication/Authorization - Endpoints/Functions with signatures - Request/response examples - Error handling - Rate limits (if applicable) - Integration points with other services ### CONTRIBUTING.md Guide for contributors. Use `examples/CONTRIBUTING-template.md`. Required sections: - Prerequisites (other repos to clone, tools to install) - Development setup - Running tests - Code style guidelines - Pull request process - Related repositories and their roles ### ARCHITECTURE.md High-level design and integration documentation. Use `examples/ARCHITECTURE-template.md`. Required sections: - System overview - Component diagram (describe verbally or use Mermaid) - Cross-repository architecture - Data flow between repositories - Design decisions and rationale - Scaling considerations ### INTEGRATIONS.md (Optional but Recommended) Dedicated document for cross-repository relationships. Use `examples/INTEGRATIONS-template.md`. Sections: - Upstream dependencies (repos/services this depends on) - Downstream consumers (repos/services that depend on this) - Sibling repositories (related repos in the same ecosystem) - External services - Communication protocols between services ## Integration Discovery Guidelines When scanning for integration points, search for: | Pattern | Indicates | |---------|-----------| | `from @org/` | Internal package/repo imports (JS/TS) | | `import.*internal` | Internal imports (Python/Java) | | `github.com/org/` | Go module references to other repos | | `client.*[Aa]pi` | API clients to other services | | `restTemplate` | REST client usage (Java) | | `fetch(` or `axios` | HTTP calls to external services | | `messaging:` | Spring Cloud/Sidecar integrations | | `pom.xml` `<artifactId>` | Maven dependencies | Use `scripts/find-integration-points.py` to automate discovery. ## Writing Guidelines ### 1. Be Specific About Integrations - Name the repositories explicitly: "Depends on `user-service` repo for authentication" - Explain the relationship: "This repo consumes events from `event-bus` via Kafka" - Link to the actual repositories when possible ### 2. Self-Contained Yet Connected - Each document should stand alone - Cross-reference other documents and repositories explicitly - Include enough context for someone new to the broader ecosystem ### 3. Concise and Scannable - **Use bullet points** over paragraphs for lists and procedures - **Lead with the essential** - put most important information first - **Use tables** for reference material (configs, commands, options) - **Code over prose** - show examples instead of lengthy explanations - **Collapse details** - use collapsible sections or "expand to read more" for depth - **One concept per section** - avoid mixing multiple topics - **Link, don't duplicate** - reference existing docs instead of repeating - **Target reading time** - a README should take ~3-5 minutes to scan ### 4. Keep Examples Current - Use actual code snippets from the repository - Verify commands work before including them - Update version numbers and dependency references - Keep examples minimal - show only what's needed to understand ### 5. Progressive Detail - Lead with high-level overview - Link to detailed documentation - Provide quick paths to "just make it work" and deep dives ## Tools and Utilities ### Scripts Use scripts in `scripts/` for automation: - **`find-integration-points.py`** - Scan codebase for references to other repositories - **`analyze-repo-structure.py`** - Generate summary of repository structure and dependencies Execute scripts without reading into context: ```bash python skills/repo-docs/scripts/find-integration-points.py /path/to/repo ``` ### References Consult `references/` for detailed guidance: - **`references/best-practices.md`** - Repository documentation standards - **`references/integration-patterns.md`** - Common integration patterns and how to document them - **`references/tech-detection.md`** - Technology detection patterns ## Additional Resources ### Reference Files For detailed guidance beyond this core workflow: - **`references/best-practices.md`** - Industry standards for repository documentation - **`references/integration-patterns.md`** - Documenting microservices, monorepos, and distributed systems - **`references/tech-detection.md`** - Patterns for identifying technologies and frameworks ### Example Templates Templates in `examples/` provide starting points: - **`examples/README-template.md`** - Standard README structure with integrations section - **`examples/API-template.md`** - API documentation template - **`examples/CONTRIBUTING-template.md`** - Contributor guide template - **`examples/ARCHITECTURE-template.md`** - Architecture documentation template - **`examples/INTEGRATIONS-template.md`** - Dedicated integrations document ### Scripts Utilities in `scripts/`: - **`scripts/find-integration-points.py`** - Automated integration discovery - **`scripts/analyze-repo-structure.py`** - Repository structure analysis ## Quality Checklist Before finalizing documentation, verify: - [ ] All cross-repository dependencies are documented - [ ] Integration points are explicitly named and described - [ ] Quick start instructions actually work - [ ] Code examples are from the actual codebase - [ ] Links to other repos are included where applicable - [ ] External service dependencies are listed - [ ] Setup instructions include dependencies on other repos - [ ] Document is readable without access to other repositories
Related Skills
weekly-report
帮助用户梳理周报,按照完整逻辑展示工作价值和边界。当用户说"写周报"、"周报"、"梳理周报"、"整理工作"时触发。
github-repo-search
帮助用户搜索和筛选 GitHub 开源项目,输出结构化推荐报告。当用户说"帮我找开源项目"、"搜一下GitHub上有什么"、"找找XX方向的仓库"、"开源项目推荐"、"github搜索"、"/github-search"时触发。
github-actions-docs
Use when users ask how to write, explain, customize, migrate, secure, or troubleshoot GitHub Actions workflows, workflow syntax, triggers, matrices, runners, reusable workflows, artifacts, caching, secrets, OIDC, deployments, custom actions, or Actions Runner Controller, especially when they need official GitHub documentation, exact links, or docs-grounded YAML guidance.
turborepo-caching
Configure Turborepo for efficient monorepo builds with local and remote caching. Use when setting up Turborepo, optimizing build pipelines, or implementing distributed caching.
monorepo-management
Master monorepo management with Turborepo, Nx, and pnpm workspaces to build efficient, scalable multi-package repositories with optimized builds and dependency management. Use when setting up monorepos, optimizing builds, or managing shared dependencies.
monorepo-architect
Expert in monorepo architecture, build systems, and dependency management at scale. Masters Nx, Turborepo, Bazel, and Lerna for efficient multi-project development. Use PROACTIVELY for monorepo setup,
docs-architect
Creates comprehensive technical documentation from existing codebases. Analyzes architecture, design patterns, and implementation details to produce long-form technical manuals and ebooks. Use PROACTIVELY for system documentation, architecture guides, or technical deep-dives.
daily-news-report
Scrapes content based on a preset URL list, filters high-quality technical information, and generates daily Markdown reports.
docstring
Write docstrings for PyTorch functions and methods following PyTorch conventions. Use when writing or updating docstrings in PyTorch code.
docs-write
Write documentation following Metabase's conversational, clear, and user-focused style. Use when creating or editing documentation files (markdown, MDX, etc.).
docs-review
Review documentation changes for compliance with the Metabase writing style guide. Use when reviewing pull requests, files, or diffs containing documentation markdown files.
repo-intake-and-plan
Narrow helper skill for README-first AI repo reproduction. Use when the task is specifically to scan a repository, read the README and common project files, extract documented commands, classify inference, evaluation, and training candidates, and return the smallest trustworthy reproduction plan to the main orchestrator. Do not use for environment setup, asset download, command execution, final reporting, paper lookup, or end-to-end orchestration.