AgentSkillsCN

documentation

在编辑 .md 文件、docs/ 目录、README 或 CHANGELOG 时加载。提供技术文档的结构化框架与最佳实践。

SKILL.md
--- frontmatter
name: documentation
description: Load when editing .md files, docs/ directory, README, or CHANGELOG. Provides documentation structure and best practices for technical writing.

Documentation

Merged Skills

  • technical-writing: Clear, concise documentation
  • api-docs: Endpoint documentation, schemas
  • guides: How-to tutorials, step-by-step instructions

⚠️ Critical Gotchas

CategoryPatternSolution
Stale docsDocs updated separately from codeUpdate docs in SAME commit as code changes
Broken linksLinks break after file movesCheck relative paths, use grep -r "old_path"
Stale examplesCode samples don't workVerify examples actually run
Duplicate contentSame info in multiple placesLink to source, don't duplicate
Missing contextDoc assumes knowledgeInclude prerequisites, link to background
No navigationUsers can't find docsUpdate docs/INDEX.md with new entries

Rules

RulePattern
Same commitDoc changes in same commit as code
Include examplesCode samples for every concept
Link don't duplicateReference existing docs
Update INDEXAdd new docs to docs/INDEX.md
Verify examplesTest that code samples work

Avoid

❌ Bad✅ Good
Docs in separate PRSame commit as code
Duplicate contentLink to existing docs
No code examplesInclude runnable samples
Orphan docsUpdate INDEX.md
Assumed knowledgeState prerequisites

Patterns

markdown
# Pattern 1: Feature documentation
# Feature Name

## Overview
Brief description of what this feature does and why it exists.

## Prerequisites
- Requirement 1
- Requirement 2

## Usage

```python
# Example code that actually works
from module import feature
result = feature.do_something()

Configuration

OptionTypeDefaultDescription
option1string"default"What it does

See Also

code

```markdown
# Pattern 2: API endpoint documentation
## POST /api/resource/

Creates a new resource.

### Request
```json
{
  "name": "string",
  "value": 123
}

Response (201)

json
{
  "id": 1,
  "name": "string",
  "created_at": "2026-01-13T00:00:00Z"
}

Errors

CodeDescription
400Invalid request body
401Unauthorized
code

## Templates (Diátaxis Framework)

| Template | Type | Use For | Location |
|----------|------|---------|----------|
| `.github/templates/doc_tutorial.md` | Tutorial | Learning-oriented guides | `docs/guides/` |
| `.github/templates/doc_guide.md` | How-To | Task-oriented instructions | `docs/guides/` |
| `.github/templates/doc_reference.md` | Reference | API specs, config lookup | `docs/technical/` |
| `.github/templates/doc_explanation.md` | Explanation | Architecture, concepts | `docs/architecture/` |
| `.github/templates/doc_analysis.md` | Analysis | Reports, audits, metrics | `docs/analysis/` |

## Structure

| Content Type | Location | Purpose |
|--------------|----------|---------|
| How-to guides | `docs/guides/` | Task-oriented tutorials |
| Feature docs | `docs/features/` | Feature explanations |
| API reference | `docs/technical/` | API specs, schemas |
| Architecture | `docs/architecture/` | Design decisions |
| Analysis/Reports | `docs/analysis/` | Audits, metrics, reports |
| Quick start | `README.md` | Getting started |
| Navigation | `docs/INDEX.md` | Doc discovery |
| Standards | `docs/contributing/` | Style guide, conventions |

## Commands

| Task | Command |
|------|---------|
| Find broken links | `grep -r "](.*\.md)" docs/ \| xargs -I{} test -f {}` |
| Check for stale refs | `grep -r "old_feature" docs/` |
| Update index | Edit `docs/INDEX.md` |
| Preview locally | Open .md file in VS Code preview |