/skill-tuning
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 Agy CLI for deep analysis. Triggers on "skill tuning", "tune skill", "skill
$ npx -y skills add catlog22/maestro-flow --skill skill-tuning --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/skill-tuning
Context preview
The summary Claude sees to decide when to auto-load this skill.
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 Agy CLI for deep analysis. Triggers on "skill tuning", "tune skill", "skill
SKILL.md
skill-tuning.SKILL.mdname: skill-tuning
disable-model-invocation: true
description: 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 Agy CLI for deep analysis. Triggers on "skill tuning", "tune skill", "skill diagnosis", "optimize skill", "skill debug".
allowed-tools: Agent, AskUserQuestion, Read, Write, Bash, Glob, Grep,
session-mode: run
<required_reading> @~/.maestro/workflows/run-mode.md </required_reading>
Skill Tuning
Autonomous diagnosis and optimization for skill execution issues.
Pre-load (before execution)
1. **Codebase docs**: If `.workflow/codebase/ARCHITECTURE.md` exists, read for project context 2. **Specs**: `maestro load --type spec --category coding` — load coding conventions 3. **Wiki knowledge**: `maestro search "skill design optimization" --json` — top 5 entries as prior context 4. All optional — proceed without if unavailable
Architecture
┌─────────────────────────────────────────────────────┐
│ Phase 0: Read Specs (mandatory) │
│ → problem-taxonomy.md, tuning-strategies.md │
└─────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────┐
│ Orchestrator (state-driven) │
│ Read state → Select action → Execute → Update → ✓ │
└─────────────────────────────────────────────────────┘
↓ ↓
┌──────────────────────┐ ┌──────────────────┐
│ Diagnosis Phase │ │ Agy CLI │
│ • Context │ │ Deep analysis │
│ • Memory │ │ (on-demand) │
│ • DataFlow │ │ │
│ • Agent │ │ Complex issues │
│ • Docs │ │ Architecture │
│ • Token Usage │ │ Performance │
└──────────────────────┘ └──────────────────┘
↓
┌───────────────────┐
│ Fix & Verify │
│ Apply → Re-test │
└───────────────────┘Core Issues Detected
| Priority | Problem | Root Cause | Fix Strategy | |----------|---------|-----------|--------------| | **P0** | Authoring Violation | Intermediate files, state bloat, file relay | eliminate_intermediate, minimize_state | | **P1** | Data Flow Disruption | Scattered state, inconsistent formats | state_centralization, schema_enforcement | | **P2** | Agent Coordination | Fragile chains, no error handling | error_wrapping, result_validation | | **P3** | Context Explosion | Unbounded history, full content passing | sliding_window, path_reference | | **P4** | Long-tail Forgetting | Early constraint loss | constraint_injection, checkpoint_restore | | **P5** | Token Consumption | Verbose prompts, state bloat | prompt_compression, lazy_loading |
Problem Categories (Detailed Specs)
See [specs/problem-taxonomy.md](specs/problem-taxonomy.md) for:
- Detection patterns (regex/checks)
- Severity calculations
- Impact assessments
Tuning Strategies (Detailed Specs)
See [specs/tuning-strategies.md](specs/tuning-strategies.md) for:
- 10+ strategies per category
- Implementation patterns
- Verification methods
Workflow
| Step | Action | Orchestrator Decision | Output | |------|--------|----------------------|--------| | 1 | `action-init` | status='pending' | Backup, session created | | 2 | `action-analyze-requirements` | After init | Required dimensions + coverage | | 3 | Diagnosis (6 types) | Focus areas | state.diagnosis.{type} | | 4 | `action-agy-analysis` | Critical issues OR user request | Deep findings | | 5 | `action-generate-report` | All diagnosis complete | state.final_report | | 6 | `action-propose-fixes` | Issues found | state.proposed_fixes[] | | 7 | `action-apply-fix` | Pending fixes | Applied + verified | | 8 | `action-complete` | Quality gates pass | session.status='completed' |
Action Reference
| Category | Actions | Purpose | |----------|---------|---------| | **Setup** | action-init | Initialize backup, session state | | **Analysis** | action-analyze-requirements | Decompose user request via Agy CLI | | **Diagnosis** | action-diagnose-{context,memory,dataflow,agent,docs,token_consumption} | Detect category-specific issues | | **Deep Analysis** | action-agy-analysis | Agy CLI: complex/critical issues | | **Reporting** | action-generate-report | Consolidate findings → final_report | | **Fixing** | action-propose-fixes, action-apply-fix | Generate + apply fixes | | **Verify** | action-verify | Re-run diagnosis, check gates | | **Exit** | action-complete, action-abort | Finalize or rollback |
Full action details: [phases/actions/](phases/actions/)
State Management
**Single source of truth**: `{run_dir}/outputs/skill-tuning-{ts}/state.json`
{
"status": "pending|running|completed|failed",
"target_skill": { "name": "...", "path": "..." },
"diagnosis": {
"context": {...},
"memory": {...},
"dataflow": {...},
"agent": {...},
"docs": {...},
"token_consumption": {...}
},
"issues": [{"id":"...", "severity":"...", "category":"...", "strategy":"..."}],
"proposed_fixes": [...],
"applied_fixes": [...],
"quality_gate": "pass|fail",
"final_report": "..."
}See [phases/state-schema.md](phases/state-schema.md) for complete schema.
Orchestrator Logic
See [phases/orchestrator.md](phases/orchestrator.md) for:
- Decision logic (termination checks → action selection)
- State transitions
- Error recovery
Key Principles
1. **Problem-First**: Diagnosis before any fix 2. **Data-Driven**: Record traces, token counts, snapshots 3. **Iterative**: Multiple rounds until quality gates pass 4. **Reversible**: All changes with backup checkpoints 5. **Non-Invasive**: Minimal changes, maximum clarity
Usage Examples
# Basic skill diagnosis
/skill-tuning "Fix memory leaks in my skill"
# Deep analysis with Agy
/skill-tuning "Architec
Read more
name: skill-tuning disable-model-invocation: true description: 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 Agy CLI for deep analysis. Triggers on "skill tuning", "tune skill", "skill diagnosis", "optimize skill", "skill debug". allowed-tools: Agent, AskUserQuestion, Read, Write, Bash, Glob, Grep, session-mode: run
<required_reading> @~/.maestro/workflows/run-mode.md </required_reading>
Skill Tuning
Autonomous diagnosis and optimization for skill execution issues.
Pre-load (before execution)
1. **Codebase docs**: If `.workflow/codebase/ARCHITECTURE.md` exists, read for project context 2. **Specs**: `maestro load --type spec --category coding` — load coding conventions 3. **Wiki knowledge**: `maestro search "skill design optimization" --json` — top 5 entries as prior context 4. All optional — proceed without if unavailable
Architecture
┌─────────────────────────────────────────────────────┐
│ Phase 0: Read Specs (mandatory) │
│ → problem-taxonomy.md, tuning-strategies.md │
└─────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────┐
│ Orchestrator (state-driven) │
│ Read state → Select action → Execute → Update → ✓ │
└─────────────────────────────────────────────────────┘
↓ ↓
┌──────────────────────┐ ┌──────────────────┐
│ Diagnosis Phase │ │ Agy CLI │
│ • Context │ │ Deep analysis │
│ • Memory │ │ (on-demand) │
│ • DataFlow │ │ │
│ • Agent │ │ Complex issues │
│ • Docs │ │ Architecture │
│ • Token Usage │ │ Performance │
└──────────────────────┘ └──────────────────┘
↓
┌───────────────────┐
│ Fix & Verify │
│ Apply → Re-test │
└───────────────────┘Core Issues Detected
| Priority | Problem | Root Cause | Fix Strategy | |----------|---------|-----------|--------------| | **P0** | Authoring Violation | Intermediate files, state bloat, file relay | eliminate_intermediate, minimize_state | | **P1** | Data Flow Disruption | Scattered state, inconsistent formats | state_centralization, schema_enforcement | | **P2** | Agent Coordination | Fragile chains, no error handling | error_wrapping, result_validation | | **P3** | Context Explosion | Unbounded history, full content passing | sliding_window, path_reference | | **P4** | Long-tail Forgetting | Early constraint loss | constraint_injection, checkpoint_restore | | **P5** | Token Consumption | Verbose prompts, state bloat | prompt_compression, lazy_loading |
Problem Categories (Detailed Specs)
See [specs/problem-taxonomy.md](specs/problem-taxonomy.md) for:
- Detection patterns (regex/checks)
- Severity calculations
- Impact assessments
Tuning Strategies (Detailed Specs)
See [specs/tuning-strategies.md](specs/tuning-strategies.md) for:
- 10+ strategies per category
- Implementation patterns
- Verification methods
Workflow
| Step | Action | Orchestrator Decision | Output | |------|--------|----------------------|--------| | 1 | `action-init` | status='pending' | Backup, session created | | 2 | `action-analyze-requirements` | After init | Required dimensions + coverage | | 3 | Diagnosis (6 types) | Focus areas | state.diagnosis.{type} | | 4 | `action-agy-analysis` | Critical issues OR user request | Deep findings | | 5 | `action-generate-report` | All diagnosis complete | state.final_report | | 6 | `action-propose-fixes` | Issues found | state.proposed_fixes[] | | 7 | `action-apply-fix` | Pending fixes | Applied + verified | | 8 | `action-complete` | Quality gates pass | session.status='completed' |
Action Reference
| Category | Actions | Purpose | |----------|---------|---------| | **Setup** | action-init | Initialize backup, session state | | **Analysis** | action-analyze-requirements | Decompose user request via Agy CLI | | **Diagnosis** | action-diagnose-{context,memory,dataflow,agent,docs,token_consumption} | Detect category-specific issues | | **Deep Analysis** | action-agy-analysis | Agy CLI: complex/critical issues | | **Reporting** | action-generate-report | Consolidate findings → final_report | | **Fixing** | action-propose-fixes, action-apply-fix | Generate + apply fixes | | **Verify** | action-verify | Re-run diagnosis, check gates | | **Exit** | action-complete, action-abort | Finalize or rollback |
Full action details: [phases/actions/](phases/actions/)
State Management
**Single source of truth**: `{run_dir}/outputs/skill-tuning-{ts}/state.json`
{
"status": "pending|running|completed|failed",
"target_skill": { "name": "...", "path": "..." },
"diagnosis": {
"context": {...},
"memory": {...},
"dataflow": {...},
"agent": {...},
"docs": {...},
"token_consumption": {...}
},
"issues": [{"id":"...", "severity":"...", "category":"...", "strategy":"..."}],
"proposed_fixes": [...],
"applied_fixes": [...],
"quality_gate": "pass|fail",
"final_report": "..."
}See [phases/state-schema.md](phases/state-schema.md) for complete schema.
Orchestrator Logic
See [phases/orchestrator.md](phases/orchestrator.md) for:
- Decision logic (termination checks → action selection)
- State transitions
- Error recovery
Key Principles
1. **Problem-First**: Diagnosis before any fix 2. **Data-Driven**: Record traces, token counts, snapshots 3. **Iterative**: Multiple rounds until quality gates pass 4. **Reversible**: All changes with backup checkpoints 5. **Non-Invasive**: Minimal changes, maximum clarity
Usage Examples
# Basic skill diagnosis /skill-tuning "Fix memory leaks in my skill" # Deep analysis with Agy /skill-tuning "Architec
Intent-driven workflow orchestration for multi-agent AI development — adaptive lifecycle engine, self-reinforcing knowledge graph, and visual dashboard for Claude Code, Gemini, Codex & more
Repo: catlog22/maestro-flow
Other skills on maestro-flow.
- /maestro-help
Maestro Flow 命令帮助系统。搜索命令、浏览技能、工作流推荐、新手引导。Triggers on "maestro-help", "帮助", "命令", "怎么用", "skill", "workflow", "maestro 怎么用".
Open skill - /skill-generator
Meta-skill for creating new Claude Code skills with configurable execution modes. Supports sequential (fixed order) and autonomous (stateless) phase patterns. Use for skill scaffolding, skill creation, or building new workflows. Triggers on "create skill", "new skill", "skill
Open skill - /skill-iter-tune
Iterative skill tuning via execute-evaluate-improve feedback loop. Uses maestro delegate Claude to execute skill, Agy to evaluate quality, and Agent to apply improvements. Iterates until quality threshold or max iterations. Triggers on "skill iter tune", "iterative skill
Open skill - /skill-simplify
SKILL.md simplification with functional integrity verification. Analyze redundancy, optimize content, check no functionality lost. Triggers on "simplify skill", "optimize skill", "skill-simplify".
Open skill - /team-arch-opt
Unified team skill for architecture optimization. Uses team-worker agent architecture with role directories for domain logic. Coordinator orchestrates pipeline, workers are team-worker agents. Triggers on "team arch-opt".
Open skill - /team-coordinate
Universal team coordination skill with dynamic role generation. Uses team-worker agent architecture with role-spec files. Only coordinator is built-in -- all worker roles are generated at runtime as role-specs and spawned via team-worker agent. Beat/cadence model for
Open skill

