docs-as-code
2
总安装量
2
周安装量
#69265
全站排名
安装命令
npx skills add https://github.com/spjoshis/claude-code-plugins --skill docs-as-code
Agent 安装分布
opencode
2
gemini-cli
2
claude-code
2
github-copilot
2
codex
2
kimi-cli
2
Skill 文档
Docs-as-Code
Implement docs-as-code workflows using version control, Markdown, and automated publishing for scalable documentation.
When to Use This Skill
- Developer documentation
- Version-controlled docs
- Collaborative writing
- Automated publishing
- Multi-version docs
- Technical documentation
- API references
- Open source projects
Core Concepts
1. Docs-as-Code Workflow
Write (Markdown) â Commit (Git) â Review (PR) â Build (CI) â Deploy (Static Site)
2. MkDocs Project Structure
my-docs/
âââ mkdocs.yml # Configuration
âââ docs/
â âââ index.md # Home page
â âââ getting-started.md
â âââ api/
â â âââ overview.md
â â âââ reference.md
â âââ guides/
â âââ authentication.md
â âââ deployment.md
âââ .github/
âââ workflows/
âââ deploy-docs.yml # CI/CD
3. mkdocs.yml Configuration
site_name: My Documentation
site_url: https://docs.example.com
theme:
name: material
features:
- navigation.tabs
- search.highlight
nav:
- Home: index.md
- Getting Started: getting-started.md
- API:
- Overview: api/overview.md
- Reference: api/reference.md
- Guides:
- Authentication: guides/authentication.md
- Deployment: guides/deployment.md
plugins:
- search
- git-revision-date
markdown_extensions:
- pymdownx.highlight
- pymdownx.superfences
- admonition
4. GitHub Actions Deployment
name: Deploy Docs
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install dependencies
run: pip install mkdocs-material
- name: Deploy
run: mkdocs gh-deploy --force
Best Practices
- Use Git – Version control for all docs
- Markdown first – Simple, portable format
- Review process – Pull requests for changes
- Automate builds – CI/CD pipelines
- Test locally – Preview before publishing
- Semantic versioning – Version your docs
- Search enabled – Make content findable
- Link checking – Validate links regularly
Resources
- MkDocs: https://www.mkdocs.org
- Docusaurus: https://docusaurus.io
- Material for MkDocs: https://squidfunk.github.io/mkdocs-material/