Skip to content
Sign in

deepwork

Multi-agent workflows on iii with the kanban board as the task list: parallel implementation tickets, tests and independent verification/review once per integrated wave, and bounded rounds. Code goals get a dev flow: autonomous reversible decisions with optional design/plan approval, tickets in isolated git worktrees, batch validation, a branch review and a kept branch unless you explicitly choose another finish.

Install0.7.2

# With the iii engine running

iii call directory::download-kit kit=iii/deepwork@0.7.2
421Installs
30Last 7 days
1Today
30 days

Exact versions are immutable. Every profile and skill is stored by its SHA-256, so updates show exactly what changed.

Deepwork Worker

deepwork-worker
agents/deepwork-worker.md

Hidden leaf: does one card phase or aggregate batch work phase, returns one result document without ticket comments, then stops. Never edits ticket fields. Base of every work tier (`deepwork-worker*`, `deepwork-impl*`).

Model
Inherited
Effort
medium
Extends
defaultbuilt-in
Icon
terminal
Color
blue
Visibility
Hidden from the picker
Preloaded skills0

No skills preloaded.

Preloaded functions9
  • kanban::ticket::getkanbanv0.2.7Schema

    Read one ticket with its comments and activity, its parent, its live subtasks and their progress. The activity is bounded to keep the result small: every comment.created entry plus the newest 50 other entries (activity_total says how many exist), and a changed text longer than 200 chars (a description edit) is cut to a prefix ending in [truncated, N chars; ...]. kanban::activity::list returns the full history and the full text. The id accepts the internal uuid or the human-readable key.

    request
    • idstringrequired

      Ticket uuid or human-readable key (KAN-1, case-insensitive).

    response
    • activityobject[]
      • actorstringrequired
      • atstringrequired
      • changesobject[]
        • fieldstringrequired
        • fromunknownrequired
        • tounknownrequired
      • comment_idstring
      • idstringrequired
      • seqinteger· uint64requiredmin 0
      • session_idstring

        The agent session whose turn made this change (`iii.session.id` in the call's baggage); absent for a person in the console or any caller outside an agent turn. See `session_links`.

      • ticket_idstringrequired
      • turn_idstring

        The turn of that session (`iii.message.id`).

      • typestringrequired

        ticket.created | ticket.updated | ticket.moved | ticket.deleted | ticket.restored | comment.created

    • activity_totalinteger· uint64requiredmin 0

      Activity entries the ticket has in total; `activity` holds fewer when older non-comment entries were left out (`kanban::activity::list` pages them all).

    • assigneestring

      Agent profile id.

    • childrenobject[]required

      Live subtasks by ticket number.

      • assigneestring
      • deleted_atstring
      • idstringrequired
      • keystringrequired
      • open_questionsinteger· uint64requiredmin 0
      • prioritystringrequired
      • project_idstring
      • release_idstring
      • statusstringrequired
      • titlestringrequired
    • commentsobject[]
      • answerany of
        any of (2)
        Variant 1
        • answer_textstringrequired
        • byany of
          Show 2 nested
          any of (2)
          Variant 1
          • channelstringrequired
          • userstring
          Variant 2
          valuenull
        • outcomestringrequiredenum answered, dismissed, withdrawn, expired_default, not_delivered
        Variant 2
        valuenull
      • authorstringrequired

        Agent profile id, or `user`.

      • bodystringrequired
      • created_atstringrequired
      • idstringrequired
      • parent_idstring

        Set for a reply; replies stay one level deep.

      • questionany of
        any of (2)
        Variant 1
        • aboutany of
          Show 2 nested
          any of (2)
          Variant 1
          • blocksstring[]
          • classstring
          • ticketstring
          • whystring
          Variant 2
          valuenull
        • asked_atinteger· int64required

          Unix epoch milliseconds, as stored by the harness.

        • question_idstringrequired
        • questionsobject[]required
          Show 4 nested
          • headerstringrequired
          • multi_selectboolean
          • optionsobject[]
            Show 3 nested
            • descriptionstring
            • labelstringrequired
            • recommendedboolean
          • questionstringrequired
        • session_idstringrequired
        Variant 2
        valuenull
      • recorded_bystring

        Agent profile that recorded a material choice without asking a person.

      • ticket_idstringrequired
    • created_atstringrequired
    • created_bystring
    • deleted_atstring

      Set when soft-deleted; the row stays on disk.

    • descriptionstring
    • idstringrequired

      Internal uuid.

    • keystringrequired

      Human-readable id, e.g. KAN-1.

    • labelsstring[]
    • open_questionsinteger· uint64requiredmin 0
    • orderinteger· uint64min 0

      Position inside its column.

    • parentany of

      The parent, deleted or not; `null` for a ticket that is not a subtask.

      any of (2)
      Variant 1
      • assigneestring
      • deleted_atstring
      • idstringrequired
      • keystringrequired
      • open_questionsinteger· uint64requiredmin 0
      • prioritystringrequired
      • project_idstring
      • release_idstring
      • statusstringrequired
      • titlestringrequired
      Variant 2
      valuenull
    • parent_idstring

      Uuid of the parent ticket. One level deep: a parent has no parent.

    • pillsobject[]

      Small icon-and-text badges another worker pins on the ticket (a due date, a priority, an alarm). Shown on the card and the ticket page.

      • iconstringrequired
      • textstringrequired
    • prioritystringrequired
    • progressobjectrequired

      Live children in the done column over live children that are not canceled.

      • doneinteger· uint64requiredmin 0
      • totalinteger· uint64requiredmin 0
    • project_idstring

      Uuid of the project (several tickets, independent of the release).

    • release_idstring

      Uuid of the release.

    • statusstringrequired

      Column id.

    • titlestringrequired
    • updated_atstringrequired
  • state::getstatev0.23.4Schema

    Read the value stored at a key in a state scope

    request
    • keystringrequired

      Identifier for the value within the scope.

    • scopestringrequired

      Namespace that groups related keys.

    response
    valuestring
  • state::compare-and-setstatev0.23.4Schema

    Atomically set a value only if it currently equals `expected` (omit `expected` to mean 'only if absent'). Returns { swapped, current }; on a miss `current` is the stored value, so the caller can recompute and retry.

    request
    • expectedunknown

      The value the caller believes is there. Omit to mean "expect absent" — the set-if-absent form.

    • keystringrequired
    • scopestringrequired
    • valueunknownrequired
    response
    • currentunknown

      What is actually stored, when the swap did not happen.

    • swappedbooleanrequired
  • shell::execidev0.13.8Schema

    Run a command in the foreground and return its full output. Put the program in `command` (string) and arguments in `args` (string[]), never argv in `command`. Host-only cwd/env/stdin reject S210 on a sandbox target. Errors return { code, message }; common: S216 host exec error, S300 VM boot failed, S200 in-VM failure.

    request
    • argsstring[]

      Arguments, in order (all strings). Omit/null to tokenize `command` shell-words style; pass an array (even empty) to use it verbatim.

    • commandstringrequired

      Program name (PATH-resolved) or path to an executable, as a string; put arguments in `args`.

    • cwdstring

      Working directory (host only, S210 on sandbox); jail-confined like shell::fs::* paths (S215 on escape), must be an existing directory.

    • envobject

      Per-call env values (host only, S210 on sandbox); exec-hijacking keys (PATH, IFS, HOME, LD_*/DYLD_*, …) reject the whole call S210.

    • stdinstring

      Bytes written to the program's stdin, then EOF (host only, S210 on sandbox); omit to leave stdin at /dev/null.

    • targetall of

      Where to run the command. Defaults to the host worker; pass `{ kind: "sandbox", sandbox_id }` to forward the call to a microVM.

      all of (1)
      Variant 1
      one of (2)
      Variant 1
      • kindstringrequiredenum host
      Variant 2
      • kindstringrequiredenum sandbox
      • sandbox_idstring· uuidrequired
    • timeout_msinteger· uint64min 0

      Per-call timeout in milliseconds, capped at the configured max; negative or fractional values fall back to the default.

    response
    • duration_msinteger· uint64requiredmin 0
    • exit_codeinteger· int32
    • stderrstringrequired
    • stderr_truncatedbooleanrequired
    • stdoutstringrequired
    • stdout_truncatedbooleanrequired
    • timed_outbooleanrequired
  • coder::read-fileidev0.13.8Schema

    Read a file. stat: true probes size/mtime/total_lines without content; line_from/line_to (1-based, inclusive) read a window of a file of any size; numbered: true prefixes absolute line numbers; paths[] (XOR path) batch-reads. Paths: relative to the primary root or absolute inside an allowed root (see coder::info).

    request
    • encodingall of

      Content encoding for full reads; `base64` returns the exact file bytes (encoded length is budgeted). C210 with stat/window/numbered.

      all of (1)
      Variant 1
      one of (2)
      Variant 1
      valuestringenum text
      Variant 2
      valuestringenum base64
    • line_frominteger· uint64min 1

      First line (1-based, >= 1) of a windowed read; windows keep files over max_read_bytes readable slice by slice. `path` mode only.

    • line_tointeger· uint64min 1

      Last line of the window, 1-based inclusive, >= `line_from`; omit to read from `line_from` to EOF. `path` mode only.

    • max_output_bytesinteger· uint64min 0

      Full-read byte budget (returned bytes, clamped to max_read_bytes); over budget fails C218 naming size/total_lines. C210 with a window.

    • numberedboolean

      Prefix each line with its absolute 1-based file line number (`N→`), matching coder::update-file line ops; C210 with `stat`. `path` mode only.

    • pathstring

      Single file to read; XOR with `paths` (C210 if both or neither is set).

    • pathsany of[]

      Batch of files to read in one call (bare path strings or window objects), processed in order against batch_read_budget_bytes; XOR with `path`.

      any of (2)
      Variant 1
      valuestring
      Variant 2
      • line_frominteger· uint64min 1

        First line of the window, 1-based inclusive (>= 1); defaults to 1 when only `line_to` is set.

      • line_tointeger· uint64min 1

        Last line of the window, 1-based inclusive, >= `line_from`; omit to read to EOF.

      • numberedboolean

        Prefix this entry's lines with their absolute 1-based line numbers (`N→`); prefix bytes count toward the batch budget.

      • pathstringrequired

        File to read.

      • statboolean

        Metadata probe for this entry: size/mode/mtime plus total_lines, content null, no budget consumed; C210 with a window or `numbered`.

    • statboolean

      Metadata probe: size/mode/mtime plus total_lines/is_utf8, no content; C210 with line_from/line_to/numbered/max_output_bytes.

    response
    • contentstring

      File content as a UTF-8 string — the whole file, or just the requested window when `line_from`/`line_to` was given (window lines keep their newline terminators). Binary content is returned with invalid bytes replaced by U+FFFD; request `encoding: "base64"` when exact bytes matter (content is then the file's bytes base64-encoded). **Single-path mode only; null when the request used `paths[]`.**

    • is_utf8boolean

      Whether `content` survived UTF-8 conversion without losing bytes. Reflects the RETURNED content only: a clean window inside an otherwise-binary file is still `true`. **Single-path mode only; null when the request used `paths[]`.**

    • lines_returnedinteger· uint64min 0

      Number of lines in `content`. For full reads this equals the file's total line count. **Single-path mode only; null when the request used `paths[]`.**

    • modeinteger· uint32min 0

      Unix permission bits (lower 9 bits of `st_mode`), e.g. 0o644. **Single-path mode only; null when the request used `paths[]`.**

    • more_linesboolean

      True when the file has content beyond what `content` includes: the window ended before EOF, or the byte budget cut the window short. Always false for full reads. **Single-path mode only; null when the request used `paths[]`.**

    • mtimeinteger· int64

      Last-modified time as a Unix epoch in seconds. **Single-path mode only; null when the request used `paths[]`.**

    • pathstring

      Canonical absolute path of the file read (resolved through the jail). **Single-path mode only; null when the request used `paths[]`.**

    • resultsobject[]

      Per-entry results for a batch `paths[]` request. **Present only when the request used `paths[]`; null in single-path mode.**

      • contentstring

        File content as a UTF-8 string — the whole file or the requested window. Binary bytes are replaced by U+FFFD (`is_utf8: false`). `null` on failure.

      • errorany of

        Structured error — present only when `success: false`.

        any of (2)
        Variant 1
        • codestringrequired

          Stable error code, e.g. "C211". See the README error table.

        • messagestringrequired

          Human/LLM-readable message: problem + actual values + corrective next call.

        Variant 2
        valuenull
      • is_utf8boolean

        Whether `content` survived UTF-8 conversion without losing bytes. `null` on failure.

      • lines_returnedinteger· uint64min 0

        Number of lines returned in `content`. `null` on failure.

      • modeinteger· uint32min 0

        Unix permission bits (lower 9 bits of `st_mode`), e.g. 0o644. `null` on failure.

      • more_linesboolean

        `true` when the file has content beyond what `content` includes (window ended before EOF, or byte budget cut the window short). `null` on failure.

      • mtimeinteger· int64

        Last-modified time as a Unix epoch in seconds. `null` on failure.

      • pathstringrequired

        Canonical absolute path of the file (resolved through the jail). If resolution failed, this echoes the caller's input verbatim.

      • sizeinteger· uint64min 0

        Size of the FILE in bytes (from metadata). `null` on failure or when the entry budget was exhausted before the file was opened.

      • successbooleanrequired

        `true` when the read succeeded (content/metadata fields are populated); `false` when an error occurred (only `error` is set).

      • total_linesinteger· uint64min 0

        Total lines in the file; present when the stream reached EOF during this entry's read. `null` when not traversed or on failure.

    • revisionstring

      Opaque identity of the file's exact bytes. Present for complete single-path reads only; pass it as `expected_revision` to `coder::create-file` for a conflict-safe whole-file overwrite.

    • sizeinteger· uint64min 0

      Size of the FILE in bytes (from metadata) — not the size of `content`; in windowed mode the two differ. **Single-path mode only; null when the request used `paths[]`.**

    • total_linesinteger· uint64min 0

      Total number of lines in the file. Present only when the read traversed the whole file: always for full reads; for windowed reads only when the stream naturally reached EOF within the byte cap. Never computed by forcing an extra full scan — absent means the file was not fully traversed. **Single-path mode only; null when the request used `paths[]`.**

  • shell::exec_bgidev0.13.8Schema

    Spawn a background job; returns { job_id, argv } immediately. Accepts the shell::exec payload plus optional job_id. Observe shell::on-job-finished with args { job_id } naming a fresh job_id before calling exec_bg with that same ID, or omit job_id to generate one. Duplicate retained IDs reject before execution. Host jobs ignore timeout_ms and use the configured background hard cap; read output with shell::status, list jobs with shell::list. Jobs have no terminal: a command that needs one fails, and a job that stays stopped is killed. Spawn-time failures are plain-string messages; later failures call shell::on-job-finished and appear in shell::status.

    request
    • argsstring[]

      Arguments, in order (all strings). Omit/null to tokenize `command` shell-words style; pass an array (even empty) to use it verbatim.

    • commandstringrequired

      Program name (PATH-resolved) or path to an executable, as a string; put arguments in `args`.

    • cwdstring

      Working directory (host only, S210 on sandbox); jail-confined like shell::fs::* paths (S215 on escape), must be an existing directory.

    • envobject

      Per-call env values (host only, S210 on sandbox); exec-hijacking keys (PATH, IFS, HOME, LD_*/DYLD_*, …) reject the whole call S210.

    • job_idstringmin 1 chars

      Optional non-blank ID for observing shell::on-job-finished before execution. Must be unique among retained jobs in this worker. Omit or pass null to generate a job-UUID automatically.

    • stdinstring

      Bytes written to the program's stdin, then EOF (host only, S210 on sandbox); omit to leave stdin at /dev/null.

    • targetall of

      Where to run: the host (default) or { kind: "sandbox", sandbox_id }.

      all of (1)
      Variant 1
      one of (2)
      Variant 1
      • kindstringrequiredenum host
      Variant 2
      • kindstringrequiredenum sandbox
      • sandbox_idstring· uuidrequired
    • timeout_msinteger· uint64min 0

      Per-call timeout in milliseconds; ignored by host background jobs, forwarded to sandbox targets.

    response
    • argvstring[]required
    • job_idstringrequired
  • shell::statusidev0.13.8Schema

    Fetch the full record (status, exit_code, timing, output) of a background job by job_id. A running host job shows the last 8 KiB of each stream, flagged truncated when there is more. Errors return { code, message }; common: S211 no such job.

    request
    • job_idstringrequired
    response
    • jobobjectrequired
      • argvstring[]required
      • exit_codeinteger· int32
      • finished_at_msinteger· uint64min 0
      • idstringrequired
      • started_at_msinteger· uint64requiredmin 0
      • statusstringrequiredenum running, finished, killed, failed
      • stderrstringrequired
      • stderr_truncatedbooleanrequired
      • stdoutstringrequired
      • stdout_truncatedbooleanrequired
  • shell::killidev0.13.8Schema

    Terminate a running background job by job_id (returned by shell::exec_bg). Errors return { code, message }; common: S211 no such job, S216 kill/signal delivery failure.

    request
    • job_idstringrequired
    response
    • job_idstringrequired
    • killedbooleanrequired
    • reasonstring
    • statusstringrequiredenum running, finished, killed, failed
  • harness::observeharnessv1.10.0Schema

    Observe a function for the current harness session: each time it runs, omit `target` to be notified in this session with what it returned, or name a non-harness `target.function_id` to call with it. Pass the function's `args` when it takes them and `filters` on its `input.<field>` to choose calls. Set `lifecycle.expires_in_ms` on every wake except a timer, to how long the work should take; a one-shot wake without it expires after 10 minutes with a notice. Returns `{ observer_id, once }`; a `note` is advice about the observer, which was created either way. Call-target results are discarded and do not return to this session.

    request
    • actionstring

      User-facing text saying what happened, shown with each delivery.

    • argsobject

      Args for the worker that hosts the function, a JSON object; its description says which it takes: cron `{ "expression" }`, database `{ "db", "table"?, "ops"? }`, `harness::on-timer` `{ "in_ms" }` or `{ "at" }` (epoch ms). Omit for a function that takes none.

    • conditionsobject[]

      Delivery-time gates, in order; each is an iii function answering `{ decision: "allow" | "skip", payload?, reason? }`.

      • configunknown

        Passed to the condition function AS its `condition_config`: give its fields (e.g. `id`, `expect`) directly, not wrapped in `condition_config`.

      • function_idstringrequired
    • filtersobject

      Which calls reach this observer, a JSON object of explicit operators on the call's fields: `{ "input.scope": { "$eq": "run" } }`.

    • function_idstringrequired

      The function to observe: `state::on-changed`, `cron::on-tick`, `harness::on-timer`, `database::on-row-changed`, or any other function. What it returns is the event.

    • labelstring

      A short human label echoed back in the notification text.

    • lifecycleany of

      When the observer stops delivering; top-level `once` is the shorthand.

      any of (2)
      Variant 1
      • expires_in_msinteger· int64

        Relative deadline: the observer stops this many milliseconds after it was created (the only deadline form). Set it on every wake except a timer, to how long the work should take: if nothing fires by then, the session is woken with a notice. A one-shot wake without it expires after 10 minutes.

      • max_firesinteger· uint64min 0

        Lifetime delivery budget; the observer is removed on its Nth delivery.

      • onceboolean

        Remove the observer after its first delivery (same as top-level `once`).

      Variant 2
      valuenull
    • namespacestring

      Where the function is hosted; omitted: this harness's namespace, then `default`, then Compose's.

    • onceboolean

      Remove the observer after its first delivery; defaults to true for a wake (no `target`) and `harness::on-timer`, false for a call target and `cron::on-tick`.

    • targetany of

      The function called with each event: `{ function_id, payload?, event_into? }` — the fixed payload and the JSON pointer where the event is injected into it (default `/event`). Omit it to be notified in this session instead. `harness::spawn` is never a valid target.

      any of (2)
      Variant 1
      • event_intostring

        JSON pointer where the event lands inside the payload (default `/event`).

      • function_idstringrequired
      • payloadunknown

        Payload template; the delivered event is injected into it at `event_into`.

      Variant 2
      valuenull
    response
    • notestring

      Advisory only — the observer was CREATED. Says what applied by default or what looks suspicious in its wiring (e.g. a filter naming a key someone already wrote). Read it and act on it if it applies.

    • observer_idstringrequired
    • oncebooleanrequired

      The effective `once` flag applied (after the per-function default).

System prompt

4,911 bytes
agents/deepwork-worker.md

Deepwork Worker

You do exactly one card phase or one aggregate batch work phase for a deepwork lead, then stop.

Decide routine implementation details with the simplest in-scope reversible default and note material assumptions in evidence; do not block on naming, layout or test selection. Scope, acceptance, permission boundaries and human-only questions remain binding.

  1. Read first. On a card task, call kanban::ticket::get on your ticket at the start of every task, a Retry included, even if an earlier read is in your transcript: comments added since then steer this attempt. For an aggregate task, read EVERY card named by Batch: before doing work (not ticket R), then fetch every Inputs: state reference as the task directs. Descriptions are the brief; comments by authors other than deepwork* are human notes. If any required ticket read fails, write failed with summary ticket read failed: <error> (never blocked) and stop. A Retry: line carries every reason the last attempt was rejected. The newest task wins.
  2. Scope. Do only the Deliverable; Out of scope is binding. If you are blocked on a question only a human can answer, write blocked with a question instead of doing half the work. A missing input that another ticket produces is failed with summary waiting for <KEY>, not blocked. If a call you need is denied, write blocked with question: "allow <function id>".
  3. Finish.
    • Do not comment on phase start/end, checks, tool calls, retries, success or failure. Return all evidence and questions in state; the orchestrator consolidates the ticket handoff.
    • Make one state::compare-and-set to the exact scope and key in your task, with a non-null object as the value. Never pass expected.
    • swapped:false: if current.item is your key, it is already written: stop. Otherwise a sibling took your key: make one more state::compare-and-set to the same scope with key <your key>.dup, the same value and no expected, then stop whatever it returns. Never retry with expected.
  4. Result document, at most 1 KB not counting result, new_items and loose_ends (each brief ≤ ~400 B; list at most the count your brief allows). item is the exact key in your task (code or work), not the ticket key:
    {"item":"<the key in your task, e.g. code>","status":"done|blocked|failed","summary":"≤60 words; say what was NOT verified","result":<the brief's Result schema, or null>,"evidence":["<check>: <observed>"],"new_items":[{"title":"…","brief":"Deliverable / Acceptance + Verify lines / Out of scope","after":["<title of another new item, or a ticket key, whose output it needs>"]}],"loose_ends":["<file>:<line>: <what you noticed>"],"question":"only when blocked"}
    new_items is work the goal still needs; loose_ends: what you noticed and the goal does not need, one line each with <file>:<line>. Not a loose end: a bug in code this run changed or a one-line fix inside your own Files: (fix it in this phase, or report it as a new_item); a check you could not run (say so in summary); a commit-message nit; harmless undocumented behaviour. Never leave either only as a TODO comment. Put long evidence in a file and give its path.
  5. Rules. Never change ticket status, labels, assignee, title or description: the orchestrator owns them. Write before the Deadline in your task; a result written after it is lost. If the work cannot finish by then, write failed with the reason instead of starting it. A command over ~90 s runs as a long run: follow the recipe in your Functions line. Don't leave a shell::exec_bg job running past your write (shell::kill it first): an older harness does not end it when you are stopped. Call shell::exec as {command, args[]}; never put a whole shell line in command. In the dev flow, run a Verify line with cwd = your Worktree (a cwd the line gives is a subfolder of it). With a Worktree: in your task, work only inside it (cwd and every path) and never run git push, merge, rebase, reset, checkout, switch, stash, clean, restore, revert, rm -r, tag, worktree or branch: siblings share the worktree. Ignore the claim, done-watch and cron steps in kanban/tickets/*. After the write, end your turn with exactly one line, <KEY> <status>: written, and nothing else.

Search the registry

Find workers, kits and executables, or jump to a page.