CommunityCoding & Developmentgithub.com

YuShenLiu06/yushen-skills

Review or refine existing technical documentation with authorization, improving repetition, headings, information order, diagrams, and examples while preserving behavioral contracts, essential warnings, and accessibility. Used for documents that are too long, hard to find information, need pre-publication review, or when rewriting is explicitly requested; not for creating documents from scratch.

What is yushen-skills?

This skill, named `doc-refine`, is designed to optimize the reading experience of technical documentation by focusing on clarity, conciseness, and information architecture. It provides a structured workflow for reviewing and refining existing docs, guided by two core axioms: 'Quick Find' (ensuring readers can locate information via clear headings and structure) and 'Every Section Has a Purpose' (ensuring no content is redundant or unnecessary). The skill explicitly protects critical elements such as technical behaviors, API contracts, safety warnings, accessibility notes, working examples, and source links from being removed or altered. It includes quantitative baseline checks and anti-pattern detection to help maintain high documentation standards. This skill is platform-agnostic, applicable to any documentation repository or editor that supports markdown, and is particularly useful for developers, technical writers, and AI agents tasked with improving existing technical content.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/YuShenLiu06/yushen-skills/tree/HEAD/skills/doc-refine

Installed? Explore more Coding & Development skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

doc-refine — Technical Documentation Reading Experience Optimization Guide

Review vs. Rewrite Boundaries

First, distinguish between review and rewrite: when only a review is requested, provide issues and suggestions; when a rewrite is explicitly requested, only modify authorized documents. If changes involve behavior or facts rather than expression adjustments, preserve the original intent and point out parts requiring confirmation.

Protect before trimming: Technical behaviors, API/data contracts, preconditions and boundary conditions, security and legal warnings, accessibility alternative descriptions, valid examples, source links, and stable anchors. Code already having the same behavior is not sufficient evidence that documentation can be deleted; locally necessary repetition can aid independent reading.

Two Inspection Goals

All judgments ultimately reduce to two questions:

AxiomQuestion to Ask YourselfIn One Sentence
① Quick FindCan the target reader determine where information is from the table of contents and headings?Clear Signposts
② Every Paragraph Has a PurposeWould deleting it lose information needed to complete a task, understand behavior, or control risk?Complete and Concise

Apply these two checks to every piece of content. If ① is not met → change headings, add diagrams, adjust structure. If ② is not met → cross-check protected items and reader tasks, then suggest merging or trimming; do not delete necessary content just to reduce length.

Workflow

1. Diagnose (Read the Full Document First, Don't Rush to Edit)

Read through the target document, recording issues per section:

  • Does the heading convey content independently of numbering? (No → Axiom ① violation)
  • Does the same logic/rule appear in 2+ places? (Yes → Axiom ② violation)
  • Does this behavioral description help users understand contracts, constraints, or outcomes? Judge purpose first; don't mechanically delete based on "what/why."
  • Is the lead-in only repetitive padding? Can be trimmed, but retain step orientation, warnings, or limitations.
  • Are 3+ items being compared scattered in prose? (Yes → Use a table)
  • Is a diagram easier to understand for flows or states than text? Choose Mermaid or keep text based on the target renderer's capability.
  • Does the example address real confusion, error recovery, or edge cases? Keep examples valid for the target reader.

2. Fix (Apply Changes Categorized by Axiom)

See specific rules below in §Axiom ① and §Axiom ②.

3. Verify (Quantitative Baseline)

After fixing, read the Checklist as needed to check information completeness and reading effectiveness. Not every metric must be met—they are diagnostic tools, not laws; exceptions are allowed when clarity takes precedence.


Axiom ①: Quick Find

Heading Discernibility

Headings are signposts. When maintainers scan the TOC, they should immediately know what each section contains.

Judgment Criteria: If you need to click into the section to know what it's about, the heading is too vague.

❌ Too Vague✅ DiscernibleWhy Changed
5.1 Table-level5.1 Project CRUD (Table-level Endpoints)"Table-level" could be anything
5.3 Row-level5.3 Row-level Collaboration EndpointsReader knows there are operations like claiming/delivering here
5.4 Export5.4 Full CSV ExportWhat format? Full or partial?
EndpointsHTTP EndpointsRemove ambiguity

Tip: When core concepts are too short, add qualifiers in parentheses for key information. But don't overdo it— the goal is to convey "what's in this section" in ≤15 characters, not write a paper title.

Information Architecture

  • One job per section: Organize content by the primary reader task (tutorial, how-to, reference, explanation); necessary API signatures or brief context can be kept, long materials use cross-references.
  • Core first, details later: Place the most important information at the beginning of a section or document top (Progressive Disclosure). Advanced/edge-case information can be collapsed or in appendices.
  • Self-sufficiency principle: Maintainers should be able to start reading from any page without "prior knowledge" (Every Page is Page One). When prerequisite concepts are needed, state them at the top of the section and add links.

Diagram Alt Text

Use diagrams when relationships, sequences, or comparisons are clearer with visual aids; retain searchable text and necessary alternative descriptions.

Decision Tree:

What is the information type?
├─ Multi-step process / branching decisions     → Flowchart
├─ Event-driven state changes                   → State diagram (stateDiagram-v2)
├─ 3+ items × 2+ dimensions to compare          → Table
├─ Component relationships / architecture layers → Diagram + layers
├─ Definitions / context / precise values        → Text (default)
└─ Uncertain                                     → Default to text (diagrams are enhancements, not decorations)

Mermaid Best Practices:

  • Nodes ≤30—beyond that, layout algorithms become unreadable; split into overview+detail multiple diagrams
  • Add labels to branch conditions and unclear relationships; clear sequential arrows may not need labels to avoid label noise
  • Use subgraph to group related nodes
  • TD (top-down) works for hierarchies; LR (left-to-right) works for sequences/pipelines

Table Design (Tufte Principles):

  • Remove unnecessary lines, shadings, pure decoration—"Above all else show the data"
  • Minimal effective difference: visual distinctions as subtle as possible but clear
  • Align numbers by column for easy scanning and comparison
  • Always keep text horizontal; prohibit vertical text

Axiom ②: Every Paragraph Has a Purpose

Deduplication

Having the same information in multiple places is the #1 enemy of maintainability—change one, forget the other.

Detection Criteria (Hit any → needs deduplication):

  1. The same logic/rule appears in 2+ sections → keep the authoritative source (usually the data model or state machine section), change the rest to cross-references
  2. After checking behavior, preconditions, risks, and independent reading, a paragraph has no information loss → merge or trim
  3. Documentation repeats implementation details → judge if the reader needs it; keep behavioral descriptions and contracts; do not delete because code already has it
  4. Multiple equivalent approaches → give a default recommendation; keep necessary alternatives that differ in compatibility, permissions, or usage conditions

ARID ≠ DRY: Documentation accepts necessary repetition—restating reference concepts in tutorials is reasonable. But eliminate parallel maintenance: the same fact should not be maintained independently in two places, or one will inevitably be outdated.

Simplify

Cut everything that does not serve the current needs of the reader.

Bad SmellFixWhy
Repetitive lead-in: "In this section we will discuss…"Merge into direct statementKeep necessary step orientation
Filler words: "It should be noted that" / "It is worth mentioning that"Trim guide phrasesWarnings or limitations themselves must still be retained
Heavy passive voice ("is used for…" "will be…")Change to active SVOShorter, clearer, reader knows "who is doing what"
Synonym drift (same function with different words)Unify terminology, one word one meaningClearly inform the reader of the function's name
Hard-to-read long nested sentencesBreak into logical sentencesDon't break relationships between conditions, exceptions, and conclusions
Listing equivalent optionsRecommended option first, necessary alternatives afterRetain feasible choices under different constraints

Example Restraint

Examples are the strongest quick-answer tool, but also the most easily abused content type. Write the Docs specifically says "Include (some) examples"—the "some" in parentheses is a deliberate limit.

When to Use Examples:

  • Readers need quick answers and will jump directly to examples (first reaction for many)
  • Concepts are hard to understand without concrete examples
  • Demonstrating high-frequency, real-world use cases

When NOT to Use Examples:

  • Demonstrating the obvious (Microsoft: "Don't illustrate obvious points")
  • Artificial scenarios that don't aid understanding; synthetic examples that are clearly marked and verifiable can be kept
  • Adding just for "completeness" without real user need driving it
  • Too many examples already—adding more reduces scannability

Good Examples:

  • Cover only the most common use cases, not exhaustive
  • Self-contained and runnable (copy-paste to work)
  • Progress from simple to complex
  • Show expected output so readers can verify
  • Omit boilerplate only when the example still runs or preconditions are clearly stated; retain necessary imports, error handling, and expected output

Bad Examples:

  • Demonstrating the obvious
  • Unrealistic artificial scenarios
  • One example tries to cover too many variables
  • Error handling unrelated to the example is stuffed in
  • Claimed runnable code not verified; clearly mark verification limits when it cannot run

Position Rules:

  • Simple one-line examples → inline in body
  • Longer examples → separated from dense reference material (standalone paragraphs or collapsible sections)
  • Examples in reference documentation → remain restrained, only for usage illustration, not mixed with teaching

Quantitative Baseline Quick Reference

The following are only initial screening prompts adjusted per language and audience; see Checklist for details.

DimensionSuggested Starting PointUsage Boundary
English sentence lengthWatch for nesting around 20 wordsDo not mechanically apply to Chinese; do not break conditions and contracts
ParagraphOne main point per paragraphExceptions and warnings can stay with the original paragraph
List/stepsConsider grouping when longDo not delete complete steps just to reduce item count
Passive voiceRewrite when subject is unclearSet no mandatory proportion
MermaidConsider overview and details when nodes are manyJudge by actual render readability
TableConsider splitting or transposing for wide tablesKeep necessary columns and units for comparison

Numbers are suggestions, not industry pass/fail standards or research laws; do not alter facts, contracts, safety, or legal texts to meet them.


Anti-Pattern Quick Reference

Anti-PatternSymptomSolution
Almighty ThudMega-document, all information equal weight, key decisions buriedSplit or add priority levels
Type MixingAPI reference stuffed into tutorial, reference contains "why"Separate by Diátaxis
Repetitive Lead-inIntroductory sentences with no substantive informationTrim wording, keep risk and step information
Synonym DriftSame function called by different wordsUnify terminology
Unclear RelationshipsBranch or arrow meaning requires guessingAdd labels to unclear relationships
ChartjunkTables with unnecessary decorative lines, shadingRemove non-informative decoration
Example OverloadExamples exhausting all scenariosKeep only most common use cases
Parallel MaintenanceSame fact maintained independently in multiple placesKeep one, change the rest to links

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

Related Skills