$npx -y skills add multica-ai/multica --skill multica-autopilotsUse when creating, updating, inspecting, triggering, or debugging Multica autopilots. Covers the full chain: schedule/webhook/manual trigger, create_issue vs run_only execution, agent/squad leader admission, runs, created issues/tasks, webhook URL rotation, and side-effect bounda
| 1 | # Multica Autopilots |
| 2 | |
| 3 | ## Quick start |
| 4 | |
| 5 | Autopilots are durable automations. Read before mutating: |
| 6 | |
| 7 | ```bash |
| 8 | multica autopilot list --output json |
| 9 | multica autopilot get <autopilot-id> --output json |
| 10 | multica autopilot runs <autopilot-id> --output json |
| 11 | ``` |
| 12 | |
| 13 | Do not run `trigger`, `delete`, `trigger-delete`, or `trigger-rotate-url` to test. Those are real side effects. |
| 14 | |
| 15 | ## Core model |
| 16 | |
| 17 | An autopilot is not an agent. It is a rule that dispatches work to an agent, or to a squad's leader agent. |
| 18 | |
| 19 | The chain is: trigger fires (`schedule`, `webhook`, or `manual`) -> `autopilot_run` row -> `execution_mode` decides output -> assignee readiness check -> issue/task execution -> run status sync. Webhooks have a durable admission step in front: HTTP ingress stores a queued `webhook_delivery`, synchronously creates or reuses its idempotent run, and returns `200` with `status=accepted|skipped` plus `run_id`; a database-leased worker then resumes accepted runs and owns recoverable issue/task dispatch. |
| 20 | |
| 21 | Execution modes: |
| 22 | |
| 23 | - `create_issue` creates a Multica issue, making the run visible as issue state. |
| 24 | - `run_only` creates an agent task directly. No issue is created; any durable |
| 25 | report location has to come from other task context or instructions. |
| 26 | |
| 27 | `issue-title-template` only supports `{{date}}`. Do not invent `{{trigger_id}}`, `{{branch}}`, or other variables. |
| 28 | |
| 29 | ## CLI |
| 30 | |
| 31 | ```bash |
| 32 | multica autopilot list --output json |
| 33 | multica autopilot get <autopilot-id> --output json |
| 34 | multica autopilot create --title "<title>" --description "<task prompt>" --agent <agent-name-or-id> --mode create_issue|run_only --output json |
| 35 | multica autopilot update <autopilot-id> --status active|paused --output json |
| 36 | multica autopilot runs <autopilot-id> --output json |
| 37 | multica autopilot trigger-add <autopilot-id> --kind schedule --cron "0 9 * * *" --timezone Asia/Shanghai --output json |
| 38 | multica autopilot trigger-add <autopilot-id> --kind webhook --label "ci" --output json |
| 39 | multica autopilot trigger <autopilot-id> --output json |
| 40 | multica autopilot trigger-rotate-url <autopilot-id> <trigger-id> --yes --output json |
| 41 | ``` |
| 42 | |
| 43 | Use `trigger` only when the user explicitly asks for a manual run. Use `trigger-rotate-url` only when rotating a webhook URL; the old URL stops being valid. |
| 44 | |
| 45 | Webhook trigger output can include a URL/token. Do not paste webhook tokens or signing material into comments, logs, docs, or PRs. Redact secrets. |
| 46 | |
| 47 | ## Debugging |
| 48 | |
| 49 | For "why didn't it run": |
| 50 | |
| 51 | 1. `multica autopilot get <id> --output json` — status, mode, assignee, triggers. |
| 52 | 2. `multica autopilot runs <id> --output json` — run status and failure reason. |
| 53 | 3. If assigned to a squad, inspect the squad: `multica squad get <squad-id> --output json`; execution goes to the leader. |
| 54 | 4. Inspect the target agent/runtime: `multica agent get <agent-id> --output json` and `multica runtime list --output json`. |
| 55 | 5. For webhooks, inspect delivery status: `queued` means the worker has not completed dispatch; `failed` carries the worker error. A provider retry with the same `X-GitHub-Delivery` / `Idempotency-Key` reuses the original delivery. |
| 56 | 6. For `create_issue`, inspect the created issue if the run records one. |
| 57 | |
| 58 | ## Side effects |
| 59 | |
| 60 | These mutate durable state or start work: `create`, `update`, `delete`, trigger add/update/delete/rotate, `trigger`, and webhook calls to `/api/webhooks/autopilots/{token}`. |
| 61 | |
| 62 | More source-backed details: `references/autopilots-source-map.md`. |