rakaarwaky/lint-arwaky

GitHub: rakaarwaky/lint-arwaky

一款面向 AI agents 和开发者的 Rust 多语言静态代码检查工具,通过 24 条 AES 规则在代码级强制执行架构规范并实现零绕过。

Stars: 1 | Forks: 0

# Lint Arwaky [![Rust 2021](https://img.shields.io/badge/rust-2021-orange.svg)](https://www.rust-lang.org/) [![crates.io](https://img.shields.io/crates/v/lint_arwaky.svg)](https://crates.io/crates/lint_arwaky) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) [![MCP Server](https://img.shields.io/badge/MCP-Server-blue.svg)](https://modelcontextprotocol.io/) [![Architecture: AES](https://img.shields.io/badge/architecture-AES+Clean-green.svg)](ARCHITECTURE.md) **为 AI agents 和开发者提供的自主代码质量与架构强制检查工具 —— 使用 Rust 编写。** Lint Arwaky 能够在单次扫描中审查 Rust、Python 和 JavaScript/TypeScript 源代码。它在 5 个组(命名、Import、质量、角色、孤儿)中强制执行 24 条 Agentic Engineering System (AES) 规则,用于检查层级边界、命名规范、类型安全、死代码以及架构绕过尝试 —— 所有这些均在代码级别进行,且零绕过。 本项目是其自身的第一个客户:在代码仓库中运行 `lint-arwaky-cli check .` 即可使用同一套 AES 规则集进行自我审查。 ## 目录 - [概述与价值主张](#overview--value-proposition) - [安装](#install) - [用法](#usage) - [架构概述](#architecture-overview) - [MCP Server 配置](#mcp-server-configuration) - [支持的 AES 规则](#supported-aes-rules) - [CLI 命令参考](#cli-commands-reference) ## 概述与价值主张 ### 功能说明 | 功能 | 描述 | | ---------------------- | ----------------------------------------------------------------------------------------------------- | | **多语言** | Rust (Clippy + AST), Python (Ruff, MyPy, Bandit, Radon), JavaScript/TypeScript (ESLint, Prettier, TSC) | | **架构审查** | 24 条 AES 规则强制执行整洁架构层级边界、命名、类型安全和死代码检查 | | **MCP Server** | 5 个工具,通过 JSON-RPC 2.0 实现自主 AI-agent 集成 | | **零绕过** | 检测并标记 `noqa`、`type: ignore` 和 `#[allow(...)]` 等屏蔽指令 | | **适配 CI** | 输出 SARIF 2.1.0、JUnit XML 和 JSON 报告,并带有正确的退出码 | | **自我审查** | 本项目在其自身的规则引擎下进行 lint | ### 目标用户 | 用户类型 | 使用场景 | 从这里开始 | | --------------- | -------------------------------------------- | ---------------------------------- | | **AI Agent** | 自主 lint、自我修复、代码审查 | [SKILL.md](SKILL.md) | | **开发者** | 对代码库进行 lint、强制执行架构规范 | 下方的[快速开始](#usage) | | **DevOps / CI** | 质量门禁、趋势报告、依赖扫描 | `ci`, `check` | | **贡献者** | 扩展 adapter、添加 CLI 命令 | [CONTRIBUTING.md](CONTRIBUTING.md) | | **审查者** | 架构审查、代码质量分析 | `check`, `orphan` | ## 安装 ### 预编译二进制文件 ``` # Linux / macOS curl -sSL https://raw.githubusercontent.com/rakaarwaky/lint-arwaky/main/install.remote.sh | bash ``` ### 从源码编译(需要 Rust 1.70+) ``` git clone https://github.com/rakaarwaky/lint-arwaky.git cd lint-arwaky cargo build --release # Binaries: target/release/lint-arwaky-cli, target/release/lint-arwaky-mcp, target/release/lint-arwaky-tui lint-arwaky-cli version # should print "Lint Arwaky v1.10.74 (AES Semantic Builder)" lint-arwaky-cli maintenance doctor # environment diagnostics ``` ## 用法 ### 对代码库进行 Lint ``` # 完整自检:对 crates/ 执行 AES 架构规则 lint-arwaky-cli check . # Git diff 模式:仅审计自 base ref 以来更改的文件 lint-arwaky-cli check . --git-diff # CI 优化,带有 exit codes(如果 score < threshold 则为 1) lint-arwaky-cli ci . --threshold 80 ``` ### 孤儿检查与修复命令 ``` lint-arwaky-cli orphan # Check if file is dead/unreachable code lint-arwaky-cli fix . # Apply safe automatic fixes (--dry-run to preview) ``` ### 监视模式 ``` cargo run --bin lint-arwaky-cli -- check . # 扫描 crates/,使用项目对其他项目强制执行的相同 AES 规则。 ``` ### Lint 其他仓库 ``` # 使用所有 adapters + AES 架构规则扫描外部项目 lint-arwaky-cli scan /path/to/some-project/ ``` ## 架构概述 Lint Arwaky 遵循其自身的 AES (Agentic Engineering System) 规范 —— 这是一种严格的分层架构,包含七个层级,并组织为 **feature crates**(垂直切片)。有关完整的规范、层级层次结构和命名约定,请参阅 [ARCHITECTURE.md](ARCHITECTURE.md)。 ## MCP Server 配置 有关 MCP 工具参考,请参阅 [SKILL.md](SKILL.md);有关客户端设置,请参阅 [DEPLOY.md](DEPLOY.md)。 ## CLI 命令参考 有关完整的命令目录,请参阅 [SKILL.md](SKILL.md)。 ## TUI(交互式文件浏览器) `lint-arwaky-tui` —— 类似 Ranger 风格的 3 面板文件浏览器(`ratatui` + `crossterm`)。 项目路径仅在启动时输入一次,随后可浏览文件夹并对选定的文件/文件夹执行命令。 ``` ┌─────────────────────────────────────────────────────────────────────┐ │ Path: /home/project/lint-arwaky [Ctrl+Q] Quit │ ├──────────┬──────────────────┬──────────────────────────────────────┤ │ crates/ │ ► cli-commands/ │ File Preview / Lint Results │ │ docs/ │ src/ │ │ │ shared/ │ ▼ surface_ │ AES203: OK │ │ ... │ check_ │ AES204: OK │ │ │ scan_ │ Violations: 0 │ │ │ tui_ │ │ │ │ fix_ │ [c]heck [s]can [f]ix [w]atch │ │ │ infrastruc… │ [o]rphan [d]octor ?:[h]elp │ │ │ Cargo.toml │ │ │ │ src/ │ │ │ │ tests/ │ │ ├──────────┴──────────────────┴──────────────────────────────────────┤ │ c:check s:scan f:fix t:ci w:watch o:orphan d:doctor i:init│ │ I:install m:mcp C:config H:hook U:unhook a:adapter v:version│ │ Status: Ready | Selected: crates/cli-commands/src/ | 0 viol. │ └─────────────────────────────────────────────────────────────────────┘ ``` ### 面板 | 面板 | 内容 | | ------- | ----------------------------------------- | | 左侧 | 目录树 | | 中间 | 文件列表 + AES 层级徽章(颜色区分) | | 右侧 | 文件预览 / lint 结果 | 每个文件都会获得一个 **层级徽章** 颜色: `[taxonomy]` 青色,`[contract]` 蓝色,`[capabilities]` 品红色,`[infra]` 黄色,`[agent]` 绿色,`[surface]` 红色,`[root]` 白色。 ### 快捷键(始终在底栏显示) #### 导航 | 按键 | 操作 | | ------------ | -------------------------- | | `j`/`k` | 向上/向下移动 | | `h` | 返回(父目录) | | `l` / `Enter` | 打开文件夹 / 预览 | | `gg` / `G` | 跳转至开头/结尾 | | `/` | 搜索文件 | | Tab | 切换面板焦点 | | 鼠标点击 | 选择项目 / 聚焦面板 | | 滚轮 | 滚动面板 | #### 操作(针对选定的文件/文件夹) | 按键 | 操作 | CLI 等价命令 | | ---- | ------------------------------------ | -------------------------- | | `c` | **check** — 完整 AES 合规性检查 | `check [path]` | | `s` | **scan** — 多 adapter 扫描 | `scan [path]` | | `f` | **fix** — 自动修复(切换 dry-run) | `fix [path]` | | `t` | **ci** — CI 模式(输入阈值) | `ci [path] --threshold N` | | `w` | **watch** — 实时文件监视 | `watch [path]` | | `o` | **orphan** — 死代码检查 | `orphan [path]` | | `^S` | **security** — 漏洞扫描 | `security [path]` | | `^D` | **duplicates** — 重复检测 | `duplicates [path]` | | `^P` | **dependencies** — 库漏洞检查 | `dependencies [path]` | | `d` | **doctor** — 环境诊断 | `doctor` | | `i` | **init** — 创建默认配置 | `init` | | `I` | **install** — 安装 adapter 依赖 | `install` | | `m` | **mcp-config** — 打印 MCP 配置 | `mcp-config` | | `C` | **config-show** — 显示当前活动配置 | `config-show` | | `H` | **install-hook** — 安装 git hook | `install-hook` | | `U` | **uninstall-hook** — 移除 git hook | `uninstall-hook` | | `a` | **adapters** — 列出活动的 adapter | `adapters` | | `v` | **version** — 显示版本 | `version` | | `?` | 帮助覆盖层 | — | | `q` | 退出 | — | ### 运行 ``` cargo run --bin lint-arwaky-tui # 或直接: ./target/release/lint-arwaky-tui ```
标签:可视化界面, 弱口令爆破, 逆向工具, 通知系统