@aslomon/effectum 0.2.1 → 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 +182 -108
- 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 +350 -21
- package/bin/reconfigure.js +29 -3
- package/package.json +1 -1
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
|
|
|
@@ -22,26 +32,38 @@ const {
|
|
|
22
32
|
buildSubstitutionMap,
|
|
23
33
|
renderTemplate,
|
|
24
34
|
findTemplatePath,
|
|
25
|
-
findRemainingPlaceholders,
|
|
26
35
|
} = require("./lib/template");
|
|
27
36
|
const { writeConfig } = require("./lib/config");
|
|
28
37
|
const { AUTONOMY_MAP, FORMATTER_MAP, MCP_SERVERS } = require("./lib/constants");
|
|
29
|
-
const {
|
|
38
|
+
const {
|
|
39
|
+
ensureDir,
|
|
40
|
+
deepMerge,
|
|
41
|
+
findRepoRoot: findRepoRootShared,
|
|
42
|
+
} = require("./lib/utils");
|
|
43
|
+
const { recommend } = require("./lib/recommendation");
|
|
30
44
|
const {
|
|
31
45
|
initClack,
|
|
32
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
323
|
console.warn(
|
|
304
|
-
|
|
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,7 @@ Options:
|
|
|
524
562
|
process.exit(0);
|
|
525
563
|
}
|
|
526
564
|
|
|
527
|
-
// ── Interactive mode
|
|
565
|
+
// ── Interactive mode — 9-step flow ────────────────────────────────────────
|
|
528
566
|
const p = await initClack();
|
|
529
567
|
printBanner();
|
|
530
568
|
|
|
@@ -536,47 +574,77 @@ Options:
|
|
|
536
574
|
);
|
|
537
575
|
}
|
|
538
576
|
|
|
539
|
-
// Scope
|
|
540
|
-
const scopeValue = await
|
|
541
|
-
message: "Install scope",
|
|
542
|
-
options: [
|
|
543
|
-
{
|
|
544
|
-
value: "local",
|
|
545
|
-
label: "Local",
|
|
546
|
-
hint: "This project only (./.claude/)",
|
|
547
|
-
},
|
|
548
|
-
{
|
|
549
|
-
value: "global",
|
|
550
|
-
label: "Global",
|
|
551
|
-
hint: "All projects (~/.claude/)",
|
|
552
|
-
},
|
|
553
|
-
],
|
|
554
|
-
initialValue: "local",
|
|
555
|
-
});
|
|
556
|
-
if (p.isCancel(scopeValue)) {
|
|
557
|
-
p.cancel("Setup cancelled.");
|
|
558
|
-
process.exit(0);
|
|
559
|
-
}
|
|
577
|
+
// ── Step 1: Install Scope ─────────────────────────────────────────────────
|
|
578
|
+
const scopeValue = await askScope();
|
|
560
579
|
const installGlobal = scopeValue === "global";
|
|
561
580
|
const installTargetDir = installGlobal ? homeClaudeDir : process.cwd();
|
|
562
581
|
|
|
563
|
-
//
|
|
564
|
-
|
|
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
|
+
}
|
|
565
599
|
|
|
566
|
-
|
|
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
|
+
}
|
|
608
|
+
|
|
609
|
+
// ── Step 2: Project Basics ────────────────────────────────────────────────
|
|
610
|
+
const projectName = await askProjectName(detected.projectName);
|
|
567
611
|
const stack = await askStack(detected.stack);
|
|
568
612
|
|
|
569
|
-
//
|
|
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 ──────────────────────────────────────────────────────
|
|
570
620
|
const langResult = await askLanguage();
|
|
571
621
|
|
|
572
|
-
// Autonomy
|
|
622
|
+
// ── Step 6: Autonomy ──────────────────────────────────────────────────────
|
|
573
623
|
const autonomyLevel = await askAutonomy();
|
|
574
624
|
|
|
575
|
-
//
|
|
576
|
-
const
|
|
625
|
+
// ── Step 7: Recommendation Preview ────────────────────────────────────────
|
|
626
|
+
const rec = recommend({
|
|
627
|
+
stack,
|
|
628
|
+
appType,
|
|
629
|
+
description,
|
|
630
|
+
autonomyLevel,
|
|
631
|
+
language: langResult.language,
|
|
632
|
+
});
|
|
633
|
+
|
|
634
|
+
showRecommendation(rec);
|
|
577
635
|
|
|
578
|
-
//
|
|
579
|
-
const
|
|
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")
|
|
580
648
|
? await askPlaywright()
|
|
581
649
|
: false;
|
|
582
650
|
|
|
@@ -584,23 +652,34 @@ Options:
|
|
|
584
652
|
const gitBranch = await askGitBranch();
|
|
585
653
|
|
|
586
654
|
// Build config object
|
|
587
|
-
const
|
|
655
|
+
const formatterDef = FORMATTER_MAP[stack] || FORMATTER_MAP.generic;
|
|
588
656
|
const config = {
|
|
589
657
|
projectName,
|
|
590
658
|
stack,
|
|
659
|
+
appType,
|
|
660
|
+
description,
|
|
591
661
|
language: langResult.language,
|
|
592
662
|
...(langResult.customLanguage
|
|
593
663
|
? { customLanguage: langResult.customLanguage }
|
|
594
664
|
: {}),
|
|
595
665
|
autonomyLevel,
|
|
596
666
|
packageManager: detected.packageManager,
|
|
597
|
-
formatter:
|
|
598
|
-
mcpServers:
|
|
667
|
+
formatter: formatterDef.name,
|
|
668
|
+
mcpServers: finalSetup.mcps,
|
|
599
669
|
playwrightBrowsers: wantPlaywright,
|
|
600
|
-
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,
|
|
601
680
|
};
|
|
602
681
|
|
|
603
|
-
// ── Dry run
|
|
682
|
+
// ── Dry run ───────────────────────────────────────────────────────────────
|
|
604
683
|
if (args.dryRun) {
|
|
605
684
|
p.log.info("Dry run — no files will be written.");
|
|
606
685
|
p.note(JSON.stringify(config, null, 2), "Planned Configuration");
|
|
@@ -612,7 +691,7 @@ Options:
|
|
|
612
691
|
"AUTONOMOUS-WORKFLOW.md",
|
|
613
692
|
".effectum.json",
|
|
614
693
|
];
|
|
615
|
-
if (
|
|
694
|
+
if (finalSetup.mcps.length > 0) {
|
|
616
695
|
plannedFiles.push("MCP servers in settings.json");
|
|
617
696
|
}
|
|
618
697
|
p.note(plannedFiles.join("\n"), "Files to be created/updated");
|
|
@@ -620,62 +699,60 @@ Options:
|
|
|
620
699
|
process.exit(0);
|
|
621
700
|
}
|
|
622
701
|
|
|
623
|
-
// ──
|
|
702
|
+
// ── Step 9: Install ───────────────────────────────────────────────────────
|
|
703
|
+
|
|
704
|
+
// Create git branch if requested
|
|
624
705
|
if (gitBranch.create) {
|
|
625
|
-
const
|
|
626
|
-
|
|
706
|
+
const sGit = p.spinner();
|
|
707
|
+
sGit.start("Creating git branch...");
|
|
627
708
|
const ok = createGitBranch(gitBranch.name);
|
|
628
709
|
if (ok) {
|
|
629
|
-
|
|
710
|
+
sGit.stop(`Branch "${gitBranch.name}" created`);
|
|
630
711
|
} else {
|
|
631
|
-
|
|
712
|
+
sGit.stop("Could not create branch (may already exist)");
|
|
632
713
|
}
|
|
633
714
|
}
|
|
634
715
|
|
|
635
|
-
//
|
|
716
|
+
// 9a: Base files
|
|
636
717
|
const s1 = p.spinner();
|
|
637
718
|
s1.start("Installing workflow commands and templates...");
|
|
638
|
-
const baseSteps = installBaseFiles(installTargetDir, repoRoot,
|
|
719
|
+
const baseSteps = installBaseFiles(installTargetDir, repoRoot, false);
|
|
639
720
|
s1.stop(
|
|
640
721
|
`Installed ${baseSteps.filter((s) => s.status === "created").length} files`,
|
|
641
722
|
);
|
|
642
723
|
|
|
643
|
-
//
|
|
644
|
-
const
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
repoRoot,
|
|
654
|
-
installGlobal,
|
|
655
|
-
);
|
|
656
|
-
configSteps.push(...cSteps);
|
|
657
|
-
s2.stop("Configuration files generated");
|
|
658
|
-
}
|
|
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");
|
|
659
734
|
|
|
660
|
-
//
|
|
661
|
-
if (
|
|
735
|
+
// 9c: MCP servers
|
|
736
|
+
if (finalSetup.mcps.length > 0) {
|
|
662
737
|
const s3 = p.spinner();
|
|
663
738
|
s3.start("Setting up MCP servers...");
|
|
664
|
-
const mcpResults = installMcpServers(
|
|
665
|
-
const settingsPath =
|
|
666
|
-
|
|
667
|
-
|
|
739
|
+
const mcpResults = installMcpServers(finalSetup.mcps);
|
|
740
|
+
const settingsPath = path.join(
|
|
741
|
+
installTargetDir,
|
|
742
|
+
".claude",
|
|
743
|
+
"settings.json",
|
|
744
|
+
);
|
|
668
745
|
addMcpToSettings(settingsPath, mcpResults, installTargetDir);
|
|
669
746
|
const okCount = mcpResults.filter((r) => r.ok).length;
|
|
670
747
|
s3.stop(`${okCount} MCP servers configured`);
|
|
671
748
|
}
|
|
672
749
|
|
|
673
|
-
//
|
|
750
|
+
// 9d: Playwright
|
|
674
751
|
if (wantPlaywright) {
|
|
675
752
|
const s4 = p.spinner();
|
|
676
753
|
s4.start("Installing Playwright browsers...");
|
|
677
754
|
const pwResult = installPlaywrightBrowsers();
|
|
678
|
-
|
|
755
|
+
ensurePlaywrightConfig(process.cwd());
|
|
679
756
|
s4.stop(
|
|
680
757
|
pwResult.ok
|
|
681
758
|
? "Playwright browsers installed"
|
|
@@ -683,13 +760,11 @@ Options:
|
|
|
683
760
|
);
|
|
684
761
|
}
|
|
685
762
|
|
|
686
|
-
//
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
configSteps.push({ status: "created", dest: configPath });
|
|
690
|
-
}
|
|
763
|
+
// 9e: Save config
|
|
764
|
+
const configPath = writeConfig(installTargetDir, config);
|
|
765
|
+
configSteps.push({ status: "created", dest: configPath });
|
|
691
766
|
|
|
692
|
-
// ── Summary
|
|
767
|
+
// ── Summary ───────────────────────────────────────────────────────────────
|
|
693
768
|
const allSteps = [...baseSteps, ...configSteps];
|
|
694
769
|
const allFiles = allSteps
|
|
695
770
|
.filter((s) => s && s.dest)
|
|
@@ -700,10 +775,9 @@ Options:
|
|
|
700
775
|
: path.relative(process.cwd(), s.dest);
|
|
701
776
|
});
|
|
702
777
|
|
|
703
|
-
// Deduplicate for summary
|
|
704
778
|
const uniqueFiles = [...new Set(allFiles)].slice(0, 20);
|
|
705
779
|
showSummary(config, uniqueFiles);
|
|
706
|
-
showOutro(
|
|
780
|
+
showOutro(false);
|
|
707
781
|
}
|
|
708
782
|
|
|
709
783
|
main().catch((err) => {
|