acstack 0.52.4 → 0.52.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "acstack",
|
|
3
3
|
"description": "Agentic coding stack where planning grows only as far as needed: a map of decisions, tasks, checks, and handoffs behind a pluggable tracker.",
|
|
4
|
-
"version": "0.52.
|
|
4
|
+
"version": "0.52.5",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "ac8318740"
|
|
7
7
|
},
|
package/README.md
CHANGED
|
@@ -284,7 +284,7 @@ What an effort leaves behind is what matters: updated specs, decision notes, and
|
|
|
284
284
|
| `/acstack:bridge` | Set up and operate the Playwriter cross-device browser bridge |
|
|
285
285
|
| `/acstack:visual-docs` | Write docs that lead with a diagram and derive structure from it (Minto pyramid) |
|
|
286
286
|
| `/acstack:new-worktree` | Create a git worktree off the remote base branch and continue the task inside it |
|
|
287
|
-
| `/acstack:teardown-worktree` | Retire finished worktrees
|
|
287
|
+
| `/acstack:teardown-worktree` | Retire finished worktrees, delete their merged local and remote branches, and clean build outputs in worktrees that stay |
|
|
288
288
|
| `/acstack:terminal-workspace` | Set up a keyboard-only terminal for driving agents on a dev machine |
|
|
289
289
|
|
|
290
290
|
## 6. Every agent
|
package/cli/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: teardown-worktree
|
|
3
|
-
description: "Retire finished git worktrees – move this session back to the main checkout, move the orchestrator's pane back to the main repo workspace, remove the checkouts,
|
|
3
|
+
description: "Retire finished git worktrees – move this session back to the main checkout, move the orchestrator's pane back to the main repo workspace, remove the checkouts, delete the merged local and remote branches, and offer to clean rebuildable build outputs in worktrees that stay. Scans the whole repo, not just the current worktree. Use whenever the user says \"tear down the worktree\", \"clean up worktrees\", \"remove this worktree\", \"delete the worktree and branch\", \"clean up stale worktrees\", \"free disk space from old sessions\", or otherwise wants finished worktrees and their branches gone."
|
|
4
4
|
argument-hint: "[worktree name, or nothing to scan the whole repo]"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Teardown worktree
|
|
8
8
|
|
|
9
|
-
Retire finished worktrees.
|
|
10
|
-
|
|
11
|
-
Move this session out first. Remove the worktrees next. Delete the branches they were on last.
|
|
9
|
+
Retire finished worktrees. Move this session out first. Remove the worktrees next. Delete the branches they were on last.
|
|
12
10
|
|
|
13
11
|
Removing a worktree this session is standing in, or one that still holds a running agent, destroys live work. The order below exists to prevent that, as far as either orchestrator can tell. Follow it.
|
|
14
12
|
|
|
@@ -24,9 +22,7 @@ One repo per run: the repo that owns the cwd. Resolve its main checkout from any
|
|
|
24
22
|
dirname "$(git rev-parse --git-common-dir)"
|
|
25
23
|
```
|
|
26
24
|
|
|
27
|
-
Submodules are separate repos with their own worktrees and their own remote.
|
|
28
|
-
|
|
29
|
-
If the repo has submodules carrying worktrees, say so. Offer a second run against each. Never scan them silently.
|
|
25
|
+
Submodules are separate repos with their own worktrees and their own remote. If the repo has submodules carrying worktrees, say so. Offer a second run against each. Never scan them silently.
|
|
30
26
|
|
|
31
27
|
## 1. Build the plan
|
|
32
28
|
|
|
@@ -38,11 +34,11 @@ List every worktree of the repo:
|
|
|
38
34
|
git worktree list --porcelain
|
|
39
35
|
```
|
|
40
36
|
|
|
41
|
-
Skip the main checkout. First settle who hosts this session and who owns each checkout, then classify each remaining worktree on the
|
|
37
|
+
Skip the main checkout. First settle who hosts this session and who owns each checkout, then classify each remaining worktree on the five checks that follow.
|
|
42
38
|
|
|
43
39
|
### Which orchestrator hosts this session, and which one owns each checkout
|
|
44
40
|
|
|
45
|
-
Settle both before the
|
|
41
|
+
Settle both before the five checks. A worktree orchestrator is a tool that opens panes and holds worktrees for you – herdr and Orca are the two this skill knows.
|
|
46
42
|
|
|
47
43
|
Two different facts drive this skill:
|
|
48
44
|
|
|
@@ -95,9 +91,11 @@ git -C <path> status --porcelain --ignore-submodules=all
|
|
|
95
91
|
|
|
96
92
|
Report pointer drift in the plan anyway, from `git -C <path> submodule status`. That way a real pending bump stays visible, and the ignore flag does not hide it.
|
|
97
93
|
|
|
98
|
-
Any output from the status check means skip.
|
|
94
|
+
Any output from the status check means skip. Do not remove it. Do not force it. List it at the end with what it holds.
|
|
95
|
+
|
|
96
|
+
### Ignored data
|
|
99
97
|
|
|
100
|
-
|
|
98
|
+
Removal deletes every file git ignores, forced or not, and the status check cannot see them. Follow `artifacts.md` step 1. Any preserve path, such as `.env` or Terraform state, means skip unless the user approves losing that named path.
|
|
101
99
|
|
|
102
100
|
### Merged
|
|
103
101
|
|
|
@@ -135,7 +133,9 @@ Nothing holds agent state, so nothing can confirm liveness. Classification then
|
|
|
135
133
|
|
|
136
134
|
### Show it
|
|
137
135
|
|
|
138
|
-
Print one table with
|
|
136
|
+
Print one table with seven columns: worktree, branch, whether the local branch goes, whether the remote branch goes, blocking panes, ignored data (each preserve path with its size, then the rebuildable total), and the reason.
|
|
137
|
+
|
|
138
|
+
Below the table, list the build outputs step 5 could clean in worktrees that stay. Then ask once: the user approves the removals and picks which cleans to run.
|
|
139
139
|
|
|
140
140
|
The blocking panes column names each pane that blocks the removal, pane id first and process name after – `w26:p2 claude` for example. Leave the cell empty when nothing blocks. The user then knows which pane to close.
|
|
141
141
|
|
|
@@ -147,9 +147,7 @@ Do this before removing anything, and only after approval.
|
|
|
147
147
|
|
|
148
148
|
So no tool call walks the session cwd back. `ExitWorktree` only unwinds a worktree this session entered with `EnterWorktree`. It is a no-op for a session that launched inside one.
|
|
149
149
|
|
|
150
|
-
The removal itself is what moves the session. Run it from the main checkout against an absolute path.
|
|
151
|
-
|
|
152
|
-
The harness then resets the session cwd to the main checkout on its own. Confirm with `pwd` afterwards.
|
|
150
|
+
The removal itself is what moves the session. Run it from the main checkout against an absolute path. The harness then resets the session cwd to the main checkout on its own. Confirm with `pwd` afterwards.
|
|
153
151
|
|
|
154
152
|
- Entered with `EnterWorktree`: call `ExitWorktree` with `action: "keep"` first. Keep, not remove: step 3 owns the removal, and `remove` refuses on a worktree entered by path.
|
|
155
153
|
- Launched inside the worktree: no call needed.
|
|
@@ -158,9 +156,7 @@ The harness then resets the session cwd to the main checkout on its own. Confirm
|
|
|
158
156
|
|
|
159
157
|
That much is the same everywhere. What follows depends on the branch `active` names. This step is the one place `active` still decides anything: how this session moves itself.
|
|
160
158
|
|
|
161
|
-
When `active` is `herdr`, follow `herdr.md` step 2 before you remove anything.
|
|
162
|
-
|
|
163
|
-
When `active` is `orca`, follow `orca.md` step 2. It leaves this session's own checkout in place.
|
|
159
|
+
When `active` is `herdr`, follow `herdr.md` step 2 before you remove anything. When `active` is `orca`, follow `orca.md` step 2. It leaves this session's own checkout in place.
|
|
164
160
|
|
|
165
161
|
### Host: none
|
|
166
162
|
|
|
@@ -172,11 +168,9 @@ Every removal through herdr or plain git passes `--force`. Orca is the exception
|
|
|
172
168
|
|
|
173
169
|
Plain `git worktree remove` refuses on any worktree containing submodules with "working trees containing submodules cannot be moved or removed". That refusal hits every worktree in a repo that has them.
|
|
174
170
|
|
|
175
|
-
Forcing is safe only because step 1 already proved the tree clean. It is never a way past uncommitted changes.
|
|
176
|
-
|
|
177
|
-
The hard rule: never run `worktree remove --force` on a workspace that still holds a pane other than this session's own. Forcing waives herdr's own check, so the pane enumeration is the only guard left.
|
|
171
|
+
Forcing is safe only because step 1 already proved the tree clean and its ignored data rebuildable or approved for loss. It is never a way past uncommitted changes.
|
|
178
172
|
|
|
179
|
-
Enumerate the panes again immediately before the call. Refuse the removal while any other pane remains.
|
|
173
|
+
The hard rule: never run `worktree remove --force` on a workspace that still holds a pane other than this session's own. Forcing waives herdr's own check, so the pane enumeration is the only guard left. Enumerate the panes again immediately before the call. Refuse the removal while any other pane remains.
|
|
180
174
|
|
|
181
175
|
Take the branch each checkout's `owner` names, not the branch `active` names. Decide per worktree: one checkout in the plan can belong to herdr while the next is plain git.
|
|
182
176
|
|
|
@@ -210,12 +204,17 @@ Use `branch -d`, never `-D`. If `-d` refuses, the merge test was wrong. Stop and
|
|
|
210
204
|
|
|
211
205
|
Skip the remote delete when nobody ever pushed the branch, or when merging the pull request already deleted it. The `git fetch origin --prune` from step 1 keeps a branch GitHub already removed from looking like work to do.
|
|
212
206
|
|
|
213
|
-
## 5.
|
|
207
|
+
## 5. Clean build outputs in kept worktrees
|
|
208
|
+
|
|
209
|
+
Only for worktrees that stay, whether step 1 skipped them or step 3 kept them, and only for the paths the user picked. Follow `artifacts.md` step 5. This step never retires a worktree, stops an agent, or closes a workspace.
|
|
210
|
+
|
|
211
|
+
## 6. Report
|
|
214
212
|
|
|
215
213
|
State what went and what stayed:
|
|
216
214
|
|
|
217
215
|
- Worktrees removed, with their branches
|
|
218
|
-
-
|
|
216
|
+
- Build outputs cleaned, with the space each freed, and the ones left because something was running
|
|
217
|
+
- Worktrees skipped, each with its reason: uncommitted work, preserve data it holds, an unmerged branch, a live agent or terminal, or the checkout this Orca terminal stands in
|
|
219
218
|
- Which live-agent checks ran against each worktree, and which did not, so nobody reads a missing check as a passed check
|
|
220
219
|
- Anything left for the user to decide
|
|
221
220
|
|
|
@@ -228,6 +227,9 @@ State what went and what stayed:
|
|
|
228
227
|
- Remove a workspace that still holds a pane other than your own.
|
|
229
228
|
- Reach for `EnterWorktree` to get back to the main checkout. It rejects the main working tree.
|
|
230
229
|
- Force past uncommitted changes. Skip and report instead.
|
|
230
|
+
- Read a clean status as proof the checkout holds nothing. It hides ignored files, and removal deletes them.
|
|
231
|
+
- Clean build outputs in a worktree with a live agent or process. Report the size instead.
|
|
232
|
+
- Remove a worktree, stop an agent, or delete a Docker volume only to reclaim disk space.
|
|
231
233
|
- Reach for `git branch -D` when `-d` refuses.
|
|
232
234
|
- Call a branch unmerged on the ancestor check alone. Check the pull request before deciding.
|
|
233
235
|
- Delete a remote branch with no merged pull request and no ancestor in an integration branch.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Teardown worktree: ignored data and build outputs
|
|
2
|
+
|
|
3
|
+
What to do with the files git ignores. `SKILL.md` step 1 lists them, and step 5 cleans build outputs in worktrees that stay. Each section names the step it belongs to.
|
|
4
|
+
|
|
5
|
+
## Why ignored data needs its own check
|
|
6
|
+
|
|
7
|
+
`git worktree remove` deletes every ignored file in the checkout, with or without `--force`, and says nothing. The uncommitted-work check cannot see them, because `git status` hides ignored paths.
|
|
8
|
+
|
|
9
|
+
Ignored does not mean disposable. `.env`, local databases, Terraform state, backups, notebooks, and review or design output are often ignored precisely because they are local and unique. Clean, merged, idle, and done are not proof either.
|
|
10
|
+
|
|
11
|
+
## Step 1 – list and classify
|
|
12
|
+
|
|
13
|
+
List the ignored paths, collapsed to directories, with their sizes:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
git -C <path> ls-files --others --ignored --exclude-standard --directory -z \
|
|
17
|
+
| xargs -0 -r -I{} du -sh -- "<path>/{}"
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Class each path as one of two things:
|
|
21
|
+
|
|
22
|
+
- **Rebuildable**: a tool-native command regenerates it from tracked files. The table below gives the common cases. Each one needs the tracked manifest or lockfile it names to exist in the checkout.
|
|
23
|
+
- **Preserve**: everything else. A generated-looking name or extension alone is not evidence. When unsure, preserve.
|
|
24
|
+
|
|
25
|
+
| Path | Rebuilt by | Needs tracked | Native clean |
|
|
26
|
+
|---|---|---|---|
|
|
27
|
+
| Cargo `target/` | `cargo build` | `Cargo.toml` | `cargo clean --manifest-path <path>/Cargo.toml` |
|
|
28
|
+
| `node_modules/` | `npm ci`, `pnpm install`, `yarn install` | the lockfile | `rm -rf <path>/node_modules` |
|
|
29
|
+
| `.next/`, `dist/`, `build/` | the project's build script | `package.json` naming that output | the project's `clean` script, or `rm -rf` the directory |
|
|
30
|
+
| `.terraform/providers/` | `terraform init` | `.terraform.lock.hcl` | `rm -rf <path>/.terraform/providers` |
|
|
31
|
+
| `__pycache__/`, `.pytest_cache/`, `.mypy_cache/`, `.ruff_cache/` | the next run | nothing | `rm -rf` the directory |
|
|
32
|
+
|
|
33
|
+
The listing collapses a wholly ignored directory to one line. Class that line by everything inside it, and list inside any directory that can mix the two classes:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
du -sh -- <path>/.terraform/*
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Only the `providers/` directory under `.terraform/` is rebuildable. The rest of `.terraform/`, `*.tfstate`, and `*.tfstate.backup` are state. Preserve them.
|
|
40
|
+
|
|
41
|
+
A Python virtual environment is preserve by default, even with a tracked requirements file. Packages installed by hand do not show up in it. Call it rebuildable only when the user confirms.
|
|
42
|
+
|
|
43
|
+
Prefer the project's own clean script when `package.json`, a `Makefile`, or `justfile` defines one. Read what it deletes first.
|
|
44
|
+
|
|
45
|
+
### What the sizes do and do not say
|
|
46
|
+
|
|
47
|
+
`du` reports allocated size. Hardlinked stores, such as pnpm's, free less than that when removed. A symlink costs nothing, and removal deletes the link, never its target.
|
|
48
|
+
|
|
49
|
+
Shared caches outside the checkout, such as `~/.cargo`, `~/.npm`, and the pip cache, serve every project. They are out of scope. Never clean them from a teardown.
|
|
50
|
+
|
|
51
|
+
### Data outside the checkout
|
|
52
|
+
|
|
53
|
+
Removal leaves behind what the session created elsewhere. Report the parts you can find. Never delete them from a teardown:
|
|
54
|
+
|
|
55
|
+
- Docker Compose containers and their volumes, when Docker is installed:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
docker ps -a --filter "label=com.docker.compose.project.working_dir=<path>" --format '{{.Names}} {{.Status}}'
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
- A Cargo target directory moved out by `CARGO_TARGET_DIR` or `.cargo/config.toml`
|
|
62
|
+
|
|
63
|
+
## Step 1 – what it means for the plan
|
|
64
|
+
|
|
65
|
+
Removing a worktree deletes everything ignored in it, so:
|
|
66
|
+
|
|
67
|
+
- Every ignored path rebuildable: the worktree can go. List the paths and total size in the plan.
|
|
68
|
+
- Any preserve path: skip the worktree. Name each preserve path and its size, so the user can move or delete it deliberately.
|
|
69
|
+
|
|
70
|
+
The user can approve losing a named preserve path in the plan. Only an explicit approval naming that path counts. A general yes to the plan does not.
|
|
71
|
+
|
|
72
|
+
## Step 5 – clean build outputs in kept worktrees
|
|
73
|
+
|
|
74
|
+
A worktree can be skipped from retirement and still hold gigabytes of build output. Cleaning that output is a separate decision from removing the worktree. It never retires the worktree, stops an agent, or closes a workspace.
|
|
75
|
+
|
|
76
|
+
Offer it for each kept worktree whose rebuildable paths total more than about 100 MB. List the paths, sizes, and the native clean command for each. The user picks which to run.
|
|
77
|
+
|
|
78
|
+
Clean a path only when step 1's live-agent checks found nothing running in that worktree. A live agent, editor, dev server, or build may be using the output, so report the size instead and leave it.
|
|
79
|
+
|
|
80
|
+
Rerun the live-agent checks immediately before each clean. Even then, finding no process is a snapshot, not a lock. Something can start using the path a moment later. Say so in the report rather than calling the clean safe.
|
|
81
|
+
|
|
82
|
+
Run the native command from the table, against absolute paths. Never run `git clean -X` or `git clean -x`. Either one deletes every preserve path along with the build output.
|