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, detecting meta-commentary, and validating that examples serve a purpose.
Best use case
ai-doc-writing is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
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, detecting meta-commentary, and validating that examples serve a purpose.
Teams using ai-doc-writing should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/ai-doc-writing/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How ai-doc-writing Compares
| Feature / Agent | ai-doc-writing | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
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, detecting meta-commentary, and validating that examples serve a purpose.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# 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
```yaml
**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
```ruby
I18n.with_locale(:ja) { recipe.name } # Falls back to 'en' if translation missing
```
### 3. Run Fluff Detector
Before committing:
```bash
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
```ruby
# Fallback behavior when translation missing
I18n.with_locale(:ja) { recipe.name } # Returns English translation
```
**❌ Exclude:** Restates description
```ruby
# 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:**
```bash
# 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)Related Skills
blog-writing
Write compelling blog posts with proven structure — hook openings, scannable body sections, clear CTAs. Use this skill when drafting blog posts, articles, or content marketing pieces.
writing-skills
Use when creating, updating, or improving agent skills.
writing-project-technical-writing
Writes technical prose (READMEs, ADRs, code comments) in the project's established human voice. Use when creating or editing .md files, writing Swift doc comments, authoring ADRs, or reviewing technical writing for voice consistency.
u09613-writing-and-rhetoric-optimization-for-household-logistics
Operate the "Writing And Rhetoric Optimization for household logistics" capability in production for household logistics workflows. Use when mission execution explicitly requires this capability and outcomes must be reproducible, policy-gated, and handoff-ready.
postmortem-writing
Write effective blameless postmortems with root cause analysis, timelines, and action items. Use when conducting incident reviews, writing postmortem documents, or improving incident response proce...
essay-writing
Writing support (drafting, evaluation and revision) for executives and tech leaders. Support everything from internal culture-building to external technical branding.
copywriting
Write persuasive copy for landing pages, emails, ads, sales pages, and marketing materials. Use when you need to write headlines, CTAs, product descriptions, ad copy, email sequences, or any text meant to drive action. Covers copywriting formulas (AIDA, PAS, FAB), headline writing, emotional triggers, objection handling in copy, and A/B testing. Trigger on "write copy", "copywriting", "landing page copy", "headline", "write a sales page", "ad copy", "email copy", "persuasive writing", "how to write [marketing text]".
Article Writing
Structure and style guidance for law review articles
amazon-writing
Use when writing narrative memos, 6-pagers, 1-pagers, press releases, or PRFAQs in Amazon style. Applies Amazon's no-PowerPoint writing standards with data over adjectives, active voice, and the "so what" test.
algebraic-rewriting
Category-theoretic graph rewriting with DPO, SPO, and SqPO pushouts for C-Sets. Declarative transformation of acset data structures.
ai-writing-detection
Comprehensive AI writing detection patterns and methodology. Provides vocabulary lists, structural patterns, model-specific fingerprints, and false positive prevention guidance. Use when analyzing text for AI authorship or understanding detection patterns.
adr-writing
Write Architectural Decision Records following MADR template. Applies Definition of Done criteria, marks gaps for later completion. Use when generating ADR documents from extracted decisions.