agentleFS
luck1ncoderluck1ncoder/agent-colleague-dashboard/.claude/skills/agent-edit/SKILL.md

agent-edit

Skill0 starsChanged 6 months agoMITView on GitHub

Modify an existing agent's `.claude/agents/<name>.md` file based on a natural-language request. Triggered by /agent-edit. Backs up the file, uses the Edit tool (which prompts the user with a diff for permission), and invalidates the dashboard cache. Use when the user wants to change an agent's behavior, prompt, tools, or model without manually editing the file.

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 10 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Search in this order, take first match:

    line 25
  2. Distinctive:

    Stop. Do not create new files in this skill.

    line 33
  3. Distinctive:

    Use the Read tool on the resolved path.

    line 37
  4. Distinctive:

    If the user says "对 magic number 宽容一点", the target is the line(s) about magic numbers — soften wording (e.g., "magic number 拒绝" → "magic …

    line 42
  5. Distinctive:

    If the user says "add a When invoked step", append one numbered item to the existing list.

    line 43
  6. Very specific:

    If the user says "switch model", change only the model: value in frontmatter.

    line 44
  7. Distinctive:

    If the request is genuinely ambiguous, ASK the user before editing — don't guess.

    line 50
  8. Distinctive:

    Use the Edit tool. The Edit tool will:

    line 73
  9. Distinctive:

    Ask the user for permission to apply

    line 75
  10. Distinctive:

    If the user rejects the edit, stop.

    line 78
  11. Very specific:

    Backup is mandatory: Always call backup.py before the Edit tool.

    line 95
  12. Distinctive:

    No silent destruction: If the user's request implies removing a large section, ask first ("This will remove the entire 'Code review …

    line 96
  13. Very specific:

    No frontmatter corruption: When editing frontmatter, preserve --- delimiters and YAML syntax.

    line 97

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

agent-edit skill

Modify an existing agent's prompt file based on natural-language instructions. The user describes the change; you (the LLM) figure out where in the file to apply it and use the Edit tool to make the change. The user reviews the diff via the Edit tool's built-in permission prompt.

Trigger

/agent-edit <agent-name> "<natural-language change request>"

Examples:

  • /agent-edit code-reviewer "对 magic number 宽容一点"
  • /agent-edit vibe-coder "add a When invoked step about reading existing tests first"
  • /agent-edit planner "switch model from sonnet to opus"

Pipeline

Step A. Resolve the agent file

Search in this order, take first match:

  1. .claude/agents/<name>.md (project-level)
  2. ~/.claude/agents/<name>.md (user-level)

If not found:

  • Tell the user the agent doesn't exist
  • List available agents (project + user dirs combined, deduplicated by stem name)
  • Suggest /agent-create <name> if they wanted to make a new one (note: that command is part of a future plan and may not exist yet)
  • Stop. Do not create new files in this skill.

Step B. Read the current file

Use the Read tool on the resolved path. Note frontmatter fields and body sections.

Step C. Plan the change

Translate the natural-language request into a targeted edit. Be specific:

  • If the user says "对 magic number 宽容一点", the target is the line(s) about magic numbers — soften wording (e.g., "magic number 拒绝" → "magic number 警告但不阻止"), don't rewrite unrelated parts.
  • If the user says "add a When invoked step", append one numbered item to the existing list.
  • If the user says "switch model", change only the model: value in frontmatter.

Hard rules:

  • Modify ONLY the resolved file. Never touch other agent files or CLAUDE.md from this skill.
  • Make the smallest change that satisfies the request. Don't refactor or "improve" surrounding content.
  • Preserve formatting (heading levels, list style, indentation, spacing).
  • If the request is genuinely ambiguous, ASK the user before editing — don't guess.

Step D. Backup before edit

Run via Bash:

DASHBOARD=.claude/skills/dashboard
python3 $DASHBOARD/scripts/backup.py <resolved-path>

The backup path will print to stdout. Note it for the report.

Step E. Invalidate the dashboard cache (before the edit)

Run via Bash:

python3 $DASHBOARD/scripts/invalidate_cache.py <resolved-path>

This MUST happen before the Edit (while the file still has its pre-edit content). Calling after the edit hashes the new content and finds nothing to remove, leaving stale entries in ~/.claude/dashboard-cache/.

Step F. Apply the edit

Use the Edit tool. The Edit tool will:

  1. Display the proposed change as a diff
  2. Ask the user for permission to apply
  3. Apply only on user approval

If the user rejects the edit, stop. The backup file is left in place (it's harmless, gitignored, and can be cleaned up manually if desired).

Step G. Report back

Tell the user, in one short message:

  1. What was changed (one sentence)
  2. Backup location (so they can rollback)
  3. Suggest re-running the dashboard to see the new persona

Example:

已把 code-reviewer 对 magic number 的态度从"拒绝"改为"警告但不阻止"。 备份: ~/.claude/agents/code-reviewer.md.bak.1714823104938293000 想看新版人设:/dashboard --agent code-reviewer

Safety boundaries

  • Single-file scope. This skill modifies exactly one file per invocation. Never edit other agent files, CLAUDE.md, or anything outside .claude/agents/ (project) or ~/.claude/agents/ (user).
  • Backup is mandatory. Always call backup.py before the Edit tool. Even if the user requested a tiny change.
  • No silent destruction. If the user's request implies removing a large section, ask first ("This will remove the entire 'Code review checklist' block — confirm?").
  • No frontmatter corruption. When editing frontmatter, preserve --- delimiters and YAML syntax. If you must change the name field, warn the user that this will rename the file effectively.
  • Don't add new files. This skill only modifies existing agents. Creating new agents is out of scope.
  • No affinity warning here. Agent edits don't change CLAUDE.md → agent affinity scoring is driven by CLAUDE.md content, not agent prompts. (/claude-edit does emit such a warning.)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.