@aslomon/effectum 0.2.0 → 0.3.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.
- package/README.md +23 -16
- package/bin/install.js +187 -112
- package/bin/lib/app-types.js +96 -0
- package/bin/lib/config.js +22 -3
- package/bin/lib/constants.js +14 -30
- package/bin/lib/foundation.js +63 -0
- package/bin/lib/languages.js +77 -0
- package/bin/lib/recommendation.js +392 -0
- package/bin/lib/specializations.js +123 -0
- package/bin/lib/template.js +2 -1
- package/bin/lib/ui.js +375 -21
- package/bin/reconfigure.js +32 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="docs/logo-dark.svg">
|
|
5
|
+
<source media="(prefers-color-scheme: light)" srcset="docs/logo-light.svg">
|
|
6
|
+
<img src="docs/logo-light.svg" alt="effectum" width="280">
|
|
7
|
+
</picture>
|
|
8
|
+
|
|
9
|
+
<br><br>
|
|
4
10
|
|
|
5
11
|
### Describe what you want. Get production-ready code.
|
|
6
12
|
|
|
@@ -9,10 +15,11 @@ _Effectum (Latin): the result, the accomplishment — that which has been brough
|
|
|
9
15
|
[](LICENSE)
|
|
10
16
|
[](https://claude.ai/claude-code)
|
|
11
17
|
[](CONTRIBUTING.md)
|
|
18
|
+
[](https://aslomon.github.io/effectum/)
|
|
12
19
|
|
|
13
20
|
<br>
|
|
14
21
|
|
|
15
|
-
[Quick Start](#-quick-start) · [How It Works](#-how-it-works) · [The Workflow](#-the-workflow) · [PRD Workshop](#-the-prd-workshop) · [How is this different?](#-how-is-this-different) · [
|
|
22
|
+
[Quick Start](#-quick-start) · [How It Works](#-how-it-works) · [The Workflow](#-the-workflow) · [PRD Workshop](#-the-prd-workshop) · [How is this different?](#-how-is-this-different) · [Website](https://aslomon.github.io/effectum/)
|
|
16
23
|
|
|
17
24
|
</div>
|
|
18
25
|
|
|
@@ -82,15 +89,15 @@ claude
|
|
|
82
89
|
|
|
83
90
|
One command. Everything you need for autonomous Claude Code development.
|
|
84
91
|
|
|
85
|
-
| What
|
|
86
|
-
|
|
92
|
+
| What | Details |
|
|
93
|
+
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------- |
|
|
87
94
|
| **10 workflow commands** | `/plan`, `/tdd`, `/verify`, `/e2e`, `/code-review`, `/build-fix`, `/refactor-clean`, `/ralph-loop`, `/cancel-ralph`, `/checkpoint` |
|
|
88
|
-
| **PRD Workshop**
|
|
89
|
-
| **4 MCP servers**
|
|
90
|
-
| **Playwright setup**
|
|
91
|
-
| **Stack presets**
|
|
92
|
-
| **Quality gates**
|
|
93
|
-
| **Guardrails**
|
|
95
|
+
| **PRD Workshop** | 8 knowledge files for guided specification writing |
|
|
96
|
+
| **4 MCP servers** | Context7, Playwright, Sequential Thinking, Filesystem |
|
|
97
|
+
| **Playwright setup** | Browser install + `playwright.config.ts` |
|
|
98
|
+
| **Stack presets** | Next.js + Supabase, Python + FastAPI, Swift/SwiftUI, Generic |
|
|
99
|
+
| **Quality gates** | 8 automated checks (build, types, lint, tests, security, etc.) |
|
|
100
|
+
| **Guardrails** | Rules that prevent known mistakes |
|
|
94
101
|
|
|
95
102
|
---
|
|
96
103
|
|
|
@@ -296,12 +303,12 @@ The better the spec, the better the code.
|
|
|
296
303
|
|
|
297
304
|
## 🆚 How is this different?
|
|
298
305
|
|
|
299
|
-
| Tool
|
|
300
|
-
|
|
301
|
-
| **GSD**
|
|
302
|
-
| **BMAD**
|
|
303
|
-
| **SpecKit**
|
|
304
|
-
| **Taskmaster** | Task breakdown from PRDs
|
|
306
|
+
| Tool | What it does | What Effectum adds |
|
|
307
|
+
| -------------- | ----------------------------------------- | -------------------------------------------------------------------------- |
|
|
308
|
+
| **GSD** | Context engineering, prevents context rot | PRD Workshop (helps you write the spec), Ralph Loop (autonomous overnight) |
|
|
309
|
+
| **BMAD** | Full enterprise methodology | Same ideas, 90% less ceremony |
|
|
310
|
+
| **SpecKit** | Living specifications | + Autonomous execution + Quality gates |
|
|
311
|
+
| **Taskmaster** | Task breakdown from PRDs | + TDD workflow + Code review + E2E testing |
|
|
305
312
|
|
|
306
313
|
The short version: Effectum doesn't invent new concepts. It combines what already works, removes what doesn't, and packages it so it actually runs.
|
|
307
314
|
|
package/bin/install.js
CHANGED
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* Effectum interactive installer.
|
|
4
|
-
*
|
|
3
|
+
* Effectum interactive installer — Intelligent Setup Recommender.
|
|
4
|
+
*
|
|
5
|
+
* 9-step flow:
|
|
6
|
+
* 1. Install Scope (global / local)
|
|
7
|
+
* 2. Project Basics (name, stack, package manager)
|
|
8
|
+
* 3. App Type (web-app, api, mobile, cli, ...)
|
|
9
|
+
* 4. Description (free-text intent)
|
|
10
|
+
* 5. Language (15+ languages + custom)
|
|
11
|
+
* 6. Autonomy (conservative / standard / full)
|
|
12
|
+
* 7. Recommendation (preview calculated setup)
|
|
13
|
+
* 8. Decision (use recommended / customize / manual)
|
|
14
|
+
* 9. Install (write files)
|
|
5
15
|
*
|
|
6
16
|
* Usage:
|
|
7
|
-
* npx @aslomon/effectum
|
|
8
|
-
* npx @aslomon/effectum --global
|
|
9
|
-
* npx @aslomon/effectum --local
|
|
10
|
-
* npx @aslomon/effectum --yes
|
|
11
|
-
* npx @aslomon/effectum --dry-run
|
|
17
|
+
* npx @aslomon/effectum -> interactive install
|
|
18
|
+
* npx @aslomon/effectum --global -> non-interactive global install
|
|
19
|
+
* npx @aslomon/effectum --local -> non-interactive local install
|
|
20
|
+
* npx @aslomon/effectum --yes -> non-interactive with smart defaults
|
|
21
|
+
* npx @aslomon/effectum --dry-run -> show plan without writing
|
|
12
22
|
*/
|
|
13
23
|
"use strict";
|
|
14
24
|
|
|
@@ -16,32 +26,44 @@ const fs = require("fs");
|
|
|
16
26
|
const path = require("path");
|
|
17
27
|
const os = require("os");
|
|
18
28
|
const { spawnSync } = require("child_process");
|
|
19
|
-
const p = require("@clack/prompts");
|
|
20
|
-
|
|
21
29
|
const { detectAll } = require("./lib/detect");
|
|
22
30
|
const { loadStackPreset } = require("./lib/stack-parser");
|
|
23
31
|
const {
|
|
24
32
|
buildSubstitutionMap,
|
|
25
33
|
renderTemplate,
|
|
26
34
|
findTemplatePath,
|
|
27
|
-
findRemainingPlaceholders,
|
|
28
35
|
} = require("./lib/template");
|
|
29
36
|
const { writeConfig } = require("./lib/config");
|
|
30
37
|
const { AUTONOMY_MAP, FORMATTER_MAP, MCP_SERVERS } = require("./lib/constants");
|
|
31
|
-
const { ensureDir, deepMerge, findRepoRoot: findRepoRootShared } = require("./lib/utils");
|
|
32
38
|
const {
|
|
39
|
+
ensureDir,
|
|
40
|
+
deepMerge,
|
|
41
|
+
findRepoRoot: findRepoRootShared,
|
|
42
|
+
} = require("./lib/utils");
|
|
43
|
+
const { recommend } = require("./lib/recommendation");
|
|
44
|
+
const {
|
|
45
|
+
initClack,
|
|
46
|
+
getClack,
|
|
33
47
|
printBanner,
|
|
48
|
+
askScope,
|
|
34
49
|
askProjectName,
|
|
35
50
|
askStack,
|
|
51
|
+
askAppType,
|
|
52
|
+
askDescription,
|
|
36
53
|
askLanguage,
|
|
37
54
|
askAutonomy,
|
|
38
|
-
|
|
55
|
+
showRecommendation,
|
|
56
|
+
askSetupMode,
|
|
57
|
+
askCustomize,
|
|
58
|
+
askManual,
|
|
39
59
|
askPlaywright,
|
|
40
60
|
askGitBranch,
|
|
41
61
|
showSummary,
|
|
42
62
|
showOutro,
|
|
43
63
|
} = require("./lib/ui");
|
|
44
64
|
|
|
65
|
+
// ─── File helpers ─────────────────────────────────────────────────────────────
|
|
66
|
+
|
|
45
67
|
function copyFile(src, dest, opts = {}) {
|
|
46
68
|
if (fs.existsSync(dest) && opts.skipExisting) {
|
|
47
69
|
return { status: "skipped", dest };
|
|
@@ -71,7 +93,7 @@ function findRepoRoot() {
|
|
|
71
93
|
return findRepoRootShared();
|
|
72
94
|
}
|
|
73
95
|
|
|
74
|
-
// ─── Parse CLI args
|
|
96
|
+
// ─── Parse CLI args ─────────────────────────────────────────────────────────
|
|
75
97
|
|
|
76
98
|
function parseArgs(argv) {
|
|
77
99
|
const args = argv.slice(2);
|
|
@@ -84,11 +106,11 @@ function parseArgs(argv) {
|
|
|
84
106
|
yes: args.includes("--yes") || args.includes("-y"),
|
|
85
107
|
dryRun: args.includes("--dry-run"),
|
|
86
108
|
help: args.includes("--help") || args.includes("-h"),
|
|
87
|
-
nonInteractive: false,
|
|
109
|
+
nonInteractive: false,
|
|
88
110
|
};
|
|
89
111
|
}
|
|
90
112
|
|
|
91
|
-
// ─── MCP server install helpers
|
|
113
|
+
// ─── MCP server install helpers ─────────────────────────────────────────────
|
|
92
114
|
|
|
93
115
|
function checkPackageAvailable(pkg) {
|
|
94
116
|
try {
|
|
@@ -174,7 +196,7 @@ function addMcpToSettings(settingsPath, mcpResults, targetDir) {
|
|
|
174
196
|
);
|
|
175
197
|
}
|
|
176
198
|
|
|
177
|
-
// ─── Playwright install helpers
|
|
199
|
+
// ─── Playwright install helpers ─────────────────────────────────────────────
|
|
178
200
|
|
|
179
201
|
function installPlaywrightBrowsers() {
|
|
180
202
|
try {
|
|
@@ -228,7 +250,7 @@ export default defineConfig({
|
|
|
228
250
|
return { status: "created", dest: tsConfig };
|
|
229
251
|
}
|
|
230
252
|
|
|
231
|
-
// ─── Core install: copy commands, templates, stacks
|
|
253
|
+
// ─── Core install: copy commands, templates, stacks ─────────────────────────
|
|
232
254
|
|
|
233
255
|
function installBaseFiles(targetDir, repoRoot, isGlobal) {
|
|
234
256
|
const claudeDir = isGlobal ? targetDir : path.join(targetDir, ".claude");
|
|
@@ -278,7 +300,7 @@ function installBaseFiles(targetDir, repoRoot, isGlobal) {
|
|
|
278
300
|
return steps;
|
|
279
301
|
}
|
|
280
302
|
|
|
281
|
-
// ─── Generate configured files (CLAUDE.md, settings.json, guardrails.md)
|
|
303
|
+
// ─── Generate configured files (CLAUDE.md, settings.json, guardrails.md) ───
|
|
282
304
|
|
|
283
305
|
function generateConfiguredFiles(config, targetDir, repoRoot, isGlobal) {
|
|
284
306
|
const claudeDir = isGlobal ? targetDir : path.join(targetDir, ".claude");
|
|
@@ -292,16 +314,14 @@ function generateConfiguredFiles(config, targetDir, repoRoot, isGlobal) {
|
|
|
292
314
|
const claudeMdTmpl = findTemplatePath("CLAUDE.md.tmpl", targetDir, repoRoot);
|
|
293
315
|
const { content: claudeMdContent, remaining: claudeMdRemaining } =
|
|
294
316
|
renderTemplate(claudeMdTmpl, vars);
|
|
295
|
-
const claudeMdDest =
|
|
296
|
-
? path.join(targetDir, "CLAUDE.md")
|
|
297
|
-
: path.join(targetDir, "CLAUDE.md");
|
|
317
|
+
const claudeMdDest = path.join(targetDir, "CLAUDE.md");
|
|
298
318
|
ensureDir(path.dirname(claudeMdDest));
|
|
299
319
|
fs.writeFileSync(claudeMdDest, claudeMdContent, "utf8");
|
|
300
320
|
steps.push({ status: "created", dest: claudeMdDest });
|
|
301
321
|
|
|
302
322
|
if (claudeMdRemaining.length > 0) {
|
|
303
|
-
|
|
304
|
-
`CLAUDE.md has remaining placeholders: ${claudeMdRemaining.join(", ")}`,
|
|
323
|
+
console.warn(
|
|
324
|
+
`Warning: CLAUDE.md has remaining placeholders: ${claudeMdRemaining.join(", ")}`,
|
|
305
325
|
);
|
|
306
326
|
}
|
|
307
327
|
|
|
@@ -327,6 +347,12 @@ function generateConfiguredFiles(config, targetDir, repoRoot, isGlobal) {
|
|
|
327
347
|
deny: settingsObj.permissions?.deny || [],
|
|
328
348
|
};
|
|
329
349
|
|
|
350
|
+
// Apply Agent Teams env var
|
|
351
|
+
if (settingsObj.env) {
|
|
352
|
+
settingsObj.env.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS =
|
|
353
|
+
config.recommended && config.recommended.agentTeams ? "1" : "0";
|
|
354
|
+
}
|
|
355
|
+
|
|
330
356
|
// Apply formatter in PostToolUse hook
|
|
331
357
|
const formatter = FORMATTER_MAP[config.stack] || FORMATTER_MAP.generic;
|
|
332
358
|
if (settingsObj.hooks?.PostToolUse) {
|
|
@@ -374,7 +400,6 @@ function generateConfiguredFiles(config, targetDir, repoRoot, isGlobal) {
|
|
|
374
400
|
const guardrailsRaw = fs.readFileSync(guardrailsTmpl, "utf8");
|
|
375
401
|
let guardrailsContent = guardrailsRaw;
|
|
376
402
|
|
|
377
|
-
// Replace "No stack-specific guardrails..." with actual content
|
|
378
403
|
if (stackSections.STACK_SPECIFIC_GUARDRAILS) {
|
|
379
404
|
guardrailsContent = guardrailsContent.replace(
|
|
380
405
|
/No stack-specific guardrails configured yet\. Run \/setup to configure for your stack\./,
|
|
@@ -396,26 +421,39 @@ function generateConfiguredFiles(config, targetDir, repoRoot, isGlobal) {
|
|
|
396
421
|
return steps;
|
|
397
422
|
}
|
|
398
423
|
|
|
399
|
-
// ─── Smart defaults for non-interactive mode
|
|
424
|
+
// ─── Smart defaults for non-interactive mode ────────────────────────────────
|
|
400
425
|
|
|
401
426
|
function buildSmartDefaults(targetDir) {
|
|
402
427
|
const detected = detectAll(targetDir);
|
|
403
|
-
const
|
|
404
|
-
|
|
428
|
+
const stack = detected.stack || "generic";
|
|
429
|
+
const formatter = FORMATTER_MAP[stack] || FORMATTER_MAP.generic;
|
|
430
|
+
|
|
431
|
+
const rec = recommend({
|
|
432
|
+
stack,
|
|
433
|
+
appType: "web-app",
|
|
434
|
+
description: "",
|
|
435
|
+
autonomyLevel: "standard",
|
|
436
|
+
language: "english",
|
|
437
|
+
});
|
|
438
|
+
|
|
405
439
|
return {
|
|
406
440
|
projectName: detected.projectName,
|
|
407
|
-
stack
|
|
441
|
+
stack,
|
|
442
|
+
appType: "web-app",
|
|
443
|
+
description: "",
|
|
408
444
|
language: "english",
|
|
409
445
|
autonomyLevel: "standard",
|
|
410
446
|
packageManager: detected.packageManager,
|
|
411
447
|
formatter: formatter.name,
|
|
412
|
-
mcpServers:
|
|
413
|
-
playwrightBrowsers:
|
|
448
|
+
mcpServers: rec.mcps,
|
|
449
|
+
playwrightBrowsers: rec.mcps.includes("playwright"),
|
|
414
450
|
installScope: "local",
|
|
451
|
+
recommended: rec,
|
|
452
|
+
mode: "recommended",
|
|
415
453
|
};
|
|
416
454
|
}
|
|
417
455
|
|
|
418
|
-
// ─── Git branch creation
|
|
456
|
+
// ─── Git branch creation ────────────────────────────────────────────────────
|
|
419
457
|
|
|
420
458
|
function createGitBranch(name) {
|
|
421
459
|
const result = spawnSync("git", ["checkout", "-b", name], {
|
|
@@ -425,7 +463,7 @@ function createGitBranch(name) {
|
|
|
425
463
|
return result.status === 0;
|
|
426
464
|
}
|
|
427
465
|
|
|
428
|
-
// ─── Main
|
|
466
|
+
// ─── Main ───────────────────────────────────────────────────────────────────
|
|
429
467
|
|
|
430
468
|
async function main() {
|
|
431
469
|
const args = parseArgs(process.argv);
|
|
@@ -434,10 +472,10 @@ async function main() {
|
|
|
434
472
|
// Help
|
|
435
473
|
if (args.help) {
|
|
436
474
|
console.log(`
|
|
437
|
-
effectum —
|
|
475
|
+
effectum — intelligent setup for Claude Code
|
|
438
476
|
|
|
439
477
|
Usage:
|
|
440
|
-
npx effectum Interactive installer
|
|
478
|
+
npx effectum Interactive installer (9-step flow)
|
|
441
479
|
npx effectum init Per-project init (after global install)
|
|
442
480
|
npx effectum reconfigure Re-apply config from .effectum.json
|
|
443
481
|
npx effectum --global Install globally (~/.claude/, no prompts)
|
|
@@ -477,7 +515,7 @@ Options:
|
|
|
477
515
|
const homeClaudeDir = path.join(os.homedir(), ".claude");
|
|
478
516
|
const targetDir = isGlobal ? homeClaudeDir : process.cwd();
|
|
479
517
|
|
|
480
|
-
// ── Non-interactive mode
|
|
518
|
+
// ── Non-interactive mode ──────────────────────────────────────────────────
|
|
481
519
|
if (isNonInteractive) {
|
|
482
520
|
const config = buildSmartDefaults(targetDir);
|
|
483
521
|
config.installScope = isGlobal ? "global" : "local";
|
|
@@ -524,7 +562,8 @@ Options:
|
|
|
524
562
|
process.exit(0);
|
|
525
563
|
}
|
|
526
564
|
|
|
527
|
-
// ── Interactive mode
|
|
565
|
+
// ── Interactive mode — 9-step flow ────────────────────────────────────────
|
|
566
|
+
const p = await initClack();
|
|
528
567
|
printBanner();
|
|
529
568
|
|
|
530
569
|
const detected = detectAll(process.cwd());
|
|
@@ -535,47 +574,77 @@ Options:
|
|
|
535
574
|
);
|
|
536
575
|
}
|
|
537
576
|
|
|
538
|
-
// Scope
|
|
539
|
-
const scopeValue = await
|
|
540
|
-
message: "Install scope",
|
|
541
|
-
options: [
|
|
542
|
-
{
|
|
543
|
-
value: "local",
|
|
544
|
-
label: "Local",
|
|
545
|
-
hint: "This project only (./.claude/)",
|
|
546
|
-
},
|
|
547
|
-
{
|
|
548
|
-
value: "global",
|
|
549
|
-
label: "Global",
|
|
550
|
-
hint: "All projects (~/.claude/)",
|
|
551
|
-
},
|
|
552
|
-
],
|
|
553
|
-
initialValue: "local",
|
|
554
|
-
});
|
|
555
|
-
if (p.isCancel(scopeValue)) {
|
|
556
|
-
p.cancel("Setup cancelled.");
|
|
557
|
-
process.exit(0);
|
|
558
|
-
}
|
|
577
|
+
// ── Step 1: Install Scope ─────────────────────────────────────────────────
|
|
578
|
+
const scopeValue = await askScope();
|
|
559
579
|
const installGlobal = scopeValue === "global";
|
|
560
580
|
const installTargetDir = installGlobal ? homeClaudeDir : process.cwd();
|
|
561
581
|
|
|
562
|
-
//
|
|
563
|
-
|
|
582
|
+
// Global install: skip project-specific steps, install base only
|
|
583
|
+
if (installGlobal) {
|
|
584
|
+
if (args.dryRun) {
|
|
585
|
+
p.log.info("Dry run — no files will be written.");
|
|
586
|
+
p.note(
|
|
587
|
+
[
|
|
588
|
+
"~/.claude/commands/*.md",
|
|
589
|
+
"~/.claude/settings.json",
|
|
590
|
+
"~/.claude/guardrails.md",
|
|
591
|
+
"~/.effectum/templates/",
|
|
592
|
+
"~/.effectum/stacks/",
|
|
593
|
+
].join("\n"),
|
|
594
|
+
"Files to be created",
|
|
595
|
+
);
|
|
596
|
+
p.outro("Dry run complete. No changes made.");
|
|
597
|
+
process.exit(0);
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
const s = p.spinner();
|
|
601
|
+
s.start("Installing global workflow commands and templates...");
|
|
602
|
+
installBaseFiles(installTargetDir, repoRoot, true);
|
|
603
|
+
s.stop("Global base files installed");
|
|
604
|
+
|
|
605
|
+
showOutro(true);
|
|
606
|
+
process.exit(0);
|
|
607
|
+
}
|
|
564
608
|
|
|
565
|
-
//
|
|
609
|
+
// ── Step 2: Project Basics ────────────────────────────────────────────────
|
|
610
|
+
const projectName = await askProjectName(detected.projectName);
|
|
566
611
|
const stack = await askStack(detected.stack);
|
|
567
612
|
|
|
568
|
-
//
|
|
613
|
+
// ── Step 3: App Type ──────────────────────────────────────────────────────
|
|
614
|
+
const appType = await askAppType();
|
|
615
|
+
|
|
616
|
+
// ── Step 4: Description ───────────────────────────────────────────────────
|
|
617
|
+
const description = await askDescription();
|
|
618
|
+
|
|
619
|
+
// ── Step 5: Language ──────────────────────────────────────────────────────
|
|
569
620
|
const langResult = await askLanguage();
|
|
570
621
|
|
|
571
|
-
// Autonomy
|
|
622
|
+
// ── Step 6: Autonomy ──────────────────────────────────────────────────────
|
|
572
623
|
const autonomyLevel = await askAutonomy();
|
|
573
624
|
|
|
574
|
-
//
|
|
575
|
-
const
|
|
625
|
+
// ── Step 7: Recommendation Preview ────────────────────────────────────────
|
|
626
|
+
const rec = recommend({
|
|
627
|
+
stack,
|
|
628
|
+
appType,
|
|
629
|
+
description,
|
|
630
|
+
autonomyLevel,
|
|
631
|
+
language: langResult.language,
|
|
632
|
+
});
|
|
576
633
|
|
|
577
|
-
|
|
578
|
-
|
|
634
|
+
showRecommendation(rec);
|
|
635
|
+
|
|
636
|
+
// ── Step 8: Decision ──────────────────────────────────────────────────────
|
|
637
|
+
const setupMode = await askSetupMode();
|
|
638
|
+
|
|
639
|
+
let finalSetup = rec;
|
|
640
|
+
if (setupMode === "customize") {
|
|
641
|
+
finalSetup = await askCustomize(rec);
|
|
642
|
+
} else if (setupMode === "manual") {
|
|
643
|
+
finalSetup = await askManual();
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
// Check if playwright is in the final MCP list and ask about browser install
|
|
647
|
+
const wantPlaywright = finalSetup.mcps.includes("playwright")
|
|
579
648
|
? await askPlaywright()
|
|
580
649
|
: false;
|
|
581
650
|
|
|
@@ -583,23 +652,34 @@ Options:
|
|
|
583
652
|
const gitBranch = await askGitBranch();
|
|
584
653
|
|
|
585
654
|
// Build config object
|
|
586
|
-
const
|
|
655
|
+
const formatterDef = FORMATTER_MAP[stack] || FORMATTER_MAP.generic;
|
|
587
656
|
const config = {
|
|
588
657
|
projectName,
|
|
589
658
|
stack,
|
|
659
|
+
appType,
|
|
660
|
+
description,
|
|
590
661
|
language: langResult.language,
|
|
591
662
|
...(langResult.customLanguage
|
|
592
663
|
? { customLanguage: langResult.customLanguage }
|
|
593
664
|
: {}),
|
|
594
665
|
autonomyLevel,
|
|
595
666
|
packageManager: detected.packageManager,
|
|
596
|
-
formatter:
|
|
597
|
-
mcpServers:
|
|
667
|
+
formatter: formatterDef.name,
|
|
668
|
+
mcpServers: finalSetup.mcps,
|
|
598
669
|
playwrightBrowsers: wantPlaywright,
|
|
599
|
-
installScope:
|
|
670
|
+
installScope: "local",
|
|
671
|
+
recommended: {
|
|
672
|
+
commands: finalSetup.commands,
|
|
673
|
+
hooks: finalSetup.hooks,
|
|
674
|
+
skills: finalSetup.skills,
|
|
675
|
+
mcps: finalSetup.mcps,
|
|
676
|
+
subagents: finalSetup.subagents,
|
|
677
|
+
agentTeams: finalSetup.agentTeams,
|
|
678
|
+
},
|
|
679
|
+
mode: setupMode,
|
|
600
680
|
};
|
|
601
681
|
|
|
602
|
-
// ── Dry run
|
|
682
|
+
// ── Dry run ───────────────────────────────────────────────────────────────
|
|
603
683
|
if (args.dryRun) {
|
|
604
684
|
p.log.info("Dry run — no files will be written.");
|
|
605
685
|
p.note(JSON.stringify(config, null, 2), "Planned Configuration");
|
|
@@ -611,7 +691,7 @@ Options:
|
|
|
611
691
|
"AUTONOMOUS-WORKFLOW.md",
|
|
612
692
|
".effectum.json",
|
|
613
693
|
];
|
|
614
|
-
if (
|
|
694
|
+
if (finalSetup.mcps.length > 0) {
|
|
615
695
|
plannedFiles.push("MCP servers in settings.json");
|
|
616
696
|
}
|
|
617
697
|
p.note(plannedFiles.join("\n"), "Files to be created/updated");
|
|
@@ -619,62 +699,60 @@ Options:
|
|
|
619
699
|
process.exit(0);
|
|
620
700
|
}
|
|
621
701
|
|
|
622
|
-
// ──
|
|
702
|
+
// ── Step 9: Install ───────────────────────────────────────────────────────
|
|
703
|
+
|
|
704
|
+
// Create git branch if requested
|
|
623
705
|
if (gitBranch.create) {
|
|
624
|
-
const
|
|
625
|
-
|
|
706
|
+
const sGit = p.spinner();
|
|
707
|
+
sGit.start("Creating git branch...");
|
|
626
708
|
const ok = createGitBranch(gitBranch.name);
|
|
627
709
|
if (ok) {
|
|
628
|
-
|
|
710
|
+
sGit.stop(`Branch "${gitBranch.name}" created`);
|
|
629
711
|
} else {
|
|
630
|
-
|
|
712
|
+
sGit.stop("Could not create branch (may already exist)");
|
|
631
713
|
}
|
|
632
714
|
}
|
|
633
715
|
|
|
634
|
-
//
|
|
716
|
+
// 9a: Base files
|
|
635
717
|
const s1 = p.spinner();
|
|
636
718
|
s1.start("Installing workflow commands and templates...");
|
|
637
|
-
const baseSteps = installBaseFiles(installTargetDir, repoRoot,
|
|
719
|
+
const baseSteps = installBaseFiles(installTargetDir, repoRoot, false);
|
|
638
720
|
s1.stop(
|
|
639
721
|
`Installed ${baseSteps.filter((s) => s.status === "created").length} files`,
|
|
640
722
|
);
|
|
641
723
|
|
|
642
|
-
//
|
|
643
|
-
const
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
repoRoot,
|
|
653
|
-
installGlobal,
|
|
654
|
-
);
|
|
655
|
-
configSteps.push(...cSteps);
|
|
656
|
-
s2.stop("Configuration files generated");
|
|
657
|
-
}
|
|
724
|
+
// 9b: Configure
|
|
725
|
+
const s2 = p.spinner();
|
|
726
|
+
s2.start("Generating CLAUDE.md, settings.json, guardrails.md...");
|
|
727
|
+
const configSteps = generateConfiguredFiles(
|
|
728
|
+
config,
|
|
729
|
+
installTargetDir,
|
|
730
|
+
repoRoot,
|
|
731
|
+
false,
|
|
732
|
+
);
|
|
733
|
+
s2.stop("Configuration files generated");
|
|
658
734
|
|
|
659
|
-
//
|
|
660
|
-
if (
|
|
735
|
+
// 9c: MCP servers
|
|
736
|
+
if (finalSetup.mcps.length > 0) {
|
|
661
737
|
const s3 = p.spinner();
|
|
662
738
|
s3.start("Setting up MCP servers...");
|
|
663
|
-
const mcpResults = installMcpServers(
|
|
664
|
-
const settingsPath =
|
|
665
|
-
|
|
666
|
-
|
|
739
|
+
const mcpResults = installMcpServers(finalSetup.mcps);
|
|
740
|
+
const settingsPath = path.join(
|
|
741
|
+
installTargetDir,
|
|
742
|
+
".claude",
|
|
743
|
+
"settings.json",
|
|
744
|
+
);
|
|
667
745
|
addMcpToSettings(settingsPath, mcpResults, installTargetDir);
|
|
668
746
|
const okCount = mcpResults.filter((r) => r.ok).length;
|
|
669
747
|
s3.stop(`${okCount} MCP servers configured`);
|
|
670
748
|
}
|
|
671
749
|
|
|
672
|
-
//
|
|
750
|
+
// 9d: Playwright
|
|
673
751
|
if (wantPlaywright) {
|
|
674
752
|
const s4 = p.spinner();
|
|
675
753
|
s4.start("Installing Playwright browsers...");
|
|
676
754
|
const pwResult = installPlaywrightBrowsers();
|
|
677
|
-
|
|
755
|
+
ensurePlaywrightConfig(process.cwd());
|
|
678
756
|
s4.stop(
|
|
679
757
|
pwResult.ok
|
|
680
758
|
? "Playwright browsers installed"
|
|
@@ -682,13 +760,11 @@ Options:
|
|
|
682
760
|
);
|
|
683
761
|
}
|
|
684
762
|
|
|
685
|
-
//
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
configSteps.push({ status: "created", dest: configPath });
|
|
689
|
-
}
|
|
763
|
+
// 9e: Save config
|
|
764
|
+
const configPath = writeConfig(installTargetDir, config);
|
|
765
|
+
configSteps.push({ status: "created", dest: configPath });
|
|
690
766
|
|
|
691
|
-
// ── Summary
|
|
767
|
+
// ── Summary ───────────────────────────────────────────────────────────────
|
|
692
768
|
const allSteps = [...baseSteps, ...configSteps];
|
|
693
769
|
const allFiles = allSteps
|
|
694
770
|
.filter((s) => s && s.dest)
|
|
@@ -699,13 +775,12 @@ Options:
|
|
|
699
775
|
: path.relative(process.cwd(), s.dest);
|
|
700
776
|
});
|
|
701
777
|
|
|
702
|
-
// Deduplicate for summary
|
|
703
778
|
const uniqueFiles = [...new Set(allFiles)].slice(0, 20);
|
|
704
779
|
showSummary(config, uniqueFiles);
|
|
705
|
-
showOutro(
|
|
780
|
+
showOutro(false);
|
|
706
781
|
}
|
|
707
782
|
|
|
708
783
|
main().catch((err) => {
|
|
709
|
-
|
|
784
|
+
console.error(`Fatal error: ${err.message}`);
|
|
710
785
|
process.exit(1);
|
|
711
786
|
});
|