nitm-ai-dev-toolkit 5.1.1 → 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,12 @@ 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
+
10
16
  ## [5.1.1] - 2026-10-21
11
17
 
12
18
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nitm-ai-dev-toolkit",
3
- "version": "5.1.1",
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"
@@ -294,7 +294,8 @@ If a ticket cannot be created, stop at `awaiting-plan`. Report the lines that ha
294
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 `.worktrees/<id>/` at the root of the main checkout (the git root, inside the repo folder). Record its absolute path 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.
298
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.
299
300
  - Create it at the start of the build stage, after the plan gate and tracking. Reuse it if it exists (rework and repair).
300
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.
@@ -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 |
@@ -99,6 +99,8 @@ Any value other than exactly `auto` is treated as `human`.
99
99
 
100
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
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.
103
+
102
104
  ### Worktree bootstrap
103
105
 
104
106
  Before the builder starts in a new worktree, the factory runs the steps listed in `factory/worktree-bootstrap.md`: one shell command per line, in order, from the worktree root. Typical steps install dependencies or vendored packages, copy `.env` from the main checkout, and create or migrate a database for the job. The file ships with no active steps, so edit it for your project. Each step receives `FACTORY_JOB_ID`, `FACTORY_PORT_BUILDER`, `FACTORY_WORKTREE`, and `FACTORY_MAIN_CHECKOUT`.
@@ -294,7 +294,8 @@ If a ticket cannot be created, stop at `awaiting-plan`. Report the lines that ha
294
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 `.worktrees/<id>/` at the root of the main checkout (inside the repo folder). Record its absolute path 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.
298
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.
299
300
  - Create it at the start of the build stage, after the plan gate and tracking. Reuse it if it exists (rework and repair).
300
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.
@@ -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 |
@@ -93,6 +93,8 @@ Any value other than exactly `auto` is treated as `human`.
93
93
 
94
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
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.
97
+
96
98
  ### Worktree bootstrap
97
99
 
98
100
  Before the builder starts in a new worktree, the factory runs the steps listed in `factory/worktree-bootstrap.md`: one shell command per line, in order, from the worktree root. Typical steps install dependencies or vendored packages, copy `.env` from the main checkout, and create or migrate a database for the job. The file ships with no active steps, so edit it for your project. Each step receives `FACTORY_JOB_ID`, `FACTORY_PORT_BUILDER`, `FACTORY_WORKTREE`, and `FACTORY_MAIN_CHECKOUT`.