agent-of-empires
Manage Agent of Empires sessions that each own a git worktree. Use to create, list, rename, move, archive, remove, restore, or recover a session, or to lay sessions out in waves.
- License 许可
- BSD-3-Clause
- 最近更新
- 2026-11-13
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- agent-of-empires
- description
- Manage Agent of Empires sessions that each own a git worktree. Use to create, list, rename, move, archive, remove, restore, or recover a session, or to lay sessions out in waves.
02 资源文件 2
- 参考文档reference.md3.3 KB
- 脚本scripts/aoe-sessions32.9 KB
03 SKILL.md 正文
agent-of-empires
One session owns one git worktree on one branch. The repository is a bare root with sibling worktrees:
<root>/.bare, <root>/main, and one folder per session beside main/.
Every operation goes through one script: scripts/aoe-sessions in this skill's folder. Run it from
inside the repository. aoe-sessions --help prints the full usage.
Discovery
Run aoe-sessions config first. It prints what the script found. A flag overrides each value.
| Setting | Found from | Flag |
|---|---|---|
| harness, stack | the one exec harnessed host-run wrapper in main/ |
--harness, --stack |
| row kind | harnessed when a stack is found, else plain aoe add -w rows |
--cmd <command> forces plain |
| AOE profile | harnessed with a stack, else $AGENT_OF_EMPIRES_PROFILE, else default |
--profile |
| group | the group of the session at main/, else the root folder's name |
--group |
If main/ holds wrappers for several stacks, the script stops. Ask the user which stack, then pass --stack.
Local files
A new worktree lacks main's gitignored files. main/.worktree-include lists the ones to bring along:
# one path relative to main/ a line; copied unless the line starts with `link `
.claude/settings.local.json
link .env
new,wave create, andrecoverapply the list. They never overwrite a file the worktree has.- Without the file, only
.claude/settings.local.jsonis copied. - Copy a file that each branch can change on its own. Link a file that must stay one shared file.
- Never list a cache or a venv. Each worktree rebuilds its own.
Sessions
| Ask | Run |
|---|---|
| What is in flight? | aoe-sessions list [<group>] |
| New session for a branch | aoe-sessions new <branch> [<title>] |
| Rename a session | aoe-sessions rename <target> <title> |
| Move a session to another group | aoe-sessions move <target> <group> |
| Pause sessions | aoe-sessions archive <target>... |
| Resume paused sessions | aoe-sessions unarchive <target>... |
| Is it safe to remove? | aoe-sessions check <target>... |
| Remove sessions | aoe-sessions remove <target>... |
| What is in the trash? | aoe-sessions trash |
| Bring one back | `aoe-sessions restore <id |
| A worktree or session is gone | aoe-sessions recover <branch> [<title>] |
| A moved harnessed session will not start | aoe-sessions repair <target> |
A <target> is a session id, a title, a branch, or wave-<n>.
newis idempotent. If the branch already has a session, it reuses it or names the one that exists.- A new branch starts from
origin/mainwith no upstream. The first push sets it. renamealso moves the worktree folder, because AOE ties the folder name to the title.movechanges the group only. The folder stays.listmarks a harnessed row whose command points at a missing wrapper asSTALE COMMAND.recoverrebuilds the worktree from the branch. It then lists the Claude conversations it can import. Offer the printedaoe session importcommand. Never run it unasked: it creates new sessions.
Waves (optional)
Waves are one way to lay out issue work. A wave is the group <group>/wave-<n>.
| Thing | Shape | Example |
|---|---|---|
| title | <wave>.<slot>-<ISSUE>-<slug> |
2.1-GH-83-two-plugins |
| branch | <ISSUE> |
GH-83 |
| worktree | the title as a slug | <root>/2-1-gh-83-two-plugins |
| Ask | Run |
|---|---|
| Start wave 2 with these issues | aoe-sessions wave create 2 GH-83:two-plugins GH-93:feedback |
| Move a session to wave 3 | aoe-sessions wave move <target> 3 [<slot>] |
| Close the slot gaps in wave 2 | aoe-sessions wave renumber 2 |
| Show, archive, check, or remove a wave | pass wave-<n> as the target |
wave createis idempotent. A session already in another wave is skipped, with the command to move it.wave movealso adopts a session that has no wave yet. Its title becomes<wave>.<slot>-<title>.- The branch never carries the wave or slot, so a reorder never renames a branch.
Safety: non-negotiable
- Run
aoe-sessions checkbefore every removal. Show the user eachBLOCKEDreason. removeskips a session with uncommitted changes, commits on no remote, no upstream, or a live process in its worktree. It never removes the session atmain/.- Pass
--allow <title>only after the user says yes to that title by name in this conversation. --purgeand--delete-branchalso need--confirm-irreversible. Add it only after an explicit yes.- Never run
aoe remove --purge,aoe session empty-trash, oraoe remove --delete-branchdirectly. - Never edit
sessions.jsonby hand. The script edits nothing in it; harnessed does, under AOE's lock. - Never rename a running session.
rename,wave move, andwave renumberrefuse one; stop it first. archiveskips a running session unless it gets--allow <title>.- The script backs up
sessions.jsonbefore each batch of changes, and prints the backup path.
# Wrong: removes the work it was asked to protect
aoe remove GH-88 --delete-worktree --purge --force
# Right: check, report, and remove only what is safe or approved by name
aoe-sessions check wave-2
aoe-sessions remove wave-2 --allow 2.1-GH-88-x # only after "yes, remove 2.1-GH-88-x"
Gotchas
- History follows the folder. Claude Code files a conversation under its working folder. After a
rename,
/resumein the new folder does not list the old one. Tell the user where it stays;renameprints the old path. - harnessed needs #544. With a stack, the script needs a
harnessedwhosehost-runhas--aoe-managed-worktree. An older one is refused before any change. SetHARNESSEDto use another binary. - harnessed uses one AOE profile. It always registers in profile
harnessed, so a stack forces it. - Older harnessed cannot see nested groups. Its registration then fails. The script registers each row in the top-level group, then moves it, so every version works.
- Two row shapes exist. Rows from before harnessed #544 store an absolute wrapper path. A rename
strands them.
repairreruns harnessed, which rewrites the command in place.
reference.md has the verified AOE behaviour and the throwaway test harness.
04 同仓库更多 Skills
foo
GH-649 fixture skill.
time-helper
Ask the time MCP server for the current time in any IANA timezone and convert times between timezones.
wrangler
暂无简介
varlock
Create and maintain `.env.schema` files in the varlock/@env-spec DSL. Use when adding env var definitions, migrating from `.env.example`, running varlock commands (init, load, run, encrypt, audit), debugging missing env vars, or wiring 1Password secrets.
thinking-partner
Find where the user's idea, plan, direction, or draft is wrong before they accelerate. Use on "I've been thinking", "what do you think", "assess this", "review my plan", "am I going the right direction", "should I". Not for code diffs.
tests-are-authority
An existing test encodes a decision already made; your change does not outrank it. Load when a test fails after your change, before editing an existing test, and before adding skip/xfail or loosening an assertion.