update
基于 Codex CLI 的 AI Skill 应用,调用 Gitee.AI 沐曦 GPU 算力上的大模型,实现规则驱动的代码审查、规范化、测试生成与白名单测试运行。
国产算力 × AI Skill 生态落地示范
让 AI 在维护者明确写下的项目规则下工作:
.muxi/rules/
confirmed_apply=true
RUNTIME_ENVIRONMENT.md
用户 (自然语言 或 $code-review) ↓ Codex Skill: .agents/skills/code-review/SKILL.md ↓ 指导 agent 调用 MCP 工具: muxi-llm / run_action(action, request, repo_root) ↓ 固定动作 (mcp/gitee_ai_muxi/action.py) init / check-rules / review / normalize / apply / test-gen / test-run ↓ 读取规则 + 收集 diff ModelRunner (runner.py) ↓ HTTPS (OpenAI 兼容, 流式) Gitee.AI → 沐曦 GPU (Qwen3-Coder-30B-A3B / MiniMax-M2.7) ↓ 日志四件套 → .muxi/calllog/YYYYMMDD/<session>/ log.txt / model-calls.jsonl / performance.json / report.md
. ├── .codex/config.toml # Codex 配置(MCP server) ├── .agents/skills/code-review/SKILL.md # Codex 扫描的 skill ├── AGENTS.md # 项目指令(Codex 也读) ├── opencode.json # OpenCode 配置(备用,双平台兼容) ├── .opencode/ # OpenCode skill(备用) ├── mcp/gitee_ai_muxi/ │ ├── runner.py # 模型调用 + 日志四件套 │ ├── rules.py # 规则加载与校验 │ ├── patch.py # patch 生成与应用 │ ├── action.py # 固定动作入口(8 个动作) │ ├── server.py # MCP server │ └── requirements.txt ├── rules-template/ # 4 份规则骨架 ├── scripts/ │ ├── init-rules.py # 生成规则骨架 │ └── benchmark.py # 性能压测 ├── logs/ # 压测报告 └── examples/ # 示例 diff
# 方式 A:一键脚本 curl -fsSL https://chatgpt.com/codex/install.sh | sh # 方式 B:npm npm install -g @openai/codex # 方式 C:Homebrew brew install --cask codex # 验证 codex --version
pip install -r mcp/gitee_ai_muxi/requirements.txt
cp .env.example .env # 填入 GITEE_AI_API_KEY(在 https://ai.gitee.com 获取) export $(cat .env | xargs)
# 进入要审查的 git 仓库 cd /path/to/your-repo python3 /path/to/muxi/scripts/init-rules.py . # 编辑 .muxi/rules/ 下四份文档
cd /data/muxi codex
在 Codex TUI 中:
$code-review # 显式调用 skill(或输入 /skills 选择)
或自然语言:
用本工具检查规则文档 用本工具审查 src/parser 模块 用本工具为 src/parser 生成测试 patch 用本工具运行 unit-test 测试
通过 MCP 工具 run_action(action, request, repo_root) 执行:
run_action(action, request, repo_root)
help
init
check-rules
review
normalize
apply
test-gen
test-run
request 字段:scope / files / commit / profile / timeout_seconds / confirmed_apply / model
request
scope
files
commit
profile
timeout_seconds
confirmed_apply
model
python3 scripts/benchmark.py # → logs/benchmark-report.md
每次 review / normalize / test-gen 在 .muxi/calllog/YYYYMMDD/<session>/ 生成:
.muxi/calllog/YYYYMMDD/<session>/
log.txt
model-calls.jsonl
performance.json
report.md
经 Gitee.AI 沐曦 GPU 调用:
Qwen3-Coder-30B-A3B-Instruct
MiniMax-M2.7
MIT
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802047560号
Metax-Style CodeImprover (Muxi GPU)
基于 Codex CLI 的 AI Skill 应用,调用 Gitee.AI 沐曦 GPU 算力上的大模型,实现规则驱动的代码审查、规范化、测试生成与白名单测试运行。
项目简介
让 AI 在维护者明确写下的项目规则下工作:
.muxi/rules/confirmed_apply=true才应用RUNTIME_ENVIRONMENT.md中声明的白名单 profile架构
目录结构
快速开始
1. 安装 Codex CLI
2. 安装 MCP 依赖
3. 配置环境变量
4. 在目标仓库初始化规则
5. 启动 Codex
在 Codex TUI 中:
或自然语言:
固定动作
通过 MCP 工具
run_action(action, request, repo_root)执行:helpinit.muxi/rules/四份骨架check-rulesreviewnormalizeapplyconfirmed_apply=true)test-gentest-runrequest字段:scope/files/commit/profile/timeout_seconds/confirmed_apply/model性能数据
每次
review/normalize/test-gen在.muxi/calllog/YYYYMMDD/<session>/生成:log.txtmodel-calls.jsonlperformance.jsonreport.md可用模型
经 Gitee.AI 沐曦 GPU 调用:
Qwen3-Coder-30B-A3B-InstructMiniMax-M2.7技术栈
许可证
MIT