@jonit-dev/night-watch-cli 1.8.3 → 1.8.4-beta.1

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.
Files changed (40) hide show
  1. package/dist/cli.js +776 -324
  2. package/dist/commands/doctor.d.ts.map +1 -1
  3. package/dist/commands/doctor.js +8 -12
  4. package/dist/commands/doctor.js.map +1 -1
  5. package/dist/commands/init.d.ts.map +1 -1
  6. package/dist/commands/init.js +101 -2
  7. package/dist/commands/init.js.map +1 -1
  8. package/dist/commands/plan.d.ts +19 -0
  9. package/dist/commands/plan.d.ts.map +1 -0
  10. package/dist/commands/plan.js +88 -0
  11. package/dist/commands/plan.js.map +1 -0
  12. package/dist/commands/prd.d.ts +8 -14
  13. package/dist/commands/prd.d.ts.map +1 -1
  14. package/dist/commands/prd.js +238 -145
  15. package/dist/commands/prd.js.map +1 -1
  16. package/dist/scripts/night-watch-plan-cron.sh +130 -0
  17. package/dist/scripts/publish.sh +94 -26
  18. package/dist/templates/pr-reviewer.md +1 -1
  19. package/dist/templates/prd-creator.md +330 -0
  20. package/dist/templates/prd-executor.md +1 -0
  21. package/dist/templates/qa.md +8 -4
  22. package/dist/templates/skills/_codex-block.md +58 -0
  23. package/dist/templates/skills/nw-add-issue.md +39 -0
  24. package/dist/templates/skills/nw-board-sync.md +47 -0
  25. package/dist/templates/skills/nw-create-prd.md +61 -0
  26. package/dist/templates/skills/nw-review.md +39 -0
  27. package/dist/templates/skills/nw-run.md +39 -0
  28. package/dist/templates/skills/nw-slice.md +33 -0
  29. package/dist/templates/skills/skills/_codex-block.md +58 -0
  30. package/dist/templates/skills/skills/nw-add-issue.md +39 -0
  31. package/dist/templates/skills/skills/nw-board-sync.md +47 -0
  32. package/dist/templates/skills/skills/nw-create-prd.md +61 -0
  33. package/dist/templates/skills/skills/nw-review.md +39 -0
  34. package/dist/templates/skills/skills/nw-run.md +39 -0
  35. package/dist/templates/skills/skills/nw-slice.md +33 -0
  36. package/dist/web/assets/index-Cp7RYjoy.css +1 -0
  37. package/dist/web/assets/index-DTsfDC7m.js +381 -0
  38. package/dist/web/assets/index-ZABWMEZR.js +381 -0
  39. package/dist/web/index.html +2 -2
  40. package/package.json +12 -3
@@ -0,0 +1,61 @@
1
+ # Skill: nw-create-prd
2
+
3
+ Create a new Product Requirements Document (PRD) for Night Watch to implement autonomously.
4
+
5
+ ## When to use
6
+
7
+ When the user describes a feature, bug fix, or improvement they want Night Watch to implement.
8
+
9
+ ## Steps
10
+
11
+ 1. **Gather requirements** — if not fully described, ask:
12
+ - What problem does this solve?
13
+ - What is the expected outcome?
14
+
15
+ 2. **Assess complexity**:
16
+ - **1 (Simple)**: single-file fix, minor config change, small bug
17
+ - **2 (Medium)**: multi-file feature, new endpoint, new component
18
+ - **3 (Complex)**: new subsystem, architectural change, major refactor
19
+
20
+ 3. **Split into phases** — each phase should be an independently testable checkpoint:
21
+ - Phase 1: data models, interfaces, schema
22
+ - Middle phases: services, API, core logic
23
+ - Final phase: UI, integration, tests
24
+
25
+ 4. **Write the PRD** to `docs/prds/<kebab-case-title>.md` using this structure:
26
+
27
+ ```
28
+ # PRD: <Title>
29
+
30
+ **Complexity: <1|2|3> → <Simple|Medium|Complex> mode**
31
+
32
+ ## Problem
33
+
34
+ <1-2 sentences describing the user problem or business need>
35
+
36
+ ## Solution
37
+
38
+ - <bullet 1>
39
+ - <bullet 2>
40
+ - <bullet 3>
41
+
42
+ ## Phases
43
+
44
+ ### Phase 1: <Name>
45
+
46
+ - [ ] <specific implementation task>
47
+ - [ ] <write tests for above>
48
+
49
+ ### Phase 2: <Name>
50
+
51
+ - [ ] <specific implementation task>
52
+ - [ ] <write integration tests>
53
+
54
+ ## Acceptance Criteria
55
+
56
+ - [ ] All phases complete
57
+ - [ ] All tests pass
58
+ - [ ] Feature reachable from existing code (no orphaned code)
59
+ ```
60
+
61
+ 5. **Confirm** to the user: show the file path and remind them to run `night-watch run` to execute immediately, or it will run on the next scheduled cron cycle.
@@ -0,0 +1,39 @@
1
+ # Skill: nw-review
2
+
3
+ Run the Night Watch automated PR reviewer on open pull requests.
4
+
5
+ ## When to use
6
+
7
+ When the user wants to trigger automated code review on Night Watch PRs, or when a PR needs a review score.
8
+
9
+ ## Steps
10
+
11
+ 1. **List open Night Watch PRs**:
12
+
13
+ ```
14
+ gh pr list --state open --json number,title,headRefName --jq '.[] | select(.headRefName | startswith("night-watch/"))'
15
+ ```
16
+
17
+ 2. **Run the reviewer** (processes all eligible PRs):
18
+
19
+ ```
20
+ night-watch review
21
+ ```
22
+
23
+ 3. **Review a specific PR**:
24
+
25
+ ```
26
+ night-watch review --pr <number>
27
+ ```
28
+
29
+ 4. **Check review results**:
30
+ ```
31
+ night-watch logs --type review
32
+ ```
33
+
34
+ ## Notes
35
+
36
+ - Minimum passing score: 80/100 (configurable via `minReviewScore` in `night-watch.config.json`)
37
+ - Failed reviews block auto-merge and trigger webhook notifications
38
+ - The reviewer runs automatically on its own cron schedule (`reviewerSchedule` in config)
39
+ - Review checks: code quality, test coverage, PR description, acceptance criteria alignment
@@ -0,0 +1,39 @@
1
+ # Skill: nw-run
2
+
3
+ Manually trigger Night Watch to execute the next available PRD immediately.
4
+
5
+ ## When to use
6
+
7
+ When the user wants to run Night Watch now instead of waiting for the cron schedule.
8
+
9
+ ## Steps
10
+
11
+ 1. **Check what's queued**:
12
+
13
+ ```
14
+ night-watch prd list
15
+ ```
16
+
17
+ 2. **Run the executor**:
18
+
19
+ ```
20
+ night-watch run
21
+ ```
22
+
23
+ 3. **To run a specific PRD** by filename:
24
+
25
+ ```
26
+ night-watch run --prd <filename.md>
27
+ ```
28
+
29
+ 4. **Monitor logs** in real time:
30
+ ```
31
+ night-watch logs --follow
32
+ ```
33
+
34
+ ## Notes
35
+
36
+ - Night Watch executes ONE PRD per run to prevent timeouts and reduce risk
37
+ - The automated cron schedule runs on a configurable interval (check with `night-watch status`)
38
+ - Use `night-watch queue` to see all queued PRDs in priority order
39
+ - If a run fails, the PRD is NOT marked as done — fix the issue and re-run
@@ -0,0 +1,33 @@
1
+ # Skill: nw-slice
2
+
3
+ Slice a high-level roadmap item or epic into multiple focused PRD files for Night Watch execution.
4
+
5
+ ## When to use
6
+
7
+ When the user has a large feature or roadmap item that should be broken into smaller,
8
+ independently-executable pieces.
9
+
10
+ ## Steps
11
+
12
+ 1. **Ask for the epic description** if not provided.
13
+
14
+ 2. **Run the slicer** to auto-generate PRDs from a roadmap file:
15
+
16
+ ```
17
+ night-watch slice
18
+ ```
19
+
20
+ This reads `docs/roadmap.md` (or configured roadmap path) and generates PRD files.
21
+
22
+ 3. **To slice a specific feature**, first add it to `docs/roadmap.md`, then run slice.
23
+
24
+ 4. **Review generated PRDs** in `docs/prds/` — adjust scope, complexity, or phases if needed.
25
+
26
+ 5. PRDs run in creation order (or by `prdPriority` config) on the next Night Watch execution.
27
+
28
+ ## Tips
29
+
30
+ - Each PRD should be deployable independently without breaking anything
31
+ - Keep PRDs focused on 1-2 user stories for faster execution
32
+ - Complex PRDs (score 3) often benefit from splitting into 2 medium PRDs
33
+ - Use `Depends-On: <other-prd.md>` in a PRD's front matter to enforce ordering
@@ -0,0 +1,58 @@
1
+ ## Night Watch Skills
2
+
3
+ The following Night Watch CLI commands are available. Use them when the user asks to manage PRDs, board issues, or trigger Night Watch operations.
4
+
5
+ ### Create a PRD (`/nw-create-prd`)
6
+
7
+ Create a new PRD at `docs/prds/<name>.md`. Ask for feature title, assess complexity (1=Simple, 2=Medium, 3=Complex), split into phases with checkbox tasks, then write the file. Tell the user to run `night-watch run` to execute immediately.
8
+
9
+ ### Add Issue to Board (`/nw-add-issue`)
10
+
11
+ Add a GitHub issue to the Night Watch board:
12
+
13
+ ```
14
+ night-watch board add-issue <issue-number>
15
+ night-watch board add-issue <issue-number> --column "In Progress"
16
+ ```
17
+
18
+ Available columns: Draft, Ready, In Progress, Review, Done.
19
+
20
+ ### Run Next PRD (`/nw-run`)
21
+
22
+ Manually trigger Night Watch to execute the next PRD:
23
+
24
+ ```
25
+ night-watch prd list # see what's queued
26
+ night-watch run # execute next PRD
27
+ night-watch run --prd <file> # run specific PRD
28
+ night-watch logs --follow # monitor progress
29
+ ```
30
+
31
+ ### Slice Roadmap (`/nw-slice`)
32
+
33
+ Break a high-level feature into multiple PRD files:
34
+
35
+ ```
36
+ night-watch slice
37
+ ```
38
+
39
+ Reads `docs/roadmap.md` and generates PRDs. Review and adjust output in `docs/prds/`.
40
+
41
+ ### Sync Board (`/nw-board-sync`)
42
+
43
+ Sync the GitHub board with PRD/PR state:
44
+
45
+ ```
46
+ night-watch board status
47
+ night-watch board sync
48
+ ```
49
+
50
+ ### Review PRs (`/nw-review`)
51
+
52
+ Run automated PR review:
53
+
54
+ ```
55
+ night-watch review
56
+ night-watch review --pr <number>
57
+ night-watch logs --type review
58
+ ```
@@ -0,0 +1,39 @@
1
+ # Skill: nw-add-issue
2
+
3
+ Add an existing GitHub issue to the Night Watch project board for tracking and execution.
4
+
5
+ ## When to use
6
+
7
+ When the user wants to add a GitHub issue to the Night Watch Kanban board.
8
+
9
+ ## Steps
10
+
11
+ 1. **Check for issue number** — if not provided, list open issues:
12
+
13
+ ```
14
+ gh issue list --state open --limit 20
15
+ ```
16
+
17
+ Ask the user which issue(s) to add.
18
+
19
+ 2. **Add the issue to the board**:
20
+
21
+ ```
22
+ night-watch board add-issue <issue-number>
23
+ ```
24
+
25
+ 3. **Optionally specify a column** (default: "Ready"):
26
+
27
+ ```
28
+ night-watch board add-issue <issue-number> --column "In Progress"
29
+ ```
30
+
31
+ Available columns: `Draft`, `Ready`, `In Progress`, `Review`, `Done`
32
+
33
+ 4. **Confirm** the issue was added and show its board position.
34
+
35
+ ## Notes
36
+
37
+ - Issues in "Ready" are picked up automatically by Night Watch on the next run
38
+ - Move issues to "Draft" if they're not yet ready for autonomous execution
39
+ - Use `night-watch board sync` if the board gets out of sync with PRDs
@@ -0,0 +1,47 @@
1
+ # Skill: nw-board-sync
2
+
3
+ Sync the GitHub Project board with the current state of Night Watch PRDs and pull requests.
4
+
5
+ ## When to use
6
+
7
+ When the board is out of sync with PRD/PR status, or after manual changes to issues or PRDs.
8
+
9
+ ## Steps
10
+
11
+ 1. **View current board state**:
12
+
13
+ ```
14
+ night-watch board status
15
+ ```
16
+
17
+ 2. **Sync board with PRD filesystem**:
18
+
19
+ ```
20
+ night-watch board sync
21
+ ```
22
+
23
+ 3. **List open issues that may need board assignment**:
24
+
25
+ ```
26
+ gh issue list --state open --label "night-watch"
27
+ ```
28
+
29
+ 4. **Add any missing issues to the board**:
30
+ ```
31
+ night-watch board add-issue <number>
32
+ ```
33
+
34
+ ## Board Columns
35
+
36
+ | Column | Meaning |
37
+ | ----------- | ------------------------------------------------ |
38
+ | Draft | Not ready for execution |
39
+ | Ready | Queued for Night Watch — picked up automatically |
40
+ | In Progress | Currently being implemented |
41
+ | Review | PR opened, awaiting review |
42
+ | Done | Merged and complete |
43
+
44
+ ## Notes
45
+
46
+ - Night Watch auto-moves issues from Ready → In Progress when starting, and In Progress → Review when opening a PR
47
+ - Use `night-watch board setup` to create the board if it doesn't exist yet
@@ -0,0 +1,61 @@
1
+ # Skill: nw-create-prd
2
+
3
+ Create a new Product Requirements Document (PRD) for Night Watch to implement autonomously.
4
+
5
+ ## When to use
6
+
7
+ When the user describes a feature, bug fix, or improvement they want Night Watch to implement.
8
+
9
+ ## Steps
10
+
11
+ 1. **Gather requirements** — if not fully described, ask:
12
+ - What problem does this solve?
13
+ - What is the expected outcome?
14
+
15
+ 2. **Assess complexity**:
16
+ - **1 (Simple)**: single-file fix, minor config change, small bug
17
+ - **2 (Medium)**: multi-file feature, new endpoint, new component
18
+ - **3 (Complex)**: new subsystem, architectural change, major refactor
19
+
20
+ 3. **Split into phases** — each phase should be an independently testable checkpoint:
21
+ - Phase 1: data models, interfaces, schema
22
+ - Middle phases: services, API, core logic
23
+ - Final phase: UI, integration, tests
24
+
25
+ 4. **Write the PRD** to `docs/prds/<kebab-case-title>.md` using this structure:
26
+
27
+ ```
28
+ # PRD: <Title>
29
+
30
+ **Complexity: <1|2|3> → <Simple|Medium|Complex> mode**
31
+
32
+ ## Problem
33
+
34
+ <1-2 sentences describing the user problem or business need>
35
+
36
+ ## Solution
37
+
38
+ - <bullet 1>
39
+ - <bullet 2>
40
+ - <bullet 3>
41
+
42
+ ## Phases
43
+
44
+ ### Phase 1: <Name>
45
+
46
+ - [ ] <specific implementation task>
47
+ - [ ] <write tests for above>
48
+
49
+ ### Phase 2: <Name>
50
+
51
+ - [ ] <specific implementation task>
52
+ - [ ] <write integration tests>
53
+
54
+ ## Acceptance Criteria
55
+
56
+ - [ ] All phases complete
57
+ - [ ] All tests pass
58
+ - [ ] Feature reachable from existing code (no orphaned code)
59
+ ```
60
+
61
+ 5. **Confirm** to the user: show the file path and remind them to run `night-watch run` to execute immediately, or it will run on the next scheduled cron cycle.
@@ -0,0 +1,39 @@
1
+ # Skill: nw-review
2
+
3
+ Run the Night Watch automated PR reviewer on open pull requests.
4
+
5
+ ## When to use
6
+
7
+ When the user wants to trigger automated code review on Night Watch PRs, or when a PR needs a review score.
8
+
9
+ ## Steps
10
+
11
+ 1. **List open Night Watch PRs**:
12
+
13
+ ```
14
+ gh pr list --state open --json number,title,headRefName --jq '.[] | select(.headRefName | startswith("night-watch/"))'
15
+ ```
16
+
17
+ 2. **Run the reviewer** (processes all eligible PRs):
18
+
19
+ ```
20
+ night-watch review
21
+ ```
22
+
23
+ 3. **Review a specific PR**:
24
+
25
+ ```
26
+ night-watch review --pr <number>
27
+ ```
28
+
29
+ 4. **Check review results**:
30
+ ```
31
+ night-watch logs --type review
32
+ ```
33
+
34
+ ## Notes
35
+
36
+ - Minimum passing score: 80/100 (configurable via `minReviewScore` in `night-watch.config.json`)
37
+ - Failed reviews block auto-merge and trigger webhook notifications
38
+ - The reviewer runs automatically on its own cron schedule (`reviewerSchedule` in config)
39
+ - Review checks: code quality, test coverage, PR description, acceptance criteria alignment
@@ -0,0 +1,39 @@
1
+ # Skill: nw-run
2
+
3
+ Manually trigger Night Watch to execute the next available PRD immediately.
4
+
5
+ ## When to use
6
+
7
+ When the user wants to run Night Watch now instead of waiting for the cron schedule.
8
+
9
+ ## Steps
10
+
11
+ 1. **Check what's queued**:
12
+
13
+ ```
14
+ night-watch prd list
15
+ ```
16
+
17
+ 2. **Run the executor**:
18
+
19
+ ```
20
+ night-watch run
21
+ ```
22
+
23
+ 3. **To run a specific PRD** by filename:
24
+
25
+ ```
26
+ night-watch run --prd <filename.md>
27
+ ```
28
+
29
+ 4. **Monitor logs** in real time:
30
+ ```
31
+ night-watch logs --follow
32
+ ```
33
+
34
+ ## Notes
35
+
36
+ - Night Watch executes ONE PRD per run to prevent timeouts and reduce risk
37
+ - The automated cron schedule runs on a configurable interval (check with `night-watch status`)
38
+ - Use `night-watch queue` to see all queued PRDs in priority order
39
+ - If a run fails, the PRD is NOT marked as done — fix the issue and re-run
@@ -0,0 +1,33 @@
1
+ # Skill: nw-slice
2
+
3
+ Slice a high-level roadmap item or epic into multiple focused PRD files for Night Watch execution.
4
+
5
+ ## When to use
6
+
7
+ When the user has a large feature or roadmap item that should be broken into smaller,
8
+ independently-executable pieces.
9
+
10
+ ## Steps
11
+
12
+ 1. **Ask for the epic description** if not provided.
13
+
14
+ 2. **Run the slicer** to auto-generate PRDs from a roadmap file:
15
+
16
+ ```
17
+ night-watch slice
18
+ ```
19
+
20
+ This reads `docs/roadmap.md` (or configured roadmap path) and generates PRD files.
21
+
22
+ 3. **To slice a specific feature**, first add it to `docs/roadmap.md`, then run slice.
23
+
24
+ 4. **Review generated PRDs** in `docs/prds/` — adjust scope, complexity, or phases if needed.
25
+
26
+ 5. PRDs run in creation order (or by `prdPriority` config) on the next Night Watch execution.
27
+
28
+ ## Tips
29
+
30
+ - Each PRD should be deployable independently without breaking anything
31
+ - Keep PRDs focused on 1-2 user stories for faster execution
32
+ - Complex PRDs (score 3) often benefit from splitting into 2 medium PRDs
33
+ - Use `Depends-On: <other-prd.md>` in a PRD's front matter to enforce ordering