---
name: autonomous
description: Execute a complex task autonomously across multiple phases — plans collaboratively, then implements, tests, and reviews each phase independently
---

# Autonomous Mode

Execute a complex task end-to-end with collaborative planning followed by autonomous execution.

## Security Boundary

Autonomous mode is workflow orchestration only. It does not grant new tools, bypass approvals, change user/session/team permissions, or change credential access.

Shell execution, code execution, credential requests, OAuth requests, spreadsheet mutation, filesystem access, remote-control approval, and other sensitive tools continue to use the same runtime permission policy and approval gates as non-autonomous runs. Team and enterprise defaults apply identically in autonomous and non-autonomous runs.

## Phase 1: Collaborative Planning

First, work with the user to build a solid plan:

1. **Switch to plan mode** — use the `switch_mode` tool to enter plan mode.
2. **Understand the task** — understand the task and create a spec with the user.
3. **Draft a phased plan** — propose clean, modular, independently verifiable phases. Each phase should have:
   - A clear goal
   - Concrete acceptance criteria
   - What will be tested/verified
4. **Iterate with the user** — refine the plan based on feedback until the user approves.

Once the user approves the plan, switch to action mode and begin execution.

## Phase 2: Autonomous Execution

Create a progress folder at a sensible location relative to the workbook (e.g. next to it, or in a `.shortcut/autonomous/` directory). Write `plan.md` and `status.md` (see formats below), then begin executing.

### Execution Loop (per phase)

Each phase follows a three-step cycle:

1. **Implement** — write code/formulas, make changes to accomplish the phase goal.
2. **Test & verify** — write tests or verification steps that check the acceptance criteria against actual workbook state. Run them.
3. **Independent review** — after implementation and tests pass, refresh context and have the next agent session independently review the implementation against the acceptance criteria. The reviewer should not assume correctness — it should verify by reading the workbook and checking results.

If the review finds issues, iterate: fix → re-test → re-review (max 3 iterations per phase). Then update `status.md` and move to the next phase.

IMPORTANT: During Phase 2, do NOT hand control back to the user between steps or phases.

- Do NOT ask "what should I do next?" or any equivalent question.
- Do NOT stop after a single completed step unless the task is done, blocked, or requires explicit user approval.
- After every implement/test/review step, update `status.md`, determine the next step yourself from `plan.md` + `status.md`, and continue the loop autonomously.
- If a fresh context is useful, call `refresh_context` with a lightweight continuation note and the progress folder. The runtime will inject the autonomous continuation wrapper for the next session.

### Plan Format (`plan.md`)

```markdown
# Plan: <task description>

## Phase 1: <name>

- Goal: <what this phase accomplishes>
- Acceptance criteria:
  - <criterion 1>
  - <criterion 2>
- Verification: <how to test/verify>

## Phase 2: <name>

...
```

### Status Format (`status.md`)

```markdown
# Status

- Current phase: 2
- Status: in_progress
- Started: <timestamp>

## Phase 1: <name>

- Status: complete
- Summary: <what was done>
- Review: passed

## Phase 2: <name>

- Status: in_progress
- Step: implement | test | review
- Iteration: 1
```

### Calling refresh_context

Use `get_tool_info` and `execute_tool` to call `refresh_context`:

```
get_tool_info({ tool_name: "refresh_context" })
execute_tool({ tool_name: "refresh_context", parameters: {
  query: "Resume from plan.md and status.md and continue the autonomous task.",
  progressFolder: "<path>",
  thinkingLevel: "high"
} })
```

IMPORTANT: The query must be self-contained — the next session has NO memory of this conversation. Always include:

- A short continuation note for the next session
- The progress folder path via `progressFolder`
- If the next phase should run on a different model, pass `model`
- If the next phase needs a specific reasoning level, pass `thinkingLevel`
- Enough context to resume safely if the current phase has special constraints

The runtime will automatically prepend:

- The original user task
- The progress folder
- The autonomous skill invocation
- The standard continuation contract

## When to Stop

- All phases complete: update `status.md` to `done`, write a final summary, and stop (do NOT call refresh_context)
- Max 3 iterations per phase without passing review: mark phase as `blocked` in status.md and stop
- Unrecoverable error: update status.md with the error and stop

## First Step

Start by reading the user's request below, then switch to plan mode and begin collaborative planning.

$ARGUMENTS
