nitm-ai-dev-toolkit 5.1.0 → 5.1.2

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/CHANGELOG.md CHANGED
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [5.1.2] - 2026-10-21
11
+
12
+ ### Fixed
13
+
14
+ - The `using-git-worktrees` skill uses only `.worktrees/` for project-local worktrees (the non-hidden `worktrees/` alternative is removed), expands `$HOME` in the global path, and commits the `.gitignore` change on the default branch. The Factory skill states that the worktree folder is named by the job id, not the branch, and that `factory/worktree-bootstrap.md` replaces the worktree skill's setup and baseline-test steps. The Factory README notes that tools ignoring `.gitignore` should exclude `.worktrees/`.
15
+
16
+ ## [5.1.1] - 2026-10-21
17
+
18
+ ### Fixed
19
+
20
+ - Factory worktrees are created in `.worktrees/<id>/` at the repo root (the git root in a monorepo) instead of a sibling `../<repo>-factory/<id>/` folder outside the repo. The factory ensures `.worktrees/` is git-ignored.
21
+
10
22
  ## [5.1.0] - 2026-10-21
11
23
 
12
24
  ### Changed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nitm-ai-dev-toolkit",
3
- "version": "5.1.0",
3
+ "version": "5.1.2",
4
4
  "description": "Scaffold AI agent config (Cursor, GitHub Copilot, Claude Code, OpenCode, Codex) into any repo, then hand off to your AI agent to finish setup.",
5
5
  "bin": {
6
6
  "nitm-ai-dev-toolkit": "bin/cli.js"
@@ -100,7 +100,7 @@ Feature folders live under the roots in `{{FACTORY_FEATURE_PATHS}}`, relative to
100
100
  "tracker_errors": [],
101
101
  "branch": "factory/001-onboarding-bootstrap",
102
102
  "worktree": true,
103
- "worktree_path": "/abs/path/to/repo-factory/001-onboarding-bootstrap",
103
+ "worktree_path": "/abs/path/to/repo/.worktrees/001-onboarding-bootstrap",
104
104
  "mr": null,
105
105
  "failed_stage": null,
106
106
  "stage": "awaiting-plan",
@@ -291,10 +291,12 @@ If a ticket cannot be created, stop at `awaiting-plan`. Report the lines that ha
291
291
 
292
292
  ## Worktree
293
293
 
294
- The default build location. Use the [using-git-worktrees](../using-git-worktrees/SKILL.md) skill for its safety checks only. Its directory selection does not apply: the path below overrides it. Never edit `.gitignore` for the worktree.
294
+ The default build location. Follow the [using-git-worktrees](../using-git-worktrees/SKILL.md) skill. Factory always takes its project-local `.worktrees/` default and never the global `~/.worktrees` option, without asking.
295
295
 
296
296
  - Branch `factory/<id>` from `{{DEFAULT_BRANCH}}`.
297
- - Path `../<repo-name>-factory/<id>/` relative to the main checkout, where `<repo-name>` is the basename of the main checkout. Record it in `worktree_path`.
297
+ - Path `.worktrees/<id>/` at the root of the main checkout (the git root, inside the repo folder). The folder is named by the job id, never by the branch: branch `factory/<id>` must not produce `.worktrees/factory/<id>`. Record its absolute path in `worktree_path`.
298
+ - `factory/worktree-bootstrap.md` replaces the worktree skill's project-setup and baseline-test steps. Factory does not run those.
299
+ - Before the first worktree, run that skill's `.gitignore` check. If it had to add `.worktrees/`, commit that on `{{DEFAULT_BRANCH}}` or tell the operator to.
298
300
  - Create it at the start of the build stage, after the plan gate and tracking. Reuse it if it exists (rework and repair).
299
301
  - Copy the job's `spec.md`, `plan.md`, and `tasks.md` (if any) from the main checkout's feature folder into the same relative path in the worktree. The builder ticks `tasks.md` there. Then run the bootstrap (next subsection) and make the feature docs commit.
300
302
  - Job state stays in the main checkout's `factory/jobs/<id>/`, never in the worktree.
@@ -350,7 +352,7 @@ PATHS
350
352
  - Main checkout (absolute): <abs>
351
353
  - Job folder (absolute): <abs>/factory/jobs/<id>
352
354
  - Feature folder (absolute, main checkout): <abs>/<feature_dir>
353
- - Worktree (absolute): <abs>/../<repo-name>-factory/<id> (in-place: the main checkout)
355
+ - Worktree (absolute): <abs>/.worktrees/<id> (in-place: the main checkout)
354
356
  - Feature folder in worktree (absolute): <worktree>/<feature_dir> (in-place: the main checkout's)
355
357
  - qa.md (absolute, build location): <worktree>/<feature_dir>/qa.md
356
358
  - Branch: factory/<id>
@@ -37,11 +37,10 @@ Follow this priority order:
37
37
 
38
38
  ```bash
39
39
  # Check in priority order
40
- ls -d .worktrees 2>/dev/null # Preferred (hidden)
41
- ls -d worktrees 2>/dev/null # Alternative
40
+ ls -d .worktrees 2>/dev/null
42
41
  ```
43
42
 
44
- **If found:** Use that directory. If both exist, `.worktrees` wins.
43
+ **If found:** Use that directory.
45
44
 
46
45
  ### 2. Check Project Configuration
47
46
 
@@ -67,21 +66,21 @@ Which would you prefer?
67
66
 
68
67
  ## Safety Verification
69
68
 
70
- ### For Project-Local Directories (.worktrees or worktrees)
69
+ ### For Project-Local Directories (.worktrees)
71
70
 
72
71
  **MUST verify directory is ignored before creating worktree:**
73
72
 
74
73
  ```bash
75
74
  # Check if directory is ignored (respects local, global, and system gitignore)
76
- git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/dev/null
75
+ git check-ignore -q .worktrees 2>/dev/null
77
76
  ```
78
77
 
79
78
  **If NOT ignored:**
80
79
 
81
80
  Fix immediately before proceeding:
82
81
 
83
- 1. Add appropriate line to .gitignore
84
- 2. Commit the change
82
+ 1. Add `.worktrees/` to .gitignore
83
+ 2. Commit the change on the default branch
85
84
  3. Proceed with worktree creation
86
85
 
87
86
  **Why critical:** Prevents accidentally committing worktree contents to repository.
@@ -103,11 +102,11 @@ project=$(basename "$(git rev-parse --show-toplevel)")
103
102
  ```bash
104
103
  # Determine full path
105
104
  case $LOCATION in
106
- .worktrees|worktrees)
105
+ .worktrees)
107
106
  path="$LOCATION/$BRANCH_NAME"
108
107
  ;;
109
108
  ~/.worktrees/*)
110
- path="~/.worktrees/$project/$BRANCH_NAME"
109
+ path="$HOME/.worktrees/$project/$BRANCH_NAME"
111
110
  ;;
112
111
  esac
113
112
 
@@ -164,8 +163,6 @@ Ready to implement <feature-name>
164
163
  | Situation | Action |
165
164
  | -------------------------- | ------------------------------- |
166
165
  | `.worktrees/` exists | Use it (verify ignored) |
167
- | `worktrees/` exists | Use it (verify ignored) |
168
- | Both exist | Use `.worktrees/` |
169
166
  | Neither exists | Check project config → Ask user |
170
167
  | Directory not ignored | Add to .gitignore + commit |
171
168
  | Tests fail during baseline | Report failures + ask |
@@ -97,7 +97,9 @@ Any value other than exactly `auto` is treated as `human`.
97
97
 
98
98
  ## Build location
99
99
 
100
- By default each job builds in its own git worktree on branch `factory/<id>`, so the main checkout stays free. A job's `job.json` records this in `worktree` (`true`) and the worktree path in `worktree_path`.
100
+ By default each job builds in its own git worktree on branch `factory/<id>`, so the main checkout stays free. A job's `job.json` records this in `worktree` (`true`) and the worktree path in `worktree_path`. Worktrees live in `.worktrees/<id>/` at the git root; the factory adds `.worktrees/` to `.gitignore` if it is missing.
101
+
102
+ Tools that do not honor `.gitignore` (Jest/Vitest test discovery, ESLint, `tsc`, workspace globs) should exclude `.worktrees/`. The local merge runs tests in the main checkout while other job worktrees may still exist.
101
103
 
102
104
  ### Worktree bootstrap
103
105
 
@@ -100,7 +100,7 @@ Feature folders live under the roots in `{{FACTORY_FEATURE_PATHS}}`, relative to
100
100
  "tracker_errors": [],
101
101
  "branch": "factory/001-onboarding-bootstrap",
102
102
  "worktree": true,
103
- "worktree_path": "/abs/path/to/repo-factory/001-onboarding-bootstrap",
103
+ "worktree_path": "/abs/path/to/repo/.worktrees/001-onboarding-bootstrap",
104
104
  "mr": null,
105
105
  "failed_stage": null,
106
106
  "stage": "awaiting-plan",
@@ -291,10 +291,12 @@ If a ticket cannot be created, stop at `awaiting-plan`. Report the lines that ha
291
291
 
292
292
  ## Worktree
293
293
 
294
- The default build location. Use the [using-git-worktrees](../using-git-worktrees/SKILL.md) skill for its safety checks only. Its directory selection does not apply: the path below overrides it. Never edit `.gitignore` for the worktree.
294
+ The default build location. Follow the [using-git-worktrees](../using-git-worktrees/SKILL.md) skill. Factory always takes its project-local `.worktrees/` default and never the global `~/.worktrees` option, without asking.
295
295
 
296
296
  - Branch `factory/<id>` from `{{DEFAULT_BRANCH}}`.
297
- - Path `../<repo-name>-factory/<id>/` relative to the main checkout, where `<repo-name>` is the basename of the main checkout. Record it in `worktree_path`.
297
+ - Path `.worktrees/<id>/` at the root of the main checkout (inside the repo folder). The folder is named by the job id, never by the branch: branch `factory/<id>` must not produce `.worktrees/factory/<id>`. Record its absolute path in `worktree_path`.
298
+ - `factory/worktree-bootstrap.md` replaces the worktree skill's project-setup and baseline-test steps. Factory does not run those.
299
+ - Before the first worktree, run that skill's `.gitignore` check. If it had to add `.worktrees/`, commit that on `{{DEFAULT_BRANCH}}` or tell the operator to.
298
300
  - Create it at the start of the build stage, after the plan gate and tracking. Reuse it if it exists (rework and repair).
299
301
  - Copy the job's `spec.md`, `plan.md`, and `tasks.md` (if any) from the main checkout's feature folder into the same relative path in the worktree. The builder ticks `tasks.md` there. Then run the bootstrap (next subsection) and make the feature docs commit.
300
302
  - Job state stays in the main checkout's `factory/jobs/<id>/`, never in the worktree.
@@ -350,7 +352,7 @@ PATHS
350
352
  - Main checkout (absolute): <abs>
351
353
  - Job folder (absolute): <abs>/factory/jobs/<id>
352
354
  - Feature folder (absolute, main checkout): <abs>/<feature_dir>
353
- - Worktree (absolute): <abs>/../<repo-name>-factory/<id> (in-place: the main checkout)
355
+ - Worktree (absolute): <abs>/.worktrees/<id> (in-place: the main checkout)
354
356
  - Feature folder in worktree (absolute): <worktree>/<feature_dir> (in-place: the main checkout's)
355
357
  - qa.md (absolute, build location): <worktree>/<feature_dir>/qa.md
356
358
  - Branch: factory/<id>
@@ -37,11 +37,10 @@ Follow this priority order:
37
37
 
38
38
  ```bash
39
39
  # Check in priority order
40
- ls -d .worktrees 2>/dev/null # Preferred (hidden)
41
- ls -d worktrees 2>/dev/null # Alternative
40
+ ls -d .worktrees 2>/dev/null
42
41
  ```
43
42
 
44
- **If found:** Use that directory. If both exist, `.worktrees` wins.
43
+ **If found:** Use that directory.
45
44
 
46
45
  ### 2. Check Project Configuration
47
46
 
@@ -67,21 +66,21 @@ Which would you prefer?
67
66
 
68
67
  ## Safety Verification
69
68
 
70
- ### For Project-Local Directories (.worktrees or worktrees)
69
+ ### For Project-Local Directories (.worktrees)
71
70
 
72
71
  **MUST verify directory is ignored before creating worktree:**
73
72
 
74
73
  ```bash
75
74
  # Check if directory is ignored (respects local, global, and system gitignore)
76
- git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/dev/null
75
+ git check-ignore -q .worktrees 2>/dev/null
77
76
  ```
78
77
 
79
78
  **If NOT ignored:**
80
79
 
81
80
  Fix immediately before proceeding:
82
81
 
83
- 1. Add appropriate line to .gitignore
84
- 2. Commit the change
82
+ 1. Add `.worktrees/` to .gitignore
83
+ 2. Commit the change on the default branch
85
84
  3. Proceed with worktree creation
86
85
 
87
86
  **Why critical:** Prevents accidentally committing worktree contents to repository.
@@ -103,11 +102,11 @@ project=$(basename "$(git rev-parse --show-toplevel)")
103
102
  ```bash
104
103
  # Determine full path
105
104
  case $LOCATION in
106
- .worktrees|worktrees)
105
+ .worktrees)
107
106
  path="$LOCATION/$BRANCH_NAME"
108
107
  ;;
109
108
  ~/.worktrees/*)
110
- path="~/.worktrees/$project/$BRANCH_NAME"
109
+ path="$HOME/.worktrees/$project/$BRANCH_NAME"
111
110
  ;;
112
111
  esac
113
112
 
@@ -164,8 +163,6 @@ Ready to implement <feature-name>
164
163
  | Situation | Action |
165
164
  | -------------------------- | ------------------------------- |
166
165
  | `.worktrees/` exists | Use it (verify ignored) |
167
- | `worktrees/` exists | Use it (verify ignored) |
168
- | Both exist | Use `.worktrees/` |
169
166
  | Neither exists | Check project config → Ask user |
170
167
  | Directory not ignored | Add to .gitignore + commit |
171
168
  | Tests fail during baseline | Report failures + ask |
@@ -91,7 +91,9 @@ Any value other than exactly `auto` is treated as `human`.
91
91
 
92
92
  ## Build location
93
93
 
94
- By default each job builds in its own git worktree on branch `factory/<id>`, so the main checkout stays free. A job's `job.json` records this in `worktree` (`true`) and the worktree path in `worktree_path`.
94
+ By default each job builds in its own git worktree on branch `factory/<id>`, so the main checkout stays free. A job's `job.json` records this in `worktree` (`true`) and the worktree path in `worktree_path`. Worktrees live in `.worktrees/<id>/` at the repo root; the factory adds `.worktrees/` to `.gitignore` if it is missing.
95
+
96
+ Tools that do not honor `.gitignore` (Jest/Vitest test discovery, ESLint, `tsc`, workspace globs) should exclude `.worktrees/`. The local merge runs tests in the main checkout while other job worktrees may still exist.
95
97
 
96
98
  ### Worktree bootstrap
97
99