| name | self-modify |
| description | Self-modification skill with tiered safety and rollback. Handles changes to AGENTS.md, skills, preferences, and state files. Triggers on phrases like "update rule", "add skill", "change how you", "remember that". Use when the user wants to modify agent behavior or configuration. |
| license | MIT |
| metadata | {"author":"local","version":"1.0.0","domain":"workflow","triggers":"update rule, add skill, change how you, remember that, always, never, APEX should, stop doing","role":"meta","scope":"configuration","output-format":"markdown","related-skills":"modify"} |
Self-Modify
Handles self-modification of agent configuration files with tiered safety and rollback support.
Core Workflow
- Identify -- Determine which file and tier the change affects
- Backup -- Tier 1 and 2:
cp [file] .agents/backups/[file].[YYYYMMDD-HHmmss]
- Confirm -- Tier 1 only: show BEFORE/AFTER diff, wait for explicit "yes"
- Apply -- Minimal surgical edit, nothing adjacent
- Verify -- Re-read the file to confirm correctness
- Report --
[file] updated | [what changed] | rollback: cp .agents/backups/[f] [dest]
File Tiers
| Tier | Files | Confirm First? |
|---|
| 1 -- Constitutional | AGENTS.md, BLUEPRINT.md | YES -- show diff, wait for "yes" |
| 2 -- Operational | skills/*.md, PREFERENCES.md | NO -- apply directly |
| 3 -- State | CONTEXT.md, lessons.md, failures.md | NO -- always free to edit |
Adding a New Skill
- Check
.agents/skills/ for existing skills
- Create
.agents/skills/<name>/SKILL.md using the frontmatter format
- Use
.agents/skills/rust-engineer/SKILL.md as the reference template
- Report trigger phrases to the user
Rollback
Get-ChildItem .agents\backups\ | Sort LastWriteTime -Desc # list backups
Copy-Item .agents\backups\[file].[ts] [original-path] # restore
Constraints
MUST DO
- Backup before modifying Tier 1 or 2 files
- Show diff and wait for confirmation on Tier 1 changes
- Make only the requested change -- nothing adjacent
- Re-read files after editing to verify correctness
MUST NOT DO
- Modify Tier 1 files without confirmation
- Delete backup files
- Change anything outside the scope of the request