Agent skill

Aif Rules Check

by unxed in unxed/f4

Run a standalone read-only rules compliance gate against changed files or a git ref.

BSD-3-ClauseAuto-check passedDevelopment

Install Aif Rules Check

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

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

GitHub CLI
$ gh skill install unxed/f4 aif-rules-check --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-check .claude/skills/aif-rules-check && 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-check
GitHub stars
243
Token cost
~2.4k tokens
SKILL.md length
1,086 words
Files
2 (incl. references)
Skills in repo
36
Repo updated
First seen
Licence
BSD-3-Clause

At a glance

Run a standalone read-only rules compliance gate against changed files or a git ref.

  • Works in 6 steps: Load Contract → Load Config → Resolve Inputs → …
  • You need a dedicated project-rules check without a full review
  • SKILL.md covers Step 0: Load Contract, Step 1: Load Config, Step 2: Resolve Inputs and Step 3: Evaluate Rules, plus 2 more sections
  • Calls git

What it does

Aif Rules Check is an agent skill from unxed/f4. Run a standalone read-only rules compliance gate against changed files or a git ref. Use when you need a dedicated project-rules check without a full review or verify pass.

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/RULES-CHECK-CONTRACT.md`).

It sits in Development, covering Agent instruction files. It works with Git. The repository describes itself as: dual pane like a charm. The licence is BSD-3-Clause.

When your agent uses it

  • You need a dedicated project-rules check without a full review
  • Tasks that involve Agent instruction files

Example prompts

  • “/aif-rules-check”

Requirements

  • Pre-approved tools (allowed-tools): Read, Glob, Grep, Bash(git *), AskUserQuestion

Workflow steps

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

  1. Load Contract
  2. Load Config
  3. Resolve Inputs
  4. Evaluate Rules
  5. Read-Only Boundary
  6. Output

What it can do on your machine

Read from SKILL.md and the folder at commit 772edc7. 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
    • Glob
    • Grep
    • Bash(git *)
    • AskUserQuestion

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

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

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    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 Check loads about 2.4k tokens when it runs, and up to ~2.8k if it reads all its reference files. Until then it costs about 47 tokens; SKILL.md has 1,086 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~47
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.8k

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 772edc7, republished under its BSD-3-Clause licence (© unxed). 1,086 words, ~2,377 tokens.

Download SKILL.mdSave it as .claude/skills/aif-rules-check/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
aif-rules-check
description
Run a standalone read-only rules compliance gate against changed files or a git ref. Use when you need a dedicated project-rules check without a full review or verify pass.
allowed-tools
Read, Glob, Grep, Bash(git *), AskUserQuestion
argument-hint
[git ref | empty]
disable-model-invocation
false
metadata.author
AI Factory
metadata.version
1.0
metadata.category
quality

Rules Compliance Gate

Run a standalone read-only rules gate for project rules. This command checks rule compliance only; it does not replace /aif-review or /aif-verify.

Step 0: Load Contract

  • Read references/RULES-CHECK-CONTRACT.md first.
  • Treat it as the canonical source for verdict semantics and report structure.
  • If examples in this file drift from the reference, follow the reference.

Step 1: Load Config

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

  • paths.rules_file
  • paths.rules
  • paths.plan
  • paths.plans
  • language.ui
  • git.enabled
  • git.base_branch
  • rules.base
  • named rules.<area> entries
  • workflow.plan_id_format (default: slug) — used by the optional branch-based plan-context lookup in Step 2.3. Active values: slug and sequential. Plan context may be a root full-plan file or direct child ultra index.md; numbered lookup covers both shapes. timestamp and uuid are reserved values and currently behave like slug. Treat any unknown value as slug.

If config is missing or partial, use defaults:

  • paths.rules_file: .ai-factory/RULES.md
  • paths.rules: .ai-factory/rules/
  • paths.plan: .ai-factory/PLAN.md
  • paths.plans: .ai-factory/plans/
  • git.enabled: true
  • git.base_branch: detect the repo default branch from git metadata; fall back to main only when detection is unavailable
  • rules.base: .ai-factory/rules/base.md
  • workflow.plan_id_format: slug

If paths.rules_file is missing from config, default to .ai-factory/RULES.md instead of treating config as incomplete. If git.base_branch is missing from config, resolve the repository default branch from git metadata when possible; use main only as the final fallback.

Step 1.1: Load Skill Context

Read .ai-factory/skill-context/aif-rules-check/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 in this file, the skill-context rule wins.
  • When there is no conflict, apply both.
  • Skill-context rules apply to all outputs of this skill, including verdict wording and report structure.

Enforcement: Before presenting the final report, verify it against all skill-context rules and fix any drift.

Step 2: Resolve Inputs

Resolve two inputs before checking any rule:

  1. Changed scope - the diff and file list you are evaluating
  2. Resolved rule sources - the rule artifacts that may apply to that scope
Step 2.1: Resolve Changed Scope

If the user provided a git ref:

  1. Validate it first:

    bash
    git rev-parse --verify <argument>
  2. If valid, use:

    bash
    git diff --name-only <argument>...HEAD
    git diff <argument>...HEAD
  3. If invalid, ask:

    AskUserQuestion: `<argument>` is not a valid git ref. What should I check instead?
    
    Options:
    1. Check staged / working-tree changes
    2. Cancel

Without arguments:

  1. Prefer staged work:
    bash
    git diff --cached --name-only
    git diff --cached
  2. If nothing is staged, fall back to working tree:
    bash
    git diff --name-only
    git diff
  3. If there is still no local diff and git.enabled = true, fall back to branch diff:
    bash
    git diff --name-only <resolved-base-branch>...HEAD
    git diff <resolved-base-branch>...HEAD

If there are still no changed files, return WARN rather than a hard failure.

Step 2.2: Resolve Rule Sources

Load rule sources in this order:

  1. The resolved paths.rules_file artifact
  2. The resolved rules.base file
  3. Any named rules.<area> files from config that clearly match the changed scope

Area rules are optional and scoped:

  • Use changed file paths, folder names, and optional plan context to judge relevance.
  • If relevance is ambiguous, mention the rule source as uncertain and keep the outcome at WARN, not FAIL.

If no rules sources resolve, return WARN rather than a hard failure.

Step 2.3: Optional Plan Context

Optional plan context: use the active plan file only when it helps interpret scope or area relevance; absence of a plan is never a failure.

Plan resolution order:

  1. Compute the canonical branch stem the same way as /aif-plan, /aif-implement, and /aif-improve:
    • get current branch via git branch --show-current (git mode only);
    • branch_stem = current branch with every / replaced by - (for example feature/user-auth → feature-user-auth).
  2. Branch-based lookup using <branch_stem>:
    • when workflow.plan_id_format = sequential, glob both paths.plans/[0-9][0-9][0-9][0-9]_<branch_stem>.md and paths.plans/[0-9][0-9][0-9][0-9]_<branch_stem>/index.md; Read every directory candidate and retain it only when it contains exactly one <!-- aif:plan-mode:ultra -->, then pick the highest-numbered valid artifact and warn when multiple valid candidates exist; prefer ultra if both shapes share the highest prefix;
    • otherwise/fallback check paths.plans/<branch_stem>/index.md and paths.plans/<branch_stem>.md; Read the directory entrypoint first, ignore it unless it contains exactly one ultra marker, and warn/prefer ultra if both valid shapes exist.
  3. A single named artifact in paths.plans: count root *.md full plans and direct child */index.md entrypoints containing <!-- aif:plan-mode:ultra -->; exclude the resolved fast-plan path and never count phase files.
  4. The fast plan at paths.plan.

For ultra, read index.md first and only the linked phase files relevant to the changed area when extra scope detail is needed. Do not fail the rules check because a plan artifact is missing or ambiguous. An automatically discovered directory entrypoint counts only when it contains exactly one <!-- aif:plan-mode:ultra -->; ignore unrelated */index.md files.

Show full SKILL.md (355 more words)Show less

Step 3: Evaluate Rules

Read the changed files from the resolved scope and compare them against the resolved rules.

Classification rules:

  • PASS when at least one applicable rule was checked and no clear violations were found.
  • WARN when no applicable rules were resolved, the evidence is ambiguous, or there are no changed files to evaluate.
  • FAIL when an explicit hard rule is clearly violated by the inspected diff or changed files.

Only return FAIL when an explicit hard rule is clearly violated by the inspected diff or changed files.

Evidence rules:

  • Tie every blocking violation to specific rule text and at least one concrete file/path or diff hunk.
  • If a rule sounds like a preference, is too vague, or cannot be verified confidently from the diff, do not escalate it past WARN.
  • Missing optional files or partially configured rules hierarchy are WARN, not FAIL.

Step 4: Read-Only Boundary

This command is read-only: do not edit RULES.md, rules/base.md, rules.<area>, plan files, or source code.

If rules are missing, stale, or need refinement:

  • Suggest /aif-rules <rule text> for axioms
  • Suggest /aif-rules area:<name> for area-specific rules

Step 5: Output

Use the exact verdict semantics and section order from references/RULES-CHECK-CONTRACT.md.

Required content:

  • overall verdict
  • files checked
  • gate results
  • blocking violations
  • suggested fixes
  • suggested rule updates
  • final machine-readable aif-gate-result fenced JSON block

When useful, suggest the next best workflow:

  • /aif-review for broader code review
  • /aif-verify for full plan-completeness verification
  • /aif-rules when the underlying rules need to be captured or corrected

Machine-readable gate result:

  • Append one final fenced aif-gate-result JSON block after the human-readable rules report.
  • Use "gate": "rules".
  • Map the human rules verdict exactly: PASS -> pass, WARN -> warn, and FAIL -> fail.
  • Use "blocking": true|false; set it to true only for explicit hard-rule violations that produce a human FAIL.
  • Include only hard-rule violations in "blockers": [.
  • Include changed or inspected paths in "affected_files": [.
  • Set "suggested_next": { to /aif-rules when rules should be added or clarified, /aif-fix when code must change, or null when no allowed next command fits.
  • Do not use /aif-review in the JSON suggested_next.command; it may appear only in human-readable workflow suggestions.
aif-gate-result
{
  "schema_version": 1,
  "gate": "rules",
  "status": "warn",
  "blocking": false,
  "blockers": [],
  "affected_files": [],
  "suggested_next": {
    "command": "/aif-rules",
    "reason": "Rules are missing or ambiguous for the changed scope."
  }
}

Schema reminder: "status": "pass|warn|fail", "blocking": true|false, "blockers": [, "affected_files": [, "suggested_next": {.

© 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

SKILL.md and 1 other file (references) in .agents/skills/aif-rules-check of unxed/f4.

  • SKILL.md
  • references/RULES-CHECK-CONTRACT.md

Open the folder on GitHubat commit 772edc7

Compare with similar skills

Aif Rules Check 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 Check compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Aif Rules Check this skillunxed/f4243—~2.4kAutomated safety check: PassBSD-3-Clause
Leon Coding Agentleon-ai/leon18k—~1.1kAutomated safety check: PassMIT
Release Docs SyncUfoMiao/zcf6.1k—~4kAutomated safety check: PassMIT
CommitLennartHennigs/Button2565—~562Automated safety check: PassMIT
Commit And PR389ds/389-ds-base294—~1kAutomated safety check: PassCustom licence
ReleaseYesterday-AI/paperclip-plugin-company-wizard186—~1.6kAutomated safety check: PassMIT

Similar skills

  • Leon Coding Agent

    leon-ai/leon

    Has Leon's agent investigate, change and verify code in a repository with its file, search and shell tools, staying inside the scope the owner authorized.

    18k GitHub stars~1.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Compares code changes since the last Git tag with the multilingual docs and CLAUDE.md, then updates them or only reports mismatches with --check-only.

    6.1k GitHub stars~4k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Commit

    LennartHennigs/Button2

    Stage and commit current changes for Button2 — checks for needed CHANGELOG/README/CLAUDE.md updates, creates a branch if on master, writes a commit message, and commits

    565 GitHub stars~562 tokensUpdated 4 mo ago
    DevelopmentAuto-check passed
  • Commit And PR

    389ds/389-ds-base

    Commit and open a PR the 389-ds-base way — "Issue NNNN - summary" subject, Bug Description/Fix Description body, Fixes:/Relates: trailer, AI-attribution trailer, and squash-merge etiquette.

    294 GitHub stars~1k tokensUpdated today
    DevelopmentAuto-check passed
  • Release

    Yesterday-AI/paperclip-plugin-company-wizard

    Prepare a new release by updating CHANGELOG.md, verifying documentation (README.md, CLAUDE.md, AGENTS.md, ROADMAP.md, docs/), bumping patch version in package.json, building, and suggesting publish…

    186 GitHub stars~1.6k tokensUpdated 5 mo ago
    DevelopmentAuto-check passed
  • Commit

    LennartHennigs/ESPRotary

    Stage and commit current changes for ESPRotary — checks for needed CHANGELOG/README/CLAUDE.md updates, creates a branch if on master, writes a commit message, and commits

    188 GitHub stars~590 tokensUpdated 2 mo ago
    DevelopmentAuto-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.

    243 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.

    243 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…

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

    243 GitHub stars~5.4k tokensUpdated today
    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…

    243 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…

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

Works with

Categories

Questions about Aif Rules Check

What does Aif Rules Check do?

Run a standalone read-only rules compliance gate against changed files or a git ref. Aif Rules Check is an agent skill from unxed/f4. Run a standalone read-only rules compliance gate against changed files or a git ref.

When should I use Aif Rules Check?

Aif Rules Check fits situations like: you need a dedicated project-rules check without a full review; tasks that involve Agent instruction files.

How do I install Aif Rules Check in Claude Code?

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

How do I install Aif Rules Check in Codex?

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

Can I use Aif Rules Check 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-check -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-check, .gemini/skills/aif-rules-check, .github/skills/aif-rules-check and .opencode/skills/aif-rules-check in your project.

What does Aif Rules Check need to run?

Going by SKILL.md and its folder, Aif Rules Check needs the command-line tools its instructions call (git). Its frontmatter pre-approves these tools: Read, Glob, Grep, Bash(git *), AskUserQuestion.

Does Aif Rules Check access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Aif Rules Check 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 Check use?

Aif Rules Check 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 Check use?

About 2.4k tokens (SKILL.md is roughly 9.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 419 tokens, read only when the agent opens those files.

What are the alternatives to Aif Rules Check?

Skills that share tags, products or a category with Aif Rules Check: Leon Coding Agent (leon-ai/leon, 18k stars), Release Docs Sync (UfoMiao/zcf, 6.1k stars), Commit (LennartHennigs/Button2, 565 stars) and Commit And PR (389ds/389-ds-base, 294 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Aif Rules Check?

unxed (a GitHub user) maintains it in unxed/f4, which has 243 GitHub stars. The repository holds 36 skills in this directory. The repository was last updated on October 10, 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.