GitHub 知识管理

May 20, 2026 · View on GitHub

AgentWorkOS 把 GitHub 当作 agent 知识源,而不是只当代码托管。

推荐仓库分层

仓库用途典型文件
AgentWorkOS-Stack个人总环境入口agentworkos.toml, agentworkos.lock.json, TERMS.md
Skill repos可复用技能包SKILL.md, agentpkg.toml, docs, tests
Agent repos角色卡和分发规则role cards, AGENTS.md, CLAUDE.md adapters
SOP repos可复用流程checklists, prompts, scripts

同步关系

GitHub source repo
  -> aw install / aw sync
  -> ~/.agentworkos/sources cache
  -> ~/.codex and ~/.claude runtime targets

aw install github:OWNER/REPO 更像 pip install git+...

agentworkos.toml 更像 requirements.txt:它声明这个环境要哪些包、从哪里来、装到哪里。

agentworkos.lock.json 更像 uv.lock:它记录当时解析到的 source、commit、hash 和 target 信息。

什么时候必须上传 GitHub

本机单次实验可以只用本地路径:

source = "./skills/readme-design"

跨电脑、团队共享、长期维护时,应该把 Stack Repo 和可复用 Package Repo 推到 GitHub:

source = "github:OWNER/readme-design"
ref = "main"

然后在新机器执行:

aw install github:OWNER/AgentWorkOS-Stack --target all --apply

三端同步

在 AgentWorkOS 语境里,三端同步指:

例子验证
Runtime copy~/.codex, ~/.claudeaw scan, aw sync dry-run
Local source repoD:/.../AgentWorkOS-Stackgit status, aw doctor
Remote GitHub repogithub.com/OWNER/AgentWorkOS-Stackgit push, lockfile commit

规则:只改 runtime 不算完成,只改本地 repo 不算完成,只推 GitHub 但 runtime 没同步也不算完成。

包源选择

Source适合场景
github:OWNER/REPO推荐写法,最短
https://github.com/OWNER/REPO兼容直链
git+https://github.com/OWNER/REPO.git类 pip 的 git source 写法
./local/path本机开发和调试

最小可迁移闭环

aw lock
aw doctor
git add .
git commit -m "Update AgentWorkOS stack"
git push

# on another machine
aw install github:OWNER/AgentWorkOS-Stack --target all --apply
aw scan