Multi-Agent Collaboration Project Skeleton (Cross-Tool Resumable)
One-Line Installation (User Says "Install This Skill" – Execute Autonomously)
Source repo: https://github.com/aduhappy/multi-agent-project-skill. Clone it into your tool's skills directory (no other dependencies).
Different tools have different skills directories; choose the correct path for your tool:
| Tool | User-Level Skills Directory | Project-Level Skills Directory |
|---|---|---|
| ZCode / Codex CLI | ~/.agents/skills/ | <project>/.agents/skills/ |
| Claude Code | ~/.claude/skills/ | <project>/.claude/skills/ |
| Cursor | N/A (use rules) | .cursor/rules/ (modern format) or .cursorrules (legacy) |
General principles:
- On Windows,
~=%USERPROFILE%. - When unsure between user-level vs project-level, default to user-level (install once, use everywhere).
- Create the directory if it doesn't exist, then clone. After cloning, tell the user to start a new conversation to activate this skill.
What This Skill Does
It generates a tool-agnostic, pure Markdown collaboration skeleton in the project root — one authoritative entry point + several thin pointers + self-contained task cards + handoff conventions. Switching between Claude / Cursor / Gemini / ZCode / Copilot, any agent that reads the same entry point can pick up the predecessor's work without losing context or overwriting each other.
Four core principles:
- Single Source of Truth:
AGENTS.mdis the sole authoritative entry point; all other tool-specific convention files (CLAUDE.md/GEMINI.md/.cursorrules/copilot-instructions.md) are 3-line thin pointers that redirect toAGENTS.md. - Keep Details External, Keep Entry Point Short:
AGENTS.mdis limited to 1–2 screens — every new agent must read it completely. Details are delegated to specialized documents underdocs/, with the entry point only holding pointers. - Pure Markdown + Relative Paths: No tool-specific syntax; won't break when switching tools.
- Trust but Verify: Agent self-checks are insufficient — key outputs must be independently reviewed by a controller or another agent (conservation/check/bounds/magnitude/consistency) before passing to the next step. This is the foundation of a trustworthy multi-agent pipeline.
When to Trigger
- User says "start a new project/topic," "how to organize docs for AI collaboration," "how to write AGENTS.md," or "multiple agents handing off."
- Existing project agents frequently ask the same questions, can't find status, or overwrite each other's outputs.
- User wants to solidify "manual collaboration experience" into a reusable structure.
How to Use (Two Modes)
Mode A: Generate Skeleton from Scratch
- Ask (ask everything at once, don't drag it out): project root, one-sentence goal, which AI tools to support, whether cloud-synced directories exist, and relevant data sources.
- Also ask for a hard constraint checklist: "List dimensions in this domain that must not be conflated (calibration/units/coordinate system/resolution/epoch/age class, etc.). Write them as hard rules that all subsequent agents must follow." — This is the most commonly overlooked rule, and getting it wrong breaks everything.
- Copy
AGENTS.mdfromassets/to the root directory, filling in the user's provided content.- Placeholder rules (important): Fill in directly where the user provided info; if the user didn't provide something, prefer a reasonable default (inferred from the project topic) and briefly mark it as "default, can change"; only leave
【TODO】for details that are user-specific and cannot be reasonably inferred (e.g., specific DOIs, passwords, accounts). Goal: minimize【TODO】in theAGENTS.mdbody; ideally zero.
- Placeholder rules (important): Fill in directly where the user provided info; if the user didn't provide something, prefer a reasonable default (inferred from the project topic) and briefly mark it as "default, can change"; only leave
- For each tool the user selected, copy the corresponding thin pointer file (
CLAUDE.md,GEMINI.md,copilot-instructions.md, etc.) with the unified content "Refer to AGENTS.md". For Cursor users, recommend.cursor/rules/multi-agent.mdc(modern format);.cursorrulesas legacy fallback. Do not generate files for tools the user didn't select. - Create
docs/task_plan_<topic>.md(copy fromassets/task_plan_template.md). If the project has multiple task cards, also copyassets/task_card_README.md(task card directory index template listing dependency chains and current status). Each task card must include a📋 Delegation Prompt (Copy & Use)block at the end — fill in the card's fields so the user can copy and paste it to any agent for a cold start, without rewriting delegation wording each time. Fill this block while building the card. - (Optional) Create as needed:
docs/delegation_task_template.md(copy fromassets/delegation_task_template.md, for the controller agent to delegate tasks),docs/decision_records/(for ADRs),docs/glossary.md(project terminology). Note: These are optional templates; skip for small projects to keep the entry point lean. - Derive dataset directories: From the user-described data sources — one directory per data type (e.g., user says "MODIS + Landsat" → create
MODIS/andLandsat/directories; user says "survey + measurements" → createsurvey/andmeasurements/). Place asource.txtfile in each dataset directory (copy fromassets/source.txt). Skip this step for projects without explicit data sources. - Organize code: Create
scripts/directory +scripts/README.md(copy fromassets/scripts_README.md). Populate with the user's existing scripts list (if any), or leave empty for subsequent agents to fill. Also copycheck_handoff.py(fromassets/check_handoff.py) — the handoff self-check script that agents run withpython scripts/check_handoff.pyeach time they finish, verifying that §3/§4/STATUS have been updated. InAGENTS.md§5 ironclad rules, agree that "scripts don't scatter in the root directory." - Create
STATUS.md(copy fromassets/STATUS.md) — an empty template; the first agent fills it in with an incremental handoff (what this agent did, which files were modified, what pitfalls were encountered). - Write the user's environment and constraints into §Ironclad Rules and §Path Conventions.
- After completion, tell the user: which files were generated, which "defaults" need confirmation, and which
【TODO】items need filling in.
Mode B: Diagnose an Existing Project
B1: Fix a Messy Project (Zero Documentation or Chaotic Docs)
The user has an existing project but collaboration is chaotic — agents repeatedly ask the same questions, overwrite each other, or can't find status. First, read the existing README / any docs / directory structure. Compare against §File Skeleton and §AGENTS.md Sections, check what's missing, and provide a full remediation list (missing thin pointers? missing entry point? task cards not self-contained? missing source.txt? no handoff conventions?). After user confirmation, fill in the gaps. Read first, then modify; never overwrite existing files without review.
B2: Enhance a Good Project (Good Docs Already, Just Missing Thin Pointers)
The user already has solid project documentation (e.g., AI_COLLABORATION_PLAN.md / README.md / detailed wiki), but AI tools won't automatically read it (Codex/Claude default to AGENTS.md and won't proactively discover custom filenames). Just add a single AGENTS.md thin pointer (3 lines) pointing to the existing documentation; then add tool-specific thin pointer files (CLAUDE.md, etc.) for each tool the user selected. Do not modify any existing documentation. Criterion: After adding, a new agent enters → reads AGENTS.md → jumps to existing docs → gets full context, without the user needing to say "first read file X."
File Skeleton (After Generation)
<project root>/
├── AGENTS.md ← Sole authoritative entry point (top 3-line TL;DR + 7 sections, all tools read by default)
├── STATUS.md ← Incremental handoff (what this agent did, which files were modified, what pitfalls were encountered; written at end of session)
├── CLAUDE.md ← Thin pointer → "Refer to AGENTS.md"
├── GEMINI.md ← Thin pointer (same, optional)
├── .cursorrules ← Thin pointer (for Cursor, optional)
├── .github/copilot-instructions.md ← Thin pointer (for Copilot, optional)
├── docs/
│ ├── task_plan_<topic>.md ← Self-contained task card (includes "pre-delivery checklist" + optional recommended model)
│ ├── task_card_README.md ← Task card directory index (dependency chain + status table, optional)
│ ├── delegation_task_template.md ← Standard wording for delegating tasks to an AI agent (copy and fill, optional)
│ ├── decision_records/ ← Key technical decisions (optional, see advanced.md)
│ └── glossary.md ← Project terminology (optional)
├── <dataset_name>/ ← One directory per dataset
│ ├── source.txt ← DOI/URL/date/calibration/units
│ └── ...
├── scripts/ ← Code organization (recommended: keep scripts out of root)
│ ├── README.md ← One-line description per script: what it does/input/output/author
│ └── check_handoff.py ← Handoff self-check script (run to verify §3/§4/STATUS have been updated)
└── progress_log.md ← Timestamped change log (optional)
AGENTS.md Sections (Order = Priority)
Fill according to assets/AGENTS.md template. The top must have a TL;DR block (3 lines: current phase / next step / blockers) so a new agent can glance and understand status. Below are 8 sections (template numbers 1–7, with path conventions numbered separately as §5.5 because it's too important to lump with ironclad rules):
- TL;DR (Quick Read on Entry) — 3 lines: current phase, next step, blockers. Updated each handoff. A new agent doesn't need to read the whole document to know what's happening.
- One-Sentence North Star — What this project is really about, for whom, and its tone (voice, publication/delivery goals, which mainline not to derail).
- Current Story/Methods — Latest agreed direction + core methods + what changed recently and why.
- Where We Are Now — Updated each handoff, 1–5 timestamped cumulative snapshots. This is the most crucial handoff point. Incremental details go into
STATUS.md; this section only holds cumulative status. - Task Board —
[ ]/[x]+ who is responsible + dependencies (T1→T2, which can be parallel) + known risks. - Ironclad Rules / Conventions — Violations cause rework: environment calls, plotting/data rules, naming, calibration, handoff conventions. Includes: "New agents (including sub-agents) must read
AGENTS.mdcompletely before starting work." 5.5. Path Conventions — Where large files go, where small outputs return (to prevent multi-agent collisions, prevent cloud sync explosions). A separate section, don't bury it in Ironclad Rules. - Deep-Read Pointers — Which document holds details (task details, decision records, glossary, task card index).
- Environment / Tools — How to call complete tool paths, env locks.
STATUS.md vs AGENTS.md §3 Division (Prevent Overlap):
STATUS.mdrecords incremental changes (what this agent did this round, which files were modified, what pitfalls were encountered);AGENTS.md§3 records cumulative snapshots (overall current progress, 1–5 items). They don't overlap —STATUS.mdis "changes since last time," §3 is "where are we overall now."
Decision Registry (Strongly Recommended, Not Just Advanced): Consolidate binding decisions into a bounded, grep-able table — one decision per row:
ID | Decision | Value/Calibration | Rationale | Date | Evidence Link | Supersedes. Place it below §6 inAGENTS.md, or near §3. It differs from free-form ADRs scattered in long STATUS narratives: bounded (one decision per row, always readable), searchable (grep a keyword to instantly hit the authoritative row), traceable (supersedes chains). This is a key layer against "decisions buried in long logs, or quietly overwritten by a lagging script." Template inreferences/advanced.md§1.
Hard Requirements for Cross-Tool Continuity (7 Rules)
- Pure Markdown + Relative Paths + Standard Filenames — No tool-specific syntax, no hardcoded absolute paths.
- Data Must Have
source.txt(DOI/URL/download date/calibration/units/known issues) — Any person or agent can trace the origin. - Handoff Conventions Written into Ironclad Rules — Every agent must update §Where We Are Now + §Task Board + write/update
STATUS.md(incremental handoff: what this agent did this round, which files were modified, what pitfalls were encountered; do not repeat §3's full snapshot) before exiting. Runpython scripts/check_handoff.pyat handoff time — it verifies §3 date freshness, TL;DR is filled,STATUS.mdis not a template, STATUS date ≥ §3 date, thin pointers exist; plus two advisories (whether decision registry exists, whether multi-script calibration constants have drifted). Handoff is only合格 if all checks pass. - Path Discipline — "Large files go to the working drive, small outputs return to the repo" / "copy, don't cut; don't touch paths others are using."
- First Thing for a New Agent (Including Sub-Agents) — Read
AGENTS.md(includingSTATUS.md) before acting; don't rely on conversation history or guess from memory.STATUS.mdwill grow and no one will read all of it — so any binding decisions (calibration/exclusion lists/selected parameters) must be promoted toAGENTS.md§3 or the decision registry layer — a bounded, must-read position; don't leave them only in STATUS's long narrative. Before data extraction/modeling/reproduction, check this layer first; don't trust hardcoded values in a script. - Single Source for Key Numbers and Calibration Parameters, Prevent Drift — Key numbers (means/percentages/areas, etc.) are only written once in
STATUS.mdorAGENTS.md§3; elsewhere, reference, don't restate. Calibration parameters/sample sets/exclusion lists (which points are used, which are excluded, what threshold) are the same: extract into a single config (config/parameters.yamlor one authoritative table); all scripts read from it; hardcoding in multiple scripts is strictly forbidden — two scripts encoding the same set differently is the most insidious handoff accident source (self-checks won't catch it, format checks won't catch it either). Before handoff, verify consistency across all documents and scripts; if the same number differs by more than 1%, or the same set has inconsistent members, treat it as a bug and align before handing off. - Retire and Quarantine Bad Outputs and Superseded Scripts Together — When an agent's output is wrong (data/figure/number), immediately: ① rename the directory with a
_DEPRECATEDsuffix or move into a_archived/subdirectory; ② inAGENTS.md§5 Ironclad Rules, note at the top with red text> ⚠️ 【Deprecated】<path>(don't put it in §3 — §3 is cumulative snapshot; bad output markings should go in the same section as ironclad rules and conventions); ③ update §4 task board status to[x]+ note "deprecated"; ④ updateSTATUS.mdto reflect the deprecation; ⑤ old scripts/methods superseded by a decision are also retired — add a comment at the top of the script:# _DEPRECATED → see <authoritative script/decision>, so the next agent doesn't get lured into using it as a live calibration. Never rely on memory alone saying "don't use that" — a downstream agent silently reusing a bad output, or copying a calibration from a lagging script, is more fatal than producing nothing.
💡 A Real Handoff Lesson (These 3 Rules Came From This): An agent needed to re-fit a curve and copied a sample set from a lagging script — the script still retained bad points that should have been excluded, and the "exclude this point" decision was buried 600 lines deep in STATUS, with two scripts encoding it in opposite ways. The result: that point dragged R² from 0.5 down to 0.27, and the external report was overturned. In hindsight, three things could have stopped it: the decision wasn't promoted to a bounded must-read layer (rule 5), the calibration set was hardcoded in multiple scripts instead of a single config (rule 6), and the superseded old script wasn't marked as retired (rule 7). Trusting a lagging script over a decision record is the common root cause of such accidents.
Core Workflow (Complete Agent Handoff Cycle)
A typical multi-agent handoff lifecycle contains 5 explicit steps. Skipping step ③ (Independent Review) is the root cause of most pipeline contamination.
① Delegate → ② Execute + Self-Check → ③ Independent Review → ④ Accept & Archive → ⑤ Handoff & Record
Step Details
① Delegate (Controller → Executing Agent)
Use standard wording (see template below or assets/delegation_task_template.md): specify what to read, what to do, what not to touch, where to output, and where to log doubts.
② Execute + Self-Check (Executing Agent) Perform the task, then run through the DoD (acceptance checklist): verify output completeness, correct format, no errors.
③ Independent Review (Controller or Another Agent Spot-Checks Key Numbers) Don't trust self-checks — the executing agent's self-check may pass while the output is still wrong (this has been proven insufficient repeatedly).
- The controller or a third agent spot-checks key numbers: conservation (input sum ≈ output sum?), bounds (any out-of-range / unclipped values?), counts (row count / pixel count as expected?), magnitude (units off by 10³?), consistency (same number across documents consistent?).
- Pass → proceed to step ④; fail → return to the executing agent for repair, and record an ADR.
- Criterion: "Independent review passed" is the gate to the next step, not an option.
④ Accept & Archive
Confirmed-correct outputs are formally placed; update source.txt (if new data) and scripts/README.md (if new script).
⑤ Handoff & Record
Update AGENTS.md §3 Status + §4 Task Board + write STATUS.md. Ensure the next agent can continue using only the Markdown in the repo.
💡 For short pipelines (1–2 agents, simple outputs), step ③ can be skipped; for outputs affecting paper conclusions or downstream pipelines, all 5 steps are mandatory.
Two Layers of Continuity (Both Required)
- Hard Continuity (Primary Dependency): Markdown in the repo, tool-agnostic, readable by any agent/person. This is the source of truth.
- Soft Continuity (Enhancement): Memory layers (Cursor memory / Claude memory) speed up retrieval, but core conclusions must not live only in memory — they must land in Markdown.
Criterion: Delete all memory layers; the next agent should be able to continue using only the Markdown in the repo → compliant.
Standard Delegation Prompt for AI Agents
When delegating to a new agent each time, start with a consistent format — far more effective than free-form. Follow assets/delegation_task_template.md:
Please first read
AGENTS.md(includingSTATUS.mdto understand current status). Do not modify raw data () or existing core code (). This task only handles phase X. If you find doubts or new issues, record them in ; do not fix them directly. Output to . Known pitfalls for this task: [list known risk points] Pre-delivery self-check: [conservation/bounds/counts/magnitude…, check each item]
The core value of this template: when a new agent cold-starts, it immediately knows what to read, what not to touch, and where to report problems. The "known pitfalls" and "self-check" columns are battle-tested critical increments — guiding the agent to self-intercept common error types before reporting completion, significantly reducing defect rates.
For critical tasks affecting paper conclusions or downstream pipelines, append an Arrange independent review after delivery instruction at the end of the prompt (advanced example in the template's final section).
Delegation Prompt Travels with the Card (Recommended): Don't make the user fill in this wording each time — each task card has a built-in
📋 Delegation Prompt (Copy & Use)block (seeassets/task_plan_template.mdT1 end). When building the card, fill in the target, boundaries, inputs/outputs, known pitfalls, self-checks, and handoff instructions. When the user wants to delegate, they can directly copy that block and paste it to any agent (cross-tool, cross-skill), no need to write from scratch. Thedelegation_task_template.mdis only a reference for field meanings.
Advanced Sections (Enable as Needed, See references/advanced.md)
Beyond the core 7 sections, these become useful as a project grows. Don't pile them all in from the start:
- Decision Records (ADRs) — Record "why this method was abandoned," preventing the next agent from re-exploring the same dead ends and re-questioning settled decisions.
- Glossary — Project-specific terms/abbreviations; new agents don't have to guess.
- Progress Log — Timestamped change log, more granular than §Where We Are Now.
- Concrete DoD — Write DoD as executable commands, not just "done is done."
- Standard Handoff Summary — Status / Next Steps / Unresolved Risks / Key File Paths.
- Naming Conventions + Idempotency — Output files include
_v1/date/coordinate system; re-runnable scripts are idempotent (cache skip). - Environment Lock — Pin conda env with
environment.yml, preventing drift when rebuilding on a different machine. - Data Snapshots / Immutable Inputs — Raw data is read-only with a hash; all modifications happen on copies.
- Filled
AGENTS.mdExample —references/example_filled_AGENTS.md, a complete example (fictional project). It's much more intuitive to fill in from a filled example than from an empty template.
Custom Reminders
- This skeleton comes from real research projects (multi-agent, multi-dataset, long pipelines, cloud-synced). Tailor after copying: for pure front-end projects, you can cut the "working drive" part of §Path Conventions; for single-agent small script projects, simplify §Task Board.
- Template placeholders use
【TODO】uniformly; delete them after filling. - Thin pointer files all have the same content (see
assets/CLAUDE.md); don't write different rules in each — that breaks the "single source of truth." - Don't overwrite the user's existing
AGENTS.md; for Mode B diagnosis, read first, then modify, making incremental fixes.