Skip to content

v0.1.0 · Phase 1-3 完整闭环

Choose a tag to compare

@lkdx0220 lkdx0220 released this 10 Oct 08:34
· 57 commits to main since this release

首个可用版本:扫描 → 体检 → 归因 → 基线 → 分批修复 → 复扫 → 质量门 的本地代码质量工作流,AI Agent Skill + CLI 双形态。

子命令

  • cq scan —— 聚合 ruff / ruff format / mypy / radon / vulture / pytest-cov / import-linter / DeepSec L1+L2,统一 findings 落 audits/<run_id>/;工具缺失/超时显式 skipped,绝不静默 pass;密钥落盘前全量脱敏
  • cq doctor —— 环境体检:缺什么工具给什么安装命令;解释器兜底(uv/pipx 隔离 venv 自动发现系统 Python),JSON 版供 Agent 消费
  • cq triage —— 四维归因(安全/可靠性/可维护性/测试)+ 处置建议 + 修复批次
  • cq baseline / cq diff —— 基线固化(自包含)与 new/fixed/existing 对比(行号漂移不算新增)
  • cq gate —— 质量门:blocker/high 上限、复杂度 D/E/F=0、覆盖率阈值、新增即失败;退出码 0/1/2/3;local_rating 近似评级
  • cq fix —— 分批修复计划,默认 dry-run;--apply 仅对自动修复批次开放(用户显式批准,apply 后不 commit)
  • cq suppress —— 豁免必须写理由,留痕 .cq/suppressions.json

适配层(agent-adapters/)

DSH(SKILL.md)/ Claude Code / Codex / Cursor / 通用 PROMPT.md 五端接入,见 README 适配器矩阵。

质量状态

  • CI 全绿(lint / typecheck / test / dogfood:cq 扫 cq 自己;后续版本已扩展为 Linux+Windows 双平台矩阵)
  • 81 个单元测试(tag 时刻;后续修正:v0.1.0 发布时实测 81,非此前误记的 90);ruff / mypy / vulture 本仓库零 finding
  • 已知债务:总覆盖率 ~59%(gate 诚实红灯);deepsec 在 CI 跳过(外部依赖)
  • 豁免留痕示范:.cq/suppressions.json(2 条 deepsec 误报,各带理由)

安装

pipx install git+https://github.com/lkdx0220/ai-code-quality-skill   # 或 uv tool install 同 URL
cq doctor && cq scan --project <你的仓库>