Run a structured 7-pass post-coding pipeline that reviews correctness, security, error handling, performance, test gaps, dead code, and code clarity, producing health scores, trend dashboards, and CI gates that ratchet quality baselines.
Accept or diff CodeCortexLoop baseline — ratchet mode for legacy codebases
Deep CodeCortexLoop pass — all 7 passes, whole project, benchmarks required for perf fixes.
Pre-PR CodeCortexLoop gate — all passes on recent changes, Critical+High must be clean for CI.
Fast CodeCortexLoop pass — review, security, error-handling on recent changes. Critical+High only.
Manually reflect on recent Direct fixes and record learnings to the playbook
Cleanup expert for /cortexloop pass 7 (final). Dead code and dependency curation with proof before removal — runs last with full pipeline handoff context.
Correctness and architecture expert for /cortexloop pass 1. Evaluates logic, edge cases, module boundaries, and structural fit — defers security, tests, perf, and cleanup to later pipeline experts.
Simplicity expert for /cortexloop pass 6. Clarity and maintainability without behavior change — runs after functional passes in the sequential pipeline.
Performance expert for /cortexloop pass 5. Hot-path risks, unbounded work, and measurement targets — defers correctness and security to earlier pipeline experts.
Security expert for /cortexloop pass 2. Vulnerability detection, threat modeling, and secure coding — defers correctness, tests, perf, and cleanup to other pipeline experts.
Deep correctness and architecture analysis for /cortexloop pass 1. Logic, invariants, structure, and maintainability — go deep here; defer other domains via handoff.
Shared CodeCortexLoop expert protocol — one pass, one category, handoff JSON, defer boundaries. Load this on every pipeline expert before domain skills.
Deep cleanup analysis for /cortexloop pass 7. Dead code and dependency proof — go deep on evidence before removal.
Deep boundary and state-machine analysis for passes 1, 3, 4. Find non-obvious triggers — apply findings within your pass category.
Deep error-path analysis for /cortexloop pass 4. Propagation, observability, recovery — go deep on failure semantics; defer security exploits and logic bugs to other passes.
Uses power tools
Uses Bash, Write, or Edit tools
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
No model invocation
Executes directly as bash, bypassing the AI model
No model invocation
Executes directly as bash, bypassing the AI model
一条命令,七位领域专家,可自我进化的 Playbook。
面向 AI 编码工具的「写完代码后」流水线:正确性 → 安全 → 测试 → 错误处理 → 性能 → 精简 → 清理 —— 配套健康分、HTML 看板、handoff 接力、双语 Playbook、基线棘轮与 CI 集成。
| 能力 | 说明 |
|---|---|
| 七专家串行 | Orchestrator 调度 7 路独立专家(Cursor/Claude/OpenCode:Task;Qoder:Agent;Trae:SOLO 委派) |
| 健康分 0–100 | 七维打分 + 总分;Direct 模式输出 修复前 → 修复后 |
| 三种模式 | Report(只诊断)· Direct(修复+复验)· CI(门禁) |
| Playbook | 项目内学习修复模式(候选/已验证,防幻觉) |
| 零依赖脚本 | 看板、徽章、history、ci-gate 纯 Node,无 npm 依赖 |
curl -fsSL https://raw.githubusercontent.com/whitequeen306/code-cortex-loop/main/scripts/install-remote.sh | bash -s cursor
Windows(PowerShell):
irm https://raw.githubusercontent.com/whitequeen306/code-cortex-loop/main/scripts/install-remote.ps1 | iex; Install-CodeCortexLoop -Tool cursor
将 cursor 换成 claude | qoder | trae | opencode | codex | all。安装后重启工具,在聊天里输入 /cortexloop。
本地 clone 安装:
git clone https://github.com/whitequeen306/code-cortex-loop.git
cd code-cortex-loop
.\scripts\install.ps1 -Tool cursor # macOS/Linux: ./scripts/install.sh cursor
任意一条答 否 → 大概率不需要(这很正常):
| 问题 | 原因 |
|---|---|
| 你常用 Cursor、Claude Code、OpenCode、Qoder、Trae(SOLO) 或 Codex 吗? | Cursor/Claude/OpenCode:Task;Qoder:Agent;Trae:SOLO;Codex:显式 spawn |
| 改动量 ≥ 几百行 或是一个完整功能吗? | 改个 typo 用 linter 就够了 |
| 能接受每次 约 3–10 分钟 跑完整流程吗? | 见下方 性能预算;小 PR 用 /cortexloop-quick |
| CodeCortexLoop | CodeRabbit / Copilot Review | SonarQube / Snyk | 自己写 Cursor rules | |
|---|---|---|---|---|
| 跑在哪 | AI IDE 会话里 | 托管 PR 机器人 | CI / 服务端 | 你的聊天 |
| 多领域审查 | 7 路专家串行 | 单次 review | 规则扫描 | 看你怎么 prompt |
| 项目内学习 | Playbook(候选/已验证) | 产品记忆 | 基线/issue | 手动维护 |
| 成本 | 你的模型 token | 订阅 | 授权/云 | 写规则的时间 |
| 适合谁 | 已习惯 Cursor/Claude/Qoder Agent 的开发者 | 零配置 PR review 的团队 | 合规/静态分析 | 爱折腾的人 |
不是 SaaS,是 harness + 零依赖脚本,让现有 AI 工具像一支有流程的审查团队。
flowchart LR
pre["分析前查 Playbook"] --> orch["Orchestrator 指挥"]
orch --> e1["专家1 正确性"]
e1 --> e2["专家2 安全"]
e2 --> e7["…专家7"]
e7 --> score["汇总 + 健康分"]
score --> out{"Report / Direct / CI"}
out -->|Direct| fix["修复 + 复验"]
fix --> reflect["反思 → Playbook"]
reflect -.-> pre
Task 工具启动(OpenCode 需配置 permission.task)Agent 工具委派 ~/.qoder/agents/ 中的自定义智能体(阻塞、独立上下文)~/.trae/agents/ 中的 7 个自定义智能体| 步 | Pass | 专家 | 类别报告 | Handoff |
|---|---|---|---|---|
| 1 | review | code-reviewer | 01-correctness.md | .cortexloop/handoff/01-correctness.json |
| 2 | security | security-auditor | 02-security.md | .cortexloop/handoff/02-security.json |
| 3 | tests | test-engineer | 05-tests.md | .cortexloop/handoff/03-tests.json |
| 4 | errorHandling | silent-failure-hunter | 06-error-handling.md | .cortexloop/handoff/04-error-handling.json |
| 5 | performance | performance-analyst | 03-performance.md | .cortexloop/handoff/05-performance.json |
| 6 | simplicity | code-simplifier | 04-simplicity.md | .cortexloop/handoff/06-simplicity.json |
| 7 | cleanup | cleanup-curator | 07-cleanup.md | .cortexloop/handoff/07-cleanup.json |
合约与边界:passes/README.md · Handoff Schema:schemas/pass-handoff.schema.json
| 模式 | 触发 | 行为 |
|---|---|---|
| Report | /cortexloop 默认询问 | 写出报告 + 看板,停下等你确认再改代码 |
| Direct | 选择 Direct | 分组修复 → 每组跑测试 → 复验重跑七专家 → 输出修复前后得分 → 自动反思写入 Playbook |
| CI | /cortexloop --ci 或配置 ci.enabled | 无交互,写 report.json,跑 ci-gate,可选 PR 评论 |
| 命令 | 用途 |
|---|---|
/cortexloop | 完整 7 pass;询问 Report / Direct 与范围 |
/cortexloop-quick | 3 pass:审查 + 安全 + 错误处理;适合小改动 |
/cortexloop-deep | 7 pass 整库深扫 |
/cortexloop-security | 安全 + 错误处理 + 依赖清理 |
/cortexloop-pre-pr | PR 前:近期改动,High+ 须清零 |
/cortexloop-baseline | 接受或对比技术债基线 |
/cortexloop-reflect | 手动复盘并写入 Playbook |
npx claudepluginhub whitequeen306/code-cortex-loop --plugin cortexloopStructured codebase health attributes with severity-based agent routing
Automated code review with severity levels and actionable feedback
Adversarial multi-agent pipeline for Claude Code. GAN-style loops where generators produce artifacts, discriminators validate them, and feedback drives convergence.
Self-review workflow: Simplifier + Scrutinizer for code quality
Live codebase visualization and structural quality gate — 14 health dimensions graded A-F, dependency analysis, and architecture governance via MCP
Analyze local repos for code health, complexity, test coverage gaps - multi-dimensional health analysis combining complexity + churn + coverage