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

claude-edit

Skill0 starsChanged 6 months agoMITView on GitHub

Modify the project's `CLAUDE.md` (or `~/.claude/CLAUDE.md` user-level) based on a natural-language request. Triggered by /claude-edit. Backs up the file, uses the Edit tool (with built-in diff and permission prompt), and invalidates the dashboard cache. Use when the user wants to change the project charter — adding, removing, or rewording principles, rules, or constraints.

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 8 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    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. Very specific:

    Ask if they want to create one (note: this skill does not create new files.

    line 31
  3. Distinctive:

    Use the Read tool on the resolved path.

    line 36
  4. Distinctive:

    If unclear ("rewrite section X" without saying how), ASK before editing.

    line 52
  5. Distinctive:

    Use the Edit tool. The diff is shown to the user.

    line 72
  6. Very specific:

    If the project has agents (.claude/agents/*.md exists), remind the user that the CLAUDE.md change may invalidate previously-computed …

    line 76
  7. Distinctive:

    Single-file scope: Only modifies the resolved CLAUDE.md.

    line 92
  8. Distinctive:

    Backup mandatory: Always before Edit.

    line 93
  9. Distinctive:

    Preserve unmodified sections: If user asks to change one principle, leave the others alone.

    line 94
  10. Distinctive:

    No silent destruction: If the request implies removing a major section, confirm first.

    line 95
  11. Very specific:

    Don't auto-fix downstream agents: If the new CLAUDE.md conflicts with an existing agent, mention it but don't edit the agent — that's a …

    line 96

≈ “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

claude-edit skill

Modify the project's CLAUDE.md based on natural-language instructions. Same pattern as agent-edit but targeting the charter file instead of an agent file.

Trigger

/claude-edit "<natural-language change request>"

Examples:

  • /claude-edit "add a 5th principle: prefer composition over inheritance"
  • /claude-edit "remove the 'No mocking' rule — we agreed it's too strict"
  • /claude-edit "soften principle 3 to allow refactoring when explicitly asked"

Pipeline

Step A. Resolve CLAUDE.md

Search in this order, take first match:

  1. ./CLAUDE.md (project root)
  2. ~/.claude/CLAUDE.md (user-level)

If neither exists:

  • Tell the user "no CLAUDE.md found in project root or ~/.claude/"
  • Ask if they want to create one (note: this skill does not create new files; suggest manual creation or a future /claude-create command)
  • Stop.

Step B. Read the file

Use the Read tool on the resolved path. Take note of:

  • Top-level structure (# CLAUDE.md, ## 1. ..., etc.)
  • Style (bullet points vs prose, heading depth, numbering scheme)
  • Any explicit "## Principles" or numbered sections

Step C. Plan the change

Translate the request into a precise edit:

  • "Add a 5th principle" → append a new ## 5. <Title> section after the last principle, matching style
  • "Remove rule X" → delete just that section, leaving surrounding sections intact
  • "Soften principle 3" → reword the text inside section 3 only

Hard rules:

  • Modify ONLY CLAUDE.md. Never touch agent files from this skill.
  • Match existing heading depth, numbering, and prose style.
  • Preserve any sections the request didn't ask to change.
  • If unclear ("rewrite section X" without saying how), ASK before editing.

Step D. Backup before edit

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

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 diff is shown to the user; they approve or reject.

Step G. Affinity recompute warning

If the project has agents (.claude/agents/*.md exists), remind the user that the CLAUDE.md change may invalidate previously-computed affinity scores. Suggest re-running /dashboard (default mode) to see updated alignment.

Step H. Report back

Tell the user:

  1. What was changed (one sentence)
  2. Backup path
  3. Suggest /dashboard --claude (or /dashboard to see team affinity recomputed)

Example:

已在 CLAUDE.md 末尾加了原则 5: "组合优于继承"。 备份: ./CLAUDE.md.bak.1714823104938293000 想看团队对新原则的服从度:/dashboard

Safety boundaries

  • Single-file scope. Only modifies the resolved CLAUDE.md.
  • Backup mandatory. Always before Edit.
  • Preserve unmodified sections. If user asks to change one principle, leave the others alone.
  • No silent destruction. If the request implies removing a major section, confirm first.
  • Don't auto-fix downstream agents. If the new CLAUDE.md conflicts with an existing agent, mention it but don't edit the agent — that's a separate /agent-edit invocation.

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.