๐ŸŽฏ

skill-tuning

๐ŸŽฏSkill

from catlog22/claude-code-workflow

VibeIndex|
What it does

skill-tuning skill from catlog22/claude-code-workflow

๐Ÿ“ฆ

Part of

catlog22/claude-code-workflow(15 items)

skill-tuning

Installation

npm installInstall npm package
npm install -g claude-code-workflow
pip installInstall Python package
pip install -e .
๐Ÿ“– Extracted from docs: catlog22/claude-code-workflow
11Installs
1,241
-
Last UpdatedJan 26, 2026

Skill Details

SKILL.md

Universal skill diagnosis and optimization tool. Detect and fix skill execution issues including context explosion, long-tail forgetting, data flow disruption, and agent coordination failures. Supports Gemini CLI for deep analysis. Triggers on "skill tuning", "tune skill", "skill diagnosis", "optimize skill", "skill debug".

Overview

# Skill Tuning

Universal skill diagnosis and optimization tool that identifies and resolves skill execution problems through iterative multi-agent analysis.

Architecture Overview

```

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”

โ”‚ Skill Tuning Architecture (Autonomous Mode + Gemini CLI) โ”‚

โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค

โ”‚ โ”‚

โ”‚ โš ๏ธ Phase 0: Specification โ†’ ้˜…่ฏป่ง„่Œƒ + ็†่งฃ็›ฎๆ ‡ skill ็ป“ๆž„ (ๅผบๅˆถๅ‰็ฝฎ) โ”‚

โ”‚ Study โ”‚

โ”‚ โ†“ โ”‚

โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚

โ”‚ โ”‚ Orchestrator (็Šถๆ€้ฉฑๅŠจๅ†ณ็ญ–) โ”‚ โ”‚

โ”‚ โ”‚ ่ฏปๅ–่ฏŠๆ–ญ็Šถๆ€ โ†’ ้€‰ๆ‹ฉไธ‹ไธ€ๆญฅๅŠจไฝœ โ†’ ๆ‰ง่กŒ โ†’ ๆ›ดๆ–ฐ็Šถๆ€ โ†’ ๅพช็Žฏ็›ดๅˆฐๅฎŒๆˆ โ”‚ โ”‚

โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚

โ”‚ โ”‚ โ”‚

โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚

โ”‚ โ†“ โ†“ โ†“ โ†“ โ†“ โ†“ โ”‚

โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚

โ”‚ โ”‚ Init โ”‚โ†’ โ”‚ Analyze โ”‚โ†’ โ”‚Diagnose โ”‚ โ”‚Diagnoseโ”‚ โ”‚Diagnoseโ”‚ โ”‚ Gemini โ”‚ โ”‚

โ”‚ โ”‚ โ”‚ โ”‚Requiremtsโ”‚ โ”‚ Context โ”‚ โ”‚ Memory โ”‚ โ”‚DataFlowโ”‚ โ”‚Analysis โ”‚ โ”‚

โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚

โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚

โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚

โ”‚ โ†“ โ”‚

โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚

โ”‚ โ”‚ Requirement Analysis (NEW) โ”‚ โ”‚

โ”‚ โ”‚ โ€ข Phase 1: ็ปดๅบฆๆ‹†่งฃ (Gemini CLI) - ๅ•ไธ€ๆ่ฟฐ โ†’ ๅคšไธชๅ…ณๆณจ็ปดๅบฆ โ”‚ โ”‚

โ”‚ โ”‚ โ€ข Phase 2: Spec ๅŒน้… - ๆฏไธช็ปดๅบฆ โ†’ taxonomy + strategy โ”‚ โ”‚

โ”‚ โ”‚ โ€ข Phase 3: ่ฆ†็›–ๅบฆ่ฏ„ไผฐ - ไปฅ"ๆœ‰ไฟฎๅค็ญ–็•ฅ"ไธบๆปก่ถณๆ ‡ๅ‡† โ”‚ โ”‚

โ”‚ โ”‚ โ€ข Phase 4: ๆญงไน‰ๆฃ€ๆต‹ - ่ฏ†ๅˆซๅคšไน‰ๆ€งๆ่ฟฐ๏ผŒๅฟ…่ฆๆ—ถ่ฏทๆฑ‚ๆพ„ๆธ… โ”‚ โ”‚

โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚

โ”‚ โ†“ โ”‚

โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚

โ”‚ โ”‚ Apply Fixes + โ”‚ โ”‚

โ”‚ โ”‚ Verify Results โ”‚ โ”‚

โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚

โ”‚ โ”‚

โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚

โ”‚ โ”‚ Gemini CLI Integration โ”‚ โ”‚

โ”‚ โ”‚ ๆ นๆฎ็”จๆˆท้œ€ๆฑ‚ๅŠจๆ€่ฐƒ็”จ gemini cli ่ฟ›่กŒๆทฑๅบฆๅˆ†ๆž: โ”‚ โ”‚

โ”‚ โ”‚ โ€ข ้œ€ๆฑ‚็ปดๅบฆๆ‹†่งฃ (requirement decomposition) โ”‚ โ”‚

โ”‚ โ”‚ โ€ข ๅคๆ‚้—ฎ้ข˜ๅˆ†ๆž (prompt engineering, architecture review) โ”‚ โ”‚

โ”‚ โ”‚ โ€ข ไปฃ็ ๆจกๅผ่ฏ†ๅˆซ (pattern matching, anti-pattern detection) โ”‚ โ”‚

โ”‚ โ”‚ โ€ข ไฟฎๅค็ญ–็•ฅ็”Ÿๆˆ (fix generation, refactoring suggestions) โ”‚ โ”‚

โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚

โ”‚ โ”‚

โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

```

Problem Domain

Based on comprehensive analysis, skill-tuning addresses core skill issues and general optimization areas:

Core Skill Issues (่‡ชๅŠจๆฃ€ๆต‹)

| Priority | Problem | Root Cause | Solution Strategy |

|----------|---------|------------|-------------------|

| P0 | Authoring Principles Violation | ไธญ้—ดๆ–‡ไปถๅญ˜ๅ‚จ, State่†จ่ƒ€, ๆ–‡ไปถไธญ่ฝฌ | eliminate_intermediate_files, minimize_state, context_passing |

| P1 | Data Flow Disruption | Scattered state, inconsistent formats | state_centralization, schema_enforcement |

| P2 | Agent Coordination | Fragile call chains, merge complexity | error_wrapping, result_validation |

| P3 | Context Explosion | Token accumulation, multi-turn bloat | sliding_window, context_summarization |

| P4 | Long-tail Forgetting | Early constraint loss | constraint_injection, checkpoint_restore |

| P5 | Token Consumption | Verbose prompts, excessive state, redundant I/O | prompt_compression, lazy_loading, output_minimization |

General Optimization Areas (ๆŒ‰้œ€ๅˆ†ๆž via Gemini CLI)

| Category | Issues | Gemini Analysis Scope |

|----------|--------|----------------------|

| Prompt Engineering | ๆจก็ณŠๆŒ‡ไปค, ่พ“ๅ‡บๆ ผๅผไธไธ€่‡ด, ๅนป่ง‰้ฃŽ้™ฉ | ๆ็คบ่ฏไผ˜ๅŒ–, ็ป“ๆž„ๅŒ–่พ“ๅ‡บ่ฎพ่ฎก |

| Architecture | ้˜ถๆฎตๅˆ’ๅˆ†ไธๅˆ็†, ไพ่ต–ๆททไนฑ, ๆ‰ฉๅฑ•ๆ€งๅทฎ | ๆžถๆž„ๅฎกๆŸฅ, ๆจกๅ—ๅŒ–ๅปบ่ฎฎ |

| Performance | ๆ‰ง่กŒๆ…ข, Tokenๆถˆ่€—้ซ˜, ้‡ๅค่ฎก็ฎ— | ๆ€ง่ƒฝๅˆ†ๆž, ็ผ“ๅญ˜็ญ–็•ฅ |

| Error Handling | ้”™่ฏฏๆขๅคไธๅฝ“, ๆ— ้™็บง็ญ–็•ฅ, ๆ—ฅๅฟ—ไธ่ถณ | ๅฎน้”™่ฎพ่ฎก, ๅฏ่ง‚ๆต‹ๆ€งๅขžๅผบ |

| Output Quality | ่พ“ๅ‡บไธ็จณๅฎš, ๆ ผๅผๆผ‚็งป, ่ดจ้‡ๆณขๅŠจ | ่ดจ้‡้—จๆŽง, ้ชŒ่ฏๆœบๅˆถ |

| User Experience | ไบคไบ’ไธๆต็•…, ๅ้ฆˆไธๆธ…ๆ™ฐ, ่ฟ›ๅบฆไธๅฏ่ง | UXไผ˜ๅŒ–, ่ฟ›ๅบฆ่ฟฝ่ธช |

Key Design Principles

  1. Problem-First Diagnosis: Systematic identification before any fix attempt
  2. Data-Driven Analysis: Record execution traces, token counts, state snapshots
  3. Iterative Refinement: Multiple tuning rounds until quality gates pass
  4. Non-Destructive: All changes are reversible with backup checkpoints
  5. Agent Coordination: Use specialized sub-agents for each diagnosis type
  6. Gemini CLI On-Demand: Deep analysis via CLI for complex/custom issues

---

Gemini CLI Integration

ๆ นๆฎ็”จๆˆท้œ€ๆฑ‚ๅŠจๆ€่ฐƒ็”จ Gemini CLI ่ฟ›่กŒๆทฑๅบฆๅˆ†ๆžใ€‚

Trigger Conditions

| Condition | Action | CLI Mode |

|-----------|--------|----------|

| ็”จๆˆทๆ่ฟฐๅคๆ‚้—ฎ้ข˜ | ่ฐƒ็”จ Gemini ๅˆ†ๆž้—ฎ้ข˜ๆ นๅ›  | analysis |

| ่‡ชๅŠจ่ฏŠๆ–ญๅ‘็Žฐ critical ้—ฎ้ข˜ | ่ฏทๆฑ‚ๆทฑๅบฆๅˆ†ๆž็กฎ่ฎค | analysis |

| ็”จๆˆท่ฏทๆฑ‚ๆžถๆž„ๅฎกๆŸฅ | ๆ‰ง่กŒๆžถๆž„ๅˆ†ๆž | analysis |

| ้œ€่ฆ็”Ÿๆˆไฟฎๅคไปฃ็  | ็”Ÿๆˆไฟฎๅคๆๆกˆ | write |

| ๆ ‡ๅ‡†็ญ–็•ฅไธ้€‚็”จ | ่ฏทๆฑ‚ๅฎšๅˆถๅŒ–็ญ–็•ฅ | analysis |

CLI Command Template

```bash

ccw cli -p "

PURPOSE: ${purpose}

TASK: ${task_steps}

MODE: ${mode}

CONTEXT: @${skill_path}/*/

EXPECTED: ${expected_output}

RULES: $(cat ~/.claude/workflows/cli-templates/protocols/${mode}-protocol.md) | ${constraints}

" --tool gemini --mode ${mode} --cd ${skill_path}

```

Analysis Types

#### 1. Problem Root Cause Analysis

```bash

ccw cli -p "

PURPOSE: Identify root cause of skill execution issue: ${user_issue_description}

TASK: โ€ข Analyze skill structure and phase flow โ€ข Identify anti-patterns โ€ข Trace data flow issues

MODE: analysis

CONTEXT: @*/.md

EXPECTED: JSON with { root_causes: [], patterns_found: [], recommendations: [] }

RULES: $(cat ~/.claude/workflows/cli-templates/protocols/analysis-protocol.md) | Focus on execution flow

" --tool gemini --mode analysis

```

#### 2. Architecture Review

```bash

ccw cli -p "

PURPOSE: Review skill architecture for scalability and maintainability

TASK: โ€ข Evaluate phase decomposition โ€ข Check state management patterns โ€ข Assess agent coordination

MODE: analysis

CONTEXT: @*/.md

EXPECTED: Architecture assessment with improvement recommendations

RULES: $(cat ~/.claude/workflows/cli-templates/protocols/analysis-protocol.md) | Focus on modularity

" --tool gemini --mode analysis

```

#### 3. Fix Strategy Generation

```bash

ccw cli -p "

PURPOSE: Generate fix strategy for issue: ${issue_id} - ${issue_description}

TASK: โ€ข Analyze issue context โ€ข Design fix approach โ€ข Generate implementation plan

MODE: analysis

CONTEXT: @*/.md

EXPECTED: JSON with { strategy: string, changes: [], verification_steps: [] }

RULES: $(cat ~/.claude/workflows/cli-templates/protocols/analysis-protocol.md) | Minimal invasive changes

" --tool gemini --mode analysis

```

---

Mandatory Prerequisites

> CRITICAL: Read these documents before executing any action.

Core Specs (Required)

| Document | Purpose | Priority |

|----------|---------|----------|

| [specs/skill-authoring-principles.md](specs/skill-authoring-principles.md) | ้ฆ–่ฆๅ‡†ๅˆ™๏ผš็ฎ€ๆด้ซ˜ๆ•ˆใ€ๅŽป้™คๅญ˜ๅ‚จใ€ไธŠไธ‹ๆ–‡ๆต่ฝฌ | P0 |

| [specs/problem-taxonomy.md](specs/problem-taxonomy.md) | Problem classification and detection patterns | P0 |

| [specs/tuning-strategies.md](specs/tuning-strategies.md) | Fix strategies for each problem type | P0 |

| [specs/dimension-mapping.md](specs/dimension-mapping.md) | Dimension to Spec mapping rules | P0 |

| [specs/quality-gates.md](specs/quality-gates.md) | Quality thresholds and verification criteria | P1 |

Templates (Reference)

| Document | Purpose |

|----------|---------|

| [templates/diagnosis-report.md](templates/diagnosis-report.md) | Diagnosis report structure |

| [templates/fix-proposal.md](templates/fix-proposal.md) | Fix proposal format |

---

Execution Flow

```

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”

โ”‚ Phase 0: Specification Study (ๅผบๅˆถๅ‰็ฝฎ - ็ฆๆญข่ทณ่ฟ‡) โ”‚

โ”‚ โ†’ Read: specs/problem-taxonomy.md (้—ฎ้ข˜ๅˆ†็ฑป) โ”‚

โ”‚ โ†’ Read: specs/tuning-strategies.md (่ฐƒไผ˜็ญ–็•ฅ) โ”‚

โ”‚ โ†’ Read: specs/dimension-mapping.md (็ปดๅบฆๆ˜ ๅฐ„่ง„ๅˆ™) โ”‚

โ”‚ โ†’ Read: Target skill's SKILL.md and phases/*.md โ”‚

โ”‚ โ†’ Output: ๅ†…ๅŒ–่ง„่Œƒ๏ผŒ็†่งฃ็›ฎๆ ‡ skill ็ป“ๆž„ โ”‚

โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค

โ”‚ action-init: Initialize Tuning Session โ”‚

โ”‚ โ†’ Create work directory: .workflow/.scratchpad/skill-tuning-{timestamp} โ”‚

โ”‚ โ†’ Initialize state.json with target skill info โ”‚

โ”‚ โ†’ Create backup of target skill files โ”‚

โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค

โ”‚ action-analyze-requirements: Requirement Analysis โ”‚

โ”‚ โ†’ Phase 1: ็ปดๅบฆๆ‹†่งฃ (Gemini CLI) - ๅ•ไธ€ๆ่ฟฐ โ†’ ๅคšไธชๅ…ณๆณจ็ปดๅบฆ โ”‚

โ”‚ โ†’ Phase 2: Spec ๅŒน้… - ๆฏไธช็ปดๅบฆ โ†’ taxonomy + strategy โ”‚

โ”‚ โ†’ Phase 3: ่ฆ†็›–ๅบฆ่ฏ„ไผฐ - ไปฅ"ๆœ‰ไฟฎๅค็ญ–็•ฅ"ไธบๆปก่ถณๆ ‡ๅ‡† โ”‚

โ”‚ โ†’ Phase 4: ๆญงไน‰ๆฃ€ๆต‹ - ่ฏ†ๅˆซๅคšไน‰ๆ€งๆ่ฟฐ๏ผŒๅฟ…่ฆๆ—ถ่ฏทๆฑ‚ๆพ„ๆธ… โ”‚

โ”‚ โ†’ Output: state.json (requirement_analysis field) โ”‚

โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค

โ”‚ action-diagnose-*: Diagnosis Actions (context/memory/dataflow/agent/docs/ โ”‚

โ”‚ token_consumption) โ”‚

โ”‚ โ†’ Execute pattern-based detection for each category โ”‚

โ”‚ โ†’ Output: state.json (diagnosis.{category} field) โ”‚

โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค

โ”‚ action-generate-report: Consolidated Report โ”‚

โ”‚ โ†’ Generate markdown summary from state.diagnosis โ”‚

โ”‚ โ†’ Prioritize issues by severity โ”‚

โ”‚ โ†’ Output: state.json (final_report field) โ”‚

โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค

โ”‚ action-propose-fixes: Fix Proposal Generation โ”‚

โ”‚ โ†’ Generate fix strategies for each issue โ”‚

โ”‚ โ†’ Create implementation plan โ”‚

โ”‚ โ†’ Output: state.json (proposed_fixes field) โ”‚

โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค

โ”‚ action-apply-fix: Apply Selected Fix โ”‚

โ”‚ โ†’ User selects fix to apply โ”‚

โ”‚ โ†’ Execute fix with backup โ”‚

โ”‚ โ†’ Update state with fix result โ”‚

โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค

โ”‚ action-verify: Verification โ”‚

โ”‚ โ†’ Re-run affected diagnosis โ”‚

โ”‚ โ†’ Check quality gates โ”‚

โ”‚ โ†’ Update iteration count โ”‚

โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค

โ”‚ action-complete: Finalization โ”‚

โ”‚ โ†’ Set status='completed' โ”‚

โ”‚ โ†’ Final report already in state.json (final_report field) โ”‚

โ”‚ โ†’ Output: state.json (final) โ”‚

โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

```

Directory Setup

```javascript

const timestamp = new Date().toISOString().slice(0,19).replace(/[-:T]/g, '');

const workDir = .workflow/.scratchpad/skill-tuning-${timestamp};

// Simplified: Only backups dir needed, diagnosis results go into state.json

Bash(mkdir -p "${workDir}/backups");

```

Output Structure

```

.workflow/.scratchpad/skill-tuning-{timestamp}/

โ”œโ”€โ”€ state.json # Single source of truth (all results consolidated)

โ”‚ โ”œโ”€โ”€ diagnosis.* # All diagnosis results embedded

โ”‚ โ”œโ”€โ”€ issues[] # Found issues

โ”‚ โ”œโ”€โ”€ proposed_fixes[] # Fix proposals

โ”‚ โ””โ”€โ”€ final_report # Markdown summary (on completion)

โ””โ”€โ”€ backups/

โ””โ”€โ”€ {skill-name}-backup/ # Original skill files backup

```

> Token Optimization: All outputs consolidated into state.json. No separate diagnosis files or report files.

State Schema

่ฏฆ็ป†็Šถๆ€็ป“ๆž„ๅฎšไน‰่ฏทๅ‚้˜… [phases/state-schema.md](phases/state-schema.md)ใ€‚

ๆ ธๅฟƒ็Šถๆ€ๅญ—ๆฎต๏ผš

  • status: ๅทฅไฝœๆต็Šถๆ€ (pending/running/completed/failed)
  • target_skill: ็›ฎๆ ‡ skill ไฟกๆฏ
  • diagnosis: ๅ„็ปดๅบฆ่ฏŠๆ–ญ็ป“ๆžœ
  • issues: ๅ‘็Žฐ็š„้—ฎ้ข˜ๅˆ—่กจ
  • proposed_fixes: ๅปบ่ฎฎ็š„ไฟฎๅคๆ–นๆกˆ

Reference Documents

| Document | Purpose |

|----------|---------|

| [phases/orchestrator.md](phases/orchestrator.md) | Orchestrator decision logic |

| [phases/state-schema.md](phases/state-schema.md) | State structure definition |

| [phases/actions/action-init.md](phases/actions/action-init.md) | Initialize tuning session |

| [phases/actions/action-analyze-requirements.md](phases/actions/action-analyze-requirements.md) | Requirement analysis (NEW) |

| [phases/actions/action-diagnose-context.md](phases/actions/action-diagnose-context.md) | Context explosion diagnosis |

| [phases/actions/action-diagnose-memory.md](phases/actions/action-diagnose-memory.md) | Long-tail forgetting diagnosis |

| [phases/actions/action-diagnose-dataflow.md](phases/actions/action-diagnose-dataflow.md) | Data flow diagnosis |

| [phases/actions/action-diagnose-agent.md](phases/actions/action-diagnose-agent.md) | Agent coordination diagnosis |

| [phases/actions/action-diagnose-docs.md](phases/actions/action-diagnose-docs.md) | Documentation structure diagnosis |

| [phases/actions/action-diagnose-token-consumption.md](phases/actions/action-diagnose-token-consumption.md) | Token consumption diagnosis |

| [phases/actions/action-generate-report.md](phases/actions/action-generate-report.md) | Report generation |

| [phases/actions/action-propose-fixes.md](phases/actions/action-propose-fixes.md) | Fix proposal |

| [phases/actions/action-apply-fix.md](phases/actions/action-apply-fix.md) | Fix application |

| [phases/actions/action-verify.md](phases/actions/action-verify.md) | Verification |

| [phases/actions/action-complete.md](phases/actions/action-complete.md) | Finalization |

| [specs/problem-taxonomy.md](specs/problem-taxonomy.md) | Problem classification |

| [specs/tuning-strategies.md](specs/tuning-strategies.md) | Fix strategies |

| [specs/dimension-mapping.md](specs/dimension-mapping.md) | Dimension to Spec mapping (NEW) |

| [specs/quality-gates.md](specs/quality-gates.md) | Quality criteria |