ck:worktree
Developmentck:worktree is an Agent Skill for development published in the phuc-nt/my-translator repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Create isolated git worktree for parallel development in monorepos.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/phuc-nt/my-translator/blob/HEAD/.opencode/skills/worktree/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/ck-worktree, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Git Worktree
Create an isolated git worktree for parallel feature development.
Workflow
Step 1: Get Repo Info
node .opencode/skills/worktree/scripts/worktree.cjs info --json
Parse JSON response for: repoType, baseBranch, projects, worktreeRoot, worktreeRootSource.
Step 2: Detect Branch Prefix
From user's description:
- "fix", "bug", "error", "issue" →
fix - "refactor", "restructure", "rewrite" →
refactor - "docs", "documentation", "readme" →
docs - "test", "spec", "coverage" →
test - "chore", "cleanup", "deps" →
chore - "perf", "performance", "optimize" →
perf - Default →
feat
Step 3: Convert to Slug
"add authentication system" → add-auth
"fix login bug" → login-bug
Max 50 chars, kebab-case.
Step 4: Handle Monorepo
If repoType === "monorepo" and project not specified, use AskUserQuestion:
AskUserQuestion({
questions: [{
header: "Project",
question: "Which project for the worktree?",
options: projects.map(p => ({ label: p.name, description: p.path })),
multiSelect: false
}]
})
Step 5: Execute
Monorepo:
node .opencode/skills/worktree/scripts/worktree.cjs create "<PROJECT>" "<SLUG>" --prefix <TYPE>
Standalone:
node .opencode/skills/worktree/scripts/worktree.cjs create "<SLUG>" --prefix <TYPE>
Options:
--prefix- Branch type: feat|fix|refactor|docs|test|chore|perf--worktree-root <path>- Override default location (only if needed)--json- JSON output--dry-run- Preview
Step 6: Install Dependencies
Based on project context, run in background:
bun.lock→bun installpnpm-lock.yaml→pnpm installyarn.lock→yarn installpackage-lock.json→npm installpoetry.lock→poetry installrequirements.txt→pip install -r requirements.txtCargo.toml→cargo buildgo.mod→go mod download
Commands
| Command | Usage | Description |
|---|---|---|
create | create [project] <feature> | Create worktree |
remove | remove <name-or-path> | Remove worktree |
info | info | Repo info with worktree location |
list | list | List worktrees |
Notes
- Script auto-detects superproject, monorepo, and standalone repos
- Default worktree location is smart: superproject > monorepo > sibling
- Use
--worktree-rootonly to override defaults - Env templates (
.env*.example) auto-copied with.examplesuffix removed