AI 编码任务委派
ai-coding-agents
将编码任务委派给自主 AI CLI 工具(Claude Code、OpenAI Codex、OpenCode),并做好相应的配置、任务范围界定和安全保障。
- License 许可
- MIT
- 最近更新
- 2026-11-06
- Stars
- ★ 5
- Forks
- 4
01 前言 Front Matter
- name
- ai-coding-agents
- author
- Hermes Agent
- license
- MIT
- version
- 1.0.0
- metadata
- { "hermes": { "tags": [ "claude-code", "codex", "opencode", "ai-coding", "delegation", "multi-agent" ], "related_skills": [ "kanban-operations" ] } }
- platforms
- [ "linux", "macos", "windows" ]
- description
- Delegate coding tasks to autonomous AI CLI tools (Claude Code, OpenAI Codex, OpenCode) with proper setup, scoping, and safety.
02 资源文件 6
- 参考文档anthropic-best-practices.md44.7 KB
- 参考文档examples/CLAUDE_MD_TESTING.md5.3 KB
- 其他graphviz-conventions.dot5.8 KB
- 参考文档persuasion-principles.md5.8 KB
- 脚本render-graphs.js4.7 KB
- 参考文档testing-skills-with-subagents.md12.3 KB
03 SKILL.md 正文
AI Coding Agents
Hermes can delegate complex coding tasks to three autonomous CLI tools. All three follow the same high-level pattern: describe the goal → delegate → review the diff → run tests. Differences are in CLI quirks, output modes, and model support.
Claude Code
claude --help # Full flag list
claude "refactor utils.py to use pathlib"
claude --output-format stream "review PR 42"
Setup
- Install:
brew install claude-code - No explicit auth required if ANTHROPIC_API_KEY or default credentials exist
Modes
- Prompt mode:
claude "do X"— one-shot - Interactive mode:
claude— REPL - Script mode:
claude -p "do X"— non-interactive
Post-Delegation Verification
Claude Code operates directly on the filesystem. After it exits:
git diff— check what actually changedgit status— verify no unintended files were touched- Run tests — Claude's claim of passing tests may be stale
OpenAI Codex
codex --help
codex "review PR 42" # One-shot
codex "implement feature X" # Implementation
codex --output-format diff # Structured review output
Setup
- Install:
npm install -g @openai/codex - Auth:
codex auth(API key via OPENAI_API_KEY env var)
Output Formats
stream— real-time (default)diff— structured patchjson— machine-readable
Non-Interactive / CI
codex "review PR 42" --output-format json --no-interaction
OpenCode
opencode --help
opencode "refactor utils.py to use pathlib"
opencode --output-format diff "review PR 42"
Setup
- Install:
npm install -g opencode - Auth:
opencode auth(supports API keys from multiple providers)
Multi-Provider Support
OpenCode can route to different providers via config:
# ~/.config/opencode/opencode.yaml
default:
provider: openai
model: gpt-4.1
Non-Interactive
opencode "do X" --no-interaction
Common Post-Delegation Checklist
| Step | Command |
|---|---|
| Inspect diff | git diff --stat && git diff |
| Verify tests | pytest / cargo test / npm test (Hermes runs, not the agent) |
| Check for secrets | `git diff |
| Review new files | git status --short |
| Commit or revert | git add -p / git checkout -- <file> |
When to Delegate vs. Do Inline
Delegate when:
- Task is self-contained (one file/module)
- Acceptance criteria are clear
- Test suite is comprehensive
- Hermes will review the diff afterward
Do inline when:
- Task spans architecture decisions
- User expects conversational iteration
- Safety critical (no unreviewed code changes)
- Agent lacks project context
Worktree Isolation
For maximum safety, always run AI coding agents in a disposable git worktree:
WORKTREE="/tmp/codex-$(date +%s)"
git worktree add -b codex-lane "$WORKTREE"
cd "$WORKTREE"
codex "implement feature X"
# Review diff, cherry-pick, or discard
git worktree remove "$WORKTREE"
04 同仓库更多 Skills
网页抓取受阻恢复
blocked-page-recovery
当抓取失败时使用:403/429 状态码、付费墙(paywall)、WAF、机器人验证墙(bot wall)。
软件实施计划编写
writing-plans
在创建或更新可执行的软件计划时使用。除非用户明确要求将计划注册到 Doct,否则请将计划保留为本地文件。
测试驱动开发
test-driven-development
TDD:强制执行「红-绿-重构」(RED-GREEN-REFACTOR)循环,先写测试再写代码。
系统化根因调试
systematic-debugging
四阶段根因调试:先理解缺陷,再着手修复。
技术预研验证
spike
在正式构建前,通过一次性(可丢弃的)实验来验证某个想法。
代码变更并行清理精简
simplify-code
并行使用 3 个智能体(agent)对近期代码变更进行清理精简。