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.
Sets up conditional documentation loading to prevent context pollution. Use when organizing project docs or implementing progressive disclosure—triggers when you need to read documentation that matches specific task conditions.
/plugin marketplace add melodic-software/claude-code-plugins/plugin install google-ecosystem@melodic-softwareThis skill is limited to using the following tools:
Set up conditional documentation loading to prevent context pollution.
Load documentation only when conditions match the current task.
"IMPORTANT: Only read the documentation if any one of the conditions match your task."
List all documentation files in the project:
# Find documentation files
find . -name "*.md" -path "*/docs/*"
find . -name "README*"
find . -name "CONTRIBUTING*"
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 |
For each document, identify when it's relevant:
- 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
Create the conditional documentation manifest:
# 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
- Conditions:
- When modifying database tables
- When creating migrations
- docs/testing/patterns.md
- Conditions:
- When writing new tests
- When debugging test failures
Add conditional docs check to planning commands:
## Relevant Documentation
Read `.claude/commands/conditional_docs.md` to check if your task
requires additional documentation. If your task matches any conditions
listed, include those documentation files.
# Good - Specific conditions
- When adding a new API endpoint
- When modifying user authentication
# Bad - Vague conditions
- When doing backend work
- When coding
- docs/auth.md
- Conditions:
- When implementing login/logout
- When adding new permissions
- When debugging auth issues
- When integrating OAuth
- When working with sessions
Each document should have distinct conditions:
# Good - Distinct conditions
- api-reference.md → API endpoints
- database-schema.md → Database tables
# Bad - Overlapping conditions
- api-reference.md → When doing backend work
- database-schema.md → When doing backend work
# 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.
Excessive documentation loading wastes context and reduces focus.
---
## Project Setup
- README.md
- Conditions:
- When first understanding the project
- When setting up development environment
- When learning available commands
## Backend
- docs/api/reference.md
- Conditions:
- When working with API endpoints
- When adding new routes
- docs/database/schema.md
- Conditions:
- When modifying database tables
- When writing migrations
## Frontend
- docs/components/guide.md
- Conditions:
- When creating new components
- When modifying UI patterns
## Testing
- docs/testing/patterns.md
- Conditions:
- When writing tests
- When debugging test failures
Date: 2025-12-26 Model: claude-opus-4-5-20251101
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.