digital-stoic-org

edit-command

0
0
# Install this skill:
npx skills add digital-stoic-org/agent-skills --skill "edit-command"

Install specific skill from multi-skill repository

# Description

Creates and modifies Claude Code slash commands following best practices. Use when user requests creating, updating, modifying, improving, or editing slash commands. Triggers include "create/make/new command", "slash command", "/command-name", file paths with /commands/, "update/modify/improve command X". Handles command structure, YAML frontmatter (description, allowed-tools, argument-hint, model), argument patterns ($ARGUMENTS, $1 $2, @filepath), tool restrictions, discoverability. Delegates to edit-tool orchestrator if uncertain about tool type (command vs skill vs agent vs script).

# SKILL.md


name: edit-command
description: Creates and modifies Claude Code slash commands following best practices. Use when user requests creating, updating, modifying, improving, or editing slash commands. Triggers include "create/make/new command", "slash command", "/command-name", file paths with /commands/, "update/modify/improve command X". Handles command structure, YAML frontmatter (description, allowed-tools, argument-hint, model), argument patterns ($ARGUMENTS, $1 $2, @filepath), tool restrictions, discoverability. Delegates to edit-tool orchestrator if uncertain about tool type (command vs skill vs agent vs script).


Instructions for Creating and Modifying Slash Commands

Uncertain About Tool Type?

If unsure whether this should be a command vs skill vs agent vs script, see the edit-tool orchestrator for comprehensive decision matrix.

Quick checks:
- Token budget <500 + auto-invoke? β†’ Probably skill
- Complex autonomous exploration? β†’ Probably sub-agent
- Deterministic shell-only? β†’ Probably bash script
- User-triggered workflow? β†’ βœ… Probably command

MANDATORY Validation (CREATE only)

STOP: Before proceeding, answer YES/NO:

Q1: User-triggered (not auto-invoked)?
- Answer: [YOU MUST STATE YES OR NO]

Q2: Multi-step workflow?
- Answer: [YOU MUST STATE YES OR NO]

Q3: Repeatedly used?
- Answer: [YOU MUST STATE YES OR NO]

Decision Tree

If ALL NO β†’ STOP. Use direct request or bash alias instead.

If ANY YES + needs AI reasoning β†’ Proceed to creation.
Otherwise β†’ Delegate to edit-tool (may suggest Sub-Agent or Skill).

Determine Action Type

CREATE: New slash command requested
MODIFY: Update existing command (keywords: "update", "modify", "improve", "add to", "fix")


Creating New Slash Commands

  1. Ask for details if missing: purpose, arguments needed, tools required
  2. Determine location:
  3. .claude/commands/ - Project commands (shared with team)
  4. ~/.claude/commands/ - Personal commands (all projects)
  5. Generate filename: [command-name].md (lowercase-hyphens only)
  6. Create file with YAML frontmatter (optional) and instructions

Frontmatter fields:
- description - Brief description (for discoverability)
- allowed-tools - Tool restrictions (Bash, Read, Edit, etc.)
- argument-hint - Expected parameters display
- model - Use haiku for simple tasks (cost/latency optimization)

Argument patterns:
- $ARGUMENTS - All arguments as string
- $1, $2, $3 - Positional arguments
- @filepath - Include file contents

Modifying Existing Slash Commands

  1. Locate and read existing command file
  2. Analyze: frontmatter (if present), instructions, arguments used
  3. Make surgical edits using Edit tool
  4. Update frontmatter if changing tools, model, or arguments
  5. Validate: YAML valid, instructions clear, arguments work

Key Principles

  • User-initiated: Commands don't pollute auto-context (vs skills), can be verbose
  • Discoverable: Add description to frontmatter so Claude can find it
  • Tool restrictions: Specify allowed-tools to control capabilities
  • Model selection: Use haiku for simple tasks to reduce cost/latency

Validation Checklist

  • [ ] Filename follows lowercase-hyphens-only rule
  • [ ] YAML frontmatter has --- markers (if used)
  • [ ] Description field present (for discoverability)
  • [ ] argument-hint matches actual usage (if args used)
  • [ ] allowed-tools includes all needed tools
  • [ ] Instructions are clear and actionable
  • [ ] Arguments ($1, $2, $ARGUMENTS) work correctly

For detailed examples, templates, patterns, and edge cases, see reference.md.

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.