@nusoft/nuos-build-catalogue 0.30.1 → 0.30.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nusoft/nuos-build-catalogue",
3
- "version": "0.30.1",
3
+ "version": "0.30.3",
4
4
  "description": "NuOS build-catalogue tooling: semantic search (WU 110) + migration runner that lifts markdown artefacts into JSON-backed workflow records (WU 111, Phase G).",
5
5
  "type": "module",
6
6
  "bin": {
@@ -15,6 +15,64 @@
15
15
 
16
16
  set -euo pipefail
17
17
 
18
+ # ---- Ensure nuos-catalogue CLI is installed --------------------------------
19
+ #
20
+ # The CLI is a global npm tool with no presence in any package.json — it
21
+ # disappears silently when global packages are cleared. Install it here so
22
+ # the build memory system is always ready after a post-clone setup run.
23
+
24
+ if ! command -v nuos-catalogue &>/dev/null; then
25
+ echo "▶ nuos-catalogue not found — installing @nusoft/nuos-build-catalogue globally..."
26
+ npm install -g @nusoft/nuos-build-catalogue
27
+ echo "✓ nuos-catalogue installed"
28
+ else
29
+ echo "✓ nuos-catalogue present ($(nuos-catalogue --version 2>/dev/null | head -1 || echo 'version unknown'))"
30
+ fi
31
+ echo
32
+
33
+ # ---- Patch ~/.claude/settings.json with the Playwright singleton hook ------
34
+ #
35
+ # Each VS Code Claude Code window spawns its own playwright-mcp process. They
36
+ # all share one Chrome profile, and Chrome's singleton lock means only the first
37
+ # one to open Chrome succeeds — every later session gets "browser already in use".
38
+ # This PreToolUse hook kills the locked Chrome before each browser_navigate so
39
+ # the current session always gets a clean launch.
40
+
41
+ CLAUDE_SETTINGS="$HOME/.claude/settings.json"
42
+ PLAYWRIGHT_HOOK_MARKER="mcp__plugin_playwright_playwright__browser_navigate"
43
+
44
+ if [[ -f "$CLAUDE_SETTINGS" ]] && ! grep -q "$PLAYWRIGHT_HOOK_MARKER" "$CLAUDE_SETTINGS"; then
45
+ echo "▶ Patching ~/.claude/settings.json with Playwright singleton hook..."
46
+ node -e "
47
+ const fs = require('fs');
48
+ const path = '$CLAUDE_SETTINGS';
49
+ const settings = JSON.parse(fs.readFileSync(path, 'utf8'));
50
+ settings.hooks = settings.hooks || {};
51
+ settings.hooks.PreToolUse = settings.hooks.PreToolUse || [];
52
+ const alreadySet = settings.hooks.PreToolUse.some(h => h.matcher === '$PLAYWRIGHT_HOOK_MARKER');
53
+ if (!alreadySet) {
54
+ settings.hooks.PreToolUse.push({
55
+ matcher: '$PLAYWRIGHT_HOOK_MARKER',
56
+ hooks: [{
57
+ type: 'command',
58
+ command: \"pkill -f 'user-data-dir.*mcp-chrome' 2>/dev/null; sleep 0.5; exit 0\",
59
+ timeout: 5,
60
+ statusMessage: 'Clearing stale Playwright browser...'
61
+ }]
62
+ });
63
+ fs.writeFileSync(path, JSON.stringify(settings, null, 2) + '\n');
64
+ console.log('✓ Playwright singleton hook added');
65
+ } else {
66
+ console.log('✓ Playwright singleton hook already present');
67
+ }
68
+ "
69
+ elif [[ ! -f "$CLAUDE_SETTINGS" ]]; then
70
+ echo "⚠ ~/.claude/settings.json not found — skipping Playwright hook patch (Claude Code not installed?)"
71
+ else
72
+ echo "✓ Playwright singleton hook already present in ~/.claude/settings.json"
73
+ fi
74
+ echo
75
+
18
76
  REPO_ROOT="$(git rev-parse --show-toplevel)"
19
77
  SOURCE="$REPO_ROOT/scripts/hooks"
20
78
  TARGET="$REPO_ROOT/.git/hooks"
@@ -34,7 +34,7 @@ Read `docs/build/STATE.md`. Look at the **Planning progress** section:
34
34
 
35
35
  If yes, **switch to the `plan-orientation` protocol** (invoke `/plan-orientation` if available; otherwise read `.claude/commands/plan-orientation.md` and follow it). If no, point them at `docs/build/WELCOME.md` and `docs/build/GLOSSARY.md` so they can read about the catalogue first, then wait.
36
36
 
37
- - If **any planning phase is in progress or marked `🟡 next`**, route to the appropriate protocol. Read the most recent session log's "Resume hint" to know exactly where to pick up within the phase.
37
+ - If **any planning phase is in progress or marked `🟡 next`**, route to the appropriate protocol. Read STATE.md's `## Last session resume` section to know exactly where to pick up within the phase. Do not open the session log file.
38
38
 
39
39
  | Phase | Protocol |
40
40
  |---|---|
@@ -50,12 +50,13 @@ Read `docs/build/STATE.md`. Look at the **Planning progress** section:
50
50
 
51
51
  ## Step 2 — Read where the project is
52
52
 
53
- Read these files in order:
53
+ Read only what is necessary — no more:
54
54
 
55
- 1. `docs/build/STATE.md` in full — the always-current snapshot
56
- 2. The most recent file in `docs/build/sessions/` what happened last session
57
- 3. The active work unit named in STATE.md, including its notes section at the bottom
58
- 4. Skim `docs/build/open-questions/_index.md` and `docs/build/risks/_index.md` for anything blocking the active work unit
55
+ 1. `docs/build/STATE.md` in full — the always-current snapshot. **This is the primary source.** The `## Last session resume` section contains the pickup point from the previous session; you do not need to open any session log file.
56
+ 2. The active work unit named in STATE.md — read the **header** (status, persona, last updated), `## What's done when this ships`, and only the **most recent dated entry** in `## Notes / log`. Do not read earlier note entries; they are history, not orientation.
57
+ 3. **Only if** STATE.md's `## Open questions blocking progress` section lists actual entries (not "None"): read `docs/build/open-questions/_index.md` and `docs/build/risks/_index.md`.
58
+
59
+ Do not open session log files. They are archives. The resume block in STATE.md is authoritative.
59
60
 
60
61
  ## Step 3 — Tell the operator where they are
61
62
 
@@ -83,4 +84,4 @@ If STATE.md still has placeholder text, references a work unit that doesn't exis
83
84
 
84
85
  - **Don't make decisions in conversation without filing them.** If the operator says "let's do X" and X is a real architectural choice, file it as a decision in `docs/build/decisions/` before moving on. Decisions made in conversation that aren't filed produce drift — and drift is the failure mode that makes the catalogue worthless.
85
86
  - **Don't start work that needs an open question resolved.** Surface the blocker; ask the operator how they want to proceed.
86
- - **Don't read past your tasks.** STATE, last session log, active work unit, blockers — then stop. Surface those, wait for direction.
87
+ - **Don't read past your tasks.** STATE.md and the scoped active work unit — then stop. Do not open session log files; the resume block in STATE.md is sufficient. Surface what you know, wait for direction.
@@ -30,6 +30,12 @@ Nothing yet — this catalogue was just adopted on {{TODAY}}.
30
30
 
31
31
  Run `/start-of-session` to begin. The AI will read this file and walk you through Phase A of planning.
32
32
 
33
+ ## Last session resume
34
+
35
+ No sessions have run yet.
36
+
37
+ _end-of-session writes here: what the last session accomplished (1–2 sentences), exactly where to pick up, and any mid-task context needed. start-of-session reads this instead of opening the session log file._
38
+
33
39
  ## Open questions blocking progress
34
40
 
35
41
  None currently filed. Filed questions live in [`open-questions/_index.md`](open-questions/_index.md).
@@ -56,6 +62,7 @@ None currently filed. Filed risks live in [`risks/_index.md`](risks/_index.md).
56
62
  - **What is currently in flight** describes ongoing work; updated when work changes shape
57
63
  - **What just shipped** notes the most recent completion(s)
58
64
  - **What is next** points at the immediate concrete action
65
+ - **Last session resume** is the pickup block written by end-of-session — start-of-session reads this instead of opening a session log file
59
66
  - Below: open questions, risks, decisions, and active work units — pulled from their respective registers for quick scanning
60
67
 
61
68
  This file is the project's executive summary. The detail lives in the register files; this is the one-screen view that says where the project is.