AgentSkillsCN

edit-tool

统筹Claude Code工具(技能、命令、代理、脚本)的创建流程。当用户请求创建、更新或优化任何Claude Code扩展机制时使用。触发条件包括:“创建/制作/新建技能/命令/代理/脚本”、“为X打造工具”、“斜杠命令”、“子代理”,以及以/skills/、/commands/、/agents/开头的文件路径。根据Token预算、使用频率、情境需求与执行类型自动进行分类与调度。在阐明决策理由后,可将任务交由edit-skill、edit-command或edit-agent处理。

SKILL.md
--- frontmatter
name: edit-tool
description: Orchestrates creation of Claude Code tools (skills, commands, agents, scripts). Use when user requests creating, updating, or improving any Claude Code extension mechanism. Triggers include "create/make/new skill/command/agent/script", "tool for X", "slash command", "sub-agent", file paths with /skills/, /commands/, /agents/. Auto-triages based on token budget, frequency, context needs, and execution type. Delegates to edit-skill, edit-command, or edit-agent after explaining decision rationale.

Edit Tool Orchestrator

Automatically triages tool creation requests to the appropriate mechanism (skill, command, agent, or script).

Triage Process

CRITICAL: Always follow these steps:

  1. Analyze request against decision tree
  2. Explain decision to user with rationale
  3. Invoke appropriate skill or provide guidance

Decision Tree

mermaid
graph TD
    A[Tool Request] --> B{Deterministic<br/>shell only?}
    B -->|Yes| C{AI needed to<br/>decide when/how?}
    C -->|No| BASH[✅ Bash Script<br/>0 tokens]
    C -->|Yes| D{Token<br/>budget?}
    D -->|<500| WRAP[✅ Skill + scripts/<br/>AI wraps code]
    D -->|>500| CMD1[✅ Command<br/>+ @filepath]

    B -->|No| E{Token<br/>budget?}
    E -->|>2000| AGENT[✅ Sub-Agent<br/>Isolated context]
    E -->|500-2000| F{Invocation?}
    F -->|User| CMD2[✅ Command<br/>User controls]
    F -->|Auto| AGENT

    E -->|<500| G{Frequency?}
    G -->|5+ per session| H{Specific<br/>capability?}
    H -->|Yes| SKILL[✅ Skill<br/>Auto-invoked]
    H -->|No| CMD2
    G -->|1-2 per session| CMD2
    G -->|Rare <1/10| DIRECT[❌ Direct Request<br/>No tool needed]

    style BASH fill:#90EE90,stroke:#000,stroke-width:2px,color:#000
    style SKILL fill:#FFD700,stroke:#000,stroke-width:2px,color:#000
    style WRAP fill:#FFA500,stroke:#000,stroke-width:2px,color:#000
    style CMD1 fill:#87CEEB,stroke:#000,stroke-width:2px,color:#000
    style CMD2 fill:#87CEEB,stroke:#000,stroke-width:2px,color:#000
    style AGENT fill:#DDA0DD,stroke:#000,stroke-width:2px,color:#000
    style DIRECT fill:#FFB6C1,stroke:#000,stroke-width:2px,color:#000

Decision Factors Reference

When path requires multiple criteria, consult:

FactorKey QuestionResult
Token Budget<500 / 500-2000 / >2000?Skill / Command / Agent
Frequency5+ / 1-2 / <1 per 10 sessions?Skill / Command / Direct
ContextMain / Isolated?Command / Agent
ScriptsAI wrapper needed?Skill+scripts/ / Bash
InvocationUser / Auto?Command / Skill
CapabilitySpecific / Workflow?Skill / Command

Explanation Template

Explain decision: ✅ [TYPE] because: token budget (~X → range), frequency (pattern), key factor (dimension)

Example: ✅ SKILL because: ~300 tokens → <500, 10+/session, auto-invoked capability

Delegation

After explanation: Skilledit-skill | Commandedit-command | Agentedit-agent | Bash → Direct guidance (scripts/, #!/bin/bash, chmod +x, no tool)

Parallelization Check

Before any write operations, verify safety:

Operation TypeGuidance
✅ Read-onlyParallelize freely
⚠️ Writes (independent files)Sequential OR Plan Mode first
⚠️ Writes (dependent changes)Must sequence carefully
❌ Destructive operationsPlan Mode MANDATORY

Plan Mode triggers:

  • Creating >3 files
  • Modifying >5 files
  • Architectural changes
  • Breaking changes

Tool Comparison Quick Reference

ToolToken CostWhen to UseContext
Bash Script0 (executed)Deterministic shell opsNone
Skill<500 idealAuto-invoked, frequentShared (pollution)
Command500-2000 okUser-triggered workflowsUser-controlled
AgentUnlimitedComplex explorationIsolated

Common Patterns

PatternWhenSolution
Script WrapperAI decides timing for existing scriptsSkill + scripts/
Verbose Workflow>1000 tokens, manual triggerSlash command
Research TaskMulti-file exploration, autonomousSub-agent (check Task tool first)

See reference.md for edge cases, conversion guide, and extended examples.