Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问许可证需确认审计通过

documentation-standards文件标准

Agent Skill

用于辅助文档、README、Markdown、说明文和内容稿件的整理与改写。它适合让 Agent 提炼结构、补齐章节、统一术语、检查链接或把零散材料整理成可读文档。使用时应保留项目已有事实、命令和路径,不要把未确认的信息写成确定结论;涉及对外文案时,还需要控制语气,避免过度营销或夸大能力。

总安装

685

周安装

28

GitHub Stars

8

下载量

222
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:documentation-standards(文件标准)
来源仓库:https://github.com/phrazzld/claude-config
仓库路径:skills/documentation-standards
安装命令:
npx skills add https://github.com/phrazzld/claude-config --skill documentation-standards
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/phrazzld/claude-config --skill documentation-standards

简介

documentation-standards 用于辅助文档、README 和内容稿件的整理与改写,适合提炼结构或统一术语。

  • 适用于文档编写和内容优化场景,需保留项目已有事实,避免过度营销。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装使用。
  • 使用时应控制语气,不要把未确认的信息写成确定结论。
  • 当前分类为研究检索,支持主流 Agent 宿主平台。

SKILL.md

Documentation Standards

Universal principles for effective documentation. Language-agnostic—focus on what and when to document, not syntax.

Core Principle

Good code documents itself. Comments explain what code cannot.

Prefer clear names and simple structure over comments. Write comments for reasoning, not restating.


Comments vs Code

When to Comment

ALWAYS comment:

  • Why (reasoning, trade-offs, decisions)

- "Use exponential backoff to avoid overwhelming API during outages" - "Chose algorithm X over Y because of O(n) vs O(n²) performance"

  • Non-obvious decisions

- "Cache invalidation: 5 minutes chosen to balance freshness vs load" - "Intentionally skipping validation here—already validated upstream"

  • Workarounds

- "Temporary fix for bug in library X version 1.2.3" - "Work around browser quirk in Safari < 15"

  • Gotchas and constraints

- "Must call init() before use or will throw" - "Not thread-safe—caller must synchronize" - "Order matters: must authenticate before making requests"

SOMETIMES comment:

  • Complex algorithms (high-level what, not line-by-line)

- "Binary search to find insertion point in sorted array" - "Dijkstra's algorithm for shortest path"

  • Business rules

- "Tax calculation per regulation ABC-123 effective Jan 2024" - "Discount tiers: 10% for >100 items, 20% for >500"

RARELY comment:

  • What (code should be self-documenting)

- If you need to explain what, improve naming/structure first

NEVER comment:

  • Obvious code

- Bad: i++ // Increment i

  • Commented-out code (delete it—it's in git)
  • Lies (outdated comments worse than no comments)

"Why Not What" Principle

Good comments (explain reasoning):

// Use exponential backoff to prevent thundering herd
retryDelay = baseDelay * Math.pow(2, attempt)

// Cache for performance—database query is expensive
const cachedResult = cache.get(key)

Bad comments (restate code):

// Set retry delay to base delay times 2 to the power of attempt
retryDelay = baseDelay * Math.pow(2, attempt)

// Get cached result from cache
const cachedResult = cache.get(key)

Exceptions to "Why Not What"

Complex algorithms benefit from high-level "what":

// Find longest common subsequence using dynamic programming
// Returns length and the subsequence itself
function longestCommonSubsequence(s1, s2)

Public API contracts (inputs, outputs, errors):

// Authenticates user with email and password
// Returns: User object on success
// Throws: AuthError if credentials invalid
// Throws: NetworkError if connection fails
function authenticate(email, password)

Comment Density: Minimal

Prefer over comments:

  1. Better names
  2. Simpler code structure
  3. Extracted functions (self-documenting)
  4. Smaller modules

Rule: If you need a comment to explain what code does, refactor first.

Comments should add information code cannot express.


README and Technical Docs

README.md Structure

Every project needs a README.

Minimal required sections:

  1. What (one sentence)

- Clear, concise description - "Task management CLI tool for developers"

  1. Why (problem it solves)

- "Existing task managers don't integrate with git/editors"

  1. Quick Start (fastest path to running)

- Installation - Basic usage example - This comes FIRST after description

  1. Setup (getting started)

- Prerequisites - Installation steps - Configuration

Optional sections (add as needed):

  • Examples (common use cases)
  • Features (capabilities)
  • Documentation (link to detailed docs)
  • Contributing (how to help)
  • License
  • Troubleshooting (common issues)

README Anti-Patterns

Novel-length README

  • Save detailed docs for separate files
  • README should get you started, not cover everything

Out-of-date examples

  • Worse than no examples
  • Update with breaking changes or delete

No quick start

  • Forcing users to read entire doc before trying it
  • Put fastest path to success up front

Installation that doesn't work

  • Test your own installation instructions
  • What works on your machine ≠ what works elsewhere

Other Documentation Types

ADRs (Architecture Decision Records):

  • What: Record of architectural decisions
  • When: Making significant architectural choices
  • Format: Context, Decision, Consequences
  • Example: "Why we chose database X over Y"

ARCHITECTURE.md:

  • What: High-level system design
  • When: System complex enough to need overview
  • Content: Components, relationships, data flow
  • Keep: Updated with major changes

CONTRIBUTING.md:

  • What: How to contribute to project
  • When: Accepting external contributors (open source, team projects)
  • Content: Setup, workflow, standards, review process

CHANGELOG.md:

  • What: What changed between versions
  • When: Project has releases/versions
  • Format: Chronological, grouped by version
  • Include: Added, Changed, Fixed, Removed

API Documentation:

  • What: Public API reference
  • When: Building libraries for others
  • Best: Generated from code comments (stays in sync)
  • Avoid: Manually maintained separate docs (get stale)

When to Create Each Document

  • README: ALWAYS (every project)
  • ADRs: Significant architectural decisions
  • ARCHITECTURE.md: Complex system needing diagram
  • CONTRIBUTING.md: Accepting external contributions
  • CHANGELOG: Versioned releases
  • API docs: Libraries meant for other developers

Documentation Maintenance

When to Update Docs

ALWAYS update:

  • Breaking changes (users depend on documented behavior)
  • New features (users need to discover them)
  • Deprecated features (warn before removal)

USUALLY update:

  • Bug fixes that change behavior
  • New configuration options
  • Performance improvements (if significant)

RARELY update:

  • Internal refactors (implementation changes)
  • Bug fixes that don't change behavior
  • Code cleanup

Stale Docs Are Worse Than No Docs

Users trust documentation.

Wrong documentation is worse than no documentation—it wastes time and builds mistrust.

If you can't maintain docs:

  • Delete them (better than lying)
  • Or clearly mark as outdated
  • Or link to code as source of truth

Documentation Debt

When to defer documentation:

  • Experimental features (still exploring)
  • Internal tools (team already knows)
  • Prototypes (may be discarded)

When documentation debt becomes unacceptable:

  • Feature shipping to users
  • Onboarding new team members
  • Open sourcing project

Automated Documentation Quality

Link Checking (lychee - Rust binary):

lychee **/*.md --offline --cache
  • Single binary, no Node.js
  • ~40x faster than markdown-link-check
  • Works offline completely
  • Install: brew install lychee

Style Linting (Vale - Go binary):

vale docs/
  • Enforces style guides (Google, Microsoft, write-good)
  • Single binary, 100% offline
  • YAML configuration (.vale.ini)
  • Install: brew install vale

Freshness Detection (git-based):

# Find docs not updated in 90 days
find docs -name '*.md' | while read f; do
  age=$(( ($(date +%s) - $(git log -1 --format=%ct -- "$f")) / 86400 ))
  [ $age -gt 90 ] && echo "$f: $age days stale"
done

CI Integration: All run in GitHub Actions without external services


Diagrams

When to Use Diagrams

Use diagrams when they clarify:

  • System architecture (components, relationships)
  • Data flow (how data moves through system)
  • State machines (states and transitions)
  • Complex interactions (sequence diagrams)

Don't use diagrams:

  • As decoration (diagrams should clarify, not prettify)
  • For simple systems (often code is clearer)
  • Without maintaining them (stale diagrams mislead)

Diagram Principles

Keep simple:

  • Complex diagrams become stale
  • Focus on high-level relationships
  • Details belong in code

Text-based preferred:

  • Version control friendly
  • Easy to update
  • Tools: Any text-based diagram format your team prefers

Maintain or delete:

  • Update diagrams with system changes
  • Or delete outdated diagrams (don't let them lie)

Quick Reference

Documentation Checklist

Before writing comment:

  • Can I make code clearer instead?
  • Am I explaining "why" or just "what"?
  • Would future me find this helpful?
  • Is this non-obvious or a gotcha?

Before shipping feature:

  • README updated (if user-facing)?
  • Breaking changes documented?
  • Examples still work?
  • Quick start still accurate?

Starting new project:

  • README with What, Why, Quick Start, Setup
  • License (if sharing)
  • .gitignore (keep docs, ignore build artifacts)

When making architectural decision:

  • Should this be an ADR?
  • Will team need context in 6 months?
  • Is this a significant departure from current approach?

Philosophy

"Code tells you how. Comments tell you why."

The best documentation is code that doesn't need documentation. But when code can't express intent, comments bridge the gap.

Documentation is for humans:

  • Future you (6 months from now)
  • Team members (new and experienced)
  • Users (trying to use your code)

Documentation is not:

  • A substitute for clear code
  • A place to explain bad design
  • Something to write and forget

Remember: Undocumented code is hard to use. Documented wrong code is harder.


Exit Codes and Error Codes

Documentation drift is silent. When documenting exit codes, error codes, or error-to-behavior mappings:

  1. Trace actual code paths. Don't document intent—document what the code actually does.
  2. Check all callers. An error code might be defined but never used, or used differently than named.
  3. Grep for the constant. grep -rn "ExitCodeFoo" internal/ reveals actual usage.

Verification rule: After writing error/exit code docs, verify each code against its actual trigger in the codebase.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.53%
按下载量换算79

Claude

29.37%
按下载量换算65

Cursor

19.04%
按下载量换算42

Gemini CLI

8.44%
按下载量换算19

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills