rules
/anty:rules — View/Edit User Rules
/anty:rules — View/Edit User Rules
Trigger
User runs /anty:rules
Behavior
Read and display the contents of .anty/rules.md, then allow the user to view, add, modify, or remove rules. Rules are injected into every agent interaction with the highest priority.
Default View (no arguments)
- Read
.anty/rules.md - Display current rules with numbered list:
==================================================== USER RULES ==================================================== Rules are injected into every agent interaction with HIGHEST priority. Agents must follow these. ==================================================== 1. [rule text] 2. [rule text] 3. [rule text] ... ==================================================== Commands: "add [rule]" — Add a new rule "edit [n]" — Edit rule number n "remove [n]" — Remove rule number n "done" — Exit rules editor ====================================================
Adding a Rule
When user says "add [rule text]":
- Append the new rule to
.anty/rules.md - Display updated rules list
- Confirm: "Rule added: [rule text]"
Editing a Rule
When user says "edit [n]":
- Display current rule #n
- Ask user for new text
- Replace rule #n in
.anty/rules.md - Display updated rules list
- Confirm: "Rule #[n] updated."
Removing a Rule
When user says "remove [n]":
- Display rule #n and ask for confirmation
- On confirmation, remove rule #n from
.anty/rules.md - Renumber remaining rules
- Display updated rules list
- Confirm: "Rule #[n] removed."
Rules Format in .anty/rules.md
# User Rules
These rules have the HIGHEST priority and override all other instructions.
1. [rule text]
2. [rule text]
3. [rule text]
Edge Cases
- If
.anty/rules.mddoes not exist, create it with the header template - If file exists but has no rules, display "No rules set. Use 'add [rule]' to create your first rule."
- Preserve any markdown formatting within rule text