Set up conditional documentation loading to prevent context pollution. Use when organizing project docs, implementing progressive disclosure, or reducing CLAUDE.md token consumption with on-demand loading.
View on GitHubmelodic-software/claude-code-plugins
tac
January 21, 2026
Select agents to install to:
npx add-skill https://github.com/melodic-software/claude-code-plugins/blob/main/plugins/tac/skills/conditional-docs-setup/SKILL.md -a claude-code --skill conditional-docs-setupInstallation paths:
.claude/skills/conditional-docs-setup/# Conditional Docs Setup Skill
Set up conditional documentation loading to prevent context pollution.
## When to Use
- Setting up documentation for a new project
- Reducing context pollution in existing projects
- Creating just-in-time documentation loading
- Optimizing agent context usage
## Core Concept
Load documentation only when conditions match the current task.
> "IMPORTANT: Only read the documentation if any one of the conditions match your task."
## Setup Workflow
### Step 1: Inventory Documentation
List all documentation files in the project:
```bash
# Find documentation files
find . -name "*.md" -path "*/docs/*"
find . -name "README*"
find . -name "CONTRIBUTING*"
```
### Step 2: Categorize by Purpose
Group documentation by what it helps with:
| Category | Examples |
| --- | --- |
| Setup | README, INSTALL, CONTRIBUTING |
| API | api-reference, endpoints, schemas |
| Architecture | design-docs, system-overview |
| Features | feature-specific guides |
| Testing | test-patterns, fixtures |
### Step 3: Define Loading Conditions
For each document, identify when it's relevant:
```markdown
- docs/api-reference.md
- Conditions:
- When working with API endpoints
- When adding new routes
- When modifying request/response formats
- docs/database-schema.md
- Conditions:
- When modifying database tables
- When adding new models
- When writing migrations
```
### Step 4: Create Conditional Docs File
Create the conditional documentation manifest:
```markdown
# Conditional Documentation
This helps determine what documentation to read based on
the specific changes you need to make in the codebase.
IMPORTANT: Only read documentation if conditions match your task.
---
- README.md
- Conditions:
- When first understanding the project
- When setting up the development environment
- docs/api/endpoints.md
- Conditions:
- When working with REST endpoints
- When adding new API routes
- docs/database/schema.md