Agent skill

Aif Rules

by unxed in unxed/f4

Add project-specific rules and conventions to the configured RULES.md artifact.

BSD-3-ClauseAuto-check passed

Install Aif Rules

skills CLI
$ npx skills add unxed/f4 --skill aif-rules -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install unxed/f4 aif-rules --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/unxed/f4.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/aif-rules .claude/skills/aif-rules && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
aif-rules
GitHub stars
241
Token cost
~2.3k tokens
SKILL.md length
947 words
Files
1
Skills in repo
36
Repo updated
First seen
Licence
BSD-3-Clause

At a glance

Add project-specific rules and conventions to the configured RULES.md artifact.

  • Works in 6 steps: Load Config → 1: Load Skill Context → Determine Mode → …
  • User says add rule
  • SKILL.md covers Rules Hierarchy, Workflow and Rules
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Aif Rules is an agent skill from unxed/f4. 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".

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: dual pane like a charm. The licence is BSD-3-Clause.

When your agent uses it

  • User says add rule

Example prompts

  • “add rule”
  • “remember this”
  • “convention”
  • “/aif-rules”

Requirements

  • Pre-approved tools (allowed-tools): Read, Write, Edit, Glob, Grep, AskUserQuestion, Questions

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Load Config
  2. 1: Load Skill Context
  3. Determine Mode
  4. Read or Create RULES.md
  5. Write Rule
  6. Confirm

What it can do on your machine

Read from SKILL.md and the folder at commit e4d719a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Glob
    • Grep
    • AskUserQuestion
    • Questions

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Aif Rules loads about 2.3k tokens when it runs. Until then it costs about 69 tokens; SKILL.md has 947 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~69
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from unxed/f4 at commit e4d719a, republished under its BSD-3-Clause licence (© unxed). 947 words, ~2,327 tokens.

Download SKILL.mdSave it as .claude/skills/aif-rules/SKILL.md (or your agent's skills folder).
name
aif-rules
description
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".
allowed-tools
Read, Write, Edit, Glob, Grep, AskUserQuestion, Questions
argument-hint
[rule text or topic]
disable-model-invocation
true

AI Factory Rules - Project Conventions

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:

  1. RULES.md - Axioms (universal project rules)

    • Managed by this skill (/aif-rules)
    • Short, flat list of hard requirements
    • Loaded by all skills
  2. rules/base.md - Project-specific base conventions

    • Created by /aif during project setup
    • Naming conventions, module boundaries, error handling patterns
    • Auto-detected from codebase analysis
  3. rules.<area> - Area-specific conventions

    • Created by this skill (Mode C)
    • Registered in .ai-factory/config.yaml as named keys such as rules.api
    • Area-specific patterns and constraints

Priority: More specific rules win. rules.<area> > rules/base.md > RULES.md

Workflow

Step 0: Load Config

FIRST: Read .ai-factory/config.yaml if it exists to resolve:

  • Paths: paths.rules_file and paths.rules
  • Language: language.ui for prompts and summaries, language.artifacts for rules artifacts, and language.technical_terms for human-readable technical terminology in rules

If config.yaml doesn't exist, use defaults:

  • RULES.md: .ai-factory/RULES.md
  • rules/: .ai-factory/rules/
  • ui_language: en
  • artifact_language: en
  • technical_terms_policy: keep

Resolved language values:

  • ui_language = language.ui || "en"
  • artifact_language = language.artifacts || language.ui || "en"
  • technical_terms_policy = language.technical_terms || "keep"

If technical_terms_policy is not one of keep, translate, or mixed, treat it as keep. Legacy values such as english also behave like keep.

All AskUserQuestion prompts, progress updates, confirmations, and next-step guidance MUST be written in ui_language.

Generated or updated rules artifacts under paths.rules_file and paths.rules/<area>.md MUST be written in artifact_language.

Templates and examples define structure, not fixed English output. If artifact_language is not en, translate human-readable headings, notes, rule text, labels, and confirmation prose before saving. Preserve markdown structure, paths, commands, config keys such as rules.<area>, area names, code identifiers, package names, API names, and raw errors unchanged. Apply technical_terms_policy to other human-readable terminology.

Step 0.1: Load Skill Context

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:

  • Treat them as project-level overrides for this skill's general instructions
  • When a skill-context rule conflicts with a general rule written in this SKILL.md, the skill-context rule wins (more specific context takes priority - same principle as nested CLAUDE.md files)
  • When there is no conflict, apply both: general rules from SKILL.md + project rules from skill-context
  • Do NOT ignore skill-context rules even if they seem to contradict this skill's defaults - they exist because the project's experience proved the default insufficient
  • CRITICAL: skill-context rules apply to ALL outputs of this skill - including the RULES.md format and rule formulation. If a skill-context rule says "rules MUST follow format X" or "RULES.md MUST include section Y" - you MUST comply. Generating rules that violate skill-context is a bug.

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.

Step 1: Determine Mode
text
Check $ARGUMENTS:
- Starts with "area:" or "area "? -> Mode C: Area rules
- Has text? -> Mode A: Direct add
- No arguments? -> Mode B: Interactive
Mode A: Direct Add

User provided rule text as argument:

text
/aif-rules Always use DTO classes instead of arrays

Skip to Step 2 with the provided text as the rule.

Mode B: Interactive

No arguments provided:

text
/aif-rules

Ask via AskUserQuestion:

text
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
Show full SKILL.md (513 more words)Show less
Mode C: Area Rules

User wants to create or update area-specific rules:

text
/aif-rules area:api
/aif-rules area frontend

Workflow:

  1. Parse area name from argument (e.g., api, frontend, backend, database)

  2. Resolve the area file path inside the configured rules directory. Default: .ai-factory/rules/<area>.md

  3. Check if area file exists:

    text
    Glob: <resolved rules dir>/<area>.md
  4. If file does NOT exist -> create it with header:

    markdown
    # <Area> Rules
    
    > Area-specific conventions for <area>. Loaded after rules/base.md.
    
    ## Rules
    
    - [first rule]
  5. If file exists -> ask user what rule to add:

    text
    AskUserQuestion: What rule would you like to add to <area>.md?
    
    Current rules in <area>.md:
    - [existing rule 1]
    - [existing rule 2]
    
    Options:
    1. Add new rule - specify below
    2. View full file
    3. Cancel
  6. Append rule using Edit at the end of the ## Rules section.

  7. Register the area in .ai-factory/config.yaml:

    • Ensure rules.<area> points to the resolved area rules file path
    • If config.yaml does not exist yet, create a minimal config scaffold using defaults plus the new rules.<area> entry
    • Preserve existing rules.base and any other named rules.<other-area> entries
  8. Confirm:

    text
    Rule added to <resolved area rules file> and registered as `rules.<area>` in config.yaml:
    
    - [the rule]
    
    Total <area> rules: [count]
  9. STOP after Mode C completes.

    • Do not continue to Step 2 / Step 3 / Step 4 below.
    • Those steps apply only to top-level axioms rules in the resolved paths.rules_file artifact.
    • Area rules belong only in <resolved rules dir>/<area>.md plus the matching rules.<area> registration in config.yaml.

Common areas:

  • api - REST/GraphQL API conventions
  • frontend - UI components, state management
  • backend - Services, business logic
  • database - Queries, migrations, schemas
  • testing - Test patterns, coverage
  • security - Auth, validation, sanitization
Step 2: Read or Create RULES.md

Check if the resolved RULES.md path exists:

text
Glob: <resolved RULES.md path>

If file does NOT exist -> create it with the header and first rule:

markdown
# 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.

Step 3: Write Rule

Use Edit to append the new rule as a - list item at the end of the ## Rules section.

Formatting rules:

  • Each rule is a single - line
  • Keep rules short and actionable (one sentence)
  • No categories, headers, or sub-lists - flat list only
  • No duplicates - if rule already exists (same meaning), tell user and skip
  • If user provides multiple rules at once (separated by newlines or semicolons), add each as a separate line
  • Write generated rule text in artifact_language; translate user-provided human-readable rule text when needed so the persisted artifact follows language.artifacts, while preserving stable technical tokens from Step 0.
Step 4: Confirm
text
Rule added to <resolved RULES.md path>:

- [the rule]

Total rules: [count]

Rules

  1. One rule per line - flat list, no nesting
  2. No categories - keep it simple, no headers inside the rules section
  3. No duplicates - check for existing rules with the same meaning before adding
  4. Actionable language - rules should be clear directives ("Always...", "Never...", "Use...", "Routes must...")
  5. RULES.md location - use the resolved paths.rules_file path (default: .ai-factory/RULES.md)
  6. Area registration - every area rules file must be mirrored in config.yaml as rules.<area>
  7. Ownership boundary - this command owns the configured RULES.md artifact and may update the rules.* subset of .ai-factory/config.yaml; other context artifacts stay read-only unless explicitly requested by the user

© unxed, BSD-3-Clause. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/aif-rules of unxed/f4.

Open the folder on GitHubat commit e4d719a

Compare with similar skills

Aif Rules next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Aif Rules compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Aif Rules this skillunxed/f4241—~2.3kAutomated safety check: PassBSD-3-Clause
Artifacts Buildernexu-io/open-design100k—~347Automated safety check: PassApache-2.0
Web Artifacts Builderanthropics/skills180k41 repos~769Automated safety check: PassApache-2.0
Configure Channelopenclaw/openclaw392k—~946Automated safety check: PassMIT
Web Artifacts Buildernexu-io/open-design100k—~337Automated safety check: PassApache-2.0
Ecc Conventionsaffaan-m/ECC275k—~2.8kAutomated safety check: PassMIT

Similar skills

  • Artifacts Builder

    nexu-io/open-design

    Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui).

    100k GitHub stars~347 tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • Web Artifacts Builder

    anthropics/skills

    Official

    Builds multi-component claude.ai HTML artifacts as a small React, TypeScript and Tailwind project, then bundles it into one shareable HTML file.

    180k GitHub starsUsed in 41 repos~769 tokens
    Frontend & DesignAuto-check passed
  • Configure Channel

    openclaw/openclaw

    Configure and prove a chat channel with non-interactive one-liners; secrets only as SecretRefs.

    392k GitHub stars~946 tokensUpdated yesterday
    Auto-check passed
  • Web Artifacts Builder

    nexu-io/open-design

    Build complex claude.ai HTML artifacts with React and Tailwind.

    100k GitHub stars~337 tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • Ecc Conventions

    affaan-m/ECC

    Development conventions and patterns for ECC. An agent skill from affaan-m/ECC.

    275k GitHub stars~2.8k tokensUpdated 4 days ago
    DevelopmentAuto-check passed
  • Web Artifacts Builder

    sickn33/agentic-awesome-skills

    To build powerful frontend claude.ai artifacts, follow these steps:

    47k GitHub starsUsed in 3 repos~824 tokens
    Frontend & DesignAuto-check passed

More from unxed/f4

All 36 skills in this repo
  • Comprehensive documentation guide for Golang projects, covering godoc comments, README, CONTRIBUTING, CHANGELOG, Go Playground, Example tests, API docs, and llms.txt.

    241 GitHub starsUsed in 3 repos~3.5k tokens
    Auto-check passed
  • Golang code style conventions — line length and breaking, variable declarations, control flow clarity, when comments help vs hurt.

    241 GitHub starsUsed in 3 repos~2.5k tokens
    Auto-check passed
  • Comprehensive guide for Go database access — parameterized queries, struct scanning, NULLable columns, transactions, isolation levels, SELECT FOR UPDATE, connection pool, batch processing, context…

    241 GitHub starsUsed in 2 repos~2.9k tokens
    Auto-check passed
  • Security audit checklist based on OWASP Top 10 and best practices.

    241 GitHub stars~5.4k tokensUpdated yesterday
    Auto-check: notes
  • Go (Golang) naming conventions — covers packages, constructors, structs, interfaces, constants, enums, errors, booleans, receivers, getters/setters, functional options, acronyms, test functions, and…

    241 GitHub starsUsed in 2 repos~3.1k tokens
    Auto-check passed
  • Golang concurrency design — goroutine lifecycle and leak prevention, channels and select, channel ownership and direction, sync.Mutex/RWMutex/sync.Map/sync.Once/atomics, errgroup, singleflight…

    241 GitHub starsUsed in 1 repo~2.4k tokens
    Auto-check passed

Questions about Aif Rules

What does Aif Rules do?

Add project-specific rules and conventions to the configured RULES.md artifact. Aif Rules is an agent skill from unxed/f4.md artifact.

When should I use Aif Rules?

Aif Rules fits situations like: user says add rule.

How do I install Aif Rules in Claude Code?

Run `npx skills add unxed/f4 --skill aif-rules -a claude-code`. Or copy the skill folder (.agents/skills/aif-rules in unxed/f4) into .claude/skills/aif-rules in your project. Claude Code loads it when a task matches its description.

How do I install Aif Rules in Codex?

Run `npx skills add unxed/f4 --skill aif-rules -a codex`. Or copy the skill folder (.agents/skills/aif-rules in unxed/f4) into .agents/skills/aif-rules in your project. Codex loads it when a task matches its description.

Can I use Aif Rules in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add unxed/f4 --skill aif-rules -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/aif-rules, .gemini/skills/aif-rules, .github/skills/aif-rules and .opencode/skills/aif-rules in your project.

What does Aif Rules need to run?

SKILL.md names no scripts, command-line tools or credentials: Aif Rules is instructions for the agent only. Its frontmatter pre-approves these tools: Read, Write, Edit, Glob, Grep, AskUserQuestion, Questions.

Does Aif Rules access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Aif Rules safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Aif Rules use?

Aif Rules is published under the BSD-3-Clause licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Aif Rules use?

About 2.3k tokens (SKILL.md is roughly 9.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Aif Rules?

Skills that share tags, products or a category with Aif Rules: Artifacts Builder (nexu-io/open-design, 100k stars), Web Artifacts Builder (anthropics/skills, 180k stars), Configure Channel (openclaw/openclaw, 392k stars) and Web Artifacts Builder (nexu-io/open-design, 100k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Aif Rules?

unxed (a GitHub user) maintains it in unxed/f4, which has 241 GitHub stars. The repository holds 36 skills in this directory. The repository was last updated on October 8, 2026.

Source: unxed/f4 on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.