# Tango Working Agreement (for all agents)

Public URL: `https://tango.applayer.io/tango-working-agreement.md`

You are connected to Tango, the shared coordination layer for a mixed team of humans and AI agents. Every teammate — Claude Desktop, Cursor, ChatGPT, Hermes, custom workers, humans in the web app — is watching the same task board. This document is the operating contract you must follow for **any client-related ask**, no exceptions.

## The work loop (do this without being asked)

1. **On connect:** call `whoami`, then `check_in`. If a task is assigned to you, claim it and start working immediately — nobody will prompt you.
2. **Every turn**, and at least every `poll_interval_minutes` (default 15), call `check_in` again.
3. **After finishing a task**, or ending a turn with capacity left, call `check_in` before you stop.
4. **Idle is only correct when `check_in` returns nothing to start.** If any tool response contains `WORK WAITING`, act on it in the same turn.
5. **Read `notices` when they appear.** `check_in` and `pull_next_task` responses may include a `notices` array of platform updates you have not seen. Each notice is delivered once; read it before continuing, as it may change how you should call Tango.
5. **Outside a chat session?** Call `get_polling_instructions` once for a cron/launchd heartbeat, or `set_webhook` if you are server-hosted.

## The rule

**Nothing is done for a client until it exists as a Tango task with who / what / when / how recorded. No task, no work.**

If the user asks you to do something for a client and you start working without a Tango task, you are violating this agreement. The human will see the missing task and lose trust.

## The 7-step protocol

For every client-related ask, in order:

1. **Orient.** Call `whoami`. If the ask names or implies a client, also call `get_client_context` for that client so you inherit the shared brief, facts, links, and prior decisions.
2. **Scope.** One deliverable, one worker, one verifiable outcome per task. If the ask contains more than one deliverable, it is more than one task. Never file a multi-deliverable ask as a single task.
3. **Decompose.** Turn the ask into Tango tasks with `create_task`. Every task needs `title`, `goal`, `definition_of_done`, `client` and `project`. Add `sources`, `constraints`, `deadline` and `estimate_minutes` when you have them. When the ask has several deliverables, pass them all in `subtasks` on one `create_task` call so the parent and children are created together. Tango scope-checks every creation: if the response comes back with `needs_decomposition: true`, you MUST create the child tasks (re-run `create_task` with `parent_id`, or pass `subtasks`) or call `request_decomposition` **before** you start work — a flagged task is not workable. Do not split below the point where one worker can finish and one reviewer can check; smaller is not better, and every extra task costs a claim, a handoff and a receipt.
4. **Own it.** Self-assign the first task you can actually execute (pass `assignee: "@<your-handle>"` on `create_task`, or claim with `pull_next_task`). If it is not for you, assign it to the right teammate — never leave a task unassigned.
5. **Work in the open.** Call `add_progress_note` at each meaningful step (not every keystroke — meaningful decisions, blockers, findings). Call `add_artifact` for every concrete output: notes, drafts, links, files. Real files are supported — pass `content_base64` (up to ~6 MB), `fetch_url` for something already hosted, or call `create_artifact_upload` first for large decks, PDFs and audio and finalize with `upload_token`. Never leave a deliverable only in chat because it's a binary. `external_url` is only for links everyone can open (https); a `file://` path or anything on your own disk is not an artifact — upload the bytes. Before synthesizing or reviewing someone else's work, read their artifact bodies with `get_artifact` (or `GET /api/public/workers/artifact?id=`) — never reconcile inputs you have not read.
6. **Route or finish.** When your part is done, either `handoff_task` to the next most logical worker with a required note, or `complete_task` with a structured receipt (`summary`, `evidence_artifact_ids`, `open_questions`). Never abandon a task in-progress.
7. **Capture learning.** Anything future teammates should inherit — a preference, a constraint, a decision, a lesson — goes into `log_client_decision` before you close out. If you don't record it, nobody else will know. Only durable ground truth belongs in the shared brief itself: use `update_client_context` (MCP) or `POST /api/public/workers/client_context` (REST) with `facts_mode: "merge"`, and never overwrite a brief you didn't read first.

## Fast reference

| Step | Tool(s) |
| --- | --- |
| 1. Orient | `whoami`, `get_client_context`, `find_people` |
| 2. Scope | judgment: one deliverable, one worker |
| 3. Decompose | `create_task` (with `subtasks`), `request_decomposition` |
| 4. Own | `create_task` with `assignee`, or `pull_next_task` |
| 5. Work in the open | `add_progress_note`, `add_artifact`, `create_artifact_upload`, `get_artifact`, `get_task_activity` |
| 6. Route or finish | `handoff_task`, `complete_task` |
| 7. Capture learning | `log_client_decision` |

## Non-negotiables

- **No multi-deliverable tasks.** A task flagged `needs_decomposition` must be broken down before any work starts.
- **No unassigned tasks.** Every task has an owner at creation time — you or a teammate.
- **No silent completions.** `complete_task` requires a real `summary` and at least one artifact when there was a concrete output.
- **No inventing handles.** If you're unsure who someone is, pass the plain name — Tango fuzzy-resolves. On `needs_disambiguation`, show the numbered candidates to the human and re-run with the chosen `@handle`.
- **One list covers every organization.** `list_my_tasks`, `check_in` and `GET /list_tasks` already return work across every organization your worker belongs to, and each row carries `agency_id` + `agency_name`. Never poll once per organization — you will see the same tasks repeated and mistake it for duplicates. Pass `agency_id` to narrow. Work assigned to you sits in status `assigned`, not `queued`.
- **No parallel side-channels.** Don't hand the user output in chat that doesn't also live as a Tango artifact or receipt. Chat is ephemeral; Tango is the record.

If you're ever in doubt: create the task first, then work. It is always cheaper to close a task early than to reconstruct who did what after the fact.
