--- name: skill-creator description: "Use when creating, refactoring, or validating OpenCode skills. Provides S.T.A.R. workflow, Bottom-Up Reconstruction, and Quality Gates. Semantic cohesion: Contextual granularity with dynamic context pruning." license: MIT compatibility: opencode --- ## Quick Decision Matrix What do you need to accomplish? --- ## Setup ```bash # Verify Python 3.8+ is installed python --version # Install dependencies pip install pyyaml rich # Create a new skill python .claude/skills/skill-creator/scripts/init_skill.py my-skill # Validate skill quality python .claude/skills/skill-creator/scripts/validate_skill.py .claude/skills/my-skill # Calculate SkillScore (Tier 1: Fast static analysis) python .claude/skills/skill-creator/scripts/skillscore_evaluator.py .claude/skills/my-skill/SKILL.md ``` ## Quantitative Impact | Metric | Anti-Pattern | Best Practice | Improvement | | -------------- | ------------ | ------------- | ----------------- | | **SkillScore** | 55-70 | 88-95 | +20-35 | | **Cohesion** | 0.45-0.60 | 0.80-0.93 | +40-105% | | **Nav Time** | 3-5 min | 30-60 sec | **75-83% faster** | | **File Hops** | 15+ | 3-5 | **70% reduction** | **Key Drivers**: - Semantic cohesion (+0.12 SkillScore): Contextual granularity vs fragments - Progressive disclosure (+8-15%): Tiered architecture with JIT loading - Quality gates (+15-25): Boolean gates + SkillScore validation - Portability (+10-15): Generic placeholders vs hardcoded paths ### About SkillScore SkillScore uses a **two-tiered quality assessment** system: - **Tier 1 (Fast)**: Static analysis of document structure (current implementation) - Validates syntax, structure, and keyword density - Speed: ~10ms per file - Use: Development iteration and CI/CD - **Tier 2 (Deep)**: AdvancedIF-style rubric verification (planned) - Validates actual agent behavior using LLM-as-a-Judge - Speed: ~2-5s per file - Use: Production validation and scientific rigor **Important**: Tier 1 is a **development tool**, not a scientific metric. For production validation, use Tier 2 (see `docs/skillscore-tier2-specification.md`). See also: `docs/skillscore-red-team-analysis.md` for critical evaluation. --- ## Core Principles **S.T.A.R.**: Structure → Target → Author → Review **Bottom-Up**: Audit → Rebuild → Validate ## 🚨 MANDATORY PROTOCOL (NON-NEGOTIABLE) 1. **STOP**. Do not create skills without a S.T.A.R. plan. 2. **MUST** use the Decision Matrix for navigation. 3. **CRITICAL**: All files MUST have semantic cohesion. 4. **NEVER** use excessive atomization (>15 files). ## Applying Prompt Engineering Best Practices When creating skills, apply **C.L.E.A.R.** principles from the `prompt-engineering` skill: | Principle | Application to Skills | Impact | | -------------- | ------------------------------------------------------------------------------------ | --------------------------- | | **Concise** | Maximize signal-to-noise. Remove filler phrases ("please", "thank you"). | 70% token reduction | | **Logical** | Follow COSTAR structure: Context → Task → Constraints → Format | +55% clarity | | **Explicit** | Use objective metrics instead of vague terms ("brief" → "3 sentences, 50 words max") | 91% hallucination reduction | | **Adaptive** | Handle edge cases with IF/THEN logic. Provide tier-based guidelines. | +51% edge case handling | | **Reflective** | Include validation checklists and self-audit before completion. | 67% error reduction | **See Also**: `prompt-engineering` skill for complete framework details (Diátaxis, COSTAR, C.L.E.A.R., Chain-of-Thought, Decision Matrices, Few-Shot). ## Document Structure ### Tier 1: YAML Frontmatter (< 100 tokens) ```yaml --- name: skill-name description: "Concise description with keywords" license: MIT compatibility: opencode --- ``` ### Tier 2: SKILL.md (100-800 lines) **Purpose**: Decision matrix + setup commands **Structure**: - Quick Decision Matrix (XML format) - Setup commands (bash) - Key workflows and common patterns - Reference links ### Tier 3: Comprehensive References (800-1500 lines) **Purpose**: Deep dives with full semantic context **Size Guidelines**: | Tier | Size Guidelines | Purpose | | ---------- | ------------------------------------------- | ------------------------ | | **Tier 3** | 800-1500 lines (when semantically cohesive) | Comprehensive deep dives | **When to Split**: - Exceeds 2000 lines AND natural section boundaries exist - Covers multiple unrelated domains (e.g., testing + deployment) - Creates navigation difficulties despite tags **When to Consolidate**: - Too many tiny files (> 15 files, avg < 150 lines) - Arbitrary splits mid-concept - Related content scattered across 5+ files ### Navigation Tags (for JIT Section Loading) XML format for `