بنقرة واحدة
gum-edit
Edit an existing GUM module — update rules, hooks, or settings
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Edit an existing GUM module — update rules, hooks, or settings
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
Create a new GUM module with rules and optional hooks
GUM reference and usage guide
Sync GUM modules in the current session after toggle, create, edit, or remove
Analyze agent context and optimize GUM modules for better compliance
Show active GUM modules and their rules in the current session
استنادا إلى تصنيف SOC المهني
| name | gum-edit |
| description | Edit an existing GUM module — update rules, hooks, or settings |
This skill modifies an existing GUM module. You read the module's current state, present it clearly, discuss changes with the user, update files, and resync hooks if needed. The user should always see what exists before deciding what to change.
Announce at start: "I'm using the gum-edit skill to modify an existing GUM module."
IMMEDIATELY on skill load — before asking ANY question or producing ANY output other than the announcement — create a TaskCreate for EACH of these items:
Mark each task as completed as you finish it. Do NOT batch — mark done immediately.
SHOW BEFORE YOU CHANGE. ALWAYS.
Never ask "what do you want to change?" without first showing the user exactly what the module contains right now. Context before questions.
Use this ESPECIALLY when:
npx get-gum list via Bash to get the list of all modules"Which module do you want to edit? Here are your modules:
enforce-tdd— Enforce test-driven development workflowauto-lint— Run eslint after file editsteam-standards— Team coding standards"
Read ALL module files:
module.yaml -- name, description, version, enabled statusrules.md -- current rules contenthooks.json -- current hooks (if exists)Present everything clearly:
Module: enforce-tdd
Description: Enforce test-driven development workflow
Version: 1.0.0
Enabled: true
Rules (rules.md):
- Write failing tests before implementation code
- Each test should cover one specific behavior
- Run tests after every code change
Hooks (hooks.json):
- PostToolUse on [Write, Edit]: npm test
MUST show this before asking what to change. The user needs to see the full picture.
Ask what they want to change. Listen for:
Actively suggest promotions:
"I notice you have 'always format code after editing' as a rule. This is mechanical -- want me to convert it to a PostToolUse hook for 100% enforcement?"
npx get-gum sync via Bash -- this resyncs rules to runtime rules directories and merges hooks into runtime settings. Do NOT manually edit registry.json or copy files.~/.claude/rules/gum/<module-name>.md so changes take effect immediately in this session."Updated
enforce-tdd: added 1 rule, promoted 1 rule to hook, removed 1 stale rule. Synced."
npx get-gum list via Bash to find modulesnpx get-gum sync after any file changes -- never manually edit registry.json~/.gum/registry.json -- use npx get-gum syncWhen creating or editing hooks, use the correct format for each runtime:
Claude Code & Codex (identical format):
PreToolUse, PostToolUse, Stop"Bash", "Edit|Write"exit 2 with reason on stderrcat | jq -r '.tool_input.command' or .tool_input.file_pathGemini CLI:
BeforeTool, AfterTool, BeforeAgent, AfterAgent, SessionStart, SessionEnd"shell", "edit_file|write_file"exit 2 with reason on stderrcat | jq -r '.tool_input.command // .input.command // empty'Cursor:
preToolUse, postToolUse, beforeShellExecution, afterShellExecution, afterFileEdit{"tool_name": "shell"} — NOT a string{"decision":"deny","reason":"..."} for preToolUse, {"permission":"deny","userMessage":"..."} for beforeShellExecutionexit 0 with JSON responseOpenCode: No hooks support — skip this runtime.
| Anti-Pattern | Why It's Wrong | Do This Instead |
|---|---|---|
| Asking "what do you want to change?" immediately | User doesn't remember module contents | Show current state first, then ask |
| Editing hooks.json without resyncing | Hooks file updated but runtime doesn't know | Always resync after hooks.json changes |
| Ignoring mechanical rules during edit | Missed optimization opportunity | Actively suggest rule-to-hook promotion |
| Overwriting the entire rules.md | Destroys rules user didn't mention | Surgically add/remove/modify specific rules |
| Not checking if module exists in registry | Cryptic file-not-found errors | Read registry first, handle missing gracefully |
| Editing without reading config.yaml | Wrong paths, missing runtime sync | Read config before any file operations |
Example 1: Simple rule addition
User: "Add a rule to my team-standards module about error handling"
Agent: "I'm using the gum-edit skill to modify an existing GUM module."
Agent: *reads registry, finds team-standards, reads all files*
Agent: "Here's the current state of `team-standards`:
Rules:
- Prefer functional components in React
- Write tests before implementation
Hooks:
- PostToolUse on [Write, Edit]: prettier --write
What error handling rule do you want to add?"
User: "Always use custom error classes instead of throwing generic Error"
Agent: *appends rule to rules.md, runs `npx get-gum sync` via Bash*
Agent: "Added to `team-standards` rules.md:
'- Always use custom error classes instead of throwing generic Error'
Ran `npx get-gum sync` to propagate the rules.md change."
Example 2: Rule-to-hook promotion during edit
User: "Edit my enforce-tdd module"
Agent: *reads registry, reads module files*
Agent: "Here's `enforce-tdd`:
Rules:
- Write failing tests before implementation
- Run tests after every code change
- Format test files with prettier
No hooks currently.
I notice two potential improvements:
1. 'Run tests after every code change' — this is mechanical.
As a hook, it runs automatically with 100% compliance.
2. 'Format test files with prettier' — also mechanical.
Perfect candidate for a PostToolUse hook.
Want me to promote these to hooks?"
User: "Yes, both"
Agent: *creates hooks.json, updates rules.md to remove promoted rules,
reads config.yaml for runtimes, syncs hooks*
Agent: "Done. `enforce-tdd` now has:
- 1 rule: 'Write failing tests before implementation'
- 2 hooks: PostToolUse for test runner and prettier
Hooks synced to claude and cursor runtimes."