@jonit-dev/night-watch-cli 1.5.7 → 1.5.9

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.
@@ -67,14 +67,15 @@ A PR needs attention if **either** the review score is below 80 **or** any CI jo
67
67
 
68
68
  4. **Fix the PR**:
69
69
 
70
- a. **Use the pre-provisioned runtime workspace**:
71
- - You are already running in an isolated runtime workspace.
72
- - Do **not** run `git checkout`/`git switch` in the original project directory.
73
- - Do **not** create/remove worktrees manually; the runtime controller handles isolation and cleanup.
74
-
75
- b. **Check out the PR branch inside the runtime workspace**:
70
+ a. **Create an isolated review worktree**:
76
71
  ```
77
72
  git fetch origin
73
+ git worktree add --detach ../${PROJECT_NAME}-nw-review-<branch-name> origin/${DEFAULT_BRANCH}
74
+ ```
75
+
76
+ b. **Check out the PR branch inside that worktree**:
77
+ ```
78
+ cd ../${PROJECT_NAME}-nw-review-<branch-name>
78
79
  git checkout <branch-name>
79
80
  git pull origin <branch-name>
80
81
  ```
@@ -135,6 +136,10 @@ A PR needs attention if **either** the review score is below 80 **or** any CI jo
135
136
  Night Watch PR Reviewer"
136
137
  ```
137
138
 
139
+ h. **Clean up worktree**: `git worktree remove ../${PROJECT_NAME}-nw-review-<branch-name>`
140
+
138
141
  5. **Repeat** for all open PRs that need work.
139
142
 
143
+ 6. When done, return to ${DEFAULT_BRANCH}: `git checkout ${DEFAULT_BRANCH}`
144
+
140
145
  Start now. Check for open PRs that need review feedback addressed or CI failures fixed.
@@ -20,13 +20,14 @@ You are the Night Watch agent. Your job is to autonomously pick up PRD tickets a
20
20
 
21
21
  b. **Branch naming**: The branch MUST be named exactly `night-watch/<prd-filename-without-.md>`. Do NOT use `feat/`, `feature/`, or any other prefix. Example: for `health-check-endpoints.md` the branch is `night-watch/health-check-endpoints`.
22
22
 
23
- c. **Use the pre-provisioned runtime workspace**:
24
- - You are already running in an isolated runtime workspace.
25
- - The target branch `night-watch/<prd-filename-without-.md>` is already prepared.
26
- - Do **not** run `git checkout`/`git switch` in the original project directory.
27
- - Do **not** create/remove worktrees manually; the runtime controller handles isolation and cleanup.
23
+ c. **Create an isolated worktree + branch** from ${DEFAULT_BRANCH}:
28
24
 
29
- d. Install dependencies in the current runtime workspace (npm install, yarn install, or pnpm install as appropriate).
25
+ ```
26
+ git fetch origin ${DEFAULT_BRANCH}
27
+ git worktree add -b night-watch/<prd-filename-without-.md> ../${PROJECT_NAME}-nw-<prd-name> origin/${DEFAULT_BRANCH}
28
+ ```
29
+
30
+ d. `cd` into the worktree and run package install (npm install, yarn install, or pnpm install as appropriate). Keep all implementation steps inside this worktree.
30
31
 
31
32
  e. **Implement the PRD using the PRD Executor workflow**:
32
33
  - Read `.claude/commands/prd-executor.md` and follow its full execution pipeline.
@@ -57,9 +58,11 @@ You are the Night Watch agent. Your job is to autonomously pick up PRD tickets a
57
58
  gh pr create --title "feat: <short title>" --body "<summary with PRD reference>"
58
59
  ```
59
60
 
60
- j. **Move PRD to done**:
61
+ j. **Move PRD to done** (back in main repo on ${DEFAULT_BRANCH}):
61
62
 
62
63
  ```
64
+ cd ${PROJECT_DIR}
65
+ git checkout ${DEFAULT_BRANCH}
63
66
  mkdir -p docs/PRDs/night-watch/done
64
67
  mv docs/PRDs/night-watch/<file>.md docs/PRDs/night-watch/done/
65
68
  ```
@@ -82,8 +85,10 @@ You are the Night Watch agent. Your job is to autonomously pick up PRD tickets a
82
85
 
83
86
  l. **Commit** the move + summary update, push ${DEFAULT_BRANCH}.
84
87
 
85
- m. **STOP after this PRD**. Do NOT continue to the next PRD. One PRD per run prevents timeouts and reduces risk. The next cron trigger will pick up the next PRD.
88
+ m. **Clean up worktree**: `git worktree remove ../${PROJECT_NAME}-nw-<prd-name>`
89
+
90
+ n. **STOP after this PRD**. Do NOT continue to the next PRD. One PRD per run prevents timeouts and reduces risk. The next cron trigger will pick up the next PRD.
86
91
 
87
- 5. **On failure**: Do NOT move the PRD to done. Log the failure in NIGHT-WATCH-SUMMARY.md with status "Failed" and the reason. The runtime controller handles cleanup. Then **stop** -- do not attempt the next PRD.
92
+ 5. **On failure**: Do NOT move the PRD to done. Log the failure in NIGHT-WATCH-SUMMARY.md with status "Failed" and the reason. Clean up worktree and **stop** -- do not attempt the next PRD.
88
93
 
89
94
  Start now. Scan for available PRDs and process the first eligible one.