thachvd-kit 1.0.37 → 1.0.39
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.
- package/LICENSE +21 -21
- package/README.md +303 -11
- package/THIRD_PARTY_NOTICES.md +49 -49
- package/bin/cli.js +1791 -1785
- package/bin/config.js +164 -0
- package/bin/entry.js +11 -1
- package/bin/native-skills.js +183 -149
- package/bin/spec-doctor.js +252 -0
- package/bin/spec-link.js +97 -0
- package/bin/spec-recipe.js +74 -0
- package/bin/spec-site.js +639 -0
- package/bin/spec-state.js +415 -0
- package/bin/spec.js +901 -0
- package/bin/upgrade.js +303 -303
- package/package.json +3 -3
- package/skills/finishing-a-development-branch/SKILL.md +240 -240
- package/skills/requesting-code-review/code-reviewer.md +198 -198
- package/skills/subagent-driven-development/SKILL.md +574 -574
- package/skills/subagent-driven-development/implementer-prompt.md +154 -154
- package/skills/subagent-driven-development/re-review-prompt.md +115 -115
- package/skills/subagent-driven-development/scripts/review-package +53 -53
- package/skills/subagent-driven-development/scripts/review-package.js +52 -52
- package/skills/subagent-driven-development/scripts/sdd-workspace +82 -82
- package/skills/subagent-driven-development/scripts/sdd-workspace-lib.js +62 -62
- package/skills/subagent-driven-development/scripts/sdd-workspace.js +15 -15
- package/skills/subagent-driven-development/scripts/task-brief +43 -43
- package/skills/subagent-driven-development/scripts/task-brief.js +46 -46
- package/skills/subagent-driven-development/task-reviewer-prompt.md +207 -207
- package/skills/system-discovery/SKILL.md +140 -0
- package/skills/system-reverse-engineer/SKILL.md +208 -0
- package/skills/system-spec-review/SKILL.md +177 -0
- package/skills/upstream.json +30 -30
- package/skills/using-git-worktrees/SKILL.md +175 -175
|
@@ -1,175 +1,175 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: using-git-worktrees
|
|
3
|
-
description: Use when the user explicitly wants an isolated workspace, especially for parallel feature development
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Using Git Worktrees
|
|
7
|
-
|
|
8
|
-
## Overview
|
|
9
|
-
|
|
10
|
-
When isolation is intended, ensure work happens in an isolated workspace. Prefer your platform's native worktree tools. Fall back to manual git worktrees only when no native tool is available.
|
|
11
|
-
|
|
12
|
-
**Core principle:** Determine the intended workspace first. Respect an explicit request to stay on the current branch/workspace. If isolation is requested, prefer native tools, then fall back to git. Never fight the harness.
|
|
13
|
-
|
|
14
|
-
**Announce at start:** "I'm using the using-git-worktrees skill to set up an isolated workspace."
|
|
15
|
-
|
|
16
|
-
## Step 0: Detect Existing Isolation
|
|
17
|
-
|
|
18
|
-
**Before creating anything, check if you are already in an isolated workspace.**
|
|
19
|
-
|
|
20
|
-
```text
|
|
21
|
-
git rev-parse --git-dir
|
|
22
|
-
git rev-parse --git-common-dir
|
|
23
|
-
git rev-parse --show-toplevel
|
|
24
|
-
git rev-parse --show-superproject-working-tree
|
|
25
|
-
git branch --show-current
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
**Submodule guard:** differing Git directory results are also possible inside git submodules. Before concluding "already in a worktree," verify you are not in a submodule:
|
|
29
|
-
|
|
30
|
-
```text
|
|
31
|
-
# If this returns a path, you're in a submodule, not a worktree — treat as normal repo
|
|
32
|
-
git rev-parse --show-superproject-working-tree
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
**If `--git-dir` differs from `--git-common-dir` (and this is not a submodule):** You are already in a linked worktree. Skip to Step 2 (Project Setup). Do NOT create another worktree.
|
|
36
|
-
|
|
37
|
-
Report with branch state:
|
|
38
|
-
- On a branch: "Already in isolated workspace at `<path>` on branch `<name>`."
|
|
39
|
-
- Detached HEAD: "Already in isolated workspace at `<path>` (detached HEAD, externally managed). Branch creation needed at finish time."
|
|
40
|
-
|
|
41
|
-
**If the values match (or this is a submodule):** You are in a normal repo checkout.
|
|
42
|
-
|
|
43
|
-
If the user explicitly says to work on the current branch/workspace, stay there. If the user invokes `/using-git-worktrees` or explicitly requests isolation, that is consent to isolate. If intent is unspecified, stay in the current workspace by default. Do not recommend or create a worktree solely because an implementation plan is large, risky, or being executed by SDD. Follow a project-level preference only when it explicitly requires isolation.
|
|
44
|
-
|
|
45
|
-
Honor any existing declared preference without asking. If isolation is not explicitly requested or required by project policy, skip to Step 2 in the current workspace.
|
|
46
|
-
|
|
47
|
-
## Step 1: Create Isolated Workspace
|
|
48
|
-
|
|
49
|
-
**You have two mechanisms. Try them in this order.**
|
|
50
|
-
|
|
51
|
-
### 1a. Native Worktree Tools (preferred)
|
|
52
|
-
|
|
53
|
-
The user has asked for an isolated workspace (Step 0 consent). Do you already have a way to create a worktree? It might be a tool with a name like `EnterWorktree`, `WorktreeCreate`, a `/worktree` command, or a `--worktree` flag. If you do, use it and skip to Step 2.
|
|
54
|
-
|
|
55
|
-
Native tools handle directory placement, branch creation, and cleanup automatically. Using `git worktree add` when you have a native tool creates phantom state your harness can't see or manage.
|
|
56
|
-
|
|
57
|
-
Only proceed to Step 1b if you have no native worktree tool available.
|
|
58
|
-
|
|
59
|
-
### 1b. Git Worktree Fallback
|
|
60
|
-
|
|
61
|
-
**Only use this if Step 1a does not apply** — you have no native worktree tool available. Create a worktree manually using git.
|
|
62
|
-
|
|
63
|
-
#### Directory Selection
|
|
64
|
-
|
|
65
|
-
Follow this priority order. Explicit user preference always beats observed filesystem state.
|
|
66
|
-
|
|
67
|
-
1. **Check your instructions for a declared worktree directory preference.** If the user has already specified one, use it without asking.
|
|
68
|
-
|
|
69
|
-
2. **Check for an existing project-local worktree directory:**
|
|
70
|
-
```text
|
|
71
|
-
PowerShell: Test-Path .worktrees; Test-Path worktrees
|
|
72
|
-
CMD: if exist .worktrees echo .worktrees & if exist worktrees echo worktrees
|
|
73
|
-
```
|
|
74
|
-
If found, use it. If both exist, `.worktrees` wins.
|
|
75
|
-
|
|
76
|
-
3. **If there is no other guidance available**, default to `.worktrees/` at the project root.
|
|
77
|
-
|
|
78
|
-
#### Safety Verification (project-local directories only)
|
|
79
|
-
|
|
80
|
-
**MUST verify directory is ignored before creating worktree:**
|
|
81
|
-
|
|
82
|
-
```text
|
|
83
|
-
git check-ignore .worktrees
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
If `.worktrees` does not exist, check the directory name you will create:
|
|
87
|
-
|
|
88
|
-
```text
|
|
89
|
-
git check-ignore worktrees
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
**If NOT ignored:** Add the appropriate entry to `.gitignore`, show that change clearly, and proceed only after the ignore rule is in place. Do not silently commit unrelated changes.
|
|
93
|
-
|
|
94
|
-
**Why critical:** Prevents accidentally committing worktree contents to repository.
|
|
95
|
-
|
|
96
|
-
#### Create the Worktree
|
|
97
|
-
|
|
98
|
-
```text
|
|
99
|
-
# Determine the path using the host shell, then run the portable Git command.
|
|
100
|
-
git worktree list --porcelain
|
|
101
|
-
git branch --list <branch>
|
|
102
|
-
git worktree add "<path>" -b "<branch>" # new branch
|
|
103
|
-
git worktree add "<path>" "<branch>" # existing, unattached branch
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
Never reset, force-checkout, delete, or steal an existing branch attached to another worktree.
|
|
107
|
-
|
|
108
|
-
**Sandbox fallback:** If `git worktree add` fails with a permission error (sandbox denial), report that clearly. If isolation was explicitly required, stop rather than silently working on the current branch; otherwise ask whether to continue in the current workspace, then run setup and baseline tests there only with that choice.
|
|
109
|
-
|
|
110
|
-
## Step 2: Project Setup
|
|
111
|
-
|
|
112
|
-
Auto-detect and run appropriate setup. Read the repository's `AGENTS.md`, `.agent/docs/tooling.md`, package scripts, and lockfiles first; do not install dependencies that the project workflow does not require:
|
|
113
|
-
|
|
114
|
-
```text
|
|
115
|
-
package-lock.json -> npm
|
|
116
|
-
pnpm-lock.yaml -> pnpm
|
|
117
|
-
yarn.lock -> yarn
|
|
118
|
-
bun.lock* -> bun
|
|
119
|
-
requirements.txt -> pip
|
|
120
|
-
uv.lock -> uv
|
|
121
|
-
Cargo.toml -> cargo
|
|
122
|
-
go.mod -> go
|
|
123
|
-
composer.json -> composer
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
Use the project's documented bootstrap command after detecting the package manager.
|
|
127
|
-
|
|
128
|
-
## Step 3: Verify Clean Baseline
|
|
129
|
-
|
|
130
|
-
Run tests to ensure workspace starts clean:
|
|
131
|
-
|
|
132
|
-
```text
|
|
133
|
-
# Run the project-appropriate command (one command, not a shell expression):
|
|
134
|
-
npm test
|
|
135
|
-
# or cargo test / pytest / go test ./...
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
**If tests fail:** Report failures, ask whether to proceed or investigate.
|
|
139
|
-
|
|
140
|
-
**If tests pass:** Report ready.
|
|
141
|
-
|
|
142
|
-
### Report
|
|
143
|
-
|
|
144
|
-
```
|
|
145
|
-
Worktree ready at <full-path>
|
|
146
|
-
Tests passing (<N> tests, 0 failures)
|
|
147
|
-
Ready to implement <feature-name>
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
## Quick Reference
|
|
151
|
-
|
|
152
|
-
| Situation | Action |
|
|
153
|
-
|-----------|--------|
|
|
154
|
-
| Already in linked worktree | Skip creation (Step 0) |
|
|
155
|
-
| In a submodule | Treat as normal repo (Step 0 guard) |
|
|
156
|
-
| Native worktree tool available | Use it (Step 1a) |
|
|
157
|
-
| No native tool | Git worktree fallback (Step 1b) |
|
|
158
|
-
| `.worktrees/` exists | Use it (verify ignored) |
|
|
159
|
-
| `worktrees/` exists | Use it (verify ignored) |
|
|
160
|
-
| Both exist | Use `.worktrees/` |
|
|
161
|
-
| Neither exists | Check instruction file, then default `.worktrees/` |
|
|
162
|
-
| Directory not ignored | Add to .gitignore + commit |
|
|
163
|
-
| Permission error on create | Sandbox fallback, work in place |
|
|
164
|
-
| Tests fail during baseline | Report failures + ask |
|
|
165
|
-
| No package.json/Cargo.toml | Skip dependency install |
|
|
166
|
-
|
|
167
|
-
## Common Rationalizations
|
|
168
|
-
|
|
169
|
-
| Excuse | Reality |
|
|
170
|
-
|--------|---------|
|
|
171
|
-
| "I'm obviously not in a worktree — no need to check" | Run Step 0. Harness-created isolation and submodules both fool eyeballing; the detection commands settle it. |
|
|
172
|
-
| "`git worktree add` is quicker than hunting for a native tool" | A native tool (e.g. `EnterWorktree`) owns placement, branching, and cleanup. Bypassing it is the #1 mistake — it creates phantom state your harness can't see or manage. |
|
|
173
|
-
| "The worktree directory is surely ignored already" | Run `git check-ignore`. An unignored worktree directory commits the whole tree into the repo. |
|
|
174
|
-
| "Any directory name works" | Explicit instructions beat an existing project-local directory, which beats the `.worktrees/` default. |
|
|
175
|
-
| "The workspace is fresh — baseline tests can wait" | A dirty baseline makes every later failure ambiguous. Run the tests now; proceeding past failures is your human partner's call. |
|
|
1
|
+
---
|
|
2
|
+
name: using-git-worktrees
|
|
3
|
+
description: Use when the user explicitly wants an isolated workspace, especially for parallel feature development
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Using Git Worktrees
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
When isolation is intended, ensure work happens in an isolated workspace. Prefer your platform's native worktree tools. Fall back to manual git worktrees only when no native tool is available.
|
|
11
|
+
|
|
12
|
+
**Core principle:** Determine the intended workspace first. Respect an explicit request to stay on the current branch/workspace. If isolation is requested, prefer native tools, then fall back to git. Never fight the harness.
|
|
13
|
+
|
|
14
|
+
**Announce at start:** "I'm using the using-git-worktrees skill to set up an isolated workspace."
|
|
15
|
+
|
|
16
|
+
## Step 0: Detect Existing Isolation
|
|
17
|
+
|
|
18
|
+
**Before creating anything, check if you are already in an isolated workspace.**
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
git rev-parse --git-dir
|
|
22
|
+
git rev-parse --git-common-dir
|
|
23
|
+
git rev-parse --show-toplevel
|
|
24
|
+
git rev-parse --show-superproject-working-tree
|
|
25
|
+
git branch --show-current
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**Submodule guard:** differing Git directory results are also possible inside git submodules. Before concluding "already in a worktree," verify you are not in a submodule:
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
# If this returns a path, you're in a submodule, not a worktree — treat as normal repo
|
|
32
|
+
git rev-parse --show-superproject-working-tree
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**If `--git-dir` differs from `--git-common-dir` (and this is not a submodule):** You are already in a linked worktree. Skip to Step 2 (Project Setup). Do NOT create another worktree.
|
|
36
|
+
|
|
37
|
+
Report with branch state:
|
|
38
|
+
- On a branch: "Already in isolated workspace at `<path>` on branch `<name>`."
|
|
39
|
+
- Detached HEAD: "Already in isolated workspace at `<path>` (detached HEAD, externally managed). Branch creation needed at finish time."
|
|
40
|
+
|
|
41
|
+
**If the values match (or this is a submodule):** You are in a normal repo checkout.
|
|
42
|
+
|
|
43
|
+
If the user explicitly says to work on the current branch/workspace, stay there. If the user invokes `/using-git-worktrees` or explicitly requests isolation, that is consent to isolate. If intent is unspecified, stay in the current workspace by default. Do not recommend or create a worktree solely because an implementation plan is large, risky, or being executed by SDD. Follow a project-level preference only when it explicitly requires isolation.
|
|
44
|
+
|
|
45
|
+
Honor any existing declared preference without asking. If isolation is not explicitly requested or required by project policy, skip to Step 2 in the current workspace.
|
|
46
|
+
|
|
47
|
+
## Step 1: Create Isolated Workspace
|
|
48
|
+
|
|
49
|
+
**You have two mechanisms. Try them in this order.**
|
|
50
|
+
|
|
51
|
+
### 1a. Native Worktree Tools (preferred)
|
|
52
|
+
|
|
53
|
+
The user has asked for an isolated workspace (Step 0 consent). Do you already have a way to create a worktree? It might be a tool with a name like `EnterWorktree`, `WorktreeCreate`, a `/worktree` command, or a `--worktree` flag. If you do, use it and skip to Step 2.
|
|
54
|
+
|
|
55
|
+
Native tools handle directory placement, branch creation, and cleanup automatically. Using `git worktree add` when you have a native tool creates phantom state your harness can't see or manage.
|
|
56
|
+
|
|
57
|
+
Only proceed to Step 1b if you have no native worktree tool available.
|
|
58
|
+
|
|
59
|
+
### 1b. Git Worktree Fallback
|
|
60
|
+
|
|
61
|
+
**Only use this if Step 1a does not apply** — you have no native worktree tool available. Create a worktree manually using git.
|
|
62
|
+
|
|
63
|
+
#### Directory Selection
|
|
64
|
+
|
|
65
|
+
Follow this priority order. Explicit user preference always beats observed filesystem state.
|
|
66
|
+
|
|
67
|
+
1. **Check your instructions for a declared worktree directory preference.** If the user has already specified one, use it without asking.
|
|
68
|
+
|
|
69
|
+
2. **Check for an existing project-local worktree directory:**
|
|
70
|
+
```text
|
|
71
|
+
PowerShell: Test-Path .worktrees; Test-Path worktrees
|
|
72
|
+
CMD: if exist .worktrees echo .worktrees & if exist worktrees echo worktrees
|
|
73
|
+
```
|
|
74
|
+
If found, use it. If both exist, `.worktrees` wins.
|
|
75
|
+
|
|
76
|
+
3. **If there is no other guidance available**, default to `.worktrees/` at the project root.
|
|
77
|
+
|
|
78
|
+
#### Safety Verification (project-local directories only)
|
|
79
|
+
|
|
80
|
+
**MUST verify directory is ignored before creating worktree:**
|
|
81
|
+
|
|
82
|
+
```text
|
|
83
|
+
git check-ignore .worktrees
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
If `.worktrees` does not exist, check the directory name you will create:
|
|
87
|
+
|
|
88
|
+
```text
|
|
89
|
+
git check-ignore worktrees
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**If NOT ignored:** Add the appropriate entry to `.gitignore`, show that change clearly, and proceed only after the ignore rule is in place. Do not silently commit unrelated changes.
|
|
93
|
+
|
|
94
|
+
**Why critical:** Prevents accidentally committing worktree contents to repository.
|
|
95
|
+
|
|
96
|
+
#### Create the Worktree
|
|
97
|
+
|
|
98
|
+
```text
|
|
99
|
+
# Determine the path using the host shell, then run the portable Git command.
|
|
100
|
+
git worktree list --porcelain
|
|
101
|
+
git branch --list <branch>
|
|
102
|
+
git worktree add "<path>" -b "<branch>" # new branch
|
|
103
|
+
git worktree add "<path>" "<branch>" # existing, unattached branch
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Never reset, force-checkout, delete, or steal an existing branch attached to another worktree.
|
|
107
|
+
|
|
108
|
+
**Sandbox fallback:** If `git worktree add` fails with a permission error (sandbox denial), report that clearly. If isolation was explicitly required, stop rather than silently working on the current branch; otherwise ask whether to continue in the current workspace, then run setup and baseline tests there only with that choice.
|
|
109
|
+
|
|
110
|
+
## Step 2: Project Setup
|
|
111
|
+
|
|
112
|
+
Auto-detect and run appropriate setup. Read the repository's `AGENTS.md`, `.agent/docs/tooling.md`, package scripts, and lockfiles first; do not install dependencies that the project workflow does not require:
|
|
113
|
+
|
|
114
|
+
```text
|
|
115
|
+
package-lock.json -> npm
|
|
116
|
+
pnpm-lock.yaml -> pnpm
|
|
117
|
+
yarn.lock -> yarn
|
|
118
|
+
bun.lock* -> bun
|
|
119
|
+
requirements.txt -> pip
|
|
120
|
+
uv.lock -> uv
|
|
121
|
+
Cargo.toml -> cargo
|
|
122
|
+
go.mod -> go
|
|
123
|
+
composer.json -> composer
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Use the project's documented bootstrap command after detecting the package manager.
|
|
127
|
+
|
|
128
|
+
## Step 3: Verify Clean Baseline
|
|
129
|
+
|
|
130
|
+
Run tests to ensure workspace starts clean:
|
|
131
|
+
|
|
132
|
+
```text
|
|
133
|
+
# Run the project-appropriate command (one command, not a shell expression):
|
|
134
|
+
npm test
|
|
135
|
+
# or cargo test / pytest / go test ./...
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**If tests fail:** Report failures, ask whether to proceed or investigate.
|
|
139
|
+
|
|
140
|
+
**If tests pass:** Report ready.
|
|
141
|
+
|
|
142
|
+
### Report
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
Worktree ready at <full-path>
|
|
146
|
+
Tests passing (<N> tests, 0 failures)
|
|
147
|
+
Ready to implement <feature-name>
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Quick Reference
|
|
151
|
+
|
|
152
|
+
| Situation | Action |
|
|
153
|
+
|-----------|--------|
|
|
154
|
+
| Already in linked worktree | Skip creation (Step 0) |
|
|
155
|
+
| In a submodule | Treat as normal repo (Step 0 guard) |
|
|
156
|
+
| Native worktree tool available | Use it (Step 1a) |
|
|
157
|
+
| No native tool | Git worktree fallback (Step 1b) |
|
|
158
|
+
| `.worktrees/` exists | Use it (verify ignored) |
|
|
159
|
+
| `worktrees/` exists | Use it (verify ignored) |
|
|
160
|
+
| Both exist | Use `.worktrees/` |
|
|
161
|
+
| Neither exists | Check instruction file, then default `.worktrees/` |
|
|
162
|
+
| Directory not ignored | Add to .gitignore + commit |
|
|
163
|
+
| Permission error on create | Sandbox fallback, work in place |
|
|
164
|
+
| Tests fail during baseline | Report failures + ask |
|
|
165
|
+
| No package.json/Cargo.toml | Skip dependency install |
|
|
166
|
+
|
|
167
|
+
## Common Rationalizations
|
|
168
|
+
|
|
169
|
+
| Excuse | Reality |
|
|
170
|
+
|--------|---------|
|
|
171
|
+
| "I'm obviously not in a worktree — no need to check" | Run Step 0. Harness-created isolation and submodules both fool eyeballing; the detection commands settle it. |
|
|
172
|
+
| "`git worktree add` is quicker than hunting for a native tool" | A native tool (e.g. `EnterWorktree`) owns placement, branching, and cleanup. Bypassing it is the #1 mistake — it creates phantom state your harness can't see or manage. |
|
|
173
|
+
| "The worktree directory is surely ignored already" | Run `git check-ignore`. An unignored worktree directory commits the whole tree into the repo. |
|
|
174
|
+
| "Any directory name works" | Explicit instructions beat an existing project-local directory, which beats the `.worktrees/` default. |
|
|
175
|
+
| "The workspace is fresh — baseline tests can wait" | A dirty baseline makes every later failure ambiguous. Run the tests now; proceeding past failures is your human partner's call. |
|