| name | start-task |
| description | Instructions for working on a task in this repo. |
start-task
Instructions for starting work on a task in this repo in an isolated git worktree.
Inputs
task_name: A short human-readable task name.
Workflow
- Load and follow canonical agent instructions from
.agents/agents.md.
- Determine the repository root and repo name.
- Normalize
task_name into a safe slug.
- Lowercase.
- Replace spaces and underscores with
-.
- Remove characters that are not letters, numbers,
-, or /.
- Collapse repeated
-.
- Trim leading/trailing
-.
- Use branch name
{slug} unless the user explicitly requested another branch naming convention.
- Create the worktree at
{repo_root}/worktrees/{slug}.
- This path is relative to the repository root discovered in step 2, not relative to the current working directory.
- Do not create task worktrees under
{repo_root}/.agents/worktrees.
- Preflight checks before creating anything:
- Confirm the repo root exists and is a git repository.
- Print or otherwise verify the resolved target path is exactly
{repo_root}/worktrees/{slug} before running git worktree add.
- If
{repo_root}/worktrees/{slug} already exists, reuse it if it is attached to the intended branch; otherwise stop and report the conflict.
- If branch
{slug} already exists, create the worktree from that branch instead of failing.
- Create the worktree:
- If the branch does not exist: create it from the current default working branch.
- If the branch exists: attach the worktree to that branch.
- Change into the new worktree directory.
- Activate or create the matching mamba environment named
{slug}, then use mamba activate {slug}.
- Run one lightweight sanity check before starting work:
python -c "import {repo_name}"
- If the package import name differs from the repo name, use the package name used by the repo.
- Report:
- worktree path
- branch name
- activated environment
- whether the sanity check passed
Notes
- Use
{repo_root}/worktrees/ consistently.
- Do not modify or delete existing worktrees unless the user explicitly asks.
- If the repo already has unrelated uncommitted changes in the main worktree, leave them alone; creating a separate worktree is the isolation mechanism.