@jonit-dev/night-watch-cli 1.8.12-beta.5 → 1.8.12-beta.7

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/dist/cli.js CHANGED
@@ -6714,9 +6714,19 @@ The PRD directory is: \`{{PRD_DIR}}\`
6714
6714
 
6715
6715
  ## Your Task
6716
6716
 
6717
- 1. **Explore the Codebase** \u2014 Read relevant existing files to understand structure, patterns, and conventions.
6717
+ 1. **Explore the Codebase** \u2014 Read relevant existing files to understand structure, patterns, and conventions. Look for:
6718
+ - \`CLAUDE.md\` or similar AI assistant documentation
6719
+ - Existing code in the area you'll be modifying
6720
+ - Related features or modules this feature interacts with
6721
+ - Test patterns and verification commands
6722
+ - \`.env\` files or env-loading utilities (use those patterns, never hardcode values)
6723
+
6718
6724
  2. **Assess Complexity** \u2014 Score using the rubric below and determine LOW / MEDIUM / HIGH.
6719
- 3. **Write a Complete PRD** \u2014 Follow the exact template structure below. Every section must be filled with concrete information.
6725
+
6726
+ 3. **Write a Complete PRD** \u2014 Follow the exact template structure below. Every section must be filled with concrete information. No placeholder text.
6727
+
6728
+ The PRD MUST include these sections: Context (with Problem, Files Analyzed, Current Behavior, Integration Points), Solution (with Approach, Key Decisions), Execution Phases (with Files, Implementation steps, Tests), and Acceptance Criteria.
6729
+
6720
6730
  4. **Write the PRD File** \u2014 Use the Write tool to create the PRD file at \`{{OUTPUT_FILE_PATH}}\`.
6721
6731
 
6722
6732
  ---
@@ -6724,6 +6734,7 @@ The PRD directory is: \`{{PRD_DIR}}\`
6724
6734
  ## Complexity Scoring
6725
6735
 
6726
6736
  \`\`\`
6737
+ COMPLEXITY SCORE (sum all that apply):
6727
6738
  +1 Touches 1-5 files
6728
6739
  +2 Touches 6-10 files
6729
6740
  +3 Touches 10+ files
@@ -6744,79 +6755,168 @@ The PRD directory is: \`{{PRD_DIR}}\`
6744
6755
 
6745
6756
  ## PRD Template Structure
6746
6757
 
6747
- Your PRD MUST use this structure. Replace every [bracketed placeholder] with real content.
6758
+ Your PRD MUST follow this exact structure. Replace every \`[bracketed placeholder]\` with real content.
6748
6759
 
6749
- # PRD: [Title]
6760
+ \`\`\`\`markdown
6761
+ # PRD: [Title from roadmap item]
6750
6762
 
6751
6763
  **Complexity: [SCORE] \u2192 [LEVEL] mode**
6752
6764
 
6765
+ - [Complexity breakdown as bullet list]
6766
+
6767
+ ---
6768
+
6753
6769
  ## 1. Context
6754
6770
 
6755
- **Problem:** [1-2 sentences]
6771
+ **Problem:** [1-2 sentences describing the issue being solved]
6756
6772
 
6757
6773
  **Files Analyzed:**
6758
- - \`path/to/file.ts\` \u2014 [what you found]
6774
+
6775
+ - \`path/to/file.ts\` \u2014 [what the file does / what you looked for]
6776
+ - [List every file you read before writing this PRD]
6759
6777
 
6760
6778
  **Current Behavior:**
6761
- - [3-5 bullets]
6779
+
6780
+ - [3-5 bullets describing what happens today]
6762
6781
 
6763
6782
  ### Integration Points
6764
- - Entry point: [cron / CLI / event / route]
6765
- - Caller file: [file invoking new code]
6766
- - User flow: User does X \u2192 triggers Y \u2192 result Z
6783
+
6784
+ **How will this feature be reached?**
6785
+
6786
+ - [ ] Entry point: [cron job / CLI command / event / API route]
6787
+ - [ ] Caller file: [file that will invoke this new code]
6788
+ - [ ] Registration/wiring: [anything that must be connected]
6789
+
6790
+ **Is this user-facing?**
6791
+
6792
+ - [ ] YES \u2192 UI components required: [list them]
6793
+ - [ ] NO \u2192 Internal/background (explain how it is triggered)
6794
+
6795
+ **Full user flow:**
6796
+
6797
+ 1. User does: [action]
6798
+ 2. Triggers: [code path]
6799
+ 3. Reaches new feature via: [specific connection point]
6800
+ 4. Result: [what the user sees]
6801
+
6802
+ ---
6767
6803
 
6768
6804
  ## 2. Solution
6769
6805
 
6770
6806
  **Approach:**
6771
- - [3-5 bullets]
6772
6807
 
6773
- **Key Decisions:** [library choices, error handling, reused utilities]
6808
+ - [3-5 bullets explaining the chosen solution]
6774
6809
 
6775
- **Data Changes:** [schema changes, or "None"]
6810
+ **Architecture Diagram** (MEDIUM/HIGH):
6776
6811
 
6777
- ## 3. Sequence Flow (MEDIUM/HIGH only)
6812
+ \`\`\`mermaid
6813
+ flowchart LR
6814
+ A[Component A] --> B[Component B] --> C[Result]
6815
+ \`\`\`
6816
+
6817
+ **Key Decisions:**
6818
+
6819
+ - [Library/framework choices, error-handling strategy, reused utilities]
6820
+
6821
+ **Data Changes:** [New schemas/migrations, or "None"]
6822
+
6823
+ ---
6824
+
6825
+ ## 3. Sequence Flow (MEDIUM/HIGH)
6826
+
6827
+ \`\`\`mermaid
6828
+ sequenceDiagram
6829
+ participant A as ComponentA
6830
+ participant B as ComponentB
6831
+ A->>B: methodName(args)
6832
+ alt Error
6833
+ B-->>A: ErrorType
6834
+ else Success
6835
+ B-->>A: Response
6836
+ end
6837
+ \`\`\`
6778
6838
 
6779
- [mermaid sequenceDiagram]
6839
+ ---
6780
6840
 
6781
6841
  ## 4. Execution Phases
6782
6842
 
6783
- ### Phase N: [Name] \u2014 [User-visible outcome]
6843
+ Critical rules:
6844
+ 1. Each phase = ONE user-testable vertical slice
6845
+ 2. Max 5 files per phase (split if larger)
6846
+ 3. Each phase MUST include concrete tests
6847
+ 4. Checkpoint after each phase
6848
+
6849
+ ### Phase 1: [Name] \u2014 [User-visible outcome in 1 sentence]
6784
6850
 
6785
6851
  **Files (max 5):**
6852
+
6786
6853
  - \`src/path/file.ts\` \u2014 [what changes]
6787
6854
 
6788
6855
  **Implementation:**
6856
+
6789
6857
  - [ ] Step 1
6858
+ - [ ] Step 2
6790
6859
 
6791
6860
  **Tests Required:**
6792
6861
  | Test File | Test Name | Assertion |
6793
6862
  |-----------|-----------|-----------|
6794
- | \`src/__tests__/feature.test.ts\` | \`should X when Y\` | \`expect(r).toBe(Z)\` |
6863
+ | \`src/__tests__/feature.test.ts\` | \`should do X when Y\` | \`expect(result).toBe(Z)\` |
6864
+
6865
+ **Verification Plan:**
6866
+
6867
+ 1. **Unit Tests:** [file and test names]
6868
+ 2. **User Verification:**
6869
+ - Action: [what to do]
6870
+ - Expected: [what should happen]
6795
6871
 
6796
6872
  **Checkpoint:** Run \`yarn verify\` and related tests after this phase.
6797
6873
 
6874
+ ---
6875
+
6876
+ [Repeat Phase block for each additional phase]
6877
+
6878
+ ---
6879
+
6798
6880
  ## 5. Acceptance Criteria
6799
6881
 
6800
6882
  - [ ] All phases complete
6801
- - [ ] All tests pass
6883
+ - [ ] All specified tests pass
6802
6884
  - [ ] \`yarn verify\` passes
6803
- - [ ] Feature is reachable (not orphaned code)
6885
+ - [ ] Feature is reachable (entry point connected, not orphaned code)
6886
+ - [ ] [Feature-specific criterion]
6887
+ - [ ] [Feature-specific criterion]
6888
+ \`\`\`\`
6804
6889
 
6805
6890
  ---
6806
6891
 
6807
6892
  ## Critical Instructions
6808
6893
 
6809
- 1. Read all relevant files BEFORE writing the PRD
6810
- 2. Follow existing patterns \u2014 use \`@/*\` path aliases, match naming conventions
6811
- 3. Include concrete file paths and implementation steps
6812
- 4. Include specific test names and assertions
6813
- 5. Use the Write tool to create the file at \`{{OUTPUT_FILE_PATH}}\`
6814
- 6. No placeholder text in the final PRD
6815
- 7. The PRD is the GitHub issue body \u2014 make it self-contained
6894
+ 1. **Read all relevant files BEFORE writing the PRD** \u2014 never guess at file paths or API shapes
6895
+ 2. **Follow existing patterns** \u2014 reuse utilities, match naming conventions, use path aliases (\`@/*\`)
6896
+ 3. **Concrete file paths and implementation details** \u2014 no vague steps
6897
+ 4. **Specific test names and assertions** \u2014 not "write tests"
6898
+ 5. **Use the Write tool** to create the file at \`{{OUTPUT_FILE_PATH}}\`
6899
+ 6. **No placeholder text** in the final PRD \u2014 every section must have real content
6900
+ 7. **Self-contained** \u2014 the PRD will be read as a GitHub issue; it must make sense without context
6816
6901
 
6817
- DO NOT leave [bracketed placeholder] text in the output.
6902
+ DO NOT leave \`[bracketed placeholder]\` text in the output.
6818
6903
  DO NOT skip any sections.
6819
6904
  DO NOT forget to write the file.
6905
+
6906
+ ---
6907
+
6908
+ ## Output
6909
+
6910
+ After writing the PRD file, report:
6911
+
6912
+ \`\`\`
6913
+ PRD Creation Complete
6914
+ File: {{OUTPUT_FILE_PATH}}
6915
+ Title: [PRD title]
6916
+ Complexity: [score] \u2192 [level]
6917
+ Phases: [count]
6918
+ Summary: [1-2 sentences]
6919
+ \`\`\`
6820
6920
  `;
6821
6921
  cachedTemplate = null;
6822
6922
  }
@@ -281,9 +281,9 @@ while IFS= read -r pr_json; do
281
281
  log "INFO: PR #${pr_number}: Rebase successful"
282
282
 
283
283
  # Poll CI until all checks complete after rebase (up to 5 minutes)
284
- local ci_max_wait=300
285
- local ci_waited=0
286
- local ci_poll=15
284
+ ci_max_wait=300
285
+ ci_waited=0
286
+ ci_poll=15
287
287
  while [ "${ci_waited}" -lt "${ci_max_wait}" ]; do
288
288
  sleep "${ci_poll}"
289
289
  ci_waited=$((ci_waited + ci_poll))
@@ -32,6 +32,8 @@ The PRD directory is: `{{PRD_DIR}}`
32
32
 
33
33
  3. **Write a Complete PRD** — Follow the exact template structure below. Every section must be filled with concrete information. No placeholder text.
34
34
 
35
+ The PRD MUST include these sections: Context (with Problem, Files Analyzed, Current Behavior, Integration Points), Solution (with Approach, Key Decisions), Execution Phases (with Files, Implementation steps, Tests), and Acceptance Criteria.
36
+
35
37
  4. **Write the PRD File** — Use the Write tool to create the PRD file at `{{OUTPUT_FILE_PATH}}`.
36
38
 
37
39
  ---
@@ -146,6 +148,7 @@ sequenceDiagram
146
148
  ## 4. Execution Phases
147
149
 
148
150
  Critical rules:
151
+
149
152
  1. Each phase = ONE user-testable vertical slice
150
153
  2. Max 5 files per phase (split if larger)
151
154
  3. Each phase MUST include concrete tests
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jonit-dev/night-watch-cli",
3
- "version": "1.8.12-beta.5",
3
+ "version": "1.8.12-beta.7",
4
4
  "description": "AI agent that implements your specs, opens PRs, and reviews code overnight. Queue GitHub issues or PRDs, wake up to pull requests.",
5
5
  "type": "module",
6
6
  "bin": {