/task-orchestrator:adopt-project-scope [project name] [--dry-run]from task-orchestrator
Migrates an existing unscoped Task Orchestrator database to the project-scoping convention by creating a project anchor root, re-parenting work trees, and updating config.yaml. Use when adopting project scope for an existing database.
Ships in task-orchestrator. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Take an existing, unscoped database (many depth-0 roots, no project anchor) and migrate it in place to the project-scoping convention: one type=project root that owns the workspace's work trees, with its UUID written back to .taskorchestrator/config.yaml under a project: block. Global containers (retrospectives, observations) stay at depth 0; test artifacts are flagged for cleanup, never moved or deleted.
This is a destructive-by-execution skill: the EXECUTE step re-parents real items. It defaults to a dry run and never mutates anything without an explicit confirmation. It deletes nothing.
For a fresh workspace with no existing unscoped work, use /task-orchestrator:init instead; this skill is for databases that already hold unscoped work trees.
Not a director-mode skill: run it outside director mode (/task-orchestrator:director off); director-guard denies its file, shell and config steps partway through. Step 0 refuses to start when the session context says director mode is on, because a guard denial between the anchor create and the config write would leave a partial anchor.
Every tool call below is a to-call block, {tool, select|op, args}, in the shapes of call-shapes.md. The config tool is orchestration-profile only.
Non-goals: cross-DB consolidation (merging items from a second database); merging multiple existing project anchors into one; any server-side enforcement of scope. This skill adopts a single workspace's single database.
Director mode. When the session context says this session is in director mode, stop before anything else: tell the user to run /task-orchestrator:director off and re-run. Do not create the anchor first.
Project name — the first non-flag token(s) in $ARGUMENTS. If absent, do not guess; ask for it in Step 3 (the dry-run plan) via AskUserQuestion before any mutation.
--dry-run — if present, the skill stops after Step 3 (the plan) and performs zero mutations regardless of confirmation. The dry run is ALSO always rendered before execution even without the flag; the flag only forces an early exit.
Run these checks in order. Each abort prints a clear, user-facing reason and stops.
Read <main>/.taskorchestrator/config.yaml, where <main> is the parent of git rev-parse --path-format=absolute --git-common-dir (the same file Step 4(b) writes, correct from a linked worktree). If it contains a project: block with a non-empty rootId:, the workspace is already scoped:
◆ Workspace already adopted — config.yaml already points at project root <rootId>.
Nothing to do. Use /work-summary to inspect the existing project tree.
Stop. (If the file is missing entirely, that is fine — a fresh unscoped DB has no config project: block. Continue.)
{"tool": "items_read", "select": "list", "args": {"type": "project", "depth": 0}}
Drop any result tagged personal-root: a personal root is not a project anchor and must never be adopted as one.
No results → continue to 1c.
One or more results → do NOT silently create a second anchor. Offer, via AskUserQuestion:
config.yaml (skip anchor creation in EXECUTE; still re-parent MOVE roots under it) and continue.If the user picks "attach", record the existing anchor UUID as ANCHOR_ID and note that EXECUTE step (a) is skipped.
The config tool (orchestration profile) pushes the config in EXECUTE step (c). Do not probe it destructively here — just remember to attempt the push there and, if the tool is not served (a knowledge-profile connection) or fails with data.results[0].error.code forbidden (the credential lacks write-config), skip it with a note rather than failing the whole adoption. The local config.yaml write (step b) is the source of truth; the server push is a convenience sync.
Full depth-0 census:
{"tool": "items_read", "select": "overview", "args": {"excludeTerminal": false, "includeChildren": true, "limit": 200}}
If the response carries page.next, continue with that cursor until every root is listed so none is missed.
Read which types the server layer declares, so process items can be told apart from project work. config effective with no rootId returns the server config alone:
{"tool": "config", "op": "effective", "args": {}}
If data.results[0].types is empty, the server declares no types: an undeclared type is rejected only when the declared set is non-empty, so the project anchor create in Step 4 would succeed schema-free and the anchor would carry no schema. Point the user to /task-orchestrator:configure-server to mount the process-schema floor now, before the plan is confirmed; continue only if they choose to adopt without it.
Classify every depth-0 root into exactly one bucket:
| Bucket | Rule | Action |
|---|---|---|
| KEEP-GLOBAL | The root's type is declared by the server layer (from the effective call above) and is not container or project — e.g. agent-observation items, which are standalone depth-0 roots; OR a container root titled Session Retrospectives, Improvement Proposals or Retrospective Trends; OR a depth-0 type=project item tagged personal-root (never MOVE it). | Stays at depth 0. |
| MOVE | Any work container or work tree (a root with work/queue/review children), and any standalone work item. Everything that is real project work. | Re-parented under the new anchor. |
| CLEANUP-CANDIDATE | Evident test artifacts: titles containing probe, smoke, depth-test, zzprobe; or tags matching mtest-*. | Flagged only — never moved, never deleted. Recommend /batch-complete. |
Per MOVE root, read and record four things (they feed the plan; nothing is mutated). Open runs, the root's config head, its documents and its pending decision blocks:
{"tool": "runs_read", "select": "list", "args": {"rootId": "<move-root>", "limit": 50}}
Keep entries whose status is open or paused. A root with no per-root config answers not_found, which means "no head":
{"tool": "config", "op": "get", "args": {"rootId": "<move-root>"}}
{"tool": "docs_read", "select": "list", "args": {"rootId": "<move-root>", "limit": 50}}
{"tool": "items_read", "select": "blocked", "args": {"ancestorId": "<move-root>", "limit": 50}}
From the blocked list keep the explicit blocks whose reason is awaiting_decision. A config head that exists is per-root config that stops applying after the move. Documents stay keyed to the old root id; the count is inventory only.
Ambiguous roots (no clear rule match — e.g., an untagged standalone item that could be work or a stray container): do NOT guess. Collect them and present via AskUserQuestion (multiSelect) asking which should MOVE vs stay KEEP-GLOBAL. Test-artifact-looking items always go to CLEANUP-CANDIDATE without asking.
--dry-run stops here)Render the full plan before any mutation. Require explicit confirmation to proceed.
◆ Adopt Project Scope — Plan [project: "<name>"]
| Root | ID | Classification | Action |
|------|----|----------------|--------|
| Auth System | `a1b2c3d4` | MOVE | re-parent under new anchor |
| Payments | `e5f6a7b8` | MOVE | re-parent under new anchor |
| Session Retrospectives | `c9d0e1f2` | KEEP-GLOBAL | stays at depth 0 |
| Improvement Proposals | `13243546` | KEEP-GLOBAL | stays at depth 0 |
| zzprobe-smoke-tree | `5768798a` | CLEANUP-CANDIDATE | flag for /batch-complete (not moved) |
Summary: 2 move · 2 stay global · 1 cleanup candidate
Execution will create a "<name>" project anchor and re-parent 2 tree(s) under it.
Add to the plan, per MOVE root: its open or paused runs, its config head (version), its document count and its pending-decision blocks. Then apply these rules before the confirmation:
runs_write open refuses a non-root, so moving the root would strand the run; the server also refuses that move with invalid_request. The plan says so, per root.runs_read decisions with the anchor as rootId will not show it.config.yaml before the move or accept losing it: a per-root config on a root that is no longer a root stops applying.scope.root_ids, or JWT to_scope.root_ids, that names one of these ids must be re-scoped to the anchor before the next server restart. A token file fails startup on a non-root id; a JWT is refused with 401.AskUserQuestion before showing the final counts.--dry-run: stop here. State plainly: "Dry run — no changes made. Re-run without --dry-run to execute."AskUserQuestion:
◆ Proceed with adoption? This re-parents <N> tree(s) under a new project anchor.
1. Yes — execute
2. No — abort, make no changes
Wait for the answer. Only "Yes" proceeds.Perform in this order. Record pre-execution counts first (used by Step 5): the depth-0 root count, the MOVE count, and the KEEP-GLOBAL count from Step 2.
(a) Create the project anchor — skip if attaching to an existing anchor (Step 1b). The global floor declares project; if the create fails (call-level partial_failure) with data.results[0].error.code schema_violation and its detail.availableTypes lacks project (the server declares types, but not this one), follow the fallback in /task-orchestrator:init (offer container or adding project to the server file; never pick a type silently):
{"tool": "items_write", "op": "create", "args": {"title": "<project name>", "type": "project", "summary": "Project anchor — subtree scope for <project name>", "priority": "low"}}
Capture the new UUID as ANCHOR_ID.
(b) Write the project: block into config.yaml at the main checkout root (the parent of git rev-parse --path-format=absolute --git-common-dir, so it is correct from a linked worktree; refuse a home directory, as /task-orchestrator:init does) — read-modify-write, preserving ALL existing content:
<main>/.taskorchestrator/config.yaml text (create the file with just the block if it does not exist).work_item_schemas:, traits:, extensions:, comments, and formatting byte-for-byte intact):
project:
rootId: "<ANCHOR_ID>"
name: "<project name>"
project: key somehow already exists (it should not — Step 1a would have aborted), update its rootId/name in place rather than adding a duplicate key.(c) Validate, then push the config server-side (tolerant — see 1c). Use the file text with CRLF replaced by LF as configYaml. A root with no config fails config get with data.results[0].error.code not_found, which means "no head" (then omit expectedVersion):
{"tool": "config", "op": "get", "args": {"rootId": "<ANCHOR_ID>"}}
{"tool": "config", "op": "validate", "args": {"rootId": "<ANCHOR_ID>", "configYaml": "<full config.yaml text, LF>"}}
{"tool": "config", "op": "push", "args": {"rootId": "<ANCHOR_ID>", "configYaml": "<full config.yaml text, LF>", "expectedVersion": 1}}
validate reports a problem as valid: false with errors[{path, reason}]; show them and skip the push (the local file is saved). Relay warnings.data.results[0].error (call-level partial_failure): config_invalid on the push: show detail.errors[{path, reason}]; nothing was stored. version_conflict: read the head again and ask before retrying.config tool is not available or the call is forbidden, skip this step and note: "Config saved locally only — the server push was not possible; the local config.yaml is authoritative."(d) Batch re-parent the MOVE roots — one items_write call whose ops array holds one update per root (never a sequential call per root). The example shows one element; repeat it for each MOVE root in the same call:
{"tool": "items_write", "op": "update", "args": {"id": "<move-root-1>", "parentId": "<ANCHOR_ID>"}}
A 4.x server recomputes each moved subtree's descendant depths and root_id. Each moved tree is also repinned against the anchor's config head, which is why the config is pushed before this step (the reparent pin point; see Schema pins), so a tree whose items resolve a schema of a different lifecycle class under the anchor's config fails that element with invalid_transition and nothing is written for it. The call commits element by element: read the per-element results, report every failure by root with its data.results[i].error.code, and leave that root for the user to decide. The codes to expect: not_claim_holder (claimed by another holder: wait for the release, or have the holder release it), forbidden (the credential's scope does not cover the root or the anchor), version_conflict (re-read that root and retry it), invalid_transition (a lifecycle-class crossing under the anchor's config), invalid_request (a run was opened on the root after the plan was read: close it, then retry). Roots held for open runs are not in this call at all.
If the push in step (c) was skipped, tell the user that the moved trees are pinned to the server's config, and that after a later push they should run validate and offer repin per affectedInFlight.
Confirm the migration landed correctly. On ANY mismatch, report loudly and do NOT auto-rollback (say the remedy explicitly).
{"tool": "items_read", "select": "overview", "args": {"anchorId": "<ANCHOR_ID>"}}
The anchor's direct-child count must equal N move.{"tool": "items_read", "select": "overview", "args": {"excludeTerminal": false, "limit": 200}}
Expected depth-0 roots = KEEP-GLOBAL count + 1 (the anchor) + any CLEANUP-CANDIDATE roots left in place (cleanup candidates were flagged, not moved). Confirm the moved roots are no longer at depth 0.{"tool": "items_read", "select": "get", "args": {"itemId": "<grandchild-of-a-moved-tree>"}}
Render a before/after table:
✓ Adoption Complete — "<project name>" (anchor `<8-char-id>`)
| | Before | After |
|---------------------|--------|-------|
| Depth-0 roots | 5 | 4 |
| Under project anchor| 0 | 2 |
| Global containers | 2 | 2 |
| Cleanup candidates | 1 | 1 (flagged, not moved) |
↳ Config: project.rootId written to .taskorchestrator/config.yaml
↳ Server push: applied | skipped (tool absent or forbidden)
↳ Cleanup candidates flagged for /batch-complete: <titles>
On mismatch (e.g., anchored child count ≠ MOVE count):
⚠ Reconciliation mismatch — expected <X> children under the anchor, found <Y>.
No rollback was performed. To undo: re-parent the affected roots back to depth 0
with an items_write update that clears their parent, one element per root, then
delete the anchor. Investigate before retrying.
The undo element for one root clears parentId (a clear list, since parentId: null is not a valid value):
{"tool": "items_write", "op": "update", "args": {"id": "<moved-root>", "clear": ["parentId"]}}
Finish by seeding the bundled process rules for the new anchor: run /task-orchestrator:init (a re-run is idempotent and resumes at rule seeding), or rely on the next session's config-sync.
A pushed config takes effect immediately for new and unpinned items of the root; items already pinned keep their schema until items_write repin (see /task-orchestrator:manage-schemas).
AskUserQuestion "Yes".project: block is surgically inserted; all other content is preserved verbatim.not_claim_holder, forbidden, version_conflict, invalid_transition or invalid_request) is reported by code and left in place.Per the specification, exercise the skill against a COPY of a production-shaped DB:
Only after the copy passes should the skill be run against the real database.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub jpicklyk/task-orchestrator --plugin task-orchestrator20 skills in this plugin
/batch-completeCompletes or cancels many items at once, closing out a feature subtree or cleaning up old work; use when a user says: close out this feature, complete everything under X, cancel this workstream, clean up old items, bulk complete, finish this feature, or archive completed work./configure-serverConfigures how the MCP Task Orchestrator SERVER runs and is reached — transport (HTTP vs STDIO), the REST API, port publishing, config mounts, and config-sync. Use when a user says: run the server, register the image, set up the Docker container, enable the REST API, set up config-sync, reconfigure the server, change transport, expose the API, reconnect to a different endpoint, or allow a hostname. NOT for first-time onboarding (that's quick-start), NOT for project/personal setup (that's init), and NOT for note schemas / gates / traits (that's manage-schemas) — this skill only decides how the container is launched and reached. Caller identity is set by the REST auth mode (API_AUTH_MODE): this skill renders none and bearer; jwks is linked to the deployment docs, not rendered./create-itemCreates an MCP work item from conversation context, anchored in the right container (an observation is a standalone root) with a declared type and its queue notes pre-filled; use when the conversation surfaces a bug, feature idea, tech debt or observation worth tracking, or the user says: track this, log this bug, create a task for, or add this to the backlog.Other plugins' skills for the same job