agentteams
Orchestrate plan execution — analyze a plan tree, score it against expectations, resolve a dependency DAG, slice work into token-budgeted groups, and drive a human-in-the-loop iteration loop with canonical handoff blocks. Use to orchestrate agent teams, run plan analysis, render scoreboards, build punch lists (P0/P1/P2), slice plans by token budget, drive iteration loops, render handoff blocks (Landed / Tested / Acceptance / Next / To Resume), and resume after /clear.
- License 许可
- MIT
- 最近更新
- 2026-08-25
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- agentteams
- tier
- org
- description
- Orchestrate plan execution — analyze a plan tree, score it against expectations, resolve a dependency DAG, slice work into token-budgeted groups, and drive a human-in-the-loop iteration loop with canonical handoff blocks. Use to orchestrate agent teams, run plan analysis, render scoreboards, build punch lists (P0/P1/P2), slice plans by token budget, drive iteration loops, render handoff blocks (Landed / Tested / Acceptance / Next / To Resume), and resume after /clear.
- dependencies
- [ "agent-skills-toolkit" ]
02 资源文件 32
- 资产文件assets/.gitkeep—
- 参考文档references/.gitkeep—
- 脚本scripts/acceptance-gate.mjs4.6 KB
- 脚本scripts/bin/agentteams1.1 KB
- 脚本scripts/mjs/bin/agentteams180 B
- 脚本scripts/mjs/Makefile515 B
- 脚本scripts/mjs/package.json543 B
- 脚本scripts/mjs/src/analyzer.mjs6.4 KB
- 脚本scripts/mjs/src/cli.mjs10.2 KB
- 脚本scripts/mjs/src/dag.mjs6.4 KB
- 脚本scripts/mjs/src/exit-codes.mjs753 B
- 脚本scripts/mjs/src/index.mjs692 B
- 脚本scripts/mjs/src/parser.mjs6.1 KB
- 脚本scripts/mjs/src/runner.mjs3.8 KB
- 脚本scripts/mjs/src/slicer.mjs4.0 KB
- 脚本scripts/mjs/test/smoke.test.mjs3.0 KB
- 脚本scripts/parity.mjs2.9 KB
- 脚本scripts/py/Makefile827 B
- 脚本scripts/py/pyproject.toml452 B
- 脚本scripts/py/src/agentteams/__init__.py865 B
- 脚本scripts/py/src/agentteams/analyzer.py7.0 KB
- 脚本scripts/py/src/agentteams/cli.py10.8 KB
- 脚本scripts/py/src/agentteams/dag.py6.7 KB
- 脚本scripts/py/src/agentteams/exit_codes.py762 B
- 脚本scripts/py/src/agentteams/parser.py6.8 KB
- 脚本scripts/py/src/agentteams/runner.py4.4 KB
- 脚本scripts/py/src/agentteams/slicer.py4.2 KB
- 脚本scripts/py/tests/__init__.py—
- 脚本scripts/py/tests/test_smoke.py2.7 KB
- 脚本scripts/py/uv.lock131 B
- 脚本scripts/resolve_target.py954 B
- 脚本scripts/resolve-target.mjs726 B
03 SKILL.md 正文
AgentTeams — Orchestrator Skill
Purpose
Drive a plan from "tree of markdown" to "shipped feature" without losing state across context resets. The skill is a thin contract over six executable subcommands.
CLI surface
agentteams analyze <plan-dir> # five-doc bundle: README, fit-matrix, analysis, gaps, schema-deltas, state-flow
agentteams dag <plan-dir> # topo-sorted JSON DAG + cycle report + P0/P1/P2 priorities
agentteams slice <plan-dir> --budget <P> # write .ai-harness/groups/NN-<slug>.md per group
agentteams run <plan-dir> [--group N] # execute one group; emit handoff block; exit 7 on HITL hard pause
agentteams report <plan-dir> # print the most-recently-emitted handoff block
agentteams resume <plan-dir> # print the exact prompt to paste after /clear
Runtime selection — mjs vs py
The skill ships two parity-tested implementations:
scripts/mjs/— Node ESM (primary; broader ecosystem, faster cold start).scripts/py/— Python twin (uv-managed; parity-tested byte-equal JSON).
A single entry point — scripts/bin/agentteams — picks between them at invocation time:
AGENTTEAMS_RUNTIME |
Behavior |
|---|---|
unset / auto (default) |
Prefer mjs if node is on $PATH; otherwise fall back to py via uv. |
mjs |
Force the Node runtime. Exits 127 if node is missing. |
py |
Force the Python runtime. Exits 127 if uv is missing. |
The Makefile, the install alias (below), and the Claude Code agent wrapper all invoke the shim — none of them hardcodes node or uv, so swapping runtimes is one env-var flip.
Install (agentteams on $PATH)
The runtime-selecting shim is at scripts/bin/agentteams and is not auto-installed globally. Add a shell alias keyed off an env var so the path stays portable across machines:
# In ~/.zshrc (or ~/.bashrc):
export AGENTTEAMS_HOME="${HOME}/<path-to-this-checkout>" # adjust per-machine
alias agentteams='"$AGENTTEAMS_HOME/.agents/skills/agentteams/scripts/bin/agentteams"'
# Optional: pin to one runtime
# export AGENTTEAMS_RUNTIME=mjs # or: py
Then agentteams analyze <plan-dir> resolves from any working directory and auto-picks mjs/py based on what's installed.
Alternative install paths (all relative to the repo root):
| Method | Command | Notes |
|---|---|---|
| Shell alias (above) | edit ~/.zshrc |
Lightest touch; survives code edits without reinstall. |
npm link (mjs only) |
cd .agents/skills/agentteams/scripts/mjs && npm link |
Symlinks agentteams-mjs into the npm global bin, bypassing the shim. Reverse with npm unlink -g agentteams-mjs. |
uv tool install (py only) |
uv tool install -e .agents/skills/agentteams/scripts/py |
Installs the py CLI to ~/.local/bin, bypassing the shim. Reverse with uv tool uninstall agentteams. |
| No install | .agents/skills/agentteams/scripts/bin/agentteams … |
Always works from the repo root; root Makefile wraps the common verbs. |
HITL modes
hard(default, recommended) — emit handoff, exit 7. Forces a/clearbetween groups.soft— emit handoff, then prompt for stdin confirmation before continuing.phase-only— exit 7 only when the current group ends a phase boundary.
Budget profiles
| Profile | Max tokens | Features/group |
|---|---|---|
| conservative | ~120,000 | 1–3 |
| comfortable | ~180,000 | 2–4 |
| aggressive | ~250,000 | 3–5 |
Default: conservative (the safest mode against context exhaustion).
Exit-code matrix
| Code | Meaning |
|---|---|
| 0 | success |
| 1 | generic failure |
| 2 | misuse (bad flag / arg) |
| 3 | plan-not-found |
| 4 | parse-error |
| 5 | cycle-detected |
| 6 | budget-exceeded |
| 7 | hitl-pause (intentional, clean) |
| 8 | gate-failed (testing or acceptance gate) |
| 100 | not-implemented (stub) |
Canonical handoff block
GROUP N COMPLETE — <feature title summary>
Landed: - <feature-id>: <description> — tests <green|red>, <N> files
• <path/to/file> (new|extended: <what>)
Tests: <pass/total> green. <bullets describing test coverage>
Acceptance: <PASS|FAIL|no gate in this group (gate lands in Group M)>
Next: GROUP <N+1> — <next group title>
To resume: 1) Run /clear to drop this session's context. 2) Paste this prompt:
implement group <N+1> of <plan-path> per <session-plan-path>
State persistence
state.json lives at <plan-dir>/.ai-harness/state.json:
{
"schemaVersion": 1,
"currentGroup": 2,
"lastCompletedGroup": 1,
"hitlMode": "hard",
"budgetProfile": "conservative",
"testingMode": "tests+gate",
"phaseAcceptanceGates": { "phase-1": { "status": "PASS", "timestamp": "..." } }
}
Writes are atomic (tmp + rename). resume reads this file to pick the next group.
When to use
- The user names a plan tree under
features/,stories/,tasks/and asks to "orchestrate", "drive iteration", "slice by token budget", or "emit handoff". - The user wants a multi-document plan scoreboard (fit matrix + analysis + punch list).
- The user wants to resume after
/clearwithout losing state.
Skip when
- The plan does not yet exist — use the upstream
plan-feature-story-taskskill to author it first. - The work is API-package scaffolding rather than execution — use
implement-polyglot-project-planinstead.
Project-local overrides
Model id, HITL defaults, and budget profile override live in a sibling agentteams-config skill at the consuming project's .agents/skills/agentteams-config/. This skill is read-only of those settings; it never authors them.
04 同仓库更多 Skills
validation_handoff
Forces the agent to conclude its response by generating a strict validation checklist and outlining pending actions, focusing heavily on defensive execution and edge-case testing.
project-ployglot-project-scafford
Scaffold a polyglot library project as TypeScript + Python twin packages under `packages/ts/` + `packages/py/`, with a shared `SPEC.md`, cross-language `tests/parity/fixtures.json`, side-by-side `examples/sdk/` + `examples/api/` documentation, per-package `Makefile`, and a root orchestrator that exposes `make ci`. Open-source friendly — no organization-specific paths or scopes baked in. Use when starting a new polyglot library, porting a single-language library to a twin, or auditing/regularizing an existing two-language repo against the canonical layout.
playwright-ui-locator
Auto-heal Playwright tests after a frontend developer changes a div's class, id, or other selector. Catches a failing Playwright test, captures the old vs new DOM tree, finds the element that drifted, derives the most stable replacement locator, and proposes the fix as a GitHub pull request (confident heals) or files a GitHub issue (ambiguous / element-removed cases) — never editing the working tree directly. Trigger when Playwright tests fail with "locator resolved to 0 elements", "Timeout waiting for selector", or after a UI refactor / class rename / Tailwind cleanup broke previously-passing tests.
org-learn-context-window
Distill the current conversation into a reusable command or skill artifact. Use when the user wants to capture a workflow they just executed (create a reusable slash command) or formalize a resolution/mistake/correction into a reusable skill so the same class of issue never recurs.
org-agent-skill-creator
Scaffold and validate scope-aware agent skills (company, enterprise, org, team, project, application). Use when the user asks to create a new agent skill, generate a SKILL.md file, scaffold a skill directory, or validate that existing skill directories meet SKILL_SPEC.md (frontmatter, naming rules, structure, scope/tier).
app-workshop-session-pdf-recap-next
Extract content from a workshop session PDF and produce a structured recap focused on (1) what was learned, (2) next steps, and (3) possible enhancements. Ingests a single PDF file path, parses session material (slides, transcripts, exercises, Q&A), and emits a Markdown report with Learning Recap, Next Steps, and Enhancement Opportunities sections with page-level traceability. Use when the user asks to "summarize a workshop", "recap a training PDF", "pull next steps from a session deck", or provides a workshop/seminar/tutorial PDF and wants a learn-and-act summary.