Purpose
Provide a simple, deterministic way for agents to create isolated worktrees and branches to work on an identified issue without contaminating runtime files at the repository root.
Instructions
- •
Prepare inputs
- •Required inputs:
- •work_item_id (string) — the work-item id (e.g.
SA-0ML0502B21WHXDYA) - •agent_name (string) — your agent name.
- •work_item_id (string) — the work-item id (e.g.
- •Required inputs:
- •
Execute the skill
- •Run the canonical script:
skill/create-worktree-skill/scripts/run.sh <work_item_id> [agent_name]
- •Run the canonical script:
- •
Observe outputs
- •The script prints status lines and writes diagnostics to
/tmpon failure (e.g./tmp/wl_init_out,/tmp/wl_init_err). It exits non-zero on unrecoverable failures.
- •The script prints status lines and writes diagnostics to
References to Bundled Resources
- •scripts/run.sh — canonical orchestration script at
skill/create-worktree-skill/scripts/run.sh.
Examples
Example invocations:
code
# preferred: pass agent name explicitly skill/create-worktree-skill/scripts/run.sh SA-0ML0502B21WHXDYA testA # agent name omitted: script derives a value skill/create-worktree-skill/scripts/run.sh SA-0ML0502B21WHXDYA
Expected result: a new worktree under .worktrees/ is created (named <agent>-<work_item_id>), a branch feature/<work_item_id> (or a unique variant if the branch is checked out elsewhere) is created/checked-out, Worklog is initialized in the worktree if necessary, and wl sync publishes the state so other worktrees can see the branch.
Security note
- •Do not commit runtime
.worklogDB files ornode_modules/into the repository branches; the skill intentionally avoids copying runtime artifacts between worktrees.
Examples for tests and CI
- •Use the included integration test to validate the skill in CI. Ensure CI performs repo-level
wl initor restores an initialized.worklogstate before running the integration test.