--- name: tasks description: Use when someone wants to turn a conversation or coding-harness plan into ArchDev Tasks, build a dependency graph, review a task plan in the browser, collect feedback and revise it until approved, or resume work on saved Tasks. --- # Tasks Use ArchDev Tasks as the shared plan and work record. You drive drafting, browser handoff, feedback collection, revisions, and save verification; the human reviews the plan in the web UI. This works from any coding harness and does not require Factory, a daemon, a resident agent, or `archdev setup`. ## Activity and risk ownership Follow the `archdev` skill for activity reporting. Plan/task lifecycle events retain their `risk.plan` / `risk.task` assessments. Server automation owns hosted PR and code-region grading: report PR events without fetching, waiting for, reusing, or attaching a server grade. No local assessment, annotation or stop hold is required. ## Epic identity and project membership An Epic has a stable `epc_` ID; its display name is not its identity. Retain that ID from an existing review, receipt, or a published member's `tasks show ` response (`task_epic`). The Task's `epic` field is the visible name or a legacy grouping label, not proof of first-class membership. Epic editing commands accept an exact unique name if the ID is unavailable; ambiguous names require the ID. Check `archdev epics --help`: it has no Epic create, list, or show verb. Graph output supplies Task IDs, not an Epic ID; inspect a returned member or retain the existing receipt rather than publishing a new graph just to discover an existing Epic. Keep Project membership separate: `project_id` belongs on each Task, stored as `metadata.archdev_project_id`, not on the Epic. Preserve existing IDs and metadata when editing Tasks. Before creating Tasks, search `archdev projects list --query ""` for an active project with the epic's exact name and the appropriate scope. Reuse it; if none fits, create it with `archdev projects create "" --description ""`. Resolve duplicate names by scope. Set both `--epic` and `--project` on task create/update. For graph import and review, set `epic` at graph level and `project_id` on every node. Preserve the project ID across name changes. Without an epic, select the project by product area or initiative. Older tasks and artifacts may omit these optional fields; new agent-authored work should include both. Project membership does not change task visibility. ## Draft, review, then publish Drafts and review requests are not runnable Tasks. Publish only on explicit human authorization after the required review. Review approval does not itself authorize claiming, execution, or Factory handoff; follow the originating thread's separate execution instructions. **In a Workbench thread**, use its canonical `task_review_publish` tool to submit the current draft for review in that originating thread. Retain its Epic ID and revision; the human approves the current revision's approval request. A chat reply, CLI import, project log, or kickoff record is not that approval. A changed draft requires approval again. `task_review_save` reads the matching receipt; it is read-only and does not approve, save, or retry. Require `saved` for the current revision before treating its Task IDs as published. If these tools are unavailable, return draft briefs to the thread assistant for review; do not bypass review by importing or claiming. **For standalone CLI review**, follow sections 4–5 below. The human's **Approve & save** authorizes saving that reviewed revision, not execution. `tasks graph import` without `--dry-run` writes and publishes Tasks; the payload's `action: "preview"` does not make it a preview-only operation. Use it only when that publication is explicitly authorized, not to evade review. For an existing Epic, these supported commands edit its draft and review: ```sh "$archdev" epics drafts put "$archdev" epics drafts blockers --blocked-on "$archdev" epics decisions put "$archdev" epics review request "$archdev" epics comments list "$archdev" epics comments resolve ``` Read installed command help and the draft/decision schema before writing files. Review request records a comment; it does not claim recipient notification or canonical thread approval. Resolve only addressed review comments after review, not merely to unblock saving. Unresolved comments block publication. Only after the required review and explicit human authorization: ```sh "$archdev" epics publish ``` Preserve the plan path, stable node keys, and durable receipt on retries. CLI file import and local review share a path-based receipt; revisions update the same Task identities. Do not use a copied plan path, a new receipt, or `--new` to bypass recovery or duplicate detection. Reconcile interrupted saves through the original receipt rather than replacing them with another Epic. ## Start branch A Task starts from the repository's `archdev.json` `origin.start_branch` (for example `stable`) unless something names another branch. Pick the branch only when the work must not start from the default: a fix that has to land on and rebase onto `main` while the repository's start branch is `stable`, or resuming a paused `needs_access` or host-environment Task from `main`. Do not set it on ordinary Tasks. Precedence, highest first: 1. PR label `archdev:start-branch:` (applies to that PR's remediation and rebase). 2. The Task's `archdev_start_branch` setting. 3. `archdev.json` `origin.start_branch`. Set it: - New Task: `archdev tasks create "" --start-branch main`. - Existing Task: `archdev tasks update --start-branch main`; clear it with `archdev tasks update --clear-start-branch`. - Plan nodes: `"start_branch": "main"` on the node. Omitting it keeps whatever the saved Task already has. - A person can edit it in the Task side panel on the ArchDev Tasks page. The value is a plain branch name (`main`, `release/1.2`); the CLI rejects anything else. It also sets the branch the dependency gate checks for that Task. `--start-branch` needs an ArchDev CLI newer than v0.55.9; on an older CLI `tasks create --help` does not list it, so upgrade rather than leaving it out. ## 1. Connect this machine Resolve the absolute directory containing this loaded `SKILL.md`, independently of the current repository. Its bootstrap installs ArchDev when missing and updates a CLI older than 0.49.6 or lacking review commands. Get approval before installing or upgrading software. The scripts never install or refresh hooks or change configuration scope. For initial ArchDev setup, follow [the agent installation guide](https://archdev.ai/install.md) and wait for the user's explicit placement choice. Capture bootstrap stdout, which is the executable's absolute path; diagnostics go to stderr. Bash/Zsh: ```sh archdev="$(bash /absolute/path/to/tasks/scripts/bootstrap.sh)" ``` Fish: ```fish set archdev (bash /absolute/path/to/tasks/scripts/bootstrap.sh) ``` Windows PowerShell: ```powershell $archdev = & powershell -NoProfile -File 'C:\absolute\path\to\tasks\scripts\bootstrap.ps1' ``` Commands below use `"$archdev"`; PowerShell uses `& $archdev` with the same arguments. If bootstrap fails, report its error and point to the [official installer](https://github.com/ArchAstro/archdev#install). 1. Run `"$archdev" auth status`. If signed out, run `"$archdev" auth login`, let the human finish browser sign-in, then check status again. 2. Read `"$archdev" tasks guide` and `"$archdev" tasks graph schema` for the installed CLI's contract. Read the schema's full output — do not truncate it (for example by piping through `head`) — it is the authority when it and this skill disagree. Prefer `--json` for output you need to parse. 3. Choose the destination from the user's request and existing context. Review defaults to the signed-in organization when present; without an organization it uses personal Tasks. For team work, supply a known `--team `; use `--repository ` when applicable. Confirm the destination before saving; if it is ambiguous, ask. Never guess an ID. 4. When resuming work, inspect the existing Tasks and local plan/receipt before creating another plan. `tasks list --team ` and `tasks show ` expose existing work; consult their help for other scopes. ## 2. Turn the source into a draft DAG A DAG is a task graph with prerequisite edges and no cycles. Draft locally first; opening review does not create runnable Tasks. In a Workbench thread, use canonical thread review above instead of standalone local review below. Do not pre-create every node with `tasks create`, or import it separately, before sending the same graph through review: approval owns publication. 1. **From conversation:** extract the requested outcome, agreed decisions, constraints, exclusions, and unresolved choices. Inspect relevant code when needed to make the tasks actionable. Do not invent requirements. 2. **From a harness plan:** read the actual plan artifact or harness-provided plan state. Translate its steps into graph nodes while preserving intent, acceptance criteria, references, and dependencies. A harness checklist is input, not a second task authority after saving. Use stable source IDs as node keys where possible; do not invent harness/session metadata. 3. Name tasks by observable outcome. Give each a concrete objective, acceptance criteria, and verification. For implementation work, name the planned end-to-end test file/scenario and the boundary and observable outcome it proves; identify any missing prerequisites honestly. **Smallest design that meets the outcome.** Search the code before writing a node. In `context`, give each implementation node: - `Extends:` the existing code it changes or reuses (path or symbol). - `Exemplar: `: the sibling implementation it copies. - `Size:` a rough estimate, for example "about 150 lines in 3 files". Write `acceptance` as concrete, checkable outcomes for the callers that exist today ("the 5 sharing mutations reject a private-result thread"), not absolute invariants ("every path", "no callable can bypass", "never"). A new mechanism needs a `Why not existing:` line saying why the current one is insufficient: a migration, a database trigger, a lock, a new OAuth or auth flow, a new module or service, a new protocol. Do not plan infrastructure for callers that do not exist yet. When two paths both work, pick the cheaper one and say why; use `major_decisions` only for a product or policy choice the code cannot settle. **Integration matrix.** A boundary is any place two sides run separately: process, pod or replica, service, network or load balancer, queue, database, external API, client/server version, OS. For any task that touches a boundary, `verification` must contain three entries: - `Integration matrix:` entry points x variations. Entry points are every way in: endpoints, sockets, messages, jobs, CLI verbs, callbacks. Variations are the ones that change behavior: placement (same or different instance), concurrency (one or many), ordering (in order, reordered, retried), failure (dependency down, timeout, restart or deploy mid-flight), version skew (old to new, new to old). State which cells the canonical e2e covers and which it does not. - `Fidelity:` what the test runs for real, what it fakes, and what the fakes share that production does not (a registry, a cache, a clock, one process). Code at the boundary under test must be the production code, not a test reimplementation of it. - `Not proven here:` each uncovered cell, with the task that proves it. That task must be a `depends_on` of the rollout or enablement node, or of the node that closes the epic, so the gap gates something. Write one `acceptance` bullet per matrix cell that matters, not one per feature. Example, a webhook consumer behind a queue with 2 workers: ```text Integration matrix: entry points: POST /webhooks, queue redelivery, replay CLI verb covered by tests/webhook.e2e.test.ts: POST on worker A, one event, in order not covered: delivery to worker B, duplicate delivery, worker restart mid-handler, consumer v1 reading a v2 payload Fidelity: real HTTP server, Postgres and queue; both workers run the production handler. The test uses one dedupe cache for both workers; production has one per worker. Not proven here: worker B and duplicate delivery -> task `webhook-multi-worker-e2e`, a depends_on of `webhook-enable`. ``` Motivating incident: a relay accept socket routed correctly only on the pod that owned it; the single-VM test shared the registry, the soak gated nothing, and the bug was found in production. Choose the simplest mechanism first, then write the matrix for it. The matrix covers the entry points that exist, and its size follows the mechanism: a row lock in five mutations needs fewer cells than a trigger on a hot table. Never pick a heavier mechanism (triggers, advisory locks, extra connections) because it makes the matrix easier to claim. 4. Add `depends_on` only where a task needs another task's result. Explain each edge with `dependency_reasons`. Leave independent tasks parallel. Every dependency must reference a node key in this graph; no self-edges or cycles. 5. Keep unresolved design choices in `major_decisions` for the human to review. Do not silently choose on their behalf when the choice changes scope. Write a UTF-8 JSON file at a stable path, such as `plans/task-review.json`. Use the graph schema's `action: "preview"` format. Required node fields are `key`, `title`, `objective`, `acceptance`, `verification`, `implementation`, and `risk`. - `implementation`: the abstract plan of attack, written without inspecting the whole codebase — numbered procedure steps, a high-level API sketch, a CLI verb/flags/outputs, or the algorithm. Use `###` or lower headings only; the Task keeps exactly one `## Implementation plan` section. Workers may later expand this same section. - `risk`: `{grade: "low"|"medium"|"high", notes?}`. Grade from system sensitivity, blast radius if the change is wrong, and how invasive the add is — easy additive work on a well-tested edge is low, a rewrite of auth, payments, or data-integrity is high. State the reason for the grade in `notes` (markdown, or a string array rendered as bullets). ### Write fields the review page can draw The review page renders Mermaid fences, Markdown tables, and leading labels as visuals. A reviewer scans those faster than paragraphs, so use them wherever the content already has that shape: | Content | Write it as | Field | |---|---|---| | A flow across actors: request path, lifecycle, retry, handoff | A ```` ```mermaid ```` `sequenceDiagram` of the failing path in `context`, and of the target path in `implementation`. When nothing fails today, draw only the target path | `context`, `implementation` | | A state change: status machine, lease, rollout | A `stateDiagram-v2` | `implementation` | | Components or data that depend on each other | A `flowchart LR` whose nodes are real modules, services, or tables | `context` or `implementation` | | A matrix or comparison: integration matrix, before/after, option trade-offs, config flags | A Markdown table, not nested bullets | any | | One item of evidence, a decision, or a precedent | A list item that starts with `Observed :` (runtime evidence; omit the date when unknown), `Current code:` (what the code does today), `Decision (, ):`, `Precedent:`, `Hypothesis:`, or `Prerequisite status:` | `context` | - Keep a diagram to the actors and messages this task changes: at most 5 participants with labels of a few words, and about 4–8 messages. A wider diagram shrinks to fit the column and its text becomes unreadable. Draw one diagram instead of a paragraph that narrates the same sequence. - Keep each implementation step to one or two lines. List the repository paths the task changes once in `scope` (files, directories, or git globs such as `src/api/export/`) instead of repeating them in every step. Write paths, not a prose label like `"Export API"`: the repository-rule check uses them to choose the rules for those languages and to read repository context, and a label matches no files. - Label a guess as `Hypothesis:`, not as an observation. - Write a field that holds a fence or a table as a string array, one line per entry, as in the example below. Such an array is joined as raw markdown, so start each list item in it with `- ` or `1. `. - Diagrams are optional. A one-file change, or a short linear procedure, needs none; a table or the numbered steps already show it. Mermaid that renders: declare `participant as