
Enhance Docs
- 63 installs
- 931 repo stars
- Updated July 26, 2026
- avifenesh/agentsys
enhance-docs is a Claude skill that analyzes documentation for readability, structure, token efficiency, and RAG optimization, with optional auto-fixes.
About
This skill analyzes documentation for readability, structure, and RAG readiness. It validates links and heading hierarchy, estimates tokens and trims verbose phrasing, and recommends chunk sizes and self-contained sections for retrieval. An AI-only mode packs information densely for agent docs, while the default mode balances human and AI readers, with auto-fixes behind a --fix flag.
- Validates links and heading hierarchy and flags content buried in the middle
- Token-efficiency checks that rewrite verbose phrases into concise ones
- RAG optimization with 200-500 token chunk targets and self-contained sections
Enhance Docs by the numbers
- 63 all-time installs (skills.sh)
- Ranked #735 of 1,879 Documentation skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
enhance-docs capabilities & compatibility
- Capabilities
- docs review · rag optimization · token optimization
- Use cases
- documentation · token optimization
What enhance-docs says it does
Analyze documentation for readability, structure, and RAG optimization.
For agent-docs and RAG-optimized documentation:
npx skills add https://github.com/avifenesh/agentsys --skill enhance-docsAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 63 |
|---|---|
| repo stars | ★ 931 |
| Last updated | July 26, 2026 |
| Repository | avifenesh/agentsys ↗ |
What it does
Analyze documentation for readability, structure, token efficiency, and RAG optimization, with optional auto-fixes.
Who is it for?
Improving markdown docs for readability, token efficiency, and retrieval
Skip if: Writing documentation from scratch or reviewing code
When should I use this skill?
The user wants to improve documentation structure, accuracy, or RAG readiness
What you get
Docs graded and optionally rewritten for readability, token efficiency, and RAG-friendly chunking.
- documentation report
- auto-fixed markdown
By the numbers
- 200-500 token optimal chunk size
- ~1500 token target for memory files
Files
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
| Type | Location | Purpose |
|---|---|---|
| User docs | docs/*.md, README.md | Human-readable guides |
| Agent docs | agent-docs/*.md | AI reference material |
| Project memory | CLAUDE.md, AGENTS.md | AI 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:
| Verbose | Concise |
|---|---|
| "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:
| Size | Issue |
|---|---|
| >1000 tokens | Too long, split into subtopics |
| <50 tokens | Too short, merge with related content |
| 200-500 tokens | Optimal 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
| Issue | Fix |
|---|---|
| Inconsistent headings | H1 → H3 becomes H1 → H2 |
| Verbose phrases | Replace with concise alternatives |
| Missing code language | Add 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
| Category | Patterns | Mode | Certainty |
|---|---|---|---|
| Links | 3 | shared | HIGH |
| Structure | 4 | shared | HIGH |
| Token Efficiency | 3 | ai | HIGH |
| RAG Optimization | 3 | ai | MEDIUM |
| Information Density | 2 | ai | MEDIUM |
| Cross-Reference | 2 | shared | MEDIUM |
| Balance | 3 | both | MEDIUM |
| Total | 20 | - | - |
<examples>
Verbose Phrase
<bad_example>
In order to configure the plugin, you need to...</bad_example> <good_example>
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, chunkingagent-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
Related skills
FAQ
What does AI-only mode do?
It aggressively reduces tokens, packs information densely, and makes sections self-contained with optimal chunk boundaries for retrieval.
What chunk size does it target?
200-500 tokens per section is optimal for retrieval, flagging chunks over 1000 or under 50 tokens.