一键导入
aif-rules-check
Read-only gate that checks changed files against project rules hierarchy. Returns PASS, WARN, or FAIL without editing rules or source code.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Read-only gate that checks changed files against project rules hierarchy. Returns PASS, WARN, or FAIL without editing rules or source code.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Bootstrap project context. Resolves localization and stack, creates/updates config.yaml and rules/base.md, then checks DESCRIPTION and guides core skill execution.
Finalize a verified OpenSpec-native change or legacy AI Factory-only plan, prepare commit/PR summaries, and drive evidence-backed follow-ups.
Switches AIFHub Extension projects between OpenSpec-native and legacy AI Factory artifact modes, synchronizes derived artifacts, checks mode drift, and reports migration/export actions. Use when changing artifactProtocol, syncing OpenSpec and AI Factory artifacts, or diagnosing mode/config drift.
| name | aif-rules-check |
| description | Read-only gate that checks changed files against project rules hierarchy. Returns PASS, WARN, or FAIL without editing rules or source code. |
| version | 1.1.0 |
| author | ichi |
Read-only gate for rule compliance verification. Checks changed files against the project rules hierarchy and returns a structured verdict without modifying any files.
This is an extension-owned temporary gate. When upstream ai-factory adds a native /aif-rules-check, this skill should be deprecated in favor of the upstream version.
.ai-factory/config.yaml - project configuration, mode detection, plan resolution, and rules paths.ai-factory/rules/generated/openspec-merged-<change-id>.md - OpenSpec-native merged generated rules, highest priority when present.ai-factory/rules/generated/openspec-change-<change-id>.md - OpenSpec-native change generated rules.ai-factory/rules/generated/openspec-base.md - OpenSpec-native base generated rules.ai-factory/RULES.md - project-level rules (if present).ai-factory/rules/base.md - base rules created by aif-analyzerules.md - legacy AI Factory-only plan rules when explicitly in legacy modegit diffPASS | WARN | FAIL with structured findings.Use OpenSpec-native mode when .ai-factory/config.yaml contains aifhub.artifactProtocol: openspec or the explicit scope is under openspec/changes/<change-id>/.
Read canonical OpenSpec artifacts only as context:
openspec/specs/**openspec/changes/<change-id>/proposal.mdopenspec/changes/<change-id>/design.mdopenspec/changes/<change-id>/tasks.mdopenspec/changes/<change-id>/specs/**/spec.mdLoad rules in this exact priority order:
.ai-factory/rules/generated/openspec-merged-<change-id>.md.ai-factory/rules/generated/openspec-change-<change-id>.md.ai-factory/rules/generated/openspec-base.md.ai-factory/RULES.md, if present.ai-factory/rules/base.md, if presentOpenSpec-native mode does not require plan-local rules.md. Plan-local rules.md is ignored unless the run is explicitly in Legacy AI Factory-only mode.
If generated rules are missing or stale, return WARN, report whether each generated rules file was present, missing, or stale, and ask the caller to regenerate rules through the compiler-owning workflow. This read-only gate must not regenerate or edit generated rules.
Do not write runtime state or QA evidence. If a normal response needs to identify related evidence locations for the caller, name .ai-factory/state/<change-id>/ and .ai-factory/qa/<change-id>/ only as external runtime state and QA evidence paths.
When OpenSpec-native mode is not enabled, preserve the legacy AI Factory-only rules hierarchy:
rules.md from .ai-factory/plans/<plan-id>/rules.md, if an active plan exists.ai-factory/RULES.md, if present.ai-factory/rules/base.md, if presentLegacy AI Factory-only mode may cross-reference the active plan pair and plan-local rules.md. It remains read-only and must not edit rules, source files, status.yaml, or plan artifacts.
.ai-factory/config.yaml for path configuration and active plan resolution.aifhub.artifactProtocol: openspec or the active scope is clearly under openspec/changes/<change-id>/.OpenSpec-native mode hierarchy above.Legacy AI Factory-only mode hierarchy above.WARN with message: "No rules files found. Run /aif-analyze to create base rules."git diff (staged + unstaged).PASS with message: "No changed files to check."For each changed file:
Return structured output:
## Rules Check Result: PASS | WARN | FAIL
### Summary
- Files checked: N
- Blocking: N
- Warnings: N
### Findings
[...per-file findings...]
### Recommendations
[...actionable suggestions...]
Verdict rules:
PASS: no findings.WARN: warnings but no blocking findings.FAIL: one or more blocking findings./aif-analyze./aif-rules.regenerate rules through the compiler-owning workflow before relying on this gate./aif-fix.rules.md to the plan folder./aif-rules.| Artifact | Owner | This Skill |
|---|---|---|
.ai-factory/rules/generated/*.md | OpenSpec generated rules compiler | Reads only |
.ai-factory/RULES.md | /aif-rules | Reads only |
.ai-factory/rules/base.md | aif-analyze | Reads only |
plan-local rules.md | /aif-plan | Reads only in legacy AI Factory-only mode |
| source code files | project | Reads only |
/aif-fix./aif-rules or aif-analyze..ai-factory/rules/generated/*.md is missing or stale, return WARN and ask the caller to regenerate rules through the compiler-owning workflow./aif-analyze or /aif-rules but do not edit them.