Add project-specific rules and conventions to .ai-factory/RULES.md. Each invocation appends new rules. These rules are automatically loaded by /aif-implement before execution. Use when user says "add rule", "remember this", "convention", or "always do X".
Add short, actionable rules and conventions for the current project. Rules are saved to .ai-factory/RULES.md and automatically loaded by /aif-implement before task execution.
Read .ai-factory/skill-context/aif-rules/SKILL.md — MANDATORY if the file exists.
This file contains project-specific rules accumulated by /aif-evolve from patches,
codebase conventions, and tech-stack analysis. These rules are tailored to the current project.
How to apply skill-context rules:
Enforcement: After generating any output artifact, verify it against all skill-context rules. If any rule is violated — fix the output before presenting it to the user.
Check $ARGUMENTS:
├── Has text? → Mode A: Direct add
└── No arguments? → Mode B: Interactive
User provided rule text as argument:
/aif-rules Always use DTO classes instead of arrays
→ Skip to Step 2 with the provided text as the rule.
No arguments provided:
/aif-rules
→ Ask via AskUserQuestion:
What rule or convention would you like to add?
Examples:
- Always use DTO classes instead of arrays for data transfer
- Routes must use kebab-case
- All database queries go through repository classes
- Never use raw SQL, always use the query builder
- Log every external API call with request/response
> ___
Check if .ai-factory/RULES.md exists:
Glob: .ai-factory/RULES.md
If file does NOT exist → create it with the header and first rule:
# Project Rules
> Short, actionable rules and conventions for this project. Loaded automatically by /aif-implement.
## Rules
- [new rule here]
If file exists → read it, then append the new rule at the end of the rules list.
Use Edit to append the new rule as a - list item at the end of the ## Rules section.
Formatting rules:
- line✅ Rule added to .ai-factory/RULES.md:
- [the rule]
Total rules: [count]
.ai-factory/RULES.md, create .ai-factory/ directory if needed.ai-factory/RULES.md; other context artifacts stay read-only unless explicitly requested by the user