@jonit-dev/night-watch-cli 1.8.2 → 1.8.4-beta.0

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 (32) hide show
  1. package/dist/cli.js +1017 -553
  2. package/dist/commands/board.d.ts.map +1 -1
  3. package/dist/commands/board.js +20 -0
  4. package/dist/commands/board.js.map +1 -1
  5. package/dist/commands/doctor.d.ts.map +1 -1
  6. package/dist/commands/doctor.js +8 -12
  7. package/dist/commands/doctor.js.map +1 -1
  8. package/dist/commands/init.d.ts.map +1 -1
  9. package/dist/commands/init.js +96 -2
  10. package/dist/commands/init.js.map +1 -1
  11. package/dist/scripts/publish.sh +94 -26
  12. package/dist/templates/prd-executor.md +1 -0
  13. package/dist/templates/skills/_codex-block.md +58 -0
  14. package/dist/templates/skills/nw-add-issue.md +39 -0
  15. package/dist/templates/skills/nw-board-sync.md +47 -0
  16. package/dist/templates/skills/nw-create-prd.md +61 -0
  17. package/dist/templates/skills/nw-review.md +39 -0
  18. package/dist/templates/skills/nw-run.md +39 -0
  19. package/dist/templates/skills/nw-slice.md +33 -0
  20. package/dist/templates/skills/skills/_codex-block.md +58 -0
  21. package/dist/templates/skills/skills/nw-add-issue.md +39 -0
  22. package/dist/templates/skills/skills/nw-board-sync.md +47 -0
  23. package/dist/templates/skills/skills/nw-create-prd.md +61 -0
  24. package/dist/templates/skills/skills/nw-review.md +39 -0
  25. package/dist/templates/skills/skills/nw-run.md +39 -0
  26. package/dist/templates/skills/skills/nw-slice.md +33 -0
  27. package/dist/web/assets/index-BFxPiKyy.js +381 -0
  28. package/dist/web/assets/index-Cp7RYjoy.css +1 -0
  29. package/dist/web/assets/index-DTsfDC7m.js +381 -0
  30. package/dist/web/assets/index-ZABWMEZR.js +381 -0
  31. package/dist/web/index.html +2 -2
  32. package/package.json +12 -3
@@ -4,6 +4,14 @@ set -euo pipefail
4
4
  REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"
5
5
  CLI_PKG="$REPO_ROOT/packages/cli"
6
6
  PROJECTS_FILE="$HOME/.night-watch/projects.json"
7
+ BETA=false
8
+
9
+ # Parse flags
10
+ for arg in "$@"; do
11
+ case $arg in
12
+ --beta) BETA=true ;;
13
+ esac
14
+ done
7
15
 
8
16
  cd "$REPO_ROOT"
9
17
 
@@ -11,16 +19,70 @@ cd "$REPO_ROOT"
11
19
  # Force all npm calls to use the official registry where the auth token is stored.
12
20
  export npm_config_registry=https://registry.npmjs.org
13
21
 
22
+ CURRENT_VERSION=$(node -p "require('$CLI_PKG/package.json').version")
23
+
24
+ # Confirmation prompt
25
+ echo ""
26
+ if [[ "$BETA" == true ]]; then
27
+ echo " ┌─────────────────────────────────────────────────────────┐"
28
+ echo " │ BETA RELEASE │"
29
+ echo " │ │"
30
+ echo " │ Published to: npm tag @beta │"
31
+ echo " │ Install with: npm i -g @jonit-dev/night-watch-cli@beta │"
32
+ echo " │ Current version: $CURRENT_VERSION"
33
+ echo " └─────────────────────────────────────────────────────────┘"
34
+ echo ""
35
+ read -r -p " Publish beta release? [y/N] " confirm
36
+ else
37
+ echo " ┌─────────────────────────────────────────────────────────┐"
38
+ echo " │ STABLE (LATEST) RELEASE │"
39
+ echo " │ │"
40
+ echo " │ WARNING: This publishes to the @latest npm tag. │"
41
+ echo " │ All users running 'npm update' will receive this. │"
42
+ echo " │ │"
43
+ echo " │ Only proceed if this version is production-ready. │"
44
+ echo " │ Current version: $CURRENT_VERSION"
45
+ echo " └─────────────────────────────────────────────────────────┘"
46
+ echo ""
47
+ read -r -p " Publish stable release to ALL users? [y/N] " confirm
48
+ fi
49
+
50
+ if [[ ! "$confirm" =~ ^[Yy]$ ]]; then
51
+ echo "Aborted."
52
+ exit 0
53
+ fi
54
+
55
+ echo ""
14
56
  echo "==> Running verify + tests..."
15
57
  yarn verify && yarn test
16
58
 
17
- echo "==> Bumping patch version..."
18
- CURRENT_VERSION=$(node -p "require('$CLI_PKG/package.json').version")
19
- IFS='.' read -r major minor patch <<< "$CURRENT_VERSION"
20
- NEW_VERSION="$major.$minor.$((patch + 1))"
21
- echo " $CURRENT_VERSION -> $NEW_VERSION"
59
+ # Version bumping
60
+ IFS='.' read -r major minor patch_full <<< "$CURRENT_VERSION"
61
+
62
+ if [[ "$BETA" == true ]]; then
63
+ # Strip any existing pre-release suffix from patch
64
+ patch="${patch_full%%-*}"
65
+
66
+ # Check if current version is already a beta of the next patch
67
+ if [[ "$CURRENT_VERSION" =~ ^([0-9]+\.[0-9]+\.[0-9]+)-beta\.([0-9]+)$ ]]; then
68
+ # Bump beta number: 1.8.4-beta.0 -> 1.8.4-beta.1
69
+ base="${BASH_REMATCH[1]}"
70
+ beta_num="${BASH_REMATCH[2]}"
71
+ NEW_VERSION="$base-beta.$((beta_num + 1))"
72
+ else
73
+ # Start new beta: 1.8.3 -> 1.8.4-beta.0
74
+ NEW_VERSION="$major.$minor.$((patch + 1))-beta.0"
75
+ fi
76
+ NPM_TAG="beta"
77
+ else
78
+ # Stable: strip any pre-release suffix and bump patch
79
+ patch="${patch_full%%-*}"
80
+ NEW_VERSION="$major.$minor.$((patch + 1))"
81
+ NPM_TAG="latest"
82
+ fi
83
+
84
+ echo "==> Bumping version: $CURRENT_VERSION -> $NEW_VERSION"
22
85
 
23
- # Update package.json
24
86
  node -e "
25
87
  const fs = require('fs');
26
88
  const pkg = JSON.parse(fs.readFileSync('$CLI_PKG/package.json', 'utf8'));
@@ -33,9 +95,9 @@ git add "$CLI_PKG/package.json"
33
95
  git commit -m "chore: bump version to $NEW_VERSION"
34
96
  git push origin master
35
97
 
36
- echo "==> Publishing to npm..."
98
+ echo "==> Publishing to npm (tag: $NPM_TAG)..."
37
99
  cd "$CLI_PKG"
38
- npm publish --access public
100
+ npm publish --access public --tag "$NPM_TAG"
39
101
 
40
102
  echo "==> Installing globally (waiting for registry propagation)..."
41
103
  echo " Waiting 60s for npm registry to propagate..."
@@ -54,25 +116,31 @@ for attempt in 1 2 3 4 5; do
54
116
  done
55
117
  night-watch --version
56
118
 
57
- echo "==> Updating registered projects (skipping /tmp/*)..."
58
- if [[ -f "$PROJECTS_FILE" ]]; then
59
- node -e "
60
- const projects = JSON.parse(require('fs').readFileSync('$PROJECTS_FILE', 'utf8'));
61
- projects
62
- .filter(p => p.path && !p.path.startsWith('/tmp/'))
63
- .forEach(p => {
64
- console.log(' Project: ' + p.name + ' (' + p.path + ')');
65
- const { execSync } = require('child_process');
66
- try {
67
- execSync('night-watch update --projects ' + p.path, { stdio: 'inherit' });
68
- } catch (e) {
69
- console.error(' WARN: update failed for ' + p.name);
70
- }
71
- });
72
- "
119
+ # Only update registered projects for stable releases
120
+ if [[ "$BETA" == true ]]; then
121
+ echo ""
122
+ echo "==> Skipping project updates (beta release)."
73
123
  else
74
- echo " No projects file found at $PROJECTS_FILE, skipping."
124
+ echo "==> Updating registered projects (skipping /tmp/*)..."
125
+ if [[ -f "$PROJECTS_FILE" ]]; then
126
+ node -e "
127
+ const projects = JSON.parse(require('fs').readFileSync('$PROJECTS_FILE', 'utf8'));
128
+ projects
129
+ .filter(p => p.path && !p.path.startsWith('/tmp/'))
130
+ .forEach(p => {
131
+ console.log(' Project: ' + p.name + ' (' + p.path + ')');
132
+ const { execSync } = require('child_process');
133
+ try {
134
+ execSync('night-watch update --projects ' + p.path, { stdio: 'inherit' });
135
+ } catch (e) {
136
+ console.error(' WARN: update failed for ' + p.name);
137
+ }
138
+ });
139
+ "
140
+ else
141
+ echo " No projects file found at $PROJECTS_FILE, skipping."
142
+ fi
75
143
  fi
76
144
 
77
145
  echo ""
78
- echo "Done! Published $NEW_VERSION"
146
+ echo "Done! Published $NEW_VERSION (@$NPM_TAG)"
@@ -233,3 +233,4 @@ If two parallel agents modify the same file:
233
233
  - **Full context** - each agent gets the complete phase spec + project rules
234
234
  - **Verify always** - never skip verification between waves
235
235
  - **Task tracking** - every phase is a tracked task with status updates
236
+ - **Clean up worktrees** - after opening a PR for a worktree branch, immediately remove the worktree to avoid blocking future `git checkout` operations
@@ -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
@@ -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.