Progressive Disclosure for Documentation

lesson patterns active patterns/progressive-disclosure.md View on GitHub

Progressive Disclosure for Documentation

Rule

Restructure large documentation files (>500 lines, >5k tokens) into slim indexes with on-demand detail directories.

Context

When always-included documentation files consume excessive context tokens.

Detection

Observable signals:

Pattern

Split monolithic docs into slim index + detail directories:

# Before: monolithic (11k tokens always)
TOOLS.md
├── Section 1 (rarely needed)
├── Section 2 (rarely needed)
└── ... (15+ sections)

# After: progressive (4k tokens always)
tools/
├── README.md     # Slim index with links
├── topic1/       # On-demand (~1k each)
├── topic2/
└── .../

Slim index structure:

Outcome

Following this pattern results in:

Related

Match Keywords

documentation file consuming excessive context tokens always-included file over 500 lines context budget consumed by rarely-needed content monolithic documentation needs restructuring restructure large documentation split monolithic docs auto-included file too large context window budget