
Aif Rules
Add project-specific rules and conventions to the configured RULES.md artifact.
Install
npx skills add lee-to/ai-factory --skill aif-rules -g -a claude-code -y- Repository
- lee-to/ai-factory1.2k
- Category
- Engineering
- Updated
- 3d ago
- License
- See repository
- Context cost
- Mediumabout 2,454 tokens
- Runs scripts
- No, instructions only
What it does
Add project-specific rules and conventions to the configured RULES.md artifact. 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".
AI Factory Rules - Project Conventions
Shared project skill-context
Before mode routing or work, read existing files relative to the current project root in this order (reuse them if already loaded):
.ai-factory/skill-context/global-skill-context.md, all bundled skills..ai-factory/skill-context/aif-rules/SKILL.md, this skill.
Missing files are skipped; an existing unreadable file stops dependent work with its path.
Precedence: individual > build (when applicable) > global > skill defaults; retain non-conflicting instructions and check all outputs against the effective rules.
These layers customize workflow; they do not replace the project's rules/architecture hierarchy or relax explicit requirements, ownership, scope, safety/privacy, validation, or approval boundaries. Report conflicts with those boundaries instead of overriding them.
global is a project-local layer, not home-directory configuration. Custom/extension skills do not automatically use it.
Add short, actionable rules and conventions for the current project. Rules are saved to the configured RULES.md artifact (default: .ai-factory/RULES.md) and automatically loaded by /aif-implement before task execution.
Rules Hierarchy
AI Factory supports a three-level rules hierarchy:
-
RULES.md - Axioms (universal project rules)
- Managed by this skill (
/aif-rules) - Short, flat list of hard requirements
- Loaded by all skills
- Managed by this skill (
-
rules/base.md - Project-specific base conventions
- Created by
/aifduring project setup - Naming conventions, module boundaries, error handling patterns
- Auto-detected from codebase analysis
- Created by
-
rules.<area> - Area-specific conventions
- Created by this skill (Mode C)
- Registered in
.ai-factory/config.yamlas named keys such asrules.api - Area-specific patterns and constraints
Priority: More specific rules win. rules.<area> > rules/base.md > RULES.md
