@nusoft/nuos-build-catalogue 0.14.0 → 0.14.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.
package/dist/cli.js CHANGED
@@ -362,7 +362,7 @@ function cmdHelp() {
362
362
  console.log(`nuos-catalogue — NuOS build-catalogue tooling (WU 110, WU 111)
363
363
 
364
364
  Usage:
365
- nuos-catalogue init [--name=X --tagline="Y" --domain=Z --role=consumer --yes]
365
+ nuos-catalogue init [--name=X --tagline="Y" --role=consumer --interactive]
366
366
  (interactive bootstrap of docs/build/, methodfile.json, .claude/commands/<protocols>, CLAUDE.md, .gitignore overrides; refuses if docs/build/ already exists)
367
367
  nuos-catalogue install-protocols
368
368
  (refresh .claude/commands/<protocols> from this CLI's bundled canonical bodies)
@@ -434,7 +434,7 @@ async function main() {
434
434
  tagline: args.flags['tagline'] ? String(args.flags['tagline']) : undefined,
435
435
  domain: args.flags['domain'] ? String(args.flags['domain']) : undefined,
436
436
  role: args.flags['role'] ? String(args.flags['role']) : undefined,
437
- nonInteractive: Boolean(args.flags['yes']),
437
+ interactive: Boolean(args.flags['interactive']),
438
438
  });
439
439
  if (result.output)
440
440
  console.log(result.output);
@@ -30,12 +30,22 @@ import type { Prompt } from './prompt.js';
30
30
  export interface InitOptions {
31
31
  /** Target project root (default: cwd). */
32
32
  cwd?: string;
33
- /** Pre-supplied values; if any are missing, the prompt fills them in. */
33
+ /** Pre-supplied values; if omitted, sensible defaults are used. */
34
34
  name?: string;
35
35
  tagline?: string;
36
36
  domain?: string;
37
37
  role?: string;
38
- /** When true, runs all steps without prompts (uses defaults / supplied values). */
38
+ /**
39
+ * Opt into the prompt flow (project name, tagline, role, confirm).
40
+ * Default is non-interactive: scaffolds immediately with sensible
41
+ * defaults. The real configuration happens during Phase A of the
42
+ * planning arc, not at init time.
43
+ */
44
+ interactive?: boolean;
45
+ /**
46
+ * @deprecated kept only for backward compat with the older `--yes` flag;
47
+ * has no effect — init is always non-interactive unless `interactive` is set.
48
+ */
39
49
  nonInteractive?: boolean;
40
50
  }
41
51
  export interface InitResult {
@@ -30,7 +30,6 @@ import { mkdir, readFile, writeFile, readdir, access } from 'node:fs/promises';
30
30
  import { existsSync, constants } from 'node:fs';
31
31
  import path from 'node:path';
32
32
  import { fileURLToPath } from 'node:url';
33
- import { askUntilValid, validate } from './prompt.js';
34
33
  const __filename = fileURLToPath(import.meta.url);
35
34
  const PACKAGE_ROOT = path.resolve(path.dirname(__filename), '..', '..');
36
35
  const TEMPLATES_ROOT = path.resolve(PACKAGE_ROOT, 'templates');
@@ -95,44 +94,41 @@ export async function cmdInit(prompt, options = {}) {
95
94
  };
96
95
  }
97
96
  // Gather inputs.
97
+ //
98
+ // Init is **zero-prompt by default**. The user wants `npx ... init` to
99
+ // just work — sensible defaults fill in everything, the scaffold goes
100
+ // down, and the real planning happens in /start-of-session (Phase A of
101
+ // the planning arc), where the AI walks the user through the project
102
+ // description, personas, and the horizon map IN CONTEXT.
103
+ //
104
+ // Old behavior (4 prompts: name, tagline, domain, role) wasn't load-
105
+ // bearing — tagline gets produced during Phase A; domain is a relic;
106
+ // role is a planning-time annotation rarely used downstream. Users who
107
+ // want the prompts back can pass --interactive.
98
108
  const projectDefault = path.basename(cwd);
99
- let name = options.name;
100
- let tagline = options.tagline;
101
- let domain = options.domain;
102
- let role = options.role;
103
- if (!options.nonInteractive) {
104
- prompt.print('Initialising a NuOS Build Method catalogue.');
109
+ let name = options.name ?? projectDefault;
110
+ let tagline = options.tagline ?? '';
111
+ let domain = options.domain ?? '';
112
+ let role = options.role ?? 'consumer';
113
+ if (options.interactive) {
114
+ prompt.print('Setting up the catalogue.');
105
115
  prompt.print('');
106
- if (!name) {
107
- name = await askUntilValid(prompt, `Project name [${projectDefault}]: `, (v) => (v.trim().length === 0 ? null : null) // empty allowed; default applied below
108
- );
109
- if (!name.trim())
110
- name = projectDefault;
116
+ if (!options.name) {
117
+ const answer = (await prompt.ask(`Project name [${projectDefault}]: `)).trim();
118
+ if (answer)
119
+ name = answer;
111
120
  }
112
- if (!tagline) {
113
- tagline = await askUntilValid(prompt, 'One-sentence tagline (what this project is): ', (v) => validate.nonEmpty(v, 'tagline'));
121
+ if (!options.tagline) {
122
+ tagline = (await prompt.ask('One-line description (or empty Phase A will fill it in): ')).trim();
114
123
  }
115
- if (!domain) {
116
- domain = (await prompt.ask('Domain (e.g. example.com; empty for none): ')).trim() || 'n/a';
117
- }
118
- if (!role) {
124
+ if (!options.role) {
119
125
  role = await prompt.askChoice('Project role?', ['consumer', 'standalone', 'harness']);
120
126
  }
121
- const confirm = await prompt.confirm(`About to create docs/build/, methodfile.json, .claude/commands/<protocols>, append to CLAUDE.md, update .gitignore, and run first migrate. Proceed?`, true);
127
+ const confirm = await prompt.confirm(`Create docs/build/, install protocols + hooks, set up the catalogue. Proceed?`, true);
122
128
  if (!confirm) {
123
- return { output: 'init cancelled by operator.', exitCode: 1 };
129
+ return { output: 'init cancelled.', exitCode: 1 };
124
130
  }
125
131
  }
126
- else {
127
- if (!name)
128
- name = projectDefault;
129
- if (!tagline)
130
- tagline = '';
131
- if (!domain)
132
- domain = 'n/a';
133
- if (!role)
134
- role = 'consumer';
135
- }
136
132
  const subs = {
137
133
  '{{PROJECT_NAME}}': name,
138
134
  '{{PROJECT_TAGLINE}}': tagline,
@@ -140,10 +136,15 @@ export async function cmdInit(prompt, options = {}) {
140
136
  '{{PROJECT_ROLE}}': role,
141
137
  '{{TODAY}}': today,
142
138
  };
139
+ // Per-step "· created X" messages are kept as an in-memory audit trail
140
+ // but NOT printed by default. The end-user-facing output is just a
141
+ // single "Done. Type /start-of-session" at the close. Pass `interactive`
142
+ // to see the per-step lines (useful for debugging).
143
143
  const log = [];
144
144
  const log_line = (msg) => {
145
145
  log.push(msg);
146
- prompt.print(msg);
146
+ if (options.interactive)
147
+ prompt.print(msg);
147
148
  };
148
149
  // Step 1: docs/build/ scaffold from starter-kit
149
150
  log_line(' · creating docs/build/ from bundled starter-kit');
@@ -196,26 +197,10 @@ export async function cmdInit(prompt, options = {}) {
196
197
  const gitignorePath = path.join(cwd, '.gitignore');
197
198
  await ensureGitignoreEntries(gitignorePath, log_line);
198
199
  prompt.print('');
199
- prompt.print(`✅ Catalogue initialised at ${path.join(cwd, 'docs/build')}`);
200
- prompt.print('');
201
- prompt.print('Next step:');
202
- prompt.print(' Run `/start-of-session` in Claude Code (or OpenCode, or Codex CLI).');
203
- prompt.print(' The AI will detect this is a brand-new catalogue and walk you');
204
- prompt.print(' through a 5-phase planning arc:');
205
- prompt.print('');
206
- prompt.print(' A. Orientation — project description, personas, the horizon (~30 min)');
207
- prompt.print(' B. Architecture — major pieces and their contracts (~60-90 min)');
208
- prompt.print(' C. UI/UX + Design — surfaces and the design system (~60-90 min)');
209
- prompt.print(' D. Maps — phases of work and near-term plan (~45 min)');
210
- prompt.print(' E. Initial work units — first 5-10 things to build (~60 min)');
211
- prompt.print('');
212
- prompt.print(' Each phase is its own session. Pause whenever you want.');
200
+ prompt.print('✅ Done.');
213
201
  prompt.print('');
214
- prompt.print('To read about the catalogue before starting:');
215
- prompt.print(` ${path.join(cwd, 'docs/build/WELCOME.md')}`);
216
- prompt.print(` ${path.join(cwd, 'docs/build/GLOSSARY.md')}`);
202
+ prompt.print('Now type /start-of-session into Claude Code to begin.');
217
203
  prompt.print('');
218
- prompt.print('To refresh protocols and hooks later: `nuos-catalogue install-protocols`');
219
204
  return { output: '', exitCode: 0 };
220
205
  }
221
206
  export async function cmdInstallProtocols(prompt, options = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nusoft/nuos-build-catalogue",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
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": {