Design skills as modular building blocks for predictable token usage and maintainable architecture. Triggers: skill design, skill architecture, modularization, token optimization, skill structure, refactoring skills, new skill creation, skill complexity Use when: creating new skills that will be >150 lines, breaking down complex monolithic skills, planning skill architecture, refactoring overlapping skills, reviewing skill maintainability, designing skill module structure DO NOT use when: evaluating existing skill quality - use skills-eval instead. DO NOT use when: writing prose for humans - use writing-clearly-and-concisely. DO NOT use when: need improvement recommendations - use skills-eval. Use this skill BEFORE creating any new skill. Check even if unsure.
/plugin marketplace add athola/claude-night-market/plugin install abstract@claude-night-marketThis skill inherits all available tools. When active, it can use any tool Claude has access to.
README.mdguide.mdmodules/antipatterns-and-migration.mdmodules/core-workflow.mdmodules/design-philosophy.mdmodules/enforcement-patterns.mdmodules/implementation-patterns.mdmodules/troubleshooting.mdscripts/analyze.pyscripts/module-validatorscripts/tokens.pyThis skill provides a framework for designing modular skills that maintain predictable token usage and sustainable architecture. It helps users break down complex, monolithic skills into focused, manageable modules that are easier to test, maintain, and optimize.
The framework implements progressive disclosure principles where skills start with essential information and provide deeper details only when needed. This approach keeps context windows efficient while ensuring comprehensive functionality is available when required.
This skill provides a framework for designing modular skills. We've found that by breaking down large, complex skills into smaller, more manageable modules, we can create a more maintainable and predictable architecture. This approach also helps us keep our token usage in check.
This skill is based on Anthropic's Agent Skills best practices, and it's built around the idea of progressive disclosure: start with a high-level overview, and then provide more detail as needed.
# Check if your skill needs modularization (works from skill directory)
python scripts/analyze.py
# Analyze with custom threshold (default: 150 lines)
python scripts/analyze.py --threshold 100
# Or import directly in Python:
from abstract.skill_tools import analyze_skill
analysis = analyze_skill(".", threshold=100)
# Estimate token consumption for your skill (works from skill directory)
python scripts/tokens.py
# Or import directly in Python:
from abstract.skill_tools import estimate_tokens
tokens = estimate_tokens("SKILL.md")
# Validate modular structure and patterns
python scripts/abstract_validator.py --scan
# Generate full validation report
python scripts/abstract_validator.py --report
# Auto-fix issues (dry run first)
python scripts/abstract_validator.py --fix --dry-run
skill_analyzer.py to identify complexity and modularization needstoken_estimator.py to optimize for context window efficiencyabstract_validator.py to ensure proper structure and patternsHere are a few common ways we use the tools:
skill-analyzer. This helps us decide if a skill needs to be modularized.guide.md.../../docs/examples/modular-skills/ directory.module-validator before deploying.token-estimator. This helps us make design decisions based on their impact on the context window.For comprehensive implementation details and advanced techniques:
modules/enforcement-patterns.md for frontmatter design patternsmodules/core-workflow.md for detailed modularization processmodules/implementation-patterns.md for coding and structure patternsmodules/antipatterns-and-migration.md for converting existing skillsmodules/design-philosophy.md for underlying principles and thinkingmodules/troubleshooting.md for common issues and solutions../../scripts/ directory:
skill_analyzer.py - Complexity analysis and recommendationstoken_estimator.py - Token usage estimation with dependenciesabstract_validator.py - Pattern validation and auto-fixing../../docs/examples/modular-skills/ directory for concrete implementationsThis 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 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 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.