Optimizes documentation for both human readability and AI retrieval (RAG readiness) through structural improvements.

Install

mkdir -p .claude/skills/enhance-docs-christophacham && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16365" && unzip -o skill.zip -d .claude/skills/enhance-docs-christophacham && rm skill.zip

Installs to .claude/skills/enhance-docs-christophacham

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Use when improving documentation structure, accuracy, and RAG readiness.
72 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Analyze documentation for readability
  • Validate link integrity
  • Check heading hierarchy and structure
  • Optimize content for token reduction
  • Improve RAG readiness with chunking guidelines
  • Apply auto-fixes for identified issues

How it works

The skill discovers and parses Markdown files, runs pattern checks for links, structure, token efficiency, and RAG optimization, then generates a report and applies auto-fixes if requested.

Inputs & outputs

You give it
A path to Markdown documentation files, with optional --fix or --ai flags
You get back
A markdown report detailing issues and optionally applying fixes to the documentation

When to use enhance-docs

  • Optimizing docs for AI agents
  • Fixing broken links in READMEs
  • Structuring documentation for RAG

About this skill

enhance-docs

Analyze documentation for readability, structure, and RAG optimization.

Parse Arguments

const args = '$ARGUMENTS'.split(' ').filter(Boolean);
const targetPath = args.find(a => !a.startsWith('--')) || '.';
const fix = args.includes('--fix');
const aiMode = args.includes('--ai');

Documentation Locations

TypeLocationPurpose
User docsdocs/*.md, README.mdHuman-readable guides
Agent docsagent-docs/*.mdAI reference material
Project memoryCLAUDE.md, AGENTS.mdAI context/instructions

Optimization Modes

AI-Only Mode (--ai)

For agent-docs and RAG-optimized documentation:

  • Aggressive token reduction
  • Dense information packing
  • Self-contained sections for retrieval
  • Optimal chunking boundaries

Both Mode (--both, default)

For user-facing documentation:

  • Balance readability with AI-friendliness
  • Clear structure for both humans and retrievers

Workflow

  1. Discover - Find all .md files
  2. Parse - Extract structure and content
  3. Check - Run pattern checks based on mode
  4. Report - Generate markdown output
  5. Fix - Apply auto-fixes if --fix

Detection Patterns

1. Link Validation (HIGH)

  • Broken anchor links ([text](#missing-anchor))
  • Links to non-existent files
  • Malformed link syntax

2. Structure Validation (HIGH)

Heading hierarchy:

  • No jumps (H1 → H3 without H2)
  • Single H1 per document
  • Code blocks with language tags

Position-aware content (based on "lost in the middle" research):

  • Critical info at START or END of document
  • Supporting details in MIDDLE
  • Flag important content buried in middle sections

Recommended structure:

1. Overview/Purpose (START - high attention)
2. Quick Start / TL;DR
3. Detailed Content
4. Reference / API
5. Summary / Key Points (END - high attention)

3. Token Efficiency (HIGH - AI Mode)

Token estimation: characters / 4 or words * 1.3

Unnecessary prose:

  • "In this document..."
  • "As you can see..."
  • "Let's explore..."
  • "It's important to note that..."

Verbose phrases:

VerboseConcise
"in order to""to"
"due to the fact that""because"
"has the ability to""can"
"at this point in time""now"
"for the purpose of""for"
"in the event that""if"

Target: ~1500 tokens for project memory files, flexible for reference docs.

4. RAG Optimization (MEDIUM - AI Mode)

Chunk size guidelines:

SizeIssue
>1000 tokensToo long, split into subtopics
<50 tokensToo short, merge with related content
200-500 tokensOptimal for retrieval

Semantic boundaries:

  • Single topic per section
  • Self-contained sections (avoid "It", "This" at section start)
  • Clear section titles that describe content

Context anchors:

# Bad - ambiguous start
## Configuration
It requires several settings...

# Good - self-contained
## Configuration
The plugin configuration requires several settings...

5. Information Density (MEDIUM - AI Mode)

Prefer tables over prose:

# Bad - verbose
The function accepts a path parameter which is required,
a limit parameter which defaults to 10, and an optional
format parameter.

# Good - dense
| Param | Required | Default | Description |
|-------|----------|---------|-------------|
| path | Yes | - | File path |
| limit | No | 10 | Max results |
| format | No | json | Output format |

Prefer lists over paragraphs for sequential items.

Use code blocks for examples, commands, configurations.

6. Cross-Reference Quality (MEDIUM)

  • Internal links should use relative paths
  • External links should be stable (avoid commit hashes)
  • Reference sections should point to canonical sources

7. Balance Suggestions (MEDIUM - Both Mode)

  • Missing section headers in long content (>500 words without heading)
  • Important information buried late in document
  • Missing TL;DR or summary for long documents

Auto-Fixes

IssueFix
Inconsistent headingsH1 → H3 becomes H1 → H2
Verbose phrasesReplace with concise alternatives
Missing code languageAdd based on content detection

Output Format

## Documentation Analysis: {name}

**File**: {path}
**Mode**: {AI-only | Both}
**Tokens**: ~{count}

| Certainty | Count |
|-----------|-------|
| HIGH | {n} |
| MEDIUM | {n} |

### Link Issues
| Line | Issue | Fix | Certainty |

### Structure Issues
| Line | Issue | Fix | Certainty |

### Efficiency Issues [AI mode]
| Line | Issue | Fix | Certainty |

### RAG Issues [AI mode]
| Line | Issue | Fix | Certainty |

Pattern Statistics

CategoryPatternsModeCertainty
Links3sharedHIGH
Structure4sharedHIGH
Token Efficiency3aiHIGH
RAG Optimization3aiMEDIUM
Information Density2aiMEDIUM
Cross-Reference2sharedMEDIUM
Balance3bothMEDIUM
Total20--
<examples> ### Verbose Phrase <bad_example> ```markdown In order to configure the plugin, you need to... ``` </bad_example> <good_example> ```markdown To configure the plugin... ``` </good_example>

RAG Chunking

<bad_example>

## Installation
[2000+ tokens of mixed content covering install, config, and usage]

</bad_example> <good_example>

## Installation
[400 tokens - installation only]

## Configuration
[300 tokens - config only]

## Usage
[400 tokens - usage only]

</good_example>

Position-Aware Content

<bad_example>

## Introduction
[Long background...]

## History
[More context...]

## Critical Setup Steps
[Important info buried in middle]

</bad_example> <good_example>

## Quick Start (Critical)
[Important setup steps at START]

## Background
[Supporting context in middle]

## Reference
[Details...]

## Key Reminders
[Critical points repeated at END]

</good_example>

Tables vs Prose

<bad_example>

The API accepts three parameters. The first is `query` which is required.
The second is `limit` which defaults to 10. The third is `format`.

</bad_example> <good_example>

| Param | Required | Default |
|-------|----------|---------|
| query | Yes | - |
| limit | No | 10 |
| format | No | json |

</good_example> </examples>

References

  • agent-docs/CONTEXT-OPTIMIZATION-REFERENCE.md - Token budgeting, position awareness, chunking
  • agent-docs/PROMPT-ENGINEERING-REFERENCE.md - Structure, information density

Constraints

  • Auto-fix only HIGH certainty issues
  • Preserve original tone and style
  • Balance AI optimization with human readability (default mode)
  • Don't remove content, only restructure or condense

Limitations

  • Auto-fix only HIGH certainty issues
  • Preserve original tone and style
  • Balance AI optimization with human readability (default mode)

How it compares

This skill specifically optimizes documentation for AI retrieval and token efficiency while balancing human readability, unlike general documentation linters.

Compared to similar skills

enhance-docs side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
enhance-docs (this skill)05moNo flagsIntermediate
postmortem-writing172moNo flagsBeginner
wiki-page-writer53moNo flagsAdvanced
confluence-assistant15moReviewBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

postmortem-writing

wshobson

Write effective blameless postmortems with root cause analysis, timelines, and action items. Use when conducting incident reviews, writing postmortem documents, or improving incident response processes.

1799

wiki-page-writer

microsoft

Generates rich technical documentation pages with dark-mode Mermaid diagrams, source code citations, and first-principles depth. Use when writing documentation, generating wiki pages, creating technical deep-dives, or documenting specific components or systems.

530

confluence-assistant

tech-leads-club

Expert in Confluence operations using Atlassian MCP - automatically detects workspace Confluence configuration or prompts for site details. Use for searching, creating, updating pages, managing spaces, and adding comments with proper Markdown formatting.

110

business-knowledge-workflow

TencentBlueKing

业务知识获取与 Skill 文档编写工作流。当用户需要熟悉新业务模块、从 iWiki 获取文档、结合代码分析生成架构文档、或将业务知识沉淀为 Skill 时使用。

15

technical-doc-creator

mhattingpete

Create HTML technical documentation with code blocks, API workflows, system architecture diagrams, and syntax highlighting. Use when users request technical documentation, API docs, API references, code examples, or developer documentation.

15

Outline Open Source Team Knowledge Base and Wiki Platform

agentskillexchange

Outline is a fast, collaborative knowledge base for teams built with React and Node.js. It provides real-time editing, Markdown support, and a rich API for integration with Slack, authentication providers, and custom workflows.

00

Search skills

Search the agent skills registry