# Kirocrew Worktree Dev

HARD RULE for developing the Kiro Crew source repo ITSELF (not users' projects)...

- Repository: https://github.com/kirodotdev/KiroCrew (4711 stars)
- Category: Git and review
- License: Apache-2.0
- Last updated: 2026-11-01
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add kirodotdev/KiroCrew --skill kirocrew-worktree-dev -g -a claude-code -y`
Codex: `npx skills add kirodotdev/KiroCrew --skill kirocrew-worktree-dev -g -a codex -y`
Cursor: `npx skills add kirodotdev/KiroCrew --skill kirocrew-worktree-dev -g -a cursor -y`
Gemini CLI: `npx skills add kirodotdev/KiroCrew --skill kirocrew-worktree-dev -g -a gemini-cli -y`

## Description

HARD RULE for developing the Kiro Crew source repo ITSELF (not users' projects): develop, build and verify in a git worktree, never against the live gateway. Covers env setup, main-clone sync, build/dist ordering, flags, previews, cleanup, publish authorization; kirocrew-prepare-pr owns PRs.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Kiro Crew worktree development

This skill applies ONLY to the Kiro Crew source repository or a worktree of it.
Ignore it for other projects. One feature uses one dedicated worktree containing
both `src/kiro_crew/` and `website/`, including backend-only changes.
Never edit the live checkout or start/stop the live gateway from a feature session.

## Worktree and environment

```bash
# From the main clone; skip creation when already in the assigned worktree.
git fetch origin main
git worktree add ../kirocrew-wt-<name> -b feat/<name> origin/main
cd ../kirocrew-wt-<name>
python3 -m venv .venv
.venv/bin/pip install -e ".[voice]" --group dev
cd website && npm ci && cd ..
git worktree list
```

To bring the main clone itself current (the first path `git worktree list`
prints), fast-forward it and nothing else:

```bash
git -C <main clone> symbolic-ref --short HEAD   # must print main
git -C <main clone> fetch origin main
git -C <main clone> merge --ff-only --no-autostash --no-overwrite-ignore origin/main
```
It refuses, changing nothing, when local `main` has diverged or a local change
would be overwritten; then stop and report, because that state belongs to whoever
left it. Before any rebase, checkout, switch, merge, pull or reset in a clone,
run `python3 <this skill>/scripts/live_checkout_guard.py <clone>`. Exit 30 (or 2):
a running gateway runs from it, so make a worktree; the operator's dashboard
Update syncs that clone. Never overlay a whole tree with `git checkout <ref> -- .`
or `git restore --source <ref> .`: neither moves HEAD, both overwrite local edits
without asking, and the checkout form keeps every file upstream deleted. Never
`git stash`: every worktree shares one stash list, so a pop can apply another
session's work.

The rest: https://github.com/kirodotdev/KiroCrew/blob/HEAD/src/kiro_crew/builtin_skills/kirocrew-dev/kirocrew-worktree-dev/SKILL.md
