create-ombutocode 0.2.5 → 0.2.6
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/README.md +78 -0
- package/bin/create-ombutocode.js +284 -34
- package/package.json +1 -1
- package/template/GettingStarted.md +6 -5
package/README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# create-ombutocode
|
|
2
|
+
|
|
3
|
+
The `npx` installer for [Ombuto Code](https://ombutocode.com). Each installer
|
|
4
|
+
version clones one pinned workbench release (`CLONE_REF` in
|
|
5
|
+
`bin/create-ombutocode.js`), so a given `create-ombutocode` version always
|
|
6
|
+
produces the same project.
|
|
7
|
+
|
|
8
|
+
## Create a new project
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npx create-ombutocode my-project
|
|
12
|
+
cd my-project
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Clones the pinned release into `my-project/`, removes the upstream
|
|
16
|
+
maintainer files and sample app, writes a project `README.md`, `CLAUDE.md`
|
|
17
|
+
and `GettingStarted.md`, installs the workbench dependencies, seeds `docs/`
|
|
18
|
+
with starter documents and skills, and makes an initial git commit.
|
|
19
|
+
|
|
20
|
+
## Adopt into an existing directory
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npx create-ombutocode --into-existing /path/to/repo
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Adds Ombuto Code to a directory that already has code in it — typically a
|
|
27
|
+
repository you want agents to work on without creating a new project around
|
|
28
|
+
it. `<dir>` must exist and must not already contain `.ombutocode/`. The
|
|
29
|
+
project name is the directory's basename.
|
|
30
|
+
|
|
31
|
+
What it does:
|
|
32
|
+
|
|
33
|
+
- Clones the pinned release into a temporary directory and moves only
|
|
34
|
+
`.ombutocode/` into `<dir>`. The clone's own `docs/` is discarded; the
|
|
35
|
+
`docs/` skeleton (folders, starter documents, `docs/Skills/`) is seeded by
|
|
36
|
+
`initombuto --keep-docs`, which only ever creates files that are missing.
|
|
37
|
+
An existing `docs/` is merged into, never overwritten.
|
|
38
|
+
- Writes `README.md`, `CLAUDE.md` and `GettingStarted.md` only if no file of
|
|
39
|
+
that name exists. If `.gitignore` exists, the Ombuto entries
|
|
40
|
+
(`.ombutocode/src/node_modules/`, `.ombutocode/src/release/`,
|
|
41
|
+
`.ombutocode/src/dist/`) are appended only when absent; otherwise a
|
|
42
|
+
`.gitignore` holding just those entries is created.
|
|
43
|
+
- Installs the workbench dependencies and runs `initombuto` against `<dir>`.
|
|
44
|
+
- Never runs `git init`, `git add` or `git commit`. If `<dir>` is already a
|
|
45
|
+
git repository it prints the commands to commit `.ombutocode/` and
|
|
46
|
+
`docs/`; if it is not, it says so — the scheduler builds in git worktrees,
|
|
47
|
+
so a repository is needed before agents can run.
|
|
48
|
+
|
|
49
|
+
## Headless-only install
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npx create-ombutocode --into-existing /app --omit-dev
|
|
53
|
+
npx create-ombutocode my-project --omit-dev
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Installs with `npm install --omit=dev --legacy-peer-deps`, leaving out
|
|
57
|
+
Electron, Vite and electron-builder (about 207 MB of `node_modules` instead
|
|
58
|
+
of 467 MB). `--legacy-peer-deps` is needed because `@electron/remote`, a
|
|
59
|
+
runtime dependency, lists `electron` as a peer dependency and npm would
|
|
60
|
+
otherwise download it anyway. The workbench UI cannot be built from such an
|
|
61
|
+
install; it is for the headless CLI (`node .ombutocode/src/headless.js …`)
|
|
62
|
+
and containers. Run `npm install` in `.ombutocode/src` later to add the UI
|
|
63
|
+
toolchain.
|
|
64
|
+
|
|
65
|
+
## Options
|
|
66
|
+
|
|
67
|
+
| Option | Effect |
|
|
68
|
+
|--------|--------|
|
|
69
|
+
| `<project-name>` | Create a new project directory (must not exist). |
|
|
70
|
+
| `--into-existing <dir>` | Adopt into an existing directory instead. Mutually exclusive with `<project-name>`. |
|
|
71
|
+
| `--omit-dev` | `npm install --omit=dev --legacy-peer-deps`; no UI toolchain. |
|
|
72
|
+
| `-h`, `--help` | Show usage. |
|
|
73
|
+
|
|
74
|
+
## Publishing
|
|
75
|
+
|
|
76
|
+
See `DeployInstructions.md` at the repository root: bump `CLONE_REF`,
|
|
77
|
+
`VERSION` and `package.json` together, then `npm publish` from this
|
|
78
|
+
directory.
|
package/bin/create-ombutocode.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const fs = require('fs');
|
|
4
|
+
const os = require('os');
|
|
4
5
|
const path = require('path');
|
|
5
6
|
const { execSync } = require('child_process');
|
|
6
7
|
|
|
@@ -8,7 +9,7 @@ const REPO_URL = 'https://github.com/FrancoisBotha/ombutocode.git';
|
|
|
8
9
|
// Installer version is kept in lockstep with the workbench version
|
|
9
10
|
// (.ombutocode/src/package.json) — every workbench release bumps both
|
|
10
11
|
// to the same number. See DeployInstructions.md §3 and §3.0.
|
|
11
|
-
const VERSION = '0.2.
|
|
12
|
+
const VERSION = '0.2.6';
|
|
12
13
|
|
|
13
14
|
// Pinned Ombuto Code workbench release to clone.
|
|
14
15
|
//
|
|
@@ -20,7 +21,7 @@ const VERSION = '0.2.5';
|
|
|
20
21
|
// 2. Bump CLONE_REF below to the new tag
|
|
21
22
|
// 3. Bump this installer's VERSION (above) and the package.json version
|
|
22
23
|
// 4. `npm publish` the installer (see DeployInstructions.md §3)
|
|
23
|
-
const CLONE_REF = 'v0.2.
|
|
24
|
+
const CLONE_REF = 'v0.2.6';
|
|
24
25
|
|
|
25
26
|
// Files and directories at the repo root that belong to the Ombuto Code
|
|
26
27
|
// upstream project and should be removed from a scaffolded user project.
|
|
@@ -67,6 +68,16 @@ const TEMPLATE_FILES = [
|
|
|
67
68
|
'GettingStarted.md',
|
|
68
69
|
];
|
|
69
70
|
|
|
71
|
+
// Root .gitignore entries an adopted project needs so the workbench's
|
|
72
|
+
// dependencies and build output never get committed. Runtime state under
|
|
73
|
+
// .ombutocode/ (databases, logs, run output) is covered by the
|
|
74
|
+
// .ombutocode/.gitignore that ships with the clone.
|
|
75
|
+
const OMBUTO_GITIGNORE_LINES = [
|
|
76
|
+
'.ombutocode/src/node_modules/',
|
|
77
|
+
'.ombutocode/src/release/',
|
|
78
|
+
'.ombutocode/src/dist/',
|
|
79
|
+
];
|
|
80
|
+
|
|
70
81
|
// ── Helpers ──
|
|
71
82
|
|
|
72
83
|
function log(msg) { console.log(` ${msg}`); }
|
|
@@ -98,6 +109,19 @@ function copyDirSync(src, dest) {
|
|
|
98
109
|
}
|
|
99
110
|
}
|
|
100
111
|
|
|
112
|
+
// Move a directory, falling back to copy + delete when the source and
|
|
113
|
+
// destination sit on different volumes (rename fails with EXDEV there —
|
|
114
|
+
// common when the OS temp directory is on another drive).
|
|
115
|
+
function moveDirSync(src, dest) {
|
|
116
|
+
try {
|
|
117
|
+
fs.renameSync(src, dest);
|
|
118
|
+
} catch (err) {
|
|
119
|
+
if (err && err.code !== 'EXDEV') throw err;
|
|
120
|
+
copyDirSync(src, dest);
|
|
121
|
+
fs.rmSync(src, { recursive: true, force: true });
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
101
125
|
function stripUpstreamFiles(projectDir) {
|
|
102
126
|
for (const name of UPSTREAM_FILES_TO_STRIP) {
|
|
103
127
|
const target = path.join(projectDir, name);
|
|
@@ -109,7 +133,10 @@ function stripUpstreamFiles(projectDir) {
|
|
|
109
133
|
}
|
|
110
134
|
}
|
|
111
135
|
|
|
112
|
-
|
|
136
|
+
// Copy the template files into projectDir. With `skipExisting`, a file that
|
|
137
|
+
// is already there (the adopted project's own README, CLAUDE.md, …) is left
|
|
138
|
+
// untouched.
|
|
139
|
+
function writeTemplateFiles(projectDir, projectName, { skipExisting = false } = {}) {
|
|
113
140
|
// Template files ship inside the installer package at ../template
|
|
114
141
|
// relative to this script (bin/create-ombutocode.js).
|
|
115
142
|
const templateDir = path.resolve(__dirname, '..', 'template');
|
|
@@ -124,35 +151,280 @@ function writeTemplateFiles(projectDir, projectName) {
|
|
|
124
151
|
log(`Template file missing: ${name} (skipping)`);
|
|
125
152
|
continue;
|
|
126
153
|
}
|
|
154
|
+
const dest = path.join(projectDir, name);
|
|
155
|
+
if (skipExisting && fs.existsSync(dest)) {
|
|
156
|
+
log(`Kept existing ${name}`);
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
127
159
|
const content = fs.readFileSync(src, 'utf-8')
|
|
128
160
|
.replace(/\{\{PROJECT_NAME\}\}/g, projectName);
|
|
129
|
-
fs.writeFileSync(
|
|
161
|
+
fs.writeFileSync(dest, content);
|
|
130
162
|
log(`Wrote ${name}`);
|
|
131
163
|
}
|
|
132
164
|
}
|
|
133
165
|
|
|
166
|
+
// Ensure the Ombuto ignore lines are present in <projectDir>/.gitignore.
|
|
167
|
+
// Creates the file if absent; otherwise appends only the missing lines.
|
|
168
|
+
function ensureGitignore(projectDir) {
|
|
169
|
+
const gitignorePath = path.join(projectDir, '.gitignore');
|
|
170
|
+
if (!fs.existsSync(gitignorePath)) {
|
|
171
|
+
fs.writeFileSync(gitignorePath, `# OmbutoCode\n${OMBUTO_GITIGNORE_LINES.join('\n')}\n`);
|
|
172
|
+
log('Wrote .gitignore');
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
const existing = fs.readFileSync(gitignorePath, 'utf-8');
|
|
176
|
+
const present = new Set(existing.split(/\r?\n/).map((l) => l.trim()));
|
|
177
|
+
const missing = OMBUTO_GITIGNORE_LINES.filter((l) => !present.has(l));
|
|
178
|
+
if (missing.length === 0) {
|
|
179
|
+
log('Kept existing .gitignore (Ombuto entries already present)');
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
const separator = existing.length === 0 || existing.endsWith('\n') ? '' : '\n';
|
|
183
|
+
fs.appendFileSync(gitignorePath, `${separator}\n# OmbutoCode\n${missing.join('\n')}\n`);
|
|
184
|
+
log(`Appended ${missing.length} Ombuto entr${missing.length === 1 ? 'y' : 'ies'} to .gitignore`);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// Run initombuto against projectDir. `initArgs` is the argument list passed
|
|
188
|
+
// to the script; `env` lets the caller propagate npm config (see --omit-dev).
|
|
189
|
+
function runInitombuto(projectDir, initArgs, env) {
|
|
190
|
+
const isWindows = process.platform === 'win32';
|
|
191
|
+
const initScript = path.join(projectDir, '.ombutocode', isWindows ? 'initombuto.bat' : 'initombuto');
|
|
192
|
+
|
|
193
|
+
if (fs.existsSync(initScript)) {
|
|
194
|
+
const argString = initArgs.map((a) => (a.startsWith('--') ? a : `"${a}"`)).join(' ');
|
|
195
|
+
if (isWindows) {
|
|
196
|
+
run(`"${initScript}" ${argString}`, { cwd: projectDir, env });
|
|
197
|
+
} else {
|
|
198
|
+
// Ensure executable
|
|
199
|
+
try { fs.chmodSync(initScript, 0o755); } catch {}
|
|
200
|
+
run(`bash "${initScript}" ${argString}`, { cwd: projectDir, env });
|
|
201
|
+
}
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
log('initombuto script not found — creating docs/ structure manually...');
|
|
206
|
+
const dirs = [
|
|
207
|
+
'Structure', 'Product Requirements Document', 'Architecture',
|
|
208
|
+
'Functional Requirements', 'Non-Functional Requirements', 'Epics',
|
|
209
|
+
'BDD Use Cases', 'Use Cases', 'Use Case Diagrams', 'Class Diagrams',
|
|
210
|
+
'Data Model', 'Style Guide', 'Mockups', 'References', 'Skills',
|
|
211
|
+
'Test Strategy', 'ScratchPad'
|
|
212
|
+
];
|
|
213
|
+
for (const dir of dirs) {
|
|
214
|
+
fs.mkdirSync(path.join(projectDir, 'docs', dir), { recursive: true });
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
134
218
|
// ── CLI ──
|
|
135
219
|
|
|
136
|
-
const
|
|
137
|
-
if (args.includes('--help') || args.includes('-h')) {
|
|
138
|
-
console.log(`
|
|
220
|
+
const HELP = `
|
|
139
221
|
create-ombutocode v${VERSION}
|
|
140
222
|
|
|
141
223
|
Create a new Ombuto Code project — Agentic Software Engineering Workbench
|
|
142
224
|
|
|
143
225
|
Usage:
|
|
144
|
-
npx create-ombutocode <project-name>
|
|
226
|
+
npx create-ombutocode <project-name> [--omit-dev]
|
|
227
|
+
npx create-ombutocode --into-existing <dir> [--omit-dev]
|
|
228
|
+
|
|
229
|
+
Options:
|
|
230
|
+
--into-existing <dir> Adopt Ombuto Code into an existing directory
|
|
231
|
+
instead of creating a new project. Adds
|
|
232
|
+
.ombutocode/ and seeds docs/ without touching
|
|
233
|
+
any file that is already there, and never runs
|
|
234
|
+
git init/add/commit. <dir> must exist and must
|
|
235
|
+
not already contain .ombutocode/.
|
|
236
|
+
--omit-dev Install with \`npm install --omit=dev
|
|
237
|
+
--legacy-peer-deps\`: no Electron, Vite or
|
|
238
|
+
electron-builder. For headless and CLI use only —
|
|
239
|
+
the workbench UI cannot be built from such an
|
|
240
|
+
install.
|
|
241
|
+
-h, --help Show this help.
|
|
145
242
|
|
|
146
243
|
Example:
|
|
147
244
|
npx create-ombutocode my-app
|
|
148
245
|
cd my-app
|
|
149
246
|
.ombutocode/buildandrun.bat # Windows
|
|
150
247
|
bash .ombutocode/buildandrun # macOS / Linux
|
|
248
|
+
|
|
249
|
+
Example (existing repository, headless):
|
|
250
|
+
npx create-ombutocode --into-existing /app --omit-dev
|
|
251
|
+
cd /app
|
|
252
|
+
node .ombutocode/src/headless.js status
|
|
253
|
+
`;
|
|
254
|
+
|
|
255
|
+
const args = process.argv.slice(2);
|
|
256
|
+
if (args.includes('--help') || args.includes('-h')) {
|
|
257
|
+
console.log(HELP);
|
|
258
|
+
process.exit(0);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
let projectName = null;
|
|
262
|
+
let intoExisting = null;
|
|
263
|
+
let omitDev = false;
|
|
264
|
+
|
|
265
|
+
for (let i = 0; i < args.length; i++) {
|
|
266
|
+
const arg = args[i];
|
|
267
|
+
if (arg === '--omit-dev') {
|
|
268
|
+
omitDev = true;
|
|
269
|
+
} else if (arg === '--into-existing') {
|
|
270
|
+
intoExisting = args[i + 1];
|
|
271
|
+
i++;
|
|
272
|
+
if (!intoExisting || intoExisting.startsWith('-')) {
|
|
273
|
+
fatal('--into-existing requires a directory:\n\n npx create-ombutocode --into-existing /path/to/repo\n');
|
|
274
|
+
}
|
|
275
|
+
} else if (arg.startsWith('--into-existing=')) {
|
|
276
|
+
intoExisting = arg.slice('--into-existing='.length);
|
|
277
|
+
if (!intoExisting) {
|
|
278
|
+
fatal('--into-existing requires a directory:\n\n npx create-ombutocode --into-existing /path/to/repo\n');
|
|
279
|
+
}
|
|
280
|
+
} else if (arg.startsWith('-')) {
|
|
281
|
+
fatal(`Unknown option "${arg}". Run with --help for usage.`);
|
|
282
|
+
} else if (projectName === null) {
|
|
283
|
+
projectName = arg;
|
|
284
|
+
} else {
|
|
285
|
+
fatal(`Unexpected argument "${arg}". Run with --help for usage.`);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// --omit=dev alone still downloads Electron: @electron/remote (a runtime
|
|
290
|
+
// dependency) declares electron as a peer dependency and npm 7+ installs
|
|
291
|
+
// peers automatically. --legacy-peer-deps turns that off; --omit=peer does
|
|
292
|
+
// not (verified against npm 10). Nothing headless.js loads needs a peer.
|
|
293
|
+
const npmInstallCmd = omitDev
|
|
294
|
+
? 'npm install --no-audit --no-fund --omit=dev --legacy-peer-deps'
|
|
295
|
+
: 'npm install --no-audit --no-fund';
|
|
296
|
+
// initombuto runs its own plain `npm install`; npm reads npm_config_* from
|
|
297
|
+
// the environment, so this keeps that second install from adding the dev
|
|
298
|
+
// dependencies and Electron back.
|
|
299
|
+
const initEnv = omitDev
|
|
300
|
+
? { ...process.env, npm_config_omit: 'dev', npm_config_legacy_peer_deps: 'true' }
|
|
301
|
+
: process.env;
|
|
302
|
+
|
|
303
|
+
function noteOmitDev() {
|
|
304
|
+
if (!omitDev) return;
|
|
305
|
+
log('--omit-dev: Electron, Vite and electron-builder were not installed.');
|
|
306
|
+
log('The workbench UI cannot be built from this install; use the headless CLI');
|
|
307
|
+
log('(node .ombutocode/src/headless.js) or re-run `npm install` in .ombutocode/src.');
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// ═════════════════════════════════════════════════════════════════════
|
|
311
|
+
// Adopt into an existing directory
|
|
312
|
+
// ═════════════════════════════════════════════════════════════════════
|
|
313
|
+
|
|
314
|
+
if (intoExisting !== null) {
|
|
315
|
+
if (projectName !== null) {
|
|
316
|
+
fatal('Give either a <project-name> or --into-existing <dir>, not both.');
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
const targetDir = path.resolve(intoExisting);
|
|
320
|
+
if (!fs.existsSync(targetDir) || !fs.statSync(targetDir).isDirectory()) {
|
|
321
|
+
fatal(`Directory "${targetDir}" does not exist. --into-existing adopts an existing directory; use \`npx create-ombutocode <project-name>\` to create a new one.`);
|
|
322
|
+
}
|
|
323
|
+
if (fs.existsSync(path.join(targetDir, '.ombutocode'))) {
|
|
324
|
+
fatal(`"${targetDir}" already contains .ombutocode/ — refusing to overwrite an existing Ombuto Code installation.`);
|
|
325
|
+
}
|
|
326
|
+
const targetName = path.basename(targetDir);
|
|
327
|
+
const targetIsGitRepo = fs.existsSync(path.join(targetDir, '.git'));
|
|
328
|
+
|
|
329
|
+
console.log(`
|
|
330
|
+
╔═══════════════════════════════════════════╗
|
|
331
|
+
║ create-ombutocode v${VERSION} ║
|
|
332
|
+
║ Agentic Software Engineering Workbench ║
|
|
333
|
+
╚═══════════════════════════════════════════╝
|
|
334
|
+
`);
|
|
335
|
+
console.log(`Adopting Ombuto Code into: ${targetDir}`);
|
|
336
|
+
|
|
337
|
+
// ── Step 1: Clone the pinned release into a temp directory ──
|
|
338
|
+
|
|
339
|
+
heading(`Cloning Ombuto Code ${CLONE_REF}`);
|
|
340
|
+
const tempRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'create-ombutocode-'));
|
|
341
|
+
const cloneDir = path.join(tempRoot, 'clone');
|
|
342
|
+
const cleanupTemp = () => { try { fs.rmSync(tempRoot, { recursive: true, force: true }); } catch {} };
|
|
343
|
+
process.on('exit', cleanupTemp);
|
|
344
|
+
run(`git clone --depth 1 --branch ${CLONE_REF} ${REPO_URL} "${cloneDir}"`);
|
|
345
|
+
|
|
346
|
+
// ── Step 1b: Strip everything that is not the workbench ──
|
|
347
|
+
//
|
|
348
|
+
// Only .ombutocode/ travels into the adopted directory. The clone's
|
|
349
|
+
// docs/ holds the upstream project's own specs and epics, which must not
|
|
350
|
+
// leak into someone else's repository — the docs/ skeleton is seeded by
|
|
351
|
+
// initombuto below instead, file by file, only where nothing exists yet.
|
|
352
|
+
|
|
353
|
+
heading('Preparing workbench files');
|
|
354
|
+
fs.rmSync(path.join(cloneDir, '.git'), { recursive: true, force: true });
|
|
355
|
+
fs.rmSync(path.join(cloneDir, 'create-ombutocode'), { recursive: true, force: true });
|
|
356
|
+
stripUpstreamFiles(cloneDir);
|
|
357
|
+
fs.rmSync(path.join(cloneDir, 'docs'), { recursive: true, force: true });
|
|
358
|
+
log('Discarded upstream docs/');
|
|
359
|
+
|
|
360
|
+
const clonedOmbutocode = path.join(cloneDir, '.ombutocode');
|
|
361
|
+
if (!fs.existsSync(path.join(clonedOmbutocode, 'src', 'package.json'))) {
|
|
362
|
+
fatal('.ombutocode/src/package.json not found in the clone — repository may be corrupted.');
|
|
363
|
+
}
|
|
364
|
+
moveDirSync(clonedOmbutocode, path.join(targetDir, '.ombutocode'));
|
|
365
|
+
log('Added .ombutocode/');
|
|
366
|
+
cleanupTemp();
|
|
367
|
+
|
|
368
|
+
writeTemplateFiles(targetDir, targetName, { skipExisting: true });
|
|
369
|
+
ensureGitignore(targetDir);
|
|
370
|
+
|
|
371
|
+
// ── Step 2: Install dependencies ──
|
|
372
|
+
|
|
373
|
+
heading('Installing dependencies');
|
|
374
|
+
run(npmInstallCmd, { cwd: path.join(targetDir, '.ombutocode', 'src') });
|
|
375
|
+
noteOmitDev();
|
|
376
|
+
|
|
377
|
+
// ── Step 3: Initialise project data ──
|
|
378
|
+
//
|
|
379
|
+
// --keep-docs: never wipe docs/. initombuto still creates every missing
|
|
380
|
+
// docs/ folder, starter document and skill file, and skips any file that
|
|
381
|
+
// already exists, which is the non-destructive merge an adopted repo needs.
|
|
382
|
+
|
|
383
|
+
heading('Initialising project');
|
|
384
|
+
runInitombuto(targetDir, ['--keep-docs', targetDir], initEnv);
|
|
385
|
+
|
|
386
|
+
// ── No Step 4: the directory's git history is the owner's business ──
|
|
387
|
+
|
|
388
|
+
console.log(`
|
|
389
|
+
╔═══════════════════════════════════════════╗
|
|
390
|
+
║ Workbench added! ║
|
|
391
|
+
╚═══════════════════════════════════════════╝
|
|
392
|
+
|
|
393
|
+
cd ${targetName}
|
|
394
|
+
`);
|
|
395
|
+
if (targetIsGitRepo) {
|
|
396
|
+
console.log(` This directory is already a git repository. Nothing was committed;
|
|
397
|
+
when you are ready, commit the workbench and its docs skeleton:
|
|
398
|
+
|
|
399
|
+
git add .ombutocode docs .gitignore
|
|
400
|
+
git commit -m "Add Ombuto Code workbench"
|
|
401
|
+
`);
|
|
402
|
+
} else {
|
|
403
|
+
console.log(` This directory is not a git repository. The workbench needs one
|
|
404
|
+
(agents build in git worktrees), so initialise it before running agents:
|
|
405
|
+
|
|
406
|
+
git init && git add -A && git commit -m "Initial commit"
|
|
407
|
+
`);
|
|
408
|
+
}
|
|
409
|
+
console.log(` # Read this first:
|
|
410
|
+
GettingStarted.md — what's in the project and what to do next
|
|
411
|
+
${omitDev ? `
|
|
412
|
+
# Headless CLI:
|
|
413
|
+
node .ombutocode/src/headless.js status
|
|
414
|
+
` : `
|
|
415
|
+
# Launch the workbench:
|
|
416
|
+
.ombutocode/buildandrun.bat # Windows
|
|
417
|
+
bash .ombutocode/buildandrun # macOS / Linux
|
|
418
|
+
`}
|
|
419
|
+
Happy building!
|
|
151
420
|
`);
|
|
152
421
|
process.exit(0);
|
|
153
422
|
}
|
|
154
423
|
|
|
155
|
-
|
|
424
|
+
// ═════════════════════════════════════════════════════════════════════
|
|
425
|
+
// Create a new project
|
|
426
|
+
// ═════════════════════════════════════════════════════════════════════
|
|
427
|
+
|
|
156
428
|
if (!projectName) {
|
|
157
429
|
fatal('Please specify a project name:\n\n npx create-ombutocode my-app\n');
|
|
158
430
|
}
|
|
@@ -209,7 +481,8 @@ writeTemplateFiles(projectDir, projectName);
|
|
|
209
481
|
heading('Installing dependencies');
|
|
210
482
|
const srcDir = path.join(projectDir, '.ombutocode', 'src');
|
|
211
483
|
if (fs.existsSync(path.join(srcDir, 'package.json'))) {
|
|
212
|
-
run(
|
|
484
|
+
run(npmInstallCmd, { cwd: srcDir });
|
|
485
|
+
noteOmitDev();
|
|
213
486
|
} else {
|
|
214
487
|
fatal('.ombutocode/src/package.json not found — repository may be corrupted.');
|
|
215
488
|
}
|
|
@@ -219,30 +492,7 @@ if (fs.existsSync(path.join(srcDir, 'package.json'))) {
|
|
|
219
492
|
heading('Initialising project');
|
|
220
493
|
|
|
221
494
|
// Run initombuto with --clear to create fresh docs/
|
|
222
|
-
|
|
223
|
-
const initScript = path.join(projectDir, '.ombutocode', isWindows ? 'initombuto.bat' : 'initombuto');
|
|
224
|
-
|
|
225
|
-
if (fs.existsSync(initScript)) {
|
|
226
|
-
if (isWindows) {
|
|
227
|
-
run(`"${initScript}" --clear "${projectDir}"`, { cwd: projectDir });
|
|
228
|
-
} else {
|
|
229
|
-
// Ensure executable
|
|
230
|
-
try { fs.chmodSync(initScript, 0o755); } catch {}
|
|
231
|
-
run(`bash "${initScript}" --clear "${projectDir}"`, { cwd: projectDir });
|
|
232
|
-
}
|
|
233
|
-
} else {
|
|
234
|
-
log('initombuto script not found — creating docs/ structure manually...');
|
|
235
|
-
const dirs = [
|
|
236
|
-
'Structure', 'Product Requirements Document', 'Architecture',
|
|
237
|
-
'Functional Requirements', 'Non-Functional Requirements', 'Epics',
|
|
238
|
-
'BDD Use Cases', 'Use Cases', 'Use Case Diagrams', 'Class Diagrams',
|
|
239
|
-
'Data Model', 'Style Guide', 'Mockups', 'References', 'Skills',
|
|
240
|
-
'Test Strategy', 'ScratchPad'
|
|
241
|
-
];
|
|
242
|
-
for (const dir of dirs) {
|
|
243
|
-
fs.mkdirSync(path.join(projectDir, 'docs', dir), { recursive: true });
|
|
244
|
-
}
|
|
245
|
-
}
|
|
495
|
+
runInitombuto(projectDir, ['--clear', projectDir], initEnv);
|
|
246
496
|
|
|
247
497
|
// ── Step 4: Initialise git ──
|
|
248
498
|
|
package/package.json
CHANGED
|
@@ -56,9 +56,6 @@ You need:
|
|
|
56
56
|
- **[Git](https://git-scm.com/)** — Ombuto Code versions your requirements
|
|
57
57
|
documents with Git just like source code. The installer has already
|
|
58
58
|
initialised a fresh repo for you.
|
|
59
|
-
|
|
60
|
-
Optional (but recommended — this is what makes the Build phase interesting):
|
|
61
|
-
|
|
62
59
|
- **At least one AI coding CLI**, installed globally and authenticated:
|
|
63
60
|
- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) —
|
|
64
61
|
`npm install -g @anthropic-ai/claude-code`, then `claude login`
|
|
@@ -66,8 +63,12 @@ Optional (but recommended — this is what makes the Build phase interesting):
|
|
|
66
63
|
`npm install -g @openai/codex`
|
|
67
64
|
- [Kimi](https://github.com/moonshotai/kimi-cli) (optional)
|
|
68
65
|
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
A coding agent is needed for Plan as well as Build. The Plan pages — PRD,
|
|
67
|
+
Architecture, Epics, Ticket Generation and the rest — work by launching an
|
|
68
|
+
AI session against a skill, and their buttons stay disabled until a
|
|
69
|
+
connected agent is configured under Settings → Coding Agents. You can still
|
|
70
|
+
read and hand-edit documents without one, but nothing will be generated for
|
|
71
|
+
you.
|
|
71
72
|
|
|
72
73
|
---
|
|
73
74
|
|