AgentSkillsCN

documentation

文档编写标准与决策依据。在决定是否需要编写文档、创建文档,或维护现有文档时使用此功能。涵盖重要性阈值、文档结构,以及交叉引用的规范。

SKILL.md
--- frontmatter
name: documentation
description: Documentation standards and decision criteria. Use when deciding whether to document, creating documentation, or maintaining existing docs. Covers significance thresholds, structure, and cross-referencing.

Documentation Standards

Standards for creating and maintaining project documentation.

Documentation Decision Criteria

Document When

CriteriaExamples
New user-facing featureDocument upload, new dashboard
New API pattern/categoryNew authentication flow, webhook system
Architectural changeNew service layer, caching system
Complex workflowMulti-step process, state machine
Reusable patternNew utility pattern, component pattern
External integrationThird-party API, OAuth provider
Significant configurationNew environment setup, deployment config

Don't Document When

CriteriaExamples
Bug fixFixing null pointer, correcting logic
Single endpoint (existing pattern)Adding GET /items/:id like other resources
RefactoringRenaming, restructuring without behavior change
Simple CRUDBasic create/read/update/delete
One-off implementationSpecial case handling
Minor UI tweaksButton styling, text changes
Test additionsAdding test coverage

Decision Flowchart

code
Is this a new capability users interact with?
  └─ Yes → Document
  └─ No → Does it introduce a new pattern?
            └─ Yes → Document
            └─ No → Does someone else need to understand how it works?
                      └─ Yes → Document
                      └─ No → Skip documentation

Documentation Types

TypeLocationPurpose
Reference docsdocumentation/reference/How features work (evergreen)
Technical docsdocumentation/technical/Implementation details
Planning docsdocumentation/planning/Decisions and context (ephemeral)
Process docs.claude/skills/How to do things (skills)

Evergreen Documentation Structure

markdown
# Feature Name

## Introduction
2-sentence summary of what this does.

## See Also
- `related/doc.md` - How it relates
- `src/path/file.ts` - Implementation
- https://external.url - Additional context

## Key Concepts
[Core ideas needed to understand the feature]

## How It Works
[Architecture, flow, or process]

## Usage Examples
[Code or workflow examples]

## Configuration
[Options and settings]

## Troubleshooting
[Common issues and solutions]

Cross-Referencing Rules

Always Link To

  • Related documentation
  • Implementation files
  • External resources (APIs, libraries)
  • Planning docs with historical context

Always Link From

  • Parent/overview documentation
  • Related features
  • README or index files

Link Format

markdown
- `documentation/reference/FEATURE.md` - Brief description of relevance
- `backend/src/services/feature.service.ts` - Core implementation
- [External Docs](https://example.com) - Official reference

Single Source of Truth

Do

  • Keep information in ONE canonical location
  • Link to the source, don't copy
  • Update in one place when things change

Don't

  • Duplicate content across files
  • Copy configuration details into multiple docs
  • Maintain parallel descriptions of the same thing

Documentation Quality Checklist

Before committing documentation:

  • Accurately reflects current implementation
  • Has "See Also" section with relevant links
  • No duplication with existing docs
  • Examples are current and working
  • Cross-references are bidirectional
  • Status indicators are accurate (if used)

Status Indicators

Use consistently when documenting feature status:

IndicatorMeaning
Implemented and working
🚧In progress
📋Planned but not started
⚠️Deprecated, avoid using

Maintenance Triggers

Update documentation when:

  • Feature behavior changes
  • API contracts change
  • Configuration options change
  • During regular housekeeping reviews
  • When you notice something outdated

Files Reference

  • documentation/reference/ - Evergreen feature docs
  • documentation/technical/ - Implementation details
  • documentation/planning/ - Decisions and history
  • documentation/DOCUMENTATION_ORGANISATION.md - Organization guide (if exists)