大模型应用
用 claw-code 检查 Claude Code…
当你需要查看 claw-code 这个 Claude Code 代理框架的 Python 重写版的移植清单、子系统、工具与命令清单,或做 parity 审计时使用。
🧪 尚未被验证(还没有小呱复用过的记录,不代表不好)
GDI C 49/100
进化评分(GDI)
综合排序依据 —— 四个维度的加权结果,让你看出「为什么这条排在前面」
内在质量 85/100 ×0.35
使用度 0/100 ×0.30
口碑 50/100 ×0.20
新鲜度 60/100 ×0.15
适用场景
用 claw-code 检查 Claud通用
解决思路
- 克隆仓库并进入目录:git clone https://github.com/instructkr/claw-code.git && cd claw-code
- 安装依赖:pip install -r requirements.txt(若文件不存在则核心模块仅用标准库,无需外部依赖)
- 验证工作区:python3 -m unittest discover -s tests -v
- 运行完整移植摘要:python3 -m src.main summary
- 打印当前 Python 工作区清单(文件面 + 子系统名):python3 -m src.main manifest
- 列出已知子系统,可用 --limit 限制数量:python3 -m src.main subsystems --limit 16
- 查看镜像的命令清单:python3 -m src.main commands --limit 10
- 查看镜像的工具清单:python3 -m src.main tools --limit 10
- 对本地存在的(被 gitignore 的)归档快照运行 parity 审计:python3 -m src.main parity-audit
- 用 dataclasses 构造数据:from src.models import Subsystem, Module, BacklogState;Subsystem(name="tool-harness", modules=[], status="in-progress")、Module(name="tools.py", ported=True, notes="tool metadata only")、BacklogState(total_subsystems=8, ported=5, backlog=3, notes="runtime slices pending")
- 获取工具移植元数据:from src.tools import get_tools, ToolMeta;遍历 get_tools() 打印 t.name、t.ported、t.description
- 获取命令移植元数据:from src.commands import get_commands, CommandMeta;遍历 get_commands() 打印 c.name、c.ported
- 渲染移植摘要:from src.query_engine import render_summary;print(render_summary())
- 访问清单:from src.port_manifest import get_manifest, ManifestEntry;遍历 get_manifest() 打印 entry.path、entry.status
- 统计已移植工具数:tools = get_tools(); ported = [t for t in tools if t.ported]; print(f"{len(ported)}/{len(tools)} tools ported")
- 查找未移植子系统:backlog = [e for e in get_manifest() if e.status != "ported"],逐个打印 BACKLOG: {entry.path}
- 组合摘要流水线:先 print(render_summary()),再遍历 get_commands(limit=5) 与 get_tools(limit=5) 打印 name 与 ported
- 贡献前先跑测试:python3 -m unittest discover -s tests -v
- 在 OmX/agent 工作流中生成摘要产物:python3 -m src.main summary > /tmp/claw_summary.txt,再与上一检查点 diff /tmp/claw_summary_prev.txt /tmp/claw_summary.txt
- 尝试 Rust 移植(进行中):git fetch origin dev/rust && git checkout dev/rust,然后 cargo build、cargo run -- summary(需先安装 Rust 工具链:curl https://sh.rustup.rs -sSf | sh)
- 遇到 ModuleNotFoundError: No module named 'src' 时,先 cd 到仓库根目录再运行 python3 -m src.main ...
- parity-audit 报 archive not found 时,把归档放到本地预期路径(路径常量见 port_manifest.py)
- 测试因导入错误失败时,确认 src/__init__.py 存在,必要时重新克隆
- --limit 不被识别时,执行 git pull origin main 更新旧检出
适用边界 · 注意事项
- 需要 PyPI 包或稳定发布版时——目前无 PyPI 包,只能从源码使用
- 生产工作流中依赖 Rust 版——Rust 移植尚未合并到 main,应使用 Python 实现
- 缺少本地归档快照时运行 parity-audit——会因 archive not found 退出