AGENT SKILL

document

Write documentation that describes reality, not intentions.

License 许可
Apache-2.0
所属仓库
usurobor/cnos
最近更新
2026-11-07
Stars
★ 9
Forks
0

01 前言 Front Matter

name
document
scope
task-local
triggers
[ "document", "docs", "README", "write docs", "explain" ]
description
Write documentation that describes reality, not intentions.
governing_question
How do we write docs whose every claim is verified against the source of truth?

02 资源文件 23

03 SKILL.md 正文

Document

Write documentation that describes reality, not intentions.

Core Principle

Coherent documentation: every claim is verified against source of truth.


1. Define

1.1. Identify the parts

  • Claim (what the doc asserts)
  • Source (code, spec, or upstream doc)
  • Verification (checking claim against source)
  • ❌ Write from memory or copy from other docs
  • ✅ Check code/spec, then write what you verified

1.2. Articulate how they fit

  • Claims describe sources; verification ensures alignment
  • Docs are a view of reality, not a separate truth
  • ❌ "The README says X, so X is true"
  • ✅ "Code does X, so the README should say X"

1.3. Name the failure mode

  • Drift: docs say one thing, code does another
  • Propagation: copying stale claims between docs
  • ❌ "Messages are encrypted at rest" (copied from old README, never verified)
  • ✅ "Code shows plaintext storage; fixed all docs that claimed encryption"

2. Unfold

2.1. Source of truth hierarchy

  • Code > Spec > Docs
  • When they conflict, trust the higher source
  • ❌ Spec says X, code does Y → "spec is authoritative"
  • ✅ Spec says X, code does Y → either fix code or update spec, then align docs

2.2. Verify before writing

  • Every claim requires a source check
  • README claims about behavior → check code
  • Architecture claims about protocol → check spec
  • ❌ "The transport works by..." (from memory)
  • ✅ grep -n "send\|push" src/ → write what code actually does

2.3. Verify after editing

  • Cross-check related docs for consistency
  • Search for same claim in other files
  • ❌ Fix README, leave ARCHITECTURE with old wording
  • ✅ grep -r "push.*branch" docs/ → fix all occurrences

3. Rules

3.1. Trace every claim to source

  • If you can't point to code or spec, don't write it
  • ❌ "The system reads config from ~/.config" (assumed)
  • ✅ "Config loaded from $XDG_CONFIG_HOME" (verified in config.ml:42)

3.2. Don't copy between docs without verifying

  • Other docs may be stale; copying propagates drift
  • ❌ README says X → copy X to ARCHITECTURE
  • ✅ README says X → check code → write verified claim to both

3.3. Update all occurrences

  • A claim appears in multiple places; fix all or fix none
  • ❌ Fix one file, leave others inconsistent
  • ✅ grep -rn "old claim" --include="*.md" → fix every hit

3.4. Version and date normative docs

  • Specs need versions; readers need to know what's current
  • ❌ Spec doc with no version header
  • ✅ **Version:** 2.0.4 at top, updated on every normative change

3.5. Examples must run

  • Code blocks are claims; verify them
  • ❌ cn sync example that errors on current version
  • ✅ Run the example, paste actual output

3.6. Remove, don't comment

  • Dead docs mislead; delete or archive
  • ❌ <!-- old section, might need later -->
  • ✅ git rm or move to _archive/

4. Checklist

Before committing doc changes:

  • [ ] Each new claim traced to code or spec
  • [ ] grep for same claim in other docs — all consistent
  • [ ] Examples tested — they run and output matches
  • [ ] No stale references to removed features
  • [ ] Version bumped if normative doc

5. Structure

Doc type Purpose Source of truth
README Entry point, quick start Code (commands, behavior)
Architecture docs System overview Code (modules, flow)
Specs / RFCs Protocol or design spec Themselves (normative)
Changelog Version history Git commits
How-to guides Procedures Code (steps must work)
Principles / values Guiding rules Themselves (normative)

6. Style

6.1. Short, direct sentences

  • ❌ "It should be noted that the agent is responsible for..."
  • ✅ "The agent produces output."

6.2. Concrete facts, no vibes

  • ❌ "The system is designed to be flexible"
  • ✅ "Supports three transport levels: L0 (PR), L1 (push-to-self), L2 (bundle)"

6.3. Only claim what you can prove

  • ❌ "This is the fastest approach"
  • ✅ "Benchmarks show 12ms p99 latency (see perf/results.md)"

04 同仓库更多 Skills

usurobor
usurobor/cnos

Issue 分诊与判定

issues/triage

Issue 分诊规则指引。在对新 issue 进行分类、判定其是否符合派发条件,或决定将其关闭/取代/延后时使用。

软件开发工程师工单与问题跟踪管理
★ 9
usurobor
usurobor/cnos

Issue 标签分类体系

issues/taxonomy

Issue 标签分类体系指引。在对 issue 的 kind/area/priority/effort/status/protocol/dispatch 标签进行分类,或看板需要解读这些标签时使用。

软件开发工程师工单与问题跟踪管理
★ 9
usurobor
usurobor/cnos

issues/map

Issue-board (Issue Pivot) generation domain. Use when reasoning about `cn issues map`'s fetch, taxonomy-parse, effort-computation, and render pipeline, or about the board's JSON/HTML output contract.

★ 9
usurobor
usurobor/cnos

issues

cnos.issues package entrypoint. Use when reasoning about issue taxonomy, the Issue Pivot / issue-board (`cn issues map`), the read-only CDS issue-state evaluator (`cn issues fsm evaluate`), or the current command-dispatch disposition of issue tooling.

★ 9
usurobor
usurobor/cnos

receipt-stream

Cross-cycle receipt-stream doctrine for protocol-iteration. Use when γ closes a cycle and writes the per-cycle iteration artifact (`cdd-iteration.md`), when γ updates the cross-cycle aggregator at `.cdd/iterations/INDEX.md`, when ε reads the receipt stream across cycles to surface protocol-gap patterns, when a finding's disposition lands a cross-repo patch and the cross-repo trace bundle attaches, or when a courtesy empty-findings stub is written for a `protocol_gap_count == 0` cycle.

★ 9
usurobor
usurobor/cnos

mid-flight

Mid-flight γ→in-flight-α rescue channel. Use when γ needs to change a load-bearing fact (pinned axis, scope, AC, blocker) after α has begun coding, when γ edits the cycle's GitHub issue body mid-cycle, or when a spec change lands on origin/main while α/β polling sessions are in-flight.

★ 9