diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index a94a396..b868296 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -94,7 +94,7 @@ { "name": "lets-finish", "source": "./", - "description": "Land finished work. Create a branch or worktree and open the PR if there is none, check its docs, changelog and tickets are current, wait for CI, get it independently reviewed, merge, update the tickets and beads it relates to, then clean up the branch and worktree. Use when the user says \"let's finish\", \"lets finish\", \"wrap up\", \"finish up\", \"ship it\", or invokes `/lets-finish`. Words after the command skip or stop steps, such as \"don't review\" or \"stop after CI\", \"and release\" or \"and deploy\" adds the project's release after the merge, \"clean\" cleans up without asking. Not for a question about status.", + "description": "Land finished work. Create a branch or worktree and open the PR if there is none, check its docs, changelog and tickets are current, wait for CI, get it independently reviewed, merge, update the tickets and beads it relates to, then clean up the branch and worktree. Use when the user says \"let's finish\", \"lets finish\", \"wrap up\", \"finish up\", \"ship it\", or invokes `/lets-finish`. Words after the command skip or stop steps, such as \"don't review\" or \"stop after CI\", \"and release\" or \"and deploy\" adds the project's release after the merge, \"clean\" explicitly requests the default automatic cleanup. Not for a question about status.", "strict": false, "skills": [ "./skills/lets-finish" diff --git a/.cursor-plugin/marketplace.json b/.cursor-plugin/marketplace.json index 0037621..c76a059 100644 --- a/.cursor-plugin/marketplace.json +++ b/.cursor-plugin/marketplace.json @@ -67,7 +67,7 @@ { "name": "lets-finish", "source": "./skills/lets-finish", - "description": "Land finished work. Create a branch or worktree and open the PR if there is none, check its docs, changelog and tickets are current, wait for CI, get it independently reviewed, merge, update the tickets and beads it relates to, then clean up the branch and worktree. Use when the user says \"let's finish\", \"lets finish\", \"wrap up\", \"finish up\", \"ship it\", or invokes `/lets-finish`. Words after the command skip or stop steps, such as \"don't review\" or \"stop after CI\", \"and release\" or \"and deploy\" adds the project's release after the merge, \"clean\" cleans up without asking. Not for a question about status.", + "description": "Land finished work. Create a branch or worktree and open the PR if there is none, check its docs, changelog and tickets are current, wait for CI, get it independently reviewed, merge, update the tickets and beads it relates to, then clean up the branch and worktree. Use when the user says \"let's finish\", \"lets finish\", \"wrap up\", \"finish up\", \"ship it\", or invokes `/lets-finish`. Words after the command skip or stop steps, such as \"don't review\" or \"stop after CI\", \"and release\" or \"and deploy\" adds the project's release after the merge, \"clean\" explicitly requests the default automatic cleanup. Not for a question about status.", "category": "workflow", "homepage": "https://github.com/killallgit/killall-skills", "version": "8.0.0" diff --git a/.github/plugin/marketplace.json b/.github/plugin/marketplace.json index a79c970..2e20526 100644 --- a/.github/plugin/marketplace.json +++ b/.github/plugin/marketplace.json @@ -95,7 +95,7 @@ { "name": "lets-finish", "source": "./", - "description": "Land finished work. Create a branch or worktree and open the PR if there is none, check its docs, changelog and tickets are current, wait for CI, get it independently reviewed, merge, update the tickets and beads it relates to, then clean up the branch and worktree. Use when the user says \"let's finish\", \"lets finish\", \"wrap up\", \"finish up\", \"ship it\", or invokes `/lets-finish`. Words after the command skip or stop steps, such as \"don't review\" or \"stop after CI\", \"and release\" or \"and deploy\" adds the project's release after the merge, \"clean\" cleans up without asking. Not for a question about status.", + "description": "Land finished work. Create a branch or worktree and open the PR if there is none, check its docs, changelog and tickets are current, wait for CI, get it independently reviewed, merge, update the tickets and beads it relates to, then clean up the branch and worktree. Use when the user says \"let's finish\", \"lets finish\", \"wrap up\", \"finish up\", \"ship it\", or invokes `/lets-finish`. Words after the command skip or stop steps, such as \"don't review\" or \"stop after CI\", \"and release\" or \"and deploy\" adds the project's release after the merge, \"clean\" explicitly requests the default automatic cleanup. Not for a question about status.", "strict": false, "skills": [ "./skills/lets-finish" diff --git a/skills/lets-finish/.cursor-plugin/plugin.json b/skills/lets-finish/.cursor-plugin/plugin.json index a0299d4..e135f61 100644 --- a/skills/lets-finish/.cursor-plugin/plugin.json +++ b/skills/lets-finish/.cursor-plugin/plugin.json @@ -1,4 +1,4 @@ { "name": "lets-finish", - "description": "Land finished work. Create a branch or worktree and open the PR if there is none, check its docs, changelog and tickets are current, wait for CI, get it independently reviewed, merge, update the tickets and beads it relates to, then clean up the branch and worktree. Use when the user says \"let's finish\", \"lets finish\", \"wrap up\", \"finish up\", \"ship it\", or invokes `/lets-finish`. Words after the command skip or stop steps, such as \"don't review\" or \"stop after CI\", \"and release\" or \"and deploy\" adds the project's release after the merge, \"clean\" cleans up without asking. Not for a question about status." + "description": "Land finished work. Create a branch or worktree and open the PR if there is none, check its docs, changelog and tickets are current, wait for CI, get it independently reviewed, merge, update the tickets and beads it relates to, then clean up the branch and worktree. Use when the user says \"let's finish\", \"lets finish\", \"wrap up\", \"finish up\", \"ship it\", or invokes `/lets-finish`. Words after the command skip or stop steps, such as \"don't review\" or \"stop after CI\", \"and release\" or \"and deploy\" adds the project's release after the merge, \"clean\" explicitly requests the default automatic cleanup. Not for a question about status." } diff --git a/skills/lets-finish/SKILL.md b/skills/lets-finish/SKILL.md index 9ca1550..737f0ed 100644 --- a/skills/lets-finish/SKILL.md +++ b/skills/lets-finish/SKILL.md @@ -1,6 +1,6 @@ --- name: lets-finish -description: Land finished work. Create a branch or worktree and open the PR if there is none, check its docs, changelog and tickets are current, wait for CI, get it independently reviewed, merge, update the tickets and beads it relates to, then clean up the branch and worktree. Use when the user says "let's finish", "lets finish", "wrap up", "finish up", "ship it", or invokes `/lets-finish`. Words after the command skip or stop steps, such as "don't review" or "stop after CI", "and release" or "and deploy" adds the project's release after the merge, "clean" cleans up without asking. Not for a question about status. +description: Land finished work. Create a branch or worktree and open the PR if there is none, check its docs, changelog and tickets are current, wait for CI, get it independently reviewed, merge, update the tickets and beads it relates to, then clean up the branch and worktree. Use when the user says "let's finish", "lets finish", "wrap up", "finish up", "ship it", or invokes `/lets-finish`. Words after the command skip or stop steps, such as "don't review" or "stop after CI", "and release" or "and deploy" adds the project's release after the merge, "clean" explicitly requests the default automatic cleanup. Not for a question about status. model: haiku argument-hint: "[PR numbers] [what to skip or where to stop]" --- @@ -20,8 +20,8 @@ has one. Without it, stop and tell the user what needs fixing. Read the words after the command as plain-language overrides. Skip the step the user names (`don't review` skips step 2, `no tickets` skips steps 4 and 5 and -the gate's ticket check, `don't clean up` skips step 7, `clean` runs step 7 -without asking) and stop after the step they name (`stop after CI`, `don't +the gate's ticket check, `don't clean up` skips step 7, `clean` explicitly +requests step 7's default automatic cleanup) and stop after the step they name (`stop after CI`, `don't merge`). Run every other step, except release (step 6), which runs only when the user's words name it (`and release`, `and deploy`, `release minor`, `deploy to staging`). An override covers step 0 too: `don't review` skips the review step 0 @@ -52,7 +52,10 @@ in the transcript, so the finished run reads top to bottom: - `[x]` the step failed. Print the reason and stop. With several PRs, steps 5 to 7 still run for the ones already merged. -No other narration between lines. +No other narration between lines, except the closing session retrospective +(step 8). Before ending the run, including an early stop or skipped cleanup, +run step 8 unless the user explicitly skipped it. This does not resume any +stopped landing steps. ## PRs @@ -318,23 +321,55 @@ because the merged branch is finished either way. ## 7. Clean up -Ask `Clean up branch(es) and worktree(s)? [y/n]` and wait for the -answer, unless `clean` was given: then go straight to **y**. - -- **n**: leave both. Stop. -- **y**: for each merged PR, from the main checkout (the first entry of - `git worktree list`; never from inside the worktree being removed): - 1. If the checkout holding the branch has uncommitted changes, or the - branch's tip (`git rev-parse `) is neither the merged - `headRefOid` nor an ancestor of it (`git merge-base --is-ancestor`), it - holds local commits the merge never saw: keep the branch and worktree - and say so. - 2. If the main checkout has the branch checked out, `git checkout - && git pull` first. If a linked worktree has it, `git worktree remove - `, then pull the default branch in the main checkout. - 3. `git branch -D `. The squash merge hides the commits from - `git branch -d`; the tip check above shows they landed. - 4. `git push origin --delete ` when the remote branch still exists - and the PR is not cross-repository (`isCrossRepository`). - - `[+] cleaned `. +Automatically remove this work's merged branches and linked worktrees; do not +ask for confirmation. Honor `don't clean up`. Never delete the default branch, +someone else's branch or worktree, or one with unrelated work or important +files that would be lost. When ownership or preservation is uncertain, keep +it and report the concrete reason rather than asking a routine cleanup question. + +For each merged PR, from the main checkout (the first entry of +`git worktree list`; never from inside the worktree being removed): + +1. Check ownership and worktree contents, including untracked and ignored + files that removal could discard. If the checkout has uncommitted changes, + important files, or the branch's tip (`git rev-parse `) is neither + the merged `headRefOid` nor an ancestor of it (`git merge-base + --is-ancestor`), keep the branch and worktree. Do not force-remove a + worktree or discard files to make cleanup pass. Print `[-] kept : + ` and continue with the other merged branches. +2. If the main checkout has the branch checked out, `git checkout + && git pull --ff-only` first. If a linked worktree has it, + `git worktree remove `. Locate the checkout actually holding the + default branch with `git worktree list` and pull there with `--ff-only`; + never pull an unrelated branch in the main checkout. If no checkout holds + the default branch, skip the pull and report it. If a removal, switch, or + pull fails, report it and keep the branch; do not proceed with deletion. +3. `git branch -D `. The squash merge hides the commits from + `git branch -d`; the tip check above shows they landed. +4. Delete the remote branch with an explicit lease: + `git push origin --force-with-lease=refs/heads/: + :refs/heads/` (one command). Run only when the remote branch still + exists, still points to the merged `headRefOid`, belongs to this work, + and the PR is not cross-repository (`isCrossRepository`). Otherwise keep + the remote branch and report why. If the lease is rejected because the + branch moved, keep it and report the reason; never retry without the lease. + +`[+] cleaned ` (state which local/remote branches and worktrees were +removed, and any retained). + +## 8. Session retrospective + +Review the session's available evidence and ask yourself: "Was there anything +discovered in this session that could have been optimized? Did we struggle on +a command or do something multiple times that should have been a script, +skill, or command?" + +Give a concise summary of concrete findings: the friction or repeated work, +and the reusable script, skill, command, or existing tool that could reduce it. +Keep it to at most three bullets. If nothing stands out, say "No clear +optimization opportunities found in this session." Do not invent findings or +claim to have reviewed unavailable session history. + +End by asking: "Would you like a further review of these optimization +opportunities?" Report only; do not start a deeper investigation or create or +change scripts, skills, or commands without the user's approval.