context-preset-management
About
This Claude Skill automatically detects task types from user requests and file patterns, then loads appropriate context presets (frontend/backend/app) with their associated rules. It operates autonomously during orchestrator Phase 0 without requiring explicit commands, storing preset preferences in memory for the session. Developers can rely on it for automatic context management in code generation workflows.
Quick Install
Claude Code
Recommended/plugin add https://github.com/romiluz13/cc10xgit clone https://github.com/romiluz13/cc10x.git ~/.claude/skills/context-preset-managementCopy and paste this command in Claude Code to install this skill
Documentation
Context Preset Management
Purpose
Automatically detect task type and load appropriate context presets for cc10x orchestrator. This skill enables task-specific context loading without requiring user commands - the orchestrator detects the task type and loads the appropriate preset automatically.
When to Use
Always used by orchestrator Phase 0 after functionality analysis and before skill loading. The orchestrator automatically invokes this skill to detect task type and load context presets.
Core Principle
Automatic Detection: The orchestrator analyzes the user request and file patterns to determine task type, then automatically loads the appropriate context preset. No user commands required.
Quick Start
Orchestrator automatically detects task type and loads appropriate context preset.
Example:
- User says: "Build a React component for file upload"
- Orchestrator detects: Frontend indicators ("React", "component") → Frontend task
- Load preset: Automatically loads frontend context preset
- Store preference: Saves preset preference in memory for future use
Result: Appropriate context preset loaded automatically without user commands.
Detection Logic
Step 1: Analyze User Request
Scan user request for task type indicators:
- Frontend indicators: "component", "UI", "React", "Vue", "Angular", "frontend", "client-side", "styling", "CSS", "TSX", "JSX"
- Backend indicators: "API", "backend", "server", "database", "service", "endpoint", "route", "controller"
- Full-stack indicators: "full-stack", "e2e", "end-to-end", "feature", "both", "all"
Step 2: File Pattern Detection
Use Glob to detect file patterns:
# Frontend patterns
Glob("**/*.{tsx,jsx}") # React/Vue components
Glob("src/components/**")
Glob("src/pages/**")
Glob("**/*.css")
Glob("**/*.scss")
# Backend patterns
Glob("**/api/**")
Glob("**/routes/**")
Glob("**/controllers/**")
Glob("**/services/**")
Glob("**/*.service.ts")
Glob("**/*.controller.ts")
Step 3: Preset Selection
Decision Tree:
Task type detected?
├─ Frontend indicators + frontend files → frontend preset
├─ Backend indicators + backend files → backend preset
├─ Both indicators + both file types → app preset
├─ No clear indicators → Check memory for last used preset
│ └─ Found in memory → Use remembered preset
│ └─ Not found → Use default preset (app)
└─ Ambiguous → Use app preset (default)
Step 4: Load Preset Rules
- Read
.claude/context.json - Select preset based on detection
- Load alwaysApply rules (always loaded)
- Load preset-specific rules
- Generate context summary for orchestrator
Integration with Orchestrator
Called by: Orchestrator Phase 0 (after functionality analysis, before skill loading)
Input: User request, file patterns detected
Output: Selected preset name, loaded rules list, context summary
Memory Integration: Stores selected preset in .claude/memory/preset_preferences.json
Troubleshooting
Common Issues:
-
Wrong preset detected
- Symptom: Frontend preset loaded for backend task or vice versa
- Cause: Detection logic didn't match user request or file patterns
- Fix: Review detection logic, check user request and file patterns
- Prevention: Verify detection logic matches task type
-
Preset not loaded
- Symptom: No preset loaded, rules missing
- Cause: Orchestrator didn't invoke skill or detection failed
- Fix: Verify orchestrator invoked skill, check detection logic
- Prevention: Ensure orchestrator invokes skill in Phase 0
-
Preset preference not stored
- Symptom: Preset selected but not saved to memory
- Cause: Memory storage failed or wrong location
- Fix: Store to
.claude/memory/preset_preferences.json - Prevention: Always store preset preference after selection
If issues persist:
- Verify orchestrator invoked skill in Phase 0
- Check that detection logic matches task type
- Ensure preset preference stored to memory
- Review detection logic section
Memory Integration
Storage: .claude/memory/preset_preferences.json
Structure:
{
"project_path": "/path/to/project",
"preset": "frontend",
"last_used": "2025-01-27T10:30:00Z",
"usage_count": 5
}
Usage:
- Store preset preference after selection
- Load preset preference on next session
- Suggest remembered preset if task type unclear
Implementation Steps
- Read context.json: Load
.claude/context.jsonto get rules and presets - Detect task type: Analyze user request and file patterns
- Select preset: Use decision tree to select appropriate preset
- Load rules: Combine alwaysApply rules + preset rules
- Generate summary: Create context summary for orchestrator
- Store preference: Save selected preset to memory
Context Summary Format
After preset selection, generate summary:
**Context Preset**: frontend
**Rules Loaded**:
- project-status (alwaysApply)
- app-design (alwaysApply)
- tech-stack (alwaysApply)
- react (preset)
- styling (preset)
- ui-components (preset)
**Task Type**: Frontend development
**File Patterns**: **/\*.{tsx,jsx}, src/components/**
Error Handling
If context.json missing:
- Use default preset (app)
- Log warning: "context.json not found, using default preset"
- Continue with workflow
If preset not found:
- Use default preset (app)
- Log warning: "Preset '{name}' not found, using default preset"
- Continue with workflow
If rules missing:
- Skip missing rules
- Log warning: "Rule '{name}' not found at '{path}', skipping"
- Continue with available rules
Examples
Example 1: Frontend Task
User Request: "Build a React modal component"
Detection:
- User request: "React" → frontend indicator
- File patterns:
Glob("**/*.{tsx,jsx}")→ found React files - Selection: frontend preset
Result: frontend preset loaded with React, styling, UI component rules
Example 2: Backend Task
User Request: "Create API endpoint for user authentication"
Detection:
- User request: "API", "endpoint" → backend indicators
- File patterns:
Glob("**/api/**")→ found API files - Selection: backend preset
Result: backend preset loaded with API, database, service rules
Example 3: Full-Stack Task
User Request: "Build user authentication feature"
Detection:
- User request: "feature" → full-stack indicator
- File patterns: Both frontend and backend files found
- Selection: app preset
Result: app preset loaded with all rules
Example 4: Ambiguous Task
User Request: "Review the code"
Detection:
- User request: No clear indicators
- File patterns: Mixed frontend and backend files
- Memory check: Last used preset was "frontend"
- Selection: frontend preset (from memory)
Result: frontend preset loaded (remembered preference)
Key Principles
- Automatic: No user commands required - orchestrator detects and loads automatically
- Memory-Aware: Remembers preset preferences per project
- Fallback: Always falls back to default preset if detection fails
- Non-Breaking: Never blocks workflow execution - always continues even if preset detection fails
- Orchestrator-Driven: All functionality flows through orchestrator Phase 0
GitHub Repository
Related Skills
sglang
MetaSGLang is a high-performance LLM serving framework that specializes in fast, structured generation for JSON, regex, and agentic workflows using its RadixAttention prefix caching. It delivers significantly faster inference, especially for tasks with repeated prefixes, making it ideal for complex, structured outputs and multi-turn conversations. Choose SGLang over alternatives like vLLM when you need constrained decoding or are building applications with extensive prefix sharing.
content-collections
MetaThis skill provides a production-tested setup for Content Collections, a TypeScript-first tool that transforms Markdown/MDX files into type-safe data collections with Zod validation. Use it when building blogs, documentation sites, or content-heavy Vite + React applications to ensure type safety and automatic content validation. It covers everything from Vite plugin configuration and MDX compilation to deployment optimization and schema validation.
langchain
MetaLangChain is a framework for building LLM applications using agents, chains, and RAG pipelines. It supports multiple LLM providers, offers 500+ integrations, and includes features like tool calling and memory management. Use it for rapid prototyping and deploying production systems like chatbots, autonomous agents, and question-answering services.
Algorithmic Art Generation
MetaThis skill helps developers create algorithmic art using p5.js, focusing on generative art, computational aesthetics, and interactive visualizations. It automatically activates for topics like "generative art" or "p5.js visualization" and guides you through creating unique algorithms with features like seeded randomness, flow fields, and particle systems. Use it when you need to build reproducible, code-driven artistic patterns.
