@jonit-dev/night-watch-cli 1.5.6 → 1.5.8

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.
@@ -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.