Skip to content
ai-doc-writing logo

AI-Optimized Documentation Writing

ai-doc-writing

This skill should be used when writing, reviewing, or refactoring documentation that will be consumed as AI context. Optimizes documentation for LLM comprehension using principles of completeness, efficiency, and zero fluff—replacing prose with structured data, enforcing heading hierarchy, detect...

SKILL.md

Full skill instructions

AI-Optimized Documentation Writing

Overview

Documentation consumed by AI has fundamentally different requirements than human-facing docs. LLMs process documentation at passage-level (phrase chunks), build mental models from heading structure, and are confused by meta-commentary, synonym variation, and narrative prose.

This skill provides:

  1. Style principles for writing AI-context docs (completeness + efficiency + zero fluff)
  2. Fluff detector (automated checker for common violations)
  3. Refactoring patterns for converting verbose docs to AI-optimized structure

When to use: Writing, reviewing, or refactoring any documentation intended for AI consumption (setup guides, architecture docs, API references, workflow guides, configuration specs).


Core Principles

Completeness: Every critical piece of information must be present. No assumptions about reader background.

Efficiency: Only essential information. No explanations of design choices, meta-commentary, or justifications.

Zero Fluff: No meta-commentary ("Updated!", "We added..."), conversational language ("You'll want to..."), transition phrases ("As mentioned..."), or redundant restatements.


Writing Workflow

1. Choose Document Structure

Pick the format that best serves the content:

  • Bullets + structured data for facts, relationships, configuration
  • Code blocks for examples that show non-obvious behavior
  • Numbered steps for workflows with clear sequence
  • Heading hierarchy (H2 → H3 → H4, never skip levels)

2. Fill Content by Category

Configuration/​Relationships: Use YAML/​code blocks, not prose

**Fallback chain:**
- ja → en
- ko → en
- zh-tw → zh-cn → en

Procedures: Numbered steps with inputs/​outputs

1. Load recipe with eager-loaded associations
2. Instantiate RecipeTranslator
3. For each language, call translator.translate_recipe()
4. Apply translations via apply_translations()

Behavior: Code examples only when they show edge cases/​counterintuitive behavior

I18n.with_locale(:ja) { recipe.name }  # Falls back to 'en' if translation missing

3. Run Fluff Detector

Before committing:

python3 scripts/​fluff-detector.py your-doc.md

Detector catches:

  • Meta-commentary: "Last Updated", "We fixed", "UPDATED!"
  • Conversational language: "You'll want to", "Gotchas", "TLDR"
  • Heading hierarchy violations: H2 → H4 (skipped H3)
  • Synonym variation: Multiple terms for same concept
  • Transition phrases: "As mentioned", "Additionally"
  • Redundant restatement: Explaining old way + new way

4. Address Violations

Meta-commentary: Remove entirely. Just describe current state.

  • ❌ "We recently migrated to Mobility"
  • ✅ "Backend: Table (Mobility gem)"

Conversational language: Convert to imperative structure.

  • ❌ "For those who want to understand how this works..."
  • ✅ "How it works: [structure content]"

Hierarchy violations: Insert missing heading level.

  • ❌ ## Configuration → #### Translation Tables
  • ✅ ## Configuration → ### Translation System → #### Translation Tables

Synonym variation: Replace all with single consistent term.

  • ❌ "Mobility (i18n gem, translation system, locale handler)"
  • ✅ "Mobility (the translation system)"

Redundant restatement: Keep only the version that's clearest.

  • ❌ "Previously JSONB, now translation tables. Translation tables are better because..."
  • ✅ "Storage: Dedicated translation tables (UUID foreign keys, locale-scoped uniqueness)"

5. Validate Examples

Examples should reveal non-obvious behavior. If example just restates description, remove it.

✅ Include: Shows edge case/​counterintuitive behavior

# Fallback behavior when translation missing
I18n.with_locale(:ja) { recipe.name }  # Returns English translation

❌ Exclude: Restates description

# To read a translation, use I18n.with_locale
I18n.with_locale(:ja) { recipe.name }

Reference: Style Guide

See references/​style-guide.md for:

  • Detailed patterns (good vs bad for each doc type)
  • Complete fluff checklist
  • Common mistakes and fixes
  • Self-check before committing

Tool: Fluff Detector

Automated checker for common violations.

Usage:

# Check single file
python3 scripts/​fluff-detector.py documentation.md

# Check multiple files
python3 scripts/​fluff-detector.py doc1.md doc2.md doc3.md

Output: Lists line numbers with violation type and content snippet

Catches:

  • Meta-commentary (errors—blocking)
  • Conversational language (warnings)
  • Heading hierarchy violations (warnings)
  • Transition phrases (warnings)
  • Redundant restatement patterns (warnings)

Refactoring Patterns

Pattern 1: Prose → Bullets + Structure

Before:

Mobility is configured with several important plugins. The fallbacks plugin
handles missing translations gracefully by falling back to the fallback locale.
We've configured the fallback chain so that Japanese falls back to English.

After:

**Plugins:** fallbacks, reader, writer, query, cache, locale_accessors

**Fallback chain:**
- ja → en

Pattern 2: Narrative → Steps + Outputs

Before:

When a recipe is created, the system triggers a background job called
TranslateRecipeJob. This job instantiates the RecipeTranslator service and
then calls the translate method for each language. Finally, it updates the
recipe's translations_completed flag.

After:

**Trigger:** Recipe creation (background job)

**Process:**
1. Instantiate RecipeTranslator
2. For each language [ja, ko, zh-tw, zh-cn, es, fr]:
   - Call translator.translate_recipe(recipe, lang)
   - Apply translations via apply_translations()
3. Set recipe.translations_completed = true

Pattern 3: Multiple terms → Single consistent term

Before:

The system uses the Mobility gem (also known as the i18n library or translation system)
to manage translations (also called locales or language variants).

After:

Mobility manages translations across 6 languages.

Checklist: Before Committing Docs

  • Run fluff detector: python3 scripts/​fluff-detector.py file.md
  • No meta-commentary (dates, "we fixed", "updated!")
  • No conversational language ("You'll want to", "Gotchas")
  • Heading hierarchy strict (H2 → H3 → H4, no skips)
  • One term used consistently (no synonyms)
  • Examples only show non-obvious behavior
  • All information is essential (no "nice to know")
  • Structured data for relationships/​config (not prose)
  • Each bullet is atomic (independent idea)

Examples

See provided before/​after examples in this skill documentation for patterns:

  • Configuration documentation
  • Workflow documentation
  • Data structure documentation
  • Procedure documentation
  • Fluff examples (what to detect and remove)

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View