Edit Tool — Unified Skill/Agent/Script Editor
Triage
CRITICAL: Always triage first, then act.
- Analyze request against decision tree
- Explain decision to user:
✅ [TYPE] because: pollution cost (~X tokens × Yfreq), context mode (main|fork), key factor
- Branch to guide or provide direct guidance
graph TD
A[Tool Request] --> AA{Plugin<br/>version/release?}
AA -->|Yes| PLUGIN[✅ edit-plugin]
AA -->|No| 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/]
D -->|>500| SKILL_REF[✅ Skill + reference.md]
B -->|No| E{Pollution<br/>cost?}
E -->|High >2000 tokens<br/>OR deep exploration| AGENT[✅ Sub-Agent]
E -->|Medium 500-2000| F{Context<br/>mode?}
F -->|Needs isolation| FORK[✅ Skill context:fork]
F -->|Needs main context| SKILL_BIG[✅ Skill + reference.md]
E -->|Low <500| G{Frequency?}
G -->|1+ per session| SKILL[✅ Skill]
G -->|Rare <1/10| DIRECT[❌ No tool needed]
style PLUGIN fill:#B2DFDB,stroke:#00897B,stroke-width:2px,color:#000
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 SKILL_REF fill:#FFA500,stroke:#000,stroke-width:2px,color:#000
style SKILL_BIG fill:#87CEEB,stroke:#000,stroke-width:2px,color:#000
style FORK fill:#DDA0DD,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
Default: All skills are dual-invocable (both /name and model auto-invoke). disable-model-invocation: true is opt-out for rare edge cases.
Modifying Existing Tools
- Locate and read existing file (SKILL.md or agent .md)
- Enumerate functional outputs — every behavior/capability = preservation contract
- Make surgical edits using Edit tool (not Write/overwrite)
- Regression check: verify each output from step 2 is retained
- Update description if changing triggers
- Validate: YAML valid, triggers clear, instructions actionable
Creating New Tools
💡 Before creating: consider running /search-skill to discover existing solutions.
- Ask for details if missing: purpose, triggers, tools needed
- Determine type via triage decision tree above
- Use
pick-model skill for model selection
- Branch to appropriate guide:
| Type |
Guide |
Location |
| Skill |
references/skill-guide.md |
skills/name/SKILL.md |
| Agent |
references/agent-guide.md |
.claude/agents/name.md or plugin agents/ |
| Plugin |
edit-plugin skill |
plugin.json + marketplace.json |
| Bash |
Direct guidance (scripts/, chmod +x) |
Project scripts dir |
Skill frontmatter (quick ref — see references/skill-guide.md for full spec):
name — lowercase-hyphens
description — triggers + use cases (max 1024 chars)
context — main (default) | fork
model — opus | sonnet | haiku
allowed-tools, argument-hint, hooks — optional
Agent frontmatter (quick ref — see references/agent-guide.md for full spec):
name, description — required
tools / disallowedTools — allowlist or denylist
model — opus | sonnet | haiku | inherit (default)
permissionMode, maxTurns, skills, mcpServers, memory, hooks, background, isolation — optional
MANDATORY Validation (CREATE only)
STOP — answer YES/NO before proceeding:
| Question |
Skill |
Agent |
| Q1: Pollution cost acceptable? (<500 tokens × freq for skill) |
Required |
N/A (isolated) |
| Q2: SKILL.md <500 tokens (with reference.md for overflow)? |
Required |
N/A |
| Q3: Specific capability, not a workflow bundle? |
Required |
Required |
| Q3a: Requires multi-step AI reasoning with isolation? |
N/A |
Required (any YES → agent) |
Skill: ANY NO → STOP. Recommend alternative (fork, agent, direct request).
Agent: ALL NO on Q3a → STOP. Recommend skill or bash script instead.
Key Principles
- Preserve function: MODIFY must not remove capabilities unless explicitly requested
- <500 tokens ideal for SKILL.md; use progressive disclosure for overflow
- Single responsibility: One focused purpose per tool
- Token-efficient: Tables, bullets, Mermaid over prose
- Context-aware: Main for quick tasks, fork for research, agent for deep exploration
Parallelization
| Operation |
Guidance |
| ✅ Read-only |
Parallelize freely |
| ⚠️ Writes (independent files) |
Sequential OR Plan Mode first |
| ❌ Destructive / >3 files |
Plan Mode MANDATORY |
See references/frameworks.md for edge cases, conversion guide, and extended examples.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: edit-tool3description: Creates, modifies, and orchestrates Claude Code tools (skills, agents, scripts). Use when user requests creating, updating, improving, or editing any Claude Code extension — skills, sub-agents, slash commands, script wrappers. Triggers include "create/make/new skill/command/agent/script", "tool for X", "slash command", "sub-agent", file paths with /skills/, /agents/. For plugin version bumps and release metadata, route directly to edit-plugin.4---56# Edit Tool — Unified Skill/Agent/Script Editor78## Triage910**CRITICAL**: Always triage first, then act.11121. **Analyze request** against decision tree132. **Explain decision** to user: `✅ [TYPE] because: pollution cost (~X tokens × Yfreq), context mode (main|fork), key factor`143. **Branch to guide** or provide direct guidance1516```mermaid17graph TD18 A[Tool Request] --> AA{Plugin<br/>version/release?}19 AA -->|Yes| PLUGIN[✅ edit-plugin]20 AA -->|No| B{Deterministic<br/>shell only?}21 B -->|Yes| C{AI needed to<br/>decide when/how?}22 C -->|No| BASH[✅ Bash Script<br/>0 tokens]23 C -->|Yes| D{Token<br/>budget?}24 D -->|<500| WRAP[✅ Skill + scripts/]25 D -->|>500| SKILL_REF[✅ Skill + reference.md]2627 B -->|No| E{Pollution<br/>cost?}28 E -->|High >2000 tokens<br/>OR deep exploration| AGENT[✅ Sub-Agent]29 E -->|Medium 500-2000| F{Context<br/>mode?}30 F -->|Needs isolation| FORK[✅ Skill context:fork]31 F -->|Needs main context| SKILL_BIG[✅ Skill + reference.md]3233 E -->|Low <500| G{Frequency?}34 G -->|1+ per session| SKILL[✅ Skill]35 G -->|Rare <1/10| DIRECT[❌ No tool needed]3637 style PLUGIN fill:#B2DFDB,stroke:#00897B,stroke-width:2px,color:#00038 style BASH fill:#90EE90,stroke:#000,stroke-width:2px,color:#00039 style SKILL fill:#FFD700,stroke:#000,stroke-width:2px,color:#00040 style WRAP fill:#FFA500,stroke:#000,stroke-width:2px,color:#00041 style SKILL_REF fill:#FFA500,stroke:#000,stroke-width:2px,color:#00042 style SKILL_BIG fill:#87CEEB,stroke:#000,stroke-width:2px,color:#00043 style FORK fill:#DDA0DD,stroke:#000,stroke-width:2px,color:#00044 style AGENT fill:#DDA0DD,stroke:#000,stroke-width:2px,color:#00045 style DIRECT fill:#FFB6C1,stroke:#000,stroke-width:2px,color:#00046```4748**Default**: All skills are dual-invocable (both `/name` and model auto-invoke). `disable-model-invocation: true` is opt-out for rare edge cases.4950## Modifying Existing Tools51521. Locate and read existing file (SKILL.md or agent .md)532. **Enumerate functional outputs** — every behavior/capability = **preservation contract**543. Make **surgical edits** using Edit tool (not Write/overwrite)554. **Regression check**: verify each output from step 2 is retained565. Update description if changing triggers576. Validate: YAML valid, triggers clear, instructions actionable5859## Creating New Tools6061💡 **Before creating:** consider running `/search-skill` to discover existing solutions.62631. Ask for details if missing: purpose, triggers, tools needed642. Determine type via triage decision tree above653. Use `pick-model` skill for model selection664. Branch to appropriate guide:6768| Type | Guide | Location |69|------|-------|----------|70| **Skill** | `references/skill-guide.md` | `skills/name/SKILL.md` |71| **Agent** | `references/agent-guide.md` | `.claude/agents/name.md` or plugin `agents/` |72| **Plugin** | `edit-plugin` skill | `plugin.json` + `marketplace.json` |73| **Bash** | Direct guidance (scripts/, chmod +x) | Project scripts dir |7475**Skill frontmatter** (quick ref — see `references/skill-guide.md` for full spec):76- `name` — lowercase-hyphens77- `description` — triggers + use cases (max 1024 chars)78- `context` — `main` (default) | `fork`79- `model` — `opus` | `sonnet` | `haiku`80- `allowed-tools`, `argument-hint`, `hooks` — optional8182**Agent frontmatter** (quick ref — see `references/agent-guide.md` for full spec):83- `name`, `description` — required84- `tools` / `disallowedTools` — allowlist or denylist85- `model` — `opus` | `sonnet` | `haiku` | `inherit` (default)86- `permissionMode`, `maxTurns`, `skills`, `mcpServers`, `memory`, `hooks`, `background`, `isolation` — optional8788## MANDATORY Validation (CREATE only)8990**STOP** — answer YES/NO before proceeding:9192| Question | Skill | Agent |93|----------|-------|-------|94| Q1: Pollution cost acceptable? (<500 tokens × freq for skill) | Required | N/A (isolated) |95| Q2: SKILL.md <500 tokens (with reference.md for overflow)? | Required | N/A |96| Q3: Specific capability, not a workflow bundle? | Required | Required |97| Q3a: Requires multi-step AI reasoning with isolation? | N/A | Required (any YES → agent) |9899**Skill: ANY NO → STOP.** Recommend alternative (fork, agent, direct request).100**Agent: ALL NO on Q3a → STOP.** Recommend skill or bash script instead.101102## Key Principles103104- **Preserve function**: MODIFY must not remove capabilities unless explicitly requested105- **<500 tokens** ideal for SKILL.md; use progressive disclosure for overflow106- **Single responsibility**: One focused purpose per tool107- **Token-efficient**: Tables, bullets, Mermaid over prose108- **Context-aware**: Main for quick tasks, fork for research, agent for deep exploration109110## Parallelization111112| Operation | Guidance |113|-----------|----------|114| ✅ Read-only | Parallelize freely |115| ⚠️ Writes (independent files) | Sequential OR Plan Mode first |116| ❌ Destructive / >3 files | Plan Mode MANDATORY |117118See `references/frameworks.md` for edge cases, conversion guide, and extended examples.119120---121> Converted and distributed by [TomeVault](https://tomevault.io/claim/digital-stoic-org) — claim your Tome and manage your conversions.122<!-- tomevault:4.0:skill_md:2026-04-13 -->