Agent Skillsrustfs/rustfs › arch-checks

arch-checks

GitHub

诊断架构守护检查失败,涵盖层依赖、文档规范、不安全代码许可及日志护栏。指导修复违规并重新运行检查,严禁弱化规则以通过测试。

.agents/skills/arch-checks/SKILL.md rustfs/rustfs

Trigger Scenarios

架构守卫检查脚本报错 需要修复违反架构规范的问题

Install

npx skills add rustfs/rustfs --skill arch-checks -g -y
More Options

Non-standard path

npx skills add https://github.com/rustfs/rustfs/tree/main/.agents/skills/arch-checks -g -y

Use without installing

npx skills use rustfs/rustfs@arch-checks

指定 Agent (Claude Code)

npx skills add rustfs/rustfs --skill arch-checks -a claude-code -g -y

安装 repo 全部 skill

npx skills add rustfs/rustfs --all -g -y

预览 repo 内 skill

npx skills add rustfs/rustfs --list

SKILL.md

Frontmatter
{
    "name": "arch-checks",
    "description": "Diagnose failures from check_layer_dependencies.sh, check_architecture_migration_rules.sh, check_unsafe_code_allowances.sh, check_logging_guardrails.sh, check_doc_paths.sh, or check_no_planning_docs.sh. Use when one of these guards fails, not for every architecture question or documentation edit."
}

Architecture Guard Checks

Read only the section for the failing guard. Use .config/make/ and the current workflow to verify its wiring; not every guard is part of every gate. Fix the cause and rerun the failed guard; never weaken a check to get green.

check_layer_dependencies.sh — layer DAG in rustfs/src

Enforces composition (server, startup/init) → interface (admin, storage/ecfs, storage/s3_api) → app → infra; no upward imports. Server source files are composition roots, while imports of their exported HTTP contracts are classified as interface dependencies. Known legacy violations live in scripts/layer-dependency-baseline.txt.

Dedicated *_test.rs and tests/ modules are outside this production guard. Inline #[cfg(test)] imports remain checked under their source file's layer; move architecture-crossing test scaffolding into a dedicated test module.

  • New violation: restructure your change so the dependency points downward (move the shared type/function to the lower layer).
  • You legitimately removed a baseline entry: run ./scripts/check_layer_dependencies.sh --update-baseline and commit the shrunken baseline. Never add new entries to the baseline to make a new violation pass.

check_architecture_migration_rules.sh — required doc sections

Asserts that the core docs under docs/architecture/ (overview, crate-boundaries, runtime-lifecycle, readiness-matrix, storage-control-data-plane, global-state-crate-split-plan, ecstore-module-split-plan, …) still contain specific headings and exact source lines. If it fails after a doc edit, you reworded or removed a guarded line — restore the wording or update the script deliberately in the same PR, with rationale.

check_unsafe_code_allowances.sh

Every #[allow(unsafe_code)] needs a SAFETY: comment within a few lines. Write the actual safety argument; don't add a placeholder.

check_logging_guardrails.sh

A fixed list of security-sensitive files (auth, IAM, KMS, admin handlers…) is scanned for logging violations. If you created a new sensitive file, consider adding it to the script's checked_files list.

check_doc_paths.sh

Instruction docs (AGENTS.md, CLAUDE.md, ARCHITECTURE.md) and every Markdown file under docs/ (architecture, operations, testing, index) must not reference repo file paths that no longer exist. If your refactor moved code, update the docs that point at it — the error message lists doc -> stale-path pairs. In durable docs, cite paths plus symbol names rather than line numbers (see docs/architecture/README.md). Review findings still need file:line.

check_no_planning_docs.sh

Planning-type documents must not be committed (see AGENTS.md "Sources of Truth"). The guard fails if anything is tracked under docs/superpowers/.gitignore already ignores it, but git add -f bypasses that, so this closes the hole. Fix by removing the listed file(s) with git rm; keep the plan or spec in the issue tracker or a local worktree instead.

Version History

  • 1880b42 Current 2026-09-23 05:25

    新增针对各具体检查脚本的详细处理指南,明确各场景下的修复步骤与约束。

  • 0d129ec 2026-08-20 14:32

Same Skill Collection

.agents/skills/adversarial-validation/SKILL.md
.agents/skills/code-change-verification/SKILL.md
.agents/skills/issue-triage/SKILL.md
.agents/skills/plugin-contract-guard/SKILL.md
.agents/skills/pr-creation-checker/SKILL.md
.agents/skills/pr-review/SKILL.md
.agents/skills/rust-code-quality/SKILL.md
.agents/skills/rustfs-logging-governance/SKILL.md
.agents/skills/rustfs-release-publish/SKILL.md
.agents/skills/rustfs-release-version-bump/SKILL.md
.agents/skills/security-advisory-lessons/SKILL.md
.agents/skills/test-coverage-improver/SKILL.md
.agents/skills/tier-debug/SKILL.md
.mimocode/skills/issue-triage/SKILL.md
.mimocode/skills/pr-review/SKILL.md

Metadata

Files
0
Version
1880b42
Hash
6c959ba5
Indexed
2026-08-20 14:32

trang chủ - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-23 08:26
浙ICP备14020137号-1