koopos/hermes/github-file-agent
Claude Code and agent skill by koopos/hermes
- community
Checking that the SKILL.md file is still in the repository.
GitHub 文件轮询式本地 Agent — 工作流、调试、排错指南。
Install
npx vskill@latest install koopos/hermes/github-file-agentSKILL.md
The same SKILL.md was published earlier as koopos/hermes/github-file-agent.
GitHub File Agent
本地轮询式 Agent,不依赖 Webhook。定时拉取 GitHub 仓库,读取任务文件,处理任务,提交状态变更。
核心组件
- Cron Job:
github-task-agent-polling— every 5m,调用poll-github-task-agent.sh - 脚本:
/Users/koopos/AIGC/agents/github-task-agent/scripts/poll-github-task-agent.sh - Prompt:
/Users/koopos/AIGC/agents/github-task-agent/prompts/polling-agent.md - 工作目录:
/Users/koopos/AIGC/agents/github-task-agent/repos/{owner}__{repo}/ - Prompts 目录:
/Users/koopos/AIGC/agents/github-task-agent/prompts/
工作流程
- Cron 触发
poll-github-task-agent.sh - Script:
git fetch + pull→ 读取 tasks.json - 调用
hermes chat -q+ polling-agent prompt - Hermes: 找 1 个 pending 任务 → claim (running) → 处理 → commit → push
任务类型路由 (polling-agent.md)
agent-dev— 代码开发,创建分支 + PRagent-image— 图片生成agent-dating-post— 相亲图文agent-video-script— 视频脚本agent-hot-content / agent-article— 图文热文
调试命令
任务创建 (Dashboard)
Dashboard 创建 agent-dev 任务时:
- 仓库名 →
input.references(数组) - 详细需求 →
task.description task.title→ PR/分支标题
Agent 处理时按 polling-agent.md 流程:先读 description,再 clone references,再实现。
多个相同轮询 Agent(横向扩容)
当前方案是多个 cron job 调同一个脚本,但每个 poller 必须使用独立 GITHUB_AGENT_WORKROOT,并且 max_tasks=1:
原因:多个 cron 共用同一个 git checkout 会互相打断 git 操作;每个 agent 独立 clone 后,脚本通过“claim commit + push conflict retry”避免重复领取同一任务。
当前 cron job 与错峰轮询频率:
de4c59996bbe—github-task-agent-polling-1— every 2m49c87e27c483—github-task-agent-polling-2— every 3m1b6dd293447a—github-task-agent-polling-3— every 4m
用户说“cron agent”通常是要查看这些 poller 的状态;直接用表格输出 Pending/Running/Completed/Failed/Blocked 和各 cron 的 last/next/status,不要长篇解释。
错峰原因:即使脚本有 push-conflict retry,多个 poller 同一秒触发也会增加 git 冲突和模型并发尖峰;后续添加更多 poller 时优先使用不同 schedule(例如 2m/3m/4m/5m)或不同 next_run_at。
Cron pre-run script(必须用于可靠轮询)
对 GitHub 文件轮询 agent,不要只在 cron prompt 里写“运行 /path/to/script ...”。如果 cron LLM 调用先超时,shell 命令可能根本没执行,任务会一直 pending。
正确做法:把确定性轮询动作放到 cron script 字段,prompt 只做简短汇报或 [SILENT]。
当前 wrapper:
~/.hermes/scripts/github_task_agent_poller.py— 共享 runner~/.hermes/scripts/github_task_agent_poller_1.py~/.hermes/scripts/github_task_agent_poller_2.py~/.hermes/scripts/github_task_agent_poller_3.py
重要:cronjob 的 script 参数必须是相对 ~/.hermes/scripts/ 的文件名,例如 github_task_agent_poller_1.py;不要传绝对路径。
详见:references/cron-pre-run-script-pattern.md
Cron "ok" 但任务没处理 — 排查方法
⚠️ 已知陷阱: Cron job last_status: ok 可能只代表 cron run 结束,不代表任务被处理。如果 cron 输出里是 API call failed after 3 retries: Request timed out,且 job 没有配置 pre-run script,说明轮询脚本可能根本没执行。
判断方法:
如果输出包含 API call failed after 3 retries: Request timed out.,说明是模型超时,不是任务不存在。
已知根因(2026-05-15 实测):
- Shell 脚本
poll-github-task-agent.sh已使用 prompt 文件模式($PROMPT_FILE),不是直接塞长文本 hermes chat -q调用 MiniMax API 本身超时,3 次重试全部失败- 这不是 prompt 优化能解决的事 — 是 MiniMax API 响应慢或限流
其他原因:
- 模型 API 限流或响应慢
- 网络到 API 不稳定
- Prompt 太长(已用 prompt 文件缓解)
解决方案:
- 等待模型恢复后 cron 自动重试(每次间隔 5m)
- 手动补跑:
bash /Users/koopos/AIGC/agents/github-task-agent/scripts/poll-github-task-agent.sh Koopos/task-list .agent/tasks.json - 如果持续超时,检查 cron schedule 是否太频繁(5m 可能太短)
详细调试步骤见references/debug-cron.md
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/autonomous-ai-agents/github-file-agent/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/koopos/hermes/github-file-agent)