claude-launchpad 1.0.0 → 1.1.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 +1 -1
- package/dist/{chunk-GRL3DOCP.js → chunk-F5PNKQKW.js} +16 -3
- package/dist/chunk-F5PNKQKW.js.map +1 -0
- package/dist/{chunk-ZXJK7CHB.js → chunk-FQRM2BKL.js} +3 -3
- package/dist/{chunk-PGDSAUP4.js → chunk-LYLUXVWT.js} +2 -2
- package/dist/{chunk-TSTTFR4B.js → chunk-N6X3E5AX.js} +2 -2
- package/dist/{chunk-AUV2JTXX.js → chunk-ULYVGZCJ.js} +2 -2
- package/dist/{chunk-4JNFXVVC.js → chunk-UN23WZVQ.js} +2 -1
- package/dist/chunk-UN23WZVQ.js.map +1 -0
- package/dist/cli.js +23 -14
- package/dist/cli.js.map +1 -1
- package/dist/commands/memory/server.js +24 -19
- package/dist/commands/memory/server.js.map +1 -1
- package/dist/{context-Q5ZQBY7O.js → context-5AV2WCYW.js} +5 -5
- package/dist/{install-LS7DTMIE.js → install-6VOUHJTI.js} +5 -5
- package/dist/{pull-4NRD4GQ4.js → pull-KRU2DRPZ.js} +8 -8
- package/dist/{push-BHYEETGP.js → push-KCT2J6FR.js} +8 -8
- package/dist/{require-deps-3GIE6TAG.js → require-deps-DVEP4QBF.js} +3 -3
- package/dist/{stats-NQ5NRUZC.js → stats-7K6GKTVB.js} +6 -6
- package/dist/{sync-clean-QWEQVAYO.js → sync-clean-P75QVF5Z.js} +2 -2
- package/dist/{sync-status-ZMXMEBGC.js → sync-status-QF6QK3NN.js} +8 -8
- package/dist/{tui-YL5NWME5.js → tui-QNOPH3I5.js} +4 -4
- package/package.json +1 -1
- package/dist/chunk-4JNFXVVC.js.map +0 -1
- package/dist/chunk-GRL3DOCP.js.map +0 -1
- /package/dist/{chunk-ZXJK7CHB.js.map → chunk-FQRM2BKL.js.map} +0 -0
- /package/dist/{chunk-PGDSAUP4.js.map → chunk-LYLUXVWT.js.map} +0 -0
- /package/dist/{chunk-TSTTFR4B.js.map → chunk-N6X3E5AX.js.map} +0 -0
- /package/dist/{chunk-AUV2JTXX.js.map → chunk-ULYVGZCJ.js.map} +0 -0
- /package/dist/{context-Q5ZQBY7O.js.map → context-5AV2WCYW.js.map} +0 -0
- /package/dist/{install-LS7DTMIE.js.map → install-6VOUHJTI.js.map} +0 -0
- /package/dist/{pull-4NRD4GQ4.js.map → pull-KRU2DRPZ.js.map} +0 -0
- /package/dist/{push-BHYEETGP.js.map → push-KCT2J6FR.js.map} +0 -0
- /package/dist/{require-deps-3GIE6TAG.js.map → require-deps-DVEP4QBF.js.map} +0 -0
- /package/dist/{stats-NQ5NRUZC.js.map → stats-7K6GKTVB.js.map} +0 -0
- /package/dist/{sync-clean-QWEQVAYO.js.map → sync-clean-P75QVF5Z.js.map} +0 -0
- /package/dist/{sync-status-ZMXMEBGC.js.map → sync-status-QF6QK3NN.js.map} +0 -0
- /package/dist/{tui-YL5NWME5.js.map → tui-QNOPH3I5.js.map} +0 -0
package/README.md
CHANGED
|
@@ -201,7 +201,7 @@ Results save to `.claude/eval/` as structured markdown. Feed them back to Claude
|
|
|
201
201
|
|
|
202
202
|
## Memory
|
|
203
203
|
|
|
204
|
-
Claude
|
|
204
|
+
Claude's built-in memory resets per machine. Launchpad gives each project persistent, cross-device memory that syncs via a private GitHub Gist. Switch laptops and your decisions are already there.
|
|
205
205
|
|
|
206
206
|
```bash
|
|
207
207
|
claude-launchpad memory
|
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
// src/commands/memory/types.ts
|
|
4
4
|
import { z } from "zod";
|
|
5
|
+
var coerceStringArray = z.preprocess((val) => {
|
|
6
|
+
if (Array.isArray(val)) return val;
|
|
7
|
+
if (typeof val === "string") {
|
|
8
|
+
try {
|
|
9
|
+
const parsed = JSON.parse(val);
|
|
10
|
+
if (Array.isArray(parsed)) return parsed;
|
|
11
|
+
} catch {
|
|
12
|
+
}
|
|
13
|
+
return val.trim() ? [val] : [];
|
|
14
|
+
}
|
|
15
|
+
return val;
|
|
16
|
+
}, z.array(z.string()));
|
|
5
17
|
var MEMORY_TYPES = ["working", "episodic", "semantic", "procedural", "pattern"];
|
|
6
18
|
var MEMORY_SOURCES = ["manual", "session_end", "consolidation", "hook", "import"];
|
|
7
19
|
var RELATION_TYPES = [
|
|
@@ -16,7 +28,7 @@ var StoreInputSchema = z.object({
|
|
|
16
28
|
type: z.enum(MEMORY_TYPES),
|
|
17
29
|
content: z.string().min(1),
|
|
18
30
|
title: z.string().max(200).optional(),
|
|
19
|
-
tags: z.array(z.string()).max(20).default([]),
|
|
31
|
+
tags: coerceStringArray.pipe(z.array(z.string()).max(20)).default([]),
|
|
20
32
|
importance: z.number().min(0).max(1).default(0.5),
|
|
21
33
|
context: z.string().optional(),
|
|
22
34
|
source: z.enum(MEMORY_SOURCES).default("manual"),
|
|
@@ -26,7 +38,7 @@ var SearchInputSchema = z.object({
|
|
|
26
38
|
query: z.string().min(1).max(500),
|
|
27
39
|
id: z.string().optional(),
|
|
28
40
|
type: z.enum(MEMORY_TYPES).optional(),
|
|
29
|
-
tags: z.array(z.string()).max(10).optional(),
|
|
41
|
+
tags: coerceStringArray.pipe(z.array(z.string()).max(10)).optional(),
|
|
30
42
|
limit: z.number().int().min(1).max(50).default(10),
|
|
31
43
|
min_importance: z.number().min(0).max(1).default(0),
|
|
32
44
|
project: z.string().max(200).optional()
|
|
@@ -69,9 +81,10 @@ var SyncPayloadSchema = z.object({
|
|
|
69
81
|
});
|
|
70
82
|
|
|
71
83
|
export {
|
|
84
|
+
coerceStringArray,
|
|
72
85
|
MEMORY_TYPES,
|
|
73
86
|
MEMORY_SOURCES,
|
|
74
87
|
RELATION_TYPES,
|
|
75
88
|
SyncPayloadSchema
|
|
76
89
|
};
|
|
77
|
-
//# sourceMappingURL=chunk-
|
|
90
|
+
//# sourceMappingURL=chunk-F5PNKQKW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/memory/types.ts"],"sourcesContent":["import { z } from 'zod';\n\n// ── MCP Harness Coercion ─────────────────────────────────────\n// Claude Code's MCP harness sometimes serializes arrays as JSON-encoded strings\n// (e.g. tags arrives as '[\"tag1\",\"tag2\"]' instead of [\"tag1\",\"tag2\"]).\n// This preprocess step accepts both forms.\nexport const coerceStringArray = z.preprocess((val) => {\n if (Array.isArray(val)) return val;\n if (typeof val === 'string') {\n try {\n const parsed = JSON.parse(val);\n if (Array.isArray(parsed)) return parsed;\n } catch { /* not JSON, treat as single-element array */ }\n return val.trim() ? [val] : [];\n }\n return val;\n}, z.array(z.string()));\n\n// ── Memory Types ──────────────────────────────────────────────\n\nexport const MEMORY_TYPES = ['working', 'episodic', 'semantic', 'procedural', 'pattern'] as const;\nexport type MemoryType = typeof MEMORY_TYPES[number];\n\nexport const MEMORY_SOURCES = ['manual', 'session_end', 'consolidation', 'hook', 'import'] as const;\nexport type MemorySource = typeof MEMORY_SOURCES[number];\n\nexport const RELATION_TYPES = [\n 'relates_to', 'depends_on', 'contradicts', 'extends', 'implements', 'derived_from',\n] as const;\nexport type RelationType = typeof RELATION_TYPES[number];\n\n// ── Core Entities ─────────────────────────────────────────────\n\nexport interface Memory {\n readonly id: string;\n readonly type: MemoryType;\n readonly title: string | null;\n readonly content: string;\n readonly context: string | null;\n readonly source: MemorySource | null;\n readonly project: string | null;\n readonly tags: readonly string[];\n readonly importance: number;\n readonly createdAt: string;\n readonly updatedAt: string;\n readonly accessCount: number;\n readonly lastAccessed: string | null;\n readonly injectionCount: number;\n}\n\nexport interface Relation {\n readonly sourceId: string;\n readonly targetId: string;\n readonly relationType: RelationType;\n readonly createdAt: string;\n}\n\n// ── Search Types ──────────────────────────────────────────────\n\nexport interface SearchResult {\n readonly memory: Memory;\n readonly score: number;\n readonly explanation: string;\n}\n\nexport interface FtsMatch {\n readonly rowid: number;\n readonly memoryId: string;\n readonly rank: number;\n}\n\nexport interface ScoredCandidate {\n readonly memoryId: string;\n readonly textScore: number;\n readonly importanceScore: number;\n readonly recencyScore: number;\n readonly accessScore: number;\n readonly contextScore: number;\n readonly composite: number;\n}\n\n// ── Decay Parameters ──────────────────────────────────────────\n\nexport interface DecayParams {\n readonly tauByType: Record<MemoryType, number>;\n readonly accessModifiers: readonly { readonly maxCount: number; readonly multiplier: number }[];\n readonly relationModifier: {\n readonly connectedThreshold: number;\n readonly connectedMultiplier: number;\n readonly isolatedMultiplier: number;\n readonly highlyConnectedThreshold: number;\n readonly highlyConnectedMultiplier: number;\n };\n readonly importanceFloor: number;\n readonly pruneThreshold: number;\n readonly pruneMinAgeDays: number;\n}\n\n// ── Input Schemas (for MCP tools) ─────────────────────────────\n\nexport const StoreInputSchema = z.object({\n type: z.enum(MEMORY_TYPES),\n content: z.string().min(1),\n title: z.string().max(200).optional(),\n tags: coerceStringArray.pipe(z.array(z.string()).max(20)).default([]),\n importance: z.number().min(0).max(1).default(0.5),\n context: z.string().optional(),\n source: z.enum(MEMORY_SOURCES).default('manual'),\n project: z.string().max(200).optional(),\n});\nexport type StoreInput = z.infer<typeof StoreInputSchema>;\n\nexport const SearchInputSchema = z.object({\n query: z.string().min(1).max(500),\n id: z.string().optional(),\n type: z.enum(MEMORY_TYPES).optional(),\n tags: coerceStringArray.pipe(z.array(z.string()).max(10)).optional(),\n limit: z.number().int().min(1).max(50).default(10),\n min_importance: z.number().min(0).max(1).default(0),\n project: z.string().max(200).optional(),\n});\nexport type SearchInput = z.infer<typeof SearchInputSchema>;\n\nexport const ForgetInputSchema = z.object({\n id: z.string(),\n hard_delete: z.boolean().default(false),\n});\nexport type ForgetInput = z.infer<typeof ForgetInputSchema>;\n\nexport const RelateInputSchema = z.object({\n source_id: z.string(),\n target_id: z.string(),\n relation_type: z.enum(RELATION_TYPES),\n});\nexport type RelateInput = z.infer<typeof RelateInputSchema>;\n\n// ── Sync Types ───────────────────────────────────────────────\n\nexport interface SyncPayload {\n readonly version: number;\n readonly machine_id: string;\n readonly pushed_at: string;\n readonly memories: readonly SyncMemoryRow[];\n readonly relations: readonly SyncRelationRow[];\n}\n\nexport interface SyncMemoryRow {\n readonly id: string;\n readonly type: MemoryType;\n readonly title: string | null;\n readonly content: string;\n readonly context: string | null;\n readonly source: MemorySource | null;\n readonly project: string | null;\n readonly tags: readonly string[];\n readonly importance: number;\n readonly access_count: number;\n readonly injection_count: number;\n readonly created_at: string;\n readonly updated_at: string;\n readonly last_accessed: string | null;\n}\n\nexport interface SyncRelationRow {\n readonly source_id: string;\n readonly target_id: string;\n readonly relation_type: RelationType;\n readonly created_at: string;\n}\n\nexport const SyncPayloadSchema = z.object({\n version: z.number(),\n machine_id: z.string(),\n pushed_at: z.string(),\n memories: z.array(z.object({\n id: z.string(),\n type: z.enum(MEMORY_TYPES),\n title: z.string().nullable(),\n content: z.string(),\n context: z.string().nullable(),\n source: z.enum(MEMORY_SOURCES).nullable(),\n project: z.string().nullable(),\n tags: z.array(z.string()),\n importance: z.number(),\n access_count: z.number(),\n injection_count: z.number(),\n created_at: z.string(),\n updated_at: z.string(),\n last_accessed: z.string().nullable(),\n })),\n relations: z.array(z.object({\n source_id: z.string(),\n target_id: z.string(),\n relation_type: z.enum(RELATION_TYPES),\n created_at: z.string(),\n })),\n});\n\nexport interface SyncConfig {\n readonly gistId: string;\n}\n\nexport interface MergeResult {\n readonly inserted: number;\n readonly updated: number;\n readonly relationsAdded: number;\n}\n\n// ── Stats ─────────────────────────────────────────────────────\n\nexport interface MemoryStats {\n readonly totalMemories: number;\n readonly byType: Record<MemoryType, number>;\n readonly totalRelations: number;\n readonly dbSizeBytes: number;\n readonly oldestMemory: string | null;\n readonly newestMemory: string | null;\n readonly topInjected: readonly { readonly id: string; readonly title: string | null; readonly injectionCount: number }[];\n}\n"],"mappings":";;;AAAA,SAAS,SAAS;AAMX,IAAM,oBAAoB,EAAE,WAAW,CAAC,QAAQ;AACrD,MAAI,MAAM,QAAQ,GAAG,EAAG,QAAO;AAC/B,MAAI,OAAO,QAA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AY,EAAE,OAAO;AAAA,IACrB,eAAe,EAAE,OAAO,EAAE,SAAS;AAAA,EACrC,CAAC,CAAC;AAAA,EACF,WAAW,EAAE,MAAM,EAAE,OAAO;AAAA,IAC1B,WAAW,EAAE,OAAO;AAAA,IACpB,WAAW,EAAE,OAAO;AAAA,IACpB,eAAe,EAAE,KAAK,cAAc;AAAA,IACpC,YAAY,EAAE,OAAO;AAAA,EACvB,CAAC,CAAC;AACJ,CAAC;","names":[]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
cwdRequire
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LYLUXVWT.js";
|
|
5
5
|
import {
|
|
6
6
|
__export
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-UN23WZVQ.js";
|
|
8
8
|
|
|
9
9
|
// src/commands/memory/config.ts
|
|
10
10
|
import { z } from "zod";
|
|
@@ -331,4 +331,4 @@ export {
|
|
|
331
331
|
closeDatabase,
|
|
332
332
|
migrate
|
|
333
333
|
};
|
|
334
|
-
//# sourceMappingURL=chunk-
|
|
334
|
+
//# sourceMappingURL=chunk-FQRM2BKL.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
log
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-UN23WZVQ.js";
|
|
5
5
|
|
|
6
6
|
// src/commands/memory/utils/require-deps.ts
|
|
7
7
|
import { createRequire } from "module";
|
|
@@ -44,4 +44,4 @@ export {
|
|
|
44
44
|
cwdRequire,
|
|
45
45
|
requireMemoryDeps
|
|
46
46
|
};
|
|
47
|
-
//# sourceMappingURL=chunk-
|
|
47
|
+
//# sourceMappingURL=chunk-LYLUXVWT.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
SyncPayloadSchema
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-F5PNKQKW.js";
|
|
5
5
|
|
|
6
6
|
// src/commands/memory/utils/sync-merge.ts
|
|
7
7
|
function memoryToSyncRow(m) {
|
|
@@ -65,4 +65,4 @@ export {
|
|
|
65
65
|
parsePayload,
|
|
66
66
|
mergeFromRemote
|
|
67
67
|
};
|
|
68
|
-
//# sourceMappingURL=chunk-
|
|
68
|
+
//# sourceMappingURL=chunk-N6X3E5AX.js.map
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
loadConfig,
|
|
11
11
|
migrate,
|
|
12
12
|
resolveDataDir
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-FQRM2BKL.js";
|
|
14
14
|
|
|
15
15
|
// src/commands/memory/subcommands/init-storage.ts
|
|
16
16
|
function initStorage(dbPath) {
|
|
@@ -32,4 +32,4 @@ function initStorage(dbPath) {
|
|
|
32
32
|
export {
|
|
33
33
|
initStorage
|
|
34
34
|
};
|
|
35
|
-
//# sourceMappingURL=chunk-
|
|
35
|
+
//# sourceMappingURL=chunk-ULYVGZCJ.js.map
|
|
@@ -765,6 +765,7 @@ var FIX_TABLE = [
|
|
|
765
765
|
} },
|
|
766
766
|
{ analyzer: "Quality", match: "Session Start", fix: (root) => addClaudeMdSection(root, "## Session Start", "- ALWAYS read @TASKS.md first - it tracks progress across sessions\n- Update TASKS.md as you complete work") },
|
|
767
767
|
{ analyzer: "Quality", match: "Backlog", fix: (root) => addClaudeMdSection(root, "## Backlog", "- When a feature is discussed but deferred, add it to BACKLOG.md immediately\n- Never leave future ideas only in TASKS.md or conversation \u2014 they get lost\n- BACKLOG.md is the single source of truth for parked features") },
|
|
768
|
+
{ analyzer: "Quality", match: "When Stuck", fix: (root) => addClaudeMdSection(root, "## When Stuck", "Three failed iterations on the same problem = stop iterating alone.\nOn the fourth attempt, spin up at least 3 parallel agents via the Agent tool, each investigating from a different angle:\n1. Root-cause debug agent\n2. Upstream library/docs research agent\n3. Alternative architecture agent\nWait for all agents to return, synthesize their findings, then act.\nDon't keep guessing in circles \u2014 rotate perspectives.") },
|
|
768
769
|
{ analyzer: "Rules", match: "No BACKLOG.md", fix: (root) => createBacklogMd(root) },
|
|
769
770
|
{ analyzer: "Rules", match: "No .claudeignore", fix: (root, detected) => createClaudeignore(root, detected) },
|
|
770
771
|
{ analyzer: "Rules", match: "No .claude/rules/", fix: (root) => createStarterRules(root) },
|
|
@@ -1136,4 +1137,4 @@ export {
|
|
|
1136
1137
|
printScoreCard,
|
|
1137
1138
|
renderDoctorReport
|
|
1138
1139
|
};
|
|
1139
|
-
//# sourceMappingURL=chunk-
|
|
1140
|
+
//# sourceMappingURL=chunk-UN23WZVQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/fs-utils.ts","../src/lib/settings.ts","../src/lib/memory-placement.ts","../src/lib/output.ts","../src/commands/doctor/fixer.ts","../src/lib/detect.ts","../src/commands/init/generators/claudeignore.ts","../src/commands/init/generators/skill-enhance.ts","../src/commands/doctor/fixer-memory.ts"],"sourcesContent":["import { readFile, access } from \"node:fs/promises\";\n\nexport async function fileExists(path: string): Promise<boolean> {\n try {\n await access(path);\n return true;\n } catch {\n return false;\n }\n}\n\nexport async function readFileOrNull(path: string): Promise<string | null> {\n try {\n return await readFile(path, \"utf-8\");\n } catch {\n return null;\n }\n}\n\nexport async function readJsonOrNull<T>(path: string): Promise<T | null> {\n try {\n const content = await readFile(path, \"utf-8\");\n return JSON.parse(content) as T;\n } catch {\n return null;\n }\n}\n","import { readFile, writeFile, mkdir } from \"node:fs/promises\";\nimport { join } from \"node:path\";\n\nexport async function readSettingsJson(root: string): Promise<Record<string, unknown>> {\n const path = join(root, \".claude\", \"settings.json\");\n try {\n const content = await readFile(path, \"utf-8\");\n return JSON.parse(content) as Record<string, unknown>;\n } catch {\n return {};\n }\n}\n\nexport async function writeSettingsJson(root: string, settings: Record<string, unknown>): Promise<void> {\n const dir = join(root, \".claude\");\n await mkdir(dir, { recursive: true });\n await writeFile(join(dir, \"settings.json\"), JSON.stringify(settings, null, 2) + \"\\n\");\n}\n\nexport async function readSettingsLocalJson(root: string): Promise<Record<string, unknown>> {\n const path = join(root, \".claude\", \"settings.local.json\");\n try {\n const content = await readFile(path, \"utf-8\");\n return JSON.parse(content) as Record<string, unknown>;\n } catch {\n return {};\n }\n}\n\nexport async function writeSettingsLocalJson(root: string, settings: Record<string, unknown>): Promise<void> {\n const dir = join(root, \".claude\");\n await mkdir(dir, { recursive: true });\n await writeFile(join(dir, \"settings.local.json\"), JSON.stringify(settings, null, 2) + \"\\n\");\n}\n","import { select } from \"@inquirer/prompts\";\nimport { readSettingsJson, readSettingsLocalJson, writeSettingsLocalJson } from \"./settings.js\";\nimport type { MemoryPlacement } from \"../types/index.js\";\n\nfunction hasMemoryPermissions(settings: Record<string, unknown>): boolean {\n const permissions = settings.permissions as Record<string, unknown> | undefined;\n const allow = (permissions?.allow as string[] | undefined) ?? [];\n return allow.some((p) => p.includes(\"agentic-memory\"));\n}\n\nexport async function getMemoryPlacement(root: string, skipPrompt = false): Promise<MemoryPlacement> {\n const local = await readSettingsLocalJson(root);\n const persisted = local.memoryPlacement;\n if (persisted === \"shared\" || persisted === \"local\") {\n return persisted;\n }\n\n // Backfill: infer from where agentic-memory permissions already live\n if (hasMemoryPermissions(local)) {\n await writeSettingsLocalJson(root, { ...local, memoryPlacement: \"local\" });\n return \"local\";\n }\n const shared = await readSettingsJson(root);\n if (hasMemoryPermissions(shared)) {\n await writeSettingsLocalJson(root, { ...local, memoryPlacement: \"shared\" });\n return \"shared\";\n }\n\n if (skipPrompt) return \"shared\";\n\n const choice = await select<MemoryPlacement>({\n message: \"Where should memory config go?\",\n choices: [\n { value: \"shared\", name: \"Shared (team sees it) — CLAUDE.md + settings.json\" },\n { value: \"local\", name: \"Local (only you) — .claude/CLAUDE.md + settings.local.json\" },\n ],\n });\n\n await writeSettingsLocalJson(root, { ...local, memoryPlacement: choice });\n return choice;\n}\n","import chalk from \"chalk\";\nimport type { Severity, AnalyzerResult, DiagnosticIssue } from \"../types/index.js\";\nimport { hasAutoFix } from \"../commands/doctor/fixer.js\";\n\n// ─── Colors ───\n\nexport const colors = {\n success: chalk.green,\n error: chalk.red,\n warn: chalk.yellow,\n info: chalk.cyan,\n dim: chalk.dim,\n bold: chalk.bold,\n score: (score: number): string => {\n if (score >= 80) return chalk.green.bold(`${score}%`);\n if (score >= 60) return chalk.yellow.bold(`${score}%`);\n return chalk.red.bold(`${score}%`);\n },\n severity: (sev: Severity): string => {\n const map: Record<Severity, (s: string) => string> = {\n critical: chalk.bgRed.white.bold,\n high: chalk.red.bold,\n medium: chalk.yellow,\n low: chalk.cyan,\n info: chalk.dim,\n };\n return map[sev](` ${sev.toUpperCase()} `);\n },\n} as const;\n\n// ─── Prefixed Output ───\n\nexport const log = {\n success: (msg: string): void => console.log(` ${chalk.green(\"✓\")} ${msg}`),\n error: (msg: string): void => console.log(` ${chalk.red(\"✗\")} ${msg}`),\n warn: (msg: string): void => console.log(` ${chalk.yellow(\"!\")} ${msg}`),\n step: (msg: string): void => console.log(` ${chalk.cyan(\"→\")} ${msg}`),\n info: (msg: string): void => console.log(` ${chalk.dim(\"·\")} ${msg}`),\n blank: (): void => console.log(),\n} as const;\n\n// ─── Banner ───\n\nexport function printBanner(): void {\n log.blank();\n console.log(chalk.cyan.bold(\" Claude Launchpad\"));\n console.log(chalk.dim(\" Scaffold · Diagnose · Evaluate · Remember\"));\n log.blank();\n}\n\n// ─── Score Display ───\n\nexport function printScoreCard(label: string, score: number, max: number = 100): void {\n const pct = Math.round((score / max) * 100);\n const bar = renderBar(pct, 20);\n console.log(` ${chalk.bold(label.padEnd(22))} ${bar} ${colors.score(pct).padStart(12)}`);\n}\n\nfunction renderBar(pct: number, width: number): string {\n const filled = Math.round((pct / 100) * width);\n const empty = width - filled;\n const color = pct >= 80 ? chalk.green : pct >= 60 ? chalk.yellow : chalk.red;\n return color(\"━\".repeat(filled)) + chalk.dim(\"─\".repeat(empty));\n}\n\n// ─── Issues List (replaces table) ───\n\nexport function printIssue(severity: Severity, _analyzer: string, message: string): void {\n const sevLabel: Record<Severity, string> = {\n critical: chalk.bgRed.white.bold(\" CRIT \"),\n high: chalk.red.bold(\"HIGH\"),\n medium: chalk.yellow(\"MED \"),\n low: chalk.dim(\"LOW \"),\n info: chalk.dim(\"INFO\"),\n };\n console.log(` ${sevLabel[severity]} ${message}`);\n}\n\n// ─── Report Rendering (shared by doctor + watcher) ───\n\nexport function renderDoctorReport(results: ReadonlyArray<AnalyzerResult>, options?: { afterFix?: boolean }): {\n overallScore: number;\n actionableCount: number;\n} {\n const overallScore = Math.round(\n results.reduce((sum, r) => sum + r.score, 0) / results.length,\n );\n\n for (const result of results) {\n printScoreCard(result.name, result.score);\n }\n log.blank();\n printScoreCard(\"Overall\", overallScore);\n log.blank();\n\n const allIssues = results.flatMap((r) => r.issues);\n const actionable = allIssues.filter((i) => i.severity !== \"info\");\n\n if (actionable.length === 0) {\n log.success(\"No issues found. Your configuration looks solid.\");\n return { overallScore, actionableCount: 0 };\n }\n\n const sorted = [...actionable].sort((a, b) => {\n const order: Record<string, number> = { critical: 0, high: 1, medium: 2, low: 3, info: 4 };\n return (order[a.severity] ?? 4) - (order[b.severity] ?? 4);\n });\n\n for (const issue of sorted) {\n printIssue(issue.severity, issue.analyzer, issue.message);\n }\n\n log.blank();\n if (options?.afterFix) {\n log.info(`${actionable.length} remaining issue(s) require manual intervention.`);\n } else {\n const fixable = actionable.filter((i) => hasAutoFix(i));\n if (fixable.length > 0) {\n log.info(`${actionable.length} issue(s). Run ${chalk.bold(\"--fix\")} to auto-repair or ${chalk.bold(\"--fix --dry-run\")} to preview.`);\n } else {\n log.info(`${actionable.length} issue(s) require manual intervention.`);\n }\n }\n return { overallScore, actionableCount: actionable.length };\n}\n","import { readFile, writeFile, mkdir, access } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { homedir } from \"node:os\";\nimport { log } from \"../../lib/output.js\";\nimport { fileExists } from \"../../lib/fs-utils.js\";\nimport { detectProject } from \"../../lib/detect.js\";\nimport { generateClaudeignore } from \"../init/generators/claudeignore.js\";\nimport { generateEnhanceSkill } from \"../init/generators/skill-enhance.js\";\nimport { readSettingsJson, writeSettingsJson } from \"../../lib/settings.js\";\nimport { getMemoryPlacement } from \"../../lib/memory-placement.js\";\nimport {\n disableAutoMemory, addMemoryToolPermissions, addAllowedMcpServers,\n addSessionStartPullHook, addSessionEndPushHook, removeStaleStopHook,\n} from \"./fixer-memory.js\";\nimport type { DiagnosticIssue, DetectedProject, MemoryPlacement } from \"../../types/index.js\";\n\ninterface FixResult {\n readonly fixed: number;\n readonly skipped: number;\n}\n\n/**\n * Auto-apply deterministic fixes for doctor issues.\n * Only applies fixes that are safe and unambiguous.\n */\nexport async function applyFixes(\n issues: ReadonlyArray<DiagnosticIssue>,\n projectRoot: string,\n): Promise<FixResult> {\n const detected = await detectProject(projectRoot);\n const hasMemoryIssues = issues.some((i) => i.analyzer === \"Memory\");\n const placement = hasMemoryIssues ? await getMemoryPlacement(projectRoot) : \"shared\";\n let fixed = 0;\n let skipped = 0;\n\n for (const issue of issues) {\n const applied = await tryFix(issue, projectRoot, detected, placement);\n if (applied) {\n fixed++;\n } else {\n skipped++;\n }\n }\n\n return { fixed, skipped };\n}\n\n// Fix lookup table: [analyzer, message substring] → fix function\ntype FixFn = (root: string, detected: DetectedProject, placement: MemoryPlacement) => Promise<boolean>;\n\nconst FIX_TABLE: ReadonlyArray<{ analyzer: string; match: string; fix: FixFn }> = [\n { analyzer: \"Hooks\", match: \"No hooks configured\", fix: async (root, detected) => {\n const a = await addEnvProtectionHook(root);\n const b = await addAutoFormatHook(root, detected);\n const c = await addForcePushProtection(root);\n const d = await addSessionStartHook(root);\n return a || b || c || d;\n }},\n { analyzer: \"Hooks\", match: \".env file protection\", fix: (root) => addEnvProtectionHook(root) },\n { analyzer: \"Hooks\", match: \"auto-format\", fix: (root, detected) => addAutoFormatHook(root, detected) },\n { analyzer: \"Hooks\", match: \"No PreToolUse\", fix: (root) => addEnvProtectionHook(root) },\n { analyzer: \"Quality\", match: \"Architecture\", fix: (root) => addClaudeMdSection(root, \"## Architecture\", \"<!-- TODO: Describe your codebase structure. Run `/lp-enhance` to auto-fill this. -->\") },\n { analyzer: \"Quality\", match: \"Off-Limits\", fix: (root) => addClaudeMdSection(root, \"## Off-Limits\", \"- Never hardcode secrets - use environment variables\\n- Never write to `.env` files\\n- Never expose internal error details in API responses\") },\n { analyzer: \"Quality\", match: \"Commands\", fix: (root) => addClaudeMdSection(root, \"## Commands\", \"<!-- TODO: Add your dev/build/test commands -->\") },\n { analyzer: \"Quality\", match: \"Stack\", fix: (root, detected) => {\n const content = detected.language\n ? `- **Language**: ${detected.language}${detected.framework ? `\\n- **Framework**: ${detected.framework}` : \"\"}${detected.packageManager ? `\\n- **Package Manager**: ${detected.packageManager}` : \"\"}`\n : \"<!-- TODO: Define your tech stack -->\";\n return addClaudeMdSection(root, \"## Stack\", content);\n }},\n { analyzer: \"Quality\", match: \"Session Start\", fix: (root) => addClaudeMdSection(root, \"## Session Start\", \"- ALWAYS read @TASKS.md first - it tracks progress across sessions\\n- Update TASKS.md as you complete work\") },\n { analyzer: \"Quality\", match: \"Backlog\", fix: (root) => addClaudeMdSection(root, \"## Backlog\", \"- When a feature is discussed but deferred, add it to BACKLOG.md immediately\\n- Never leave future ideas only in TASKS.md or conversation — they get lost\\n- BACKLOG.md is the single source of truth for parked features\") },\n { analyzer: \"Quality\", match: \"When Stuck\", fix: (root) => addClaudeMdSection(root, \"## When Stuck\", \"Three failed iterations on the same problem = stop iterating alone.\\nOn the fourth attempt, spin up at least 3 parallel agents via the Agent tool, each investigating from a different angle:\\n1. Root-cause debug agent\\n2. Upstream library/docs research agent\\n3. Alternative architecture agent\\nWait for all agents to return, synthesize their findings, then act.\\nDon't keep guessing in circles — rotate perspectives.\") },\n { analyzer: \"Rules\", match: \"No BACKLOG.md\", fix: (root) => createBacklogMd(root) },\n { analyzer: \"Rules\", match: \"No .claudeignore\", fix: (root, detected) => createClaudeignore(root, detected) },\n { analyzer: \"Rules\", match: \"No .claude/rules/\", fix: (root) => createStarterRules(root) },\n { analyzer: \"Hooks\", match: \"PostCompact\", fix: (root) => addPostCompactHook(root) },\n { analyzer: \"Permissions\", match: \"force-push\", fix: (root) => addForcePushProtection(root) },\n { analyzer: \"Permissions\", match: \"Credential files not blocked\", fix: (root) => addCredentialDenyRules(root) },\n { analyzer: \"Permissions\", match: \"Bypass permissions mode\", fix: (root) => addBypassDisable(root) },\n { analyzer: \"Permissions\", match: \"Sandbox not enabled\", fix: (root) => addSandboxSettings(root) },\n { analyzer: \"Permissions\", match: \".env is protected by hooks but not in .claudeignore\", fix: (root) => addEnvToClaudeignore(root) },\n { analyzer: \"Rules\", match: \"No /lp-enhance skill\", fix: (root) => createEnhanceSkill(root) },\n { analyzer: \"Rules\", match: \"lp-enhance skill is outdated\", fix: (root) => updateEnhanceSkill(root) },\n { analyzer: \"Settings\", match: \"Deprecated includeCoAuthoredBy\", fix: (root) => migrateAttribution(root) },\n { analyzer: \"Hooks\", match: \"SessionStart\", fix: (root) => addSessionStartHook(root) },\n { analyzer: \"Memory\", match: \"Deprecated Stop hook\", fix: (root) => removeStaleStopHook(root) },\n { analyzer: \"Memory\", match: \"autoMemoryEnabled not disabled\", fix: (root, _det, placement) => disableAutoMemory(root, placement) },\n { analyzer: \"Memory\", match: \"MCP tool permission\", fix: (root, _det, placement) => addMemoryToolPermissions(root, placement) },\n { analyzer: \"MCP\", match: \"no allowedMcpServers\", fix: (root, _det, placement) => addAllowedMcpServers(root, placement) },\n { analyzer: \"Memory\", match: \"SessionStart hook to auto-pull\", fix: (root, _det, placement) => addSessionStartPullHook(root, placement) },\n { analyzer: \"Memory\", match: \"SessionEnd hook to auto-push\", fix: (root, _det, placement) => addSessionEndPushHook(root, placement) },\n { analyzer: \"Memory\", match: \"CLAUDE.md missing memory guidance\", fix: (root, _det, placement) => {\n const content = \"Use agentic-memory to persist knowledge across sessions:\\n- Memories are automatically injected at session start\\n- STORE IMMEDIATELY when: a dependency strategy changes, an architecture decision is made, a convention is established, a bug pattern is discovered, or a feature is killed/added\\n- Use memory_search before memory_store to check for duplicates\\n- NEVER store credentials, API keys, tokens, or secrets in memories\";\n const target = placement === \"local\" ? join(root, \".claude\", \"CLAUDE.md\") : undefined;\n return addClaudeMdSection(root, \"## Memory\", content, target);\n }},\n];\n\nexport function hasAutoFix(issue: DiagnosticIssue): boolean {\n return FIX_TABLE.some(\n (e) => e.analyzer === issue.analyzer && issue.message.includes(e.match),\n );\n}\n\nasync function tryFix(\n issue: DiagnosticIssue,\n root: string,\n detected: DetectedProject,\n placement: MemoryPlacement,\n): Promise<boolean> {\n const entry = FIX_TABLE.find(\n (e) => e.analyzer === issue.analyzer && issue.message.includes(e.match),\n );\n return entry ? entry.fix(root, detected, placement) : false;\n}\n\n// ─── Hook Helper ───\n\nasync function addHook(\n root: string,\n event: string,\n dedupKeyword: string,\n entry: Record<string, unknown>,\n successMsg: string,\n): Promise<boolean> {\n const settings = await readSettingsJson(root);\n const hooks = (settings.hooks ?? {}) as Record<string, unknown>;\n const hookList = (hooks[event] as Record<string, unknown>[] | undefined) ?? [];\n\n const alreadyHas = hookList.some((g: Record<string, unknown>) => {\n const nested = g.hooks as Record<string, unknown>[] | undefined;\n return nested?.some((h) => String(h.command ?? \"\").includes(dedupKeyword));\n });\n if (alreadyHas) return false;\n\n const updated = [...hookList, entry];\n const updatedSettings = { ...settings, hooks: { ...hooks, [event]: updated } };\n await writeSettingsJson(root, updatedSettings);\n log.success(successMsg);\n return true;\n}\n\n// ─── Fix Implementations ───\n\nasync function addEnvProtectionHook(root: string): Promise<boolean> {\n return addHook(root, \"PreToolUse\", \".env\", {\n matcher: \"Read|Write|Edit\",\n hooks: [{\n type: \"command\",\n command: \"echo \\\"$TOOL_INPUT_FILE_PATH\\\" | grep -qE '\\\\.(env|env\\\\..*)$' && ! echo \\\"$TOOL_INPUT_FILE_PATH\\\" | grep -q '.env.example' && echo 'BLOCKED: .env files contain secrets' && exit 1; exit 0\",\n }],\n }, \"Added .env file protection hook (PreToolUse)\");\n}\n\nasync function addAutoFormatHook(root: string, detected: DetectedProject): Promise<boolean> {\n if (!detected.language) return false;\n\n const formatters: Record<string, { extensions: string[]; command: string }> = {\n TypeScript: { extensions: [\"ts\", \"tsx\"], command: \"npx prettier --write\" },\n JavaScript: { extensions: [\"js\", \"jsx\"], command: \"npx prettier --write\" },\n Python: { extensions: [\"py\"], command: \"ruff format\" },\n Go: { extensions: [\"go\"], command: \"gofmt -w\" },\n Rust: { extensions: [\"rs\"], command: \"rustfmt\" },\n Ruby: { extensions: [\"rb\"], command: \"rubocop -A\" },\n PHP: { extensions: [\"php\"], command: \"vendor/bin/pint\" },\n };\n\n const config = formatters[detected.language];\n if (!config) return false;\n\n const extChecks = config.extensions.map((ext) => `[ \"$ext\" = \"${ext}\" ]`).join(\" || \");\n return addHook(root, \"PostToolUse\", \"format\", {\n matcher: \"Write|Edit\",\n hooks: [{\n type: \"command\",\n command: `ext=\\${TOOL_INPUT_FILE_PATH##*.}; (${extChecks}) && ${config.command} \"$TOOL_INPUT_FILE_PATH\" 2>/dev/null; exit 0`,\n }],\n }, `Added auto-format hook (PostToolUse → ${config.command})`);\n}\n\nasync function addForcePushProtection(root: string): Promise<boolean> {\n return addHook(root, \"PreToolUse\", \"force\", {\n matcher: \"Bash\",\n hooks: [{\n type: \"command\",\n command: \"echo \\\"$TOOL_INPUT_COMMAND\\\" | grep -qE 'push.*--force|push.*-f' && echo 'WARNING: Force push detected — this can destroy remote history' && exit 1; exit 0\",\n }],\n }, \"Added force-push protection hook (PreToolUse → Bash)\");\n}\n\nasync function addPostCompactHook(root: string): Promise<boolean> {\n return addHook(root, \"PostCompact\", \"TASKS.md\", {\n matcher: \"\",\n hooks: [{\n type: \"command\",\n command: \"cat TASKS.md 2>/dev/null; exit 0\",\n }],\n }, \"Added PostCompact hook (re-injects TASKS.md after compaction)\");\n}\n\nasync function addSessionStartHook(root: string): Promise<boolean> {\n return addHook(root, \"SessionStart\", \"TASKS.md\", {\n matcher: \"startup|resume\",\n hooks: [{\n type: \"command\",\n command: \"cat TASKS.md 2>/dev/null; exit 0\",\n }],\n }, \"Added SessionStart hook (injects TASKS.md at startup)\");\n}\n\nasync function migrateAttribution(root: string): Promise<boolean> {\n const settings = await readSettingsJson(root);\n if (settings.includeCoAuthoredBy === undefined) return false;\n\n const { includeCoAuthoredBy: _, ...rest } = settings;\n const updated = { ...rest, attribution: { commit: \"\", pr: \"\" } };\n await writeSettingsJson(root, updated);\n log.success(\"Migrated includeCoAuthoredBy → attribution object\");\n return true;\n}\n\nasync function addCredentialDenyRules(root: string): Promise<boolean> {\n const settings = await readSettingsJson(root);\n const permissions = (settings.permissions ?? {}) as Record<string, unknown>;\n const deny = (permissions.deny as string[] | undefined) ?? [];\n\n const toAdd = [\"Read(~/.ssh/*)\", \"Read(~/.aws/*)\", \"Read(~/.npmrc)\"];\n const missing = toAdd.filter((p) => !deny.includes(p));\n if (missing.length === 0) return false;\n\n const updated = { ...settings, permissions: { ...permissions, deny: [...deny, ...missing] } };\n await writeSettingsJson(root, updated);\n log.success(\"Added credential deny rules (SSH, AWS, npm)\");\n return true;\n}\n\nasync function addBypassDisable(root: string): Promise<boolean> {\n const settings = await readSettingsJson(root);\n if (settings.disableBypassPermissionsMode === \"disable\") return false;\n\n const updated = { ...settings, disableBypassPermissionsMode: \"disable\" };\n await writeSettingsJson(root, updated);\n log.success(\"Added disableBypassPermissionsMode: disable\");\n return true;\n}\n\nasync function addSandboxSettings(root: string): Promise<boolean> {\n const settings = await readSettingsJson(root);\n const sandbox = settings.sandbox as Record<string, unknown> | undefined;\n if (sandbox?.enabled === true) return false;\n\n const updated = { ...settings, sandbox: { enabled: true, failIfUnavailable: true } };\n await writeSettingsJson(root, updated);\n log.success(\"Enabled sandbox with failIfUnavailable\");\n return true;\n}\n\n\nasync function addEnvToClaudeignore(root: string): Promise<boolean> {\n const ignorePath = join(root, \".claudeignore\");\n let content: string;\n try {\n content = await readFile(ignorePath, \"utf-8\");\n } catch {\n return false; // No .claudeignore to modify\n }\n\n const lines = content.split(\"\\n\").map((l) => l.trim());\n if (lines.some((l) => l === \".env\" || l === \".env.*\" || l === \".env*\")) return false;\n\n await writeFile(ignorePath, content.trimEnd() + \"\\n.env\\n.env.*\\n\");\n log.success(\"Added .env to .claudeignore\");\n return true;\n}\n\nasync function addClaudeMdSection(root: string, heading: string, content: string, targetPath?: string): Promise<boolean> {\n const claudeMdPath = targetPath ?? join(root, \"CLAUDE.md\");\n let existing: string;\n try {\n existing = await readFile(claudeMdPath, \"utf-8\");\n } catch {\n if (!targetPath) return false; // No root CLAUDE.md to add to\n // Create local .claude/CLAUDE.md\n await mkdir(join(root, \".claude\"), { recursive: true });\n existing = \"# Local Claude Config\\n\";\n }\n\n // Don't add if section already exists\n if (existing.includes(heading)) return false;\n\n // Append before Key Decisions if it exists, otherwise at end\n const keyDecisionsIdx = existing.indexOf(\"## Key Decisions\");\n const insertAt = keyDecisionsIdx > -1 ? keyDecisionsIdx : existing.length;\n\n const section = `\\n${heading}\\n${content}\\n\\n`;\n const updated = existing.slice(0, insertAt) + section + existing.slice(insertAt);\n\n await writeFile(claudeMdPath, updated);\n const label = targetPath ? \".claude/CLAUDE.md\" : \"CLAUDE.md\";\n log.success(`Added \"${heading}\" section to ${label}`);\n return true;\n}\n\nasync function createBacklogMd(root: string): Promise<boolean> {\n const backlogPath = join(root, \"BACKLOG.md\");\n try {\n await access(backlogPath);\n return false;\n } catch {\n // Create it\n }\n\n const name = root.split(\"/\").pop() ?? \"Project\";\n await writeFile(backlogPath, `# ${name} - Backlog\n\n> Features discussed but deferred. Pick up when relevant.\n> Priority: P0 = next sprint, P1 = soon, P2 = when relevant.\n`);\n log.success(\"Generated BACKLOG.md\");\n return true;\n}\n\nasync function createClaudeignore(root: string, detected: DetectedProject): Promise<boolean> {\n const ignorePath = join(root, \".claudeignore\");\n try {\n await access(ignorePath);\n return false; // Already exists\n } catch {\n // Create it\n }\n\n const content = generateClaudeignore(detected);\n await writeFile(ignorePath, content);\n log.success(\"Generated .claudeignore with language-specific ignore patterns\");\n return true;\n}\n\nasync function createStarterRules(root: string): Promise<boolean> {\n const rulesDir = join(root, \".claude\", \"rules\");\n try {\n await access(rulesDir);\n return false; // Already exists\n } catch {\n // Create it\n }\n\n await mkdir(rulesDir, { recursive: true });\n\n await writeFile(\n join(rulesDir, \"conventions.md\"),\n `# Project Conventions\n\n- Use conventional commits (feat:, fix:, docs:, refactor:, test:, chore:)\n- Keep files under 400 lines, functions under 50 lines\n- Handle errors explicitly — no empty catch blocks\n- Validate input at system boundaries\n`,\n );\n\n log.success(\"Created .claude/rules/conventions.md with starter rules\");\n return true;\n}\n\n\nasync function createEnhanceSkill(root: string): Promise<boolean> {\n const skillDir = join(root, \".claude\", \"skills\", \"lp-enhance\");\n const skillPath = join(skillDir, \"SKILL.md\");\n const globalPath = join(homedir(), \".claude\", \"skills\", \"lp-enhance\", \"SKILL.md\");\n // Also check legacy commands/ location\n const legacyProject = join(root, \".claude\", \"commands\", \"lp-enhance.md\");\n const legacyGlobal = join(homedir(), \".claude\", \"commands\", \"lp-enhance.md\");\n\n if (await fileExists(skillPath) || await fileExists(globalPath)\n || await fileExists(legacyProject) || await fileExists(legacyGlobal)) return false;\n\n await mkdir(skillDir, { recursive: true });\n await writeFile(skillPath, generateEnhanceSkill());\n log.success(\"Generated /lp-enhance skill (.claude/skills/lp-enhance/)\");\n return true;\n}\n\nasync function updateEnhanceSkill(root: string): Promise<boolean> {\n // Update whichever location has the skill installed\n const projectPath = join(root, \".claude\", \"skills\", \"lp-enhance\", \"SKILL.md\");\n const globalPath = join(homedir(), \".claude\", \"skills\", \"lp-enhance\", \"SKILL.md\");\n\n const targetPath = await fileExists(projectPath) ? projectPath\n : await fileExists(globalPath) ? globalPath\n : null;\n\n if (!targetPath) return false;\n\n await writeFile(targetPath, generateEnhanceSkill());\n log.success(\"Updated /lp-enhance skill to latest version\");\n return true;\n}\n\n\n","import { join, basename } from \"node:path\";\nimport { fileExists, readFileOrNull, readJsonOrNull } from \"./fs-utils.js\";\nimport type { DetectedProject } from \"../types/index.js\";\n\n/**\n * Detect project characteristics by scanning manifest files and directory structure.\n * Works with any stack — no hardcoded list of supported frameworks.\n */\nexport async function detectProject(root: string): Promise<DetectedProject> {\n const name = basename(root);\n\n const [pkgJson, goMod, pyProject, gemfile, cargo, pubspec, composerJson, pomXml, buildGradleGroovy, buildGradleKts, packageSwift, mixExs, csproj, lockfiles] = await Promise.all([\n readJsonOrNull<PackageJson>(join(root, \"package.json\")),\n fileExists(join(root, \"go.mod\")),\n readFileOrNull(join(root, \"pyproject.toml\")),\n fileExists(join(root, \"Gemfile\")),\n fileExists(join(root, \"Cargo.toml\")),\n fileExists(join(root, \"pubspec.yaml\")),\n readJsonOrNull<ComposerJson>(join(root, \"composer.json\")),\n fileExists(join(root, \"pom.xml\")),\n fileExists(join(root, \"build.gradle\")),\n fileExists(join(root, \"build.gradle.kts\")),\n fileExists(join(root, \"Package.swift\")),\n fileExists(join(root, \"mix.exs\")),\n globExists(root, \"*.csproj\"),\n detectLockfiles(root),\n ]);\n\n const buildGradle = buildGradleGroovy || buildGradleKts;\n\n const manifests: ManifestState = {\n pkgJson, goMod, pyProject, gemfile, cargo, pubspec,\n composerJson, pomXml, buildGradle, packageSwift, mixExs, csproj,\n };\n\n const language = detectLanguage(manifests);\n const framework = detectFramework(manifests);\n const packageManager = detectPackageManager(manifests, lockfiles);\n const scripts = detectScripts({ pkgJson, pyProject, goMod, gemfile, composerJson, language, packageManager });\n\n return {\n name,\n language,\n framework,\n packageManager,\n hasTests: scripts.testCommand !== null,\n hasLinter: scripts.lintCommand !== null,\n hasFormatter: scripts.formatCommand !== null,\n ...scripts,\n };\n}\n\n// ─── Language Detection ───\n\ninterface ManifestState {\n pkgJson: PackageJson | null;\n goMod: boolean;\n pyProject: string | null;\n gemfile: boolean;\n cargo: boolean;\n pubspec: boolean;\n composerJson: ComposerJson | null;\n pomXml: boolean;\n buildGradle: boolean;\n packageSwift: boolean;\n mixExs: boolean;\n csproj: boolean;\n}\n\nfunction detectLanguage(m: ManifestState): string | null {\n if (m.pkgJson?.devDependencies?.typescript || m.pkgJson?.dependencies?.typescript) return \"TypeScript\";\n if (m.pkgJson) return \"JavaScript\";\n if (m.goMod) return \"Go\";\n if (m.pyProject) return \"Python\";\n if (m.gemfile) return \"Ruby\";\n if (m.cargo) return \"Rust\";\n if (m.pubspec) return \"Dart\";\n if (m.composerJson) return \"PHP\";\n if (m.buildGradle) return \"Kotlin\";\n if (m.pomXml) return \"Java\";\n if (m.packageSwift) return \"Swift\";\n if (m.mixExs) return \"Elixir\";\n if (m.csproj) return \"C#\";\n return null;\n}\n\n// ─── Framework Detection ───\n\nfunction detectFramework(m: ManifestState): string | null {\n const deps = { ...m.pkgJson?.dependencies, ...m.pkgJson?.devDependencies };\n\n // JS/TS frameworks\n if (deps.next) return \"Next.js\";\n if (deps.nuxt) return \"Nuxt\";\n if (deps.svelte || deps[\"@sveltejs/kit\"]) return \"SvelteKit\";\n if (deps.astro) return \"Astro\";\n if (deps[\"@angular/core\"]) return \"Angular\";\n if (deps.remix || deps[\"@remix-run/react\"]) return \"Remix\";\n if (deps.vue) return \"Vue\";\n if (deps.react && !deps.next) return \"React\";\n if (deps.express) return \"Express\";\n if (deps.fastify) return \"Fastify\";\n if (deps.hono) return \"Hono\";\n if (deps.nestjs || deps[\"@nestjs/core\"]) return \"NestJS\";\n\n // Python frameworks\n if (m.pyProject) {\n if (m.pyProject.includes(\"fastapi\")) return \"FastAPI\";\n if (m.pyProject.includes(\"django\")) return \"Django\";\n if (m.pyProject.includes(\"flask\")) return \"Flask\";\n }\n\n // PHP frameworks\n if (m.composerJson) {\n const phpDeps = { ...m.composerJson.require, ...m.composerJson[\"require-dev\"] };\n if (phpDeps[\"laravel/framework\"]) return \"Laravel\";\n if (phpDeps[\"symfony/framework-bundle\"]) return \"Symfony\";\n }\n\n // Ruby\n if (m.gemfile) return \"Rails\";\n\n // JVM\n if (m.buildGradle) return \"Gradle\"; // Could be Spring Boot, Android, etc.\n if (m.pomXml) return \"Maven\";\n\n return null;\n}\n\n// ─── Package Manager Detection ───\n\ninterface DetectedLockfiles {\n pnpmLock: boolean;\n yarnLock: boolean;\n bunLock: boolean;\n npmLock: boolean;\n}\n\nasync function detectLockfiles(root: string): Promise<DetectedLockfiles> {\n const [pnpmLock, yarnLock, bunLock, npmLock] = await Promise.all([\n fileExists(join(root, \"pnpm-lock.yaml\")),\n fileExists(join(root, \"yarn.lock\")),\n fileExists(join(root, \"bun.lockb\")),\n fileExists(join(root, \"package-lock.json\")),\n ]);\n return { pnpmLock, yarnLock, bunLock, npmLock };\n}\n\nfunction detectPackageManager(\n m: Pick<ManifestState, \"pkgJson\" | \"goMod\" | \"pyProject\" | \"gemfile\" | \"cargo\" | \"composerJson\">,\n lockfiles: DetectedLockfiles,\n): string | null {\n if (m.pkgJson) {\n // Check packageManager field first (most explicit)\n const pm = m.pkgJson.packageManager;\n if (pm?.startsWith(\"pnpm\")) return \"pnpm\";\n if (pm?.startsWith(\"yarn\")) return \"yarn\";\n if (pm?.startsWith(\"bun\")) return \"bun\";\n if (pm?.startsWith(\"npm\")) return \"npm\";\n\n // Fall back to lockfile detection\n if (lockfiles.pnpmLock) return \"pnpm\";\n if (lockfiles.yarnLock) return \"yarn\";\n if (lockfiles.bunLock) return \"bun\";\n if (lockfiles.npmLock) return \"npm\";\n\n return \"npm\";\n }\n if (m.goMod) return \"go modules\";\n if (m.pyProject) {\n if (m.pyProject.includes(\"[tool.uv]\")) return \"uv\";\n if (m.pyProject.includes(\"[tool.poetry]\")) return \"poetry\";\n return \"pip\";\n }\n if (m.gemfile) return \"bundler\";\n if (m.cargo) return \"cargo\";\n if (m.composerJson) return \"composer\";\n return null;\n}\n\n// ─── Script Detection ───\n\ninterface DetectedScripts {\n formatCommand: string | null;\n lintCommand: string | null;\n testCommand: string | null;\n devCommand: string | null;\n buildCommand: string | null;\n}\n\n// Language → default scripts config\nconst LANGUAGE_SCRIPTS: Record<string, DetectedScripts> = {\n Go: { devCommand: \"go run .\", buildCommand: \"go build .\", testCommand: \"go test ./...\", lintCommand: \"golangci-lint run\", formatCommand: \"gofmt -w .\" },\n Ruby: { devCommand: \"bin/dev\", buildCommand: null, testCommand: \"bin/rails test\", lintCommand: \"bin/rubocop\", formatCommand: null },\n PHP: { devCommand: \"php artisan serve\", buildCommand: null, testCommand: \"php artisan test\", lintCommand: \"vendor/bin/phpstan analyse\", formatCommand: \"vendor/bin/pint\" },\n Rust: { devCommand: \"cargo run\", buildCommand: \"cargo build\", testCommand: \"cargo test\", lintCommand: \"cargo clippy\", formatCommand: \"cargo fmt\" },\n Java: { devCommand: null, buildCommand: \"mvn package\", testCommand: \"mvn test\", lintCommand: null, formatCommand: null },\n Kotlin: { devCommand: null, buildCommand: \"mvn package\", testCommand: \"mvn test\", lintCommand: null, formatCommand: null },\n Swift: { devCommand: null, buildCommand: \"swift build\", testCommand: \"swift test\", lintCommand: \"swiftlint\", formatCommand: \"swift-format format -r .\" },\n Elixir: { devCommand: \"mix phx.server\", buildCommand: \"mix compile\", testCommand: \"mix test\", lintCommand: \"mix credo\", formatCommand: \"mix format\" },\n \"C#\": { devCommand: \"dotnet run\", buildCommand: \"dotnet build\", testCommand: \"dotnet test\", lintCommand: null, formatCommand: \"dotnet format\" },\n};\n\nfunction detectScripts(m: {\n pkgJson: PackageJson | null;\n pyProject: string | null;\n goMod: boolean;\n gemfile: boolean;\n composerJson: ComposerJson | null;\n language: string | null;\n packageManager: string | null;\n}): DetectedScripts {\n // JS/TS: read from package.json scripts\n if (m.pkgJson) {\n const scripts = m.pkgJson.scripts ?? {};\n const run = pmRun(m.packageManager);\n return {\n devCommand: scripts.dev ? `${run} dev` : null,\n buildCommand: scripts.build ? `${run} build` : null,\n testCommand: scripts.test ? `${run} test` : null,\n lintCommand: scripts.lint ? `${run} lint` : null,\n formatCommand: scripts.format ? `${run} format` : null,\n };\n }\n\n // Python: runner depends on uv vs pip\n if (m.language === \"Python\") {\n const r = m.pyProject?.includes(\"[tool.uv]\") ? \"uv run\" : \"python -m\";\n return { devCommand: null, buildCommand: null, testCommand: `${r} pytest`, lintCommand: `${r} ruff check .`, formatCommand: `${r} ruff format .` };\n }\n\n // Everything else: lookup table\n if (m.language && LANGUAGE_SCRIPTS[m.language]) {\n return LANGUAGE_SCRIPTS[m.language];\n }\n\n return { devCommand: null, buildCommand: null, testCommand: null, lintCommand: null, formatCommand: null };\n}\n\nfunction pmRun(packageManager: string | null): string {\n if (packageManager === \"pnpm\") return \"pnpm\";\n if (packageManager === \"yarn\") return \"yarn\";\n if (packageManager === \"bun\") return \"bun\";\n return \"npm run\";\n}\n\n// ─── Utilities ───\n\ninterface PackageJson {\n name?: string;\n packageManager?: string;\n scripts?: Record<string, string>;\n dependencies?: Record<string, string>;\n devDependencies?: Record<string, string>;\n}\n\ninterface ComposerJson {\n require?: Record<string, string>;\n \"require-dev\"?: Record<string, string>;\n}\n\nasync function globExists(dir: string, pattern: string): Promise<boolean> {\n const { readdir } = await import(\"node:fs/promises\");\n try {\n const entries = await readdir(dir);\n return entries.some((e) => e.endsWith(pattern.replace(\"*\", \"\")));\n } catch {\n return false;\n }\n}\n","import type { DetectedProject } from \"../../../types/index.js\";\n\n/**\n * Generate .claudeignore based on detected project type.\n * Prevents Claude from reading noise files that waste context.\n */\nexport function generateClaudeignore(detected: DetectedProject): string {\n const sections: string[] = [\"# Generated by claude-launchpad\"];\n\n // Universal ignores (every project)\n sections.push(`\n# Build output\ndist/\nbuild/\nout/\n\n# IDE & OS\n.vscode/\n.idea/\n*.swp\n*.swo\n.DS_Store\nThumbs.db\n\n# Test & coverage\ncoverage/\n\n# Environment (should never be read)\n.env\n.env.*\n!.env.example`);\n\n // Language-specific ignores\n const lang = detected.language;\n\n if (lang === \"TypeScript\" || lang === \"JavaScript\") {\n sections.push(`\n# Node\nnode_modules/\n.pnp/\n.yarn/\n.next/\n.nuxt/\n.output/\n.svelte-kit/\n.vercel/\n.turbo/\npnpm-lock.yaml\npackage-lock.json\nyarn.lock\nbun.lockb\n.nyc_output/\n__snapshots__/`);\n }\n\n if (lang === \"Python\") {\n sections.push(`\n# Python\n__pycache__/\n*.pyc\n*.pyo\n.venv/\nvenv/\n.mypy_cache/\n.ruff_cache/\n.pytest_cache/\n*.egg-info/`);\n }\n\n if (lang === \"Go\") {\n sections.push(`\n# Go\nbin/\nvendor/`);\n }\n\n if (lang === \"Rust\") {\n sections.push(`\n# Rust\ntarget/\nCargo.lock`);\n }\n\n if (lang === \"Ruby\") {\n sections.push(`\n# Ruby\nvendor/bundle/\n.bundle/\ntmp/\nlog/`);\n }\n\n if (lang === \"Java\" || lang === \"Kotlin\") {\n sections.push(`\n# JVM\ntarget/\nbuild/\n.gradle/\n*.class\n*.jar`);\n }\n\n if (lang === \"Dart\") {\n sections.push(`\n# Dart/Flutter\n.dart_tool/\n.packages\nbuild/`);\n }\n\n if (lang === \"PHP\") {\n sections.push(`\n# PHP\nvendor/\ncomposer.lock`);\n }\n\n if (lang === \"C#\") {\n sections.push(`\n# .NET\nbin/\nobj/\n*.dll`);\n }\n\n if (lang === \"Elixir\") {\n sections.push(`\n# Elixir\n_build/\ndeps/\n.elixir_ls/`);\n }\n\n if (lang === \"Swift\") {\n sections.push(`\n# Swift\n.build/\nDerivedData/\n*.xcuserdata`);\n }\n\n return sections.join(\"\\n\") + \"\\n\";\n}\n","/**\n * Skill schema version. Bump this when the skill content changes.\n * Doctor compares this against installed skills to detect stale versions.\n */\nexport const ENHANCE_SKILL_VERSION = 5;\n\n/**\n * Generates the /lp-enhance skill markdown content.\n * This skill runs inside the user's active Claude Code session\n * to analyze the codebase and improve CLAUDE.md.\n */\nexport function generateEnhanceSkill(): string {\n return [\n '---',\n 'name: lp-enhance',\n 'description: |',\n ' AI-improve your CLAUDE.md based on codebase analysis. Fills in architecture, conventions, guardrails, and suggests hooks and MCP servers.',\n ' TRIGGER when: user runs /lp-enhance, asks to \"improve CLAUDE.md\", \"fill in architecture\", or after major refactors.',\n ' DO NOT TRIGGER when: user is editing CLAUDE.md manually, doing normal coding, or running doctor/eval.',\n 'allowed-tools: Read, Glob, Grep, Edit, Write',\n 'argument-hint: (no arguments needed)',\n '---',\n '',\n `<!-- lp-enhance-version: ${ENHANCE_SKILL_VERSION} -->`,\n '',\n '# lp-enhance - AI-powered CLAUDE.md improver',\n '',\n 'Read CLAUDE.md and the project\\'s codebase, then update CLAUDE.md to fill in missing or incomplete sections.',\n '',\n '## Phase 1: Research',\n '',\n '1. Read CLAUDE.md (if it exists)',\n '2. Read .claude/settings.json (hooks, permissions, MCP)',\n '3. Read .claude/rules/*.md (existing rules)',\n '4. Read .claudeignore (if it exists)',\n '5. Scan src/ directory structure (top-level dirs, key files)',\n '6. Read package.json / go.mod / pyproject.toml for stack detection',\n '7. Check for monorepo indicators (workspaces, nx.json, lerna.json)',\n '8. Check scenarios/ directory for existing eval scenarios',\n '',\n '**Done when:** you have a mental model of the stack, architecture, and existing config.',\n '',\n '## Phase 2: Plan',\n '',\n 'Count current CLAUDE.md actionable lines. Budget is 200 lines max. Plan which sections to add or improve:',\n '',\n '1. **## Stack** - detect language, framework, package manager',\n '2. **## Architecture** - 3-5 bullets describing codebase shape',\n '3. **## Conventions** - max 8 key patterns. Overflow to .claude/rules/conventions.md',\n '4. **## Off-Limits** - max 8 guardrails specific to this project',\n '5. **## Memory** - ONLY if agentic-memory is configured in settings.json. Max 6 bullets.',\n '6. **## Key Decisions** - only decisions that affect how Claude works in this codebase',\n '',\n '7. **Skill Authoring** - if .claude/rules/conventions.md lacks a Skill Authoring section, plan to add one',\n '',\n 'If any section would exceed 8 bullets, plan a .claude/rules/ file for the overflow.',\n '',\n '**Done when:** you know exactly what to add/change and the line count stays under 200.',\n '',\n '## Phase 3: Execute',\n '',\n 'Edit CLAUDE.md with the planned changes. Then:',\n '',\n '1. Create or update .claude/rules/ files for overflow content',\n '2. Generate path-scoped rules if the project has distinct areas (see below)',\n '3. Review .claudeignore and print suggestions (see below)',\n '4. Generate 2-3 custom eval scenarios in scenarios/custom/ (see below)',\n '5. Verify line count is under 200',\n '',\n '**Rules:**',\n '- Don\\'t remove existing content, only add or improve',\n '- Be specific to THIS project, not generic advice',\n '- Use bullet points, not paragraphs',\n '',\n '## Phase 4: Verify',\n '',\n '1. Run `claude-launchpad doctor` to check the score improved',\n '2. Print suggested hooks (exact JSON) for .claude/settings.json but don\\'t modify it',\n '3. Print suggested MCP servers if external services detected (Postgres, Redis, Stripe, etc.)',\n '4. If eval scenarios were generated, print: \"Run this in your terminal (not inside Claude Code): `claude-launchpad eval --scenarios scenarios/ --runs 1`\"',\n '',\n '**Done when:** doctor score is equal or higher, suggestions printed, eval scenarios created if applicable.',\n '',\n '## Path-scoped rules generation',\n '',\n 'Scan the project structure and generate focused .claude/rules/ files with paths: frontmatter. These load ONLY when Claude works on matching files, saving context tokens.',\n '',\n '**How to detect areas:**',\n '1. List top-level directories under src/ (or equivalent). Each distinct area (api, components, lib, tests) is a candidate.',\n '2. Check for monorepo indicators: workspaces in package.json, pnpm-workspace.yaml, nx.json, lerna.json. Each workspace is a candidate.',\n '3. Check for docs/, tests/, scripts/ as separate scopes.',\n '',\n '**For each detected area, create a rules file with this format:**',\n '',\n '---',\n 'paths: [\"src/api/**\"]',\n '---',\n '# API Rules',\n '- Validate all request input with zod schemas',\n '- Return typed error responses, never throw raw errors',\n '- Keep route handlers under 30 lines',\n '',\n '**Stack-specific patterns to include:**',\n '- Next.js app/: \"Use Server Components by default, add \\'use client\\' only when needed\"',\n '- API routes / src/api/: \"Validate input at boundaries, typed error responses\"',\n '- React components: \"Colocate components near usage, props interface above component\"',\n '- Tests: \"One assertion per test when possible, descriptive test names\"',\n '- Database / prisma/ / drizzle/: \"Never write raw SQL, use the ORM, migrations required\"',\n '- Docs: \"No em dashes, max 3 sentences per paragraph, code examples required\"',\n '',\n '**When NOT to generate:**',\n '- Small projects with < 5 source files (one conventions.md is enough)',\n '- Projects where all code is in one flat directory',\n '- If path-scoped rules already exist, don\\'t overwrite them',\n '',\n '**Monorepo handling:**',\n '- Each package gets its own rules file: .claude/rules/packages-<name>.md',\n '- Suggest claudeMdExcludes in settings.json to skip irrelevant package CLAUDE.md files',\n '',\n '## Skill authoring conventions',\n '',\n 'If .claude/rules/conventions.md exists but has no Skill Authoring section, add this:',\n '',\n '## Skill Authoring',\n '',\n 'When creating Claude Code skills (.claude/skills/*/SKILL.md):',\n '',\n '- Add TRIGGER when / DO NOT TRIGGER when clauses in the description for auto-invocation',\n '- Add allowed-tools in frontmatter to restrict tool access (e.g. Read, Glob, Grep for read-only skills)',\n '- Add argument-hint in frontmatter showing the expected input format',\n '- Structure as phases: Research, Plan, Execute, Verify with \"Done when:\" success criteria per phase',\n '- Handle edge cases and preconditions before execution',\n '',\n '## Hook review',\n '',\n 'Review .claude/settings.json hooks:',\n '- If you see project-specific patterns that deserve hooks, suggest them',\n '- If no PostCompact hook exists, suggest one that re-injects TASKS.md',\n '- If no SessionStart hook exists, suggest one that injects TASKS.md',\n '- DO NOT modify settings.json directly. Print exact JSON to add.',\n '',\n '## .claudeignore review',\n '',\n 'Read .claudeignore and check if the patterns make sense for the detected stack:',\n '',\n '**Always flag:**',\n '- Missing node_modules/ (JS/TS projects)',\n '- Missing __pycache__/ or .venv/ (Python projects)',\n '- Missing target/ (Rust/Java projects)',\n '- Missing .env / .env.* patterns',\n '- Missing lock files (pnpm-lock.yaml, package-lock.json, yarn.lock, etc.)',\n '- Missing coverage/ directory',\n '- Large generated files that waste context (*.min.js, *.map, migrations/)',\n '',\n '**Never flag:**',\n '- Patterns the user clearly added intentionally',\n '- Test fixtures or seed data (might be needed for context)',\n '',\n 'If .claudeignore is missing entirely, create one with sensible defaults for the detected stack.',\n 'If it exists but has gaps, print suggested additions. Do NOT modify it directly.',\n '',\n '## Eval scenario generation',\n '',\n 'After improving CLAUDE.md, generate 2-3 custom eval scenarios that test whether Claude follows the project\\'s specific rules. Write them as YAML files in scenarios/ at the project root.',\n '',\n '**Scenario YAML format:**',\n '```yaml',\n 'name: custom/scenario-name',\n 'description: What this scenario tests',\n 'setup:',\n ' files:',\n ' - path: src/example.ts',\n ' content: |',\n ' // Starter file that tempts Claude to break a rule',\n ' instructions: |',\n ' The specific rule from CLAUDE.md being tested.',\n 'prompt: \"A task that would tempt Claude to break the rule\"',\n 'checks:',\n ' - type: grep',\n ' pattern: \"expected_pattern\"',\n ' target: src/example.ts',\n ' expect: present',\n ' points: 5',\n ' label: What this check verifies',\n ' - type: file-exists',\n ' target: path/to/expected/file',\n ' expect: present',\n ' points: 5',\n ' label: What this check verifies',\n 'passingScore: 7',\n 'runs: 3',\n '```',\n '',\n '**How to choose scenarios:**',\n '1. Pick the 2-3 most important rules from ## Off-Limits and ## Conventions',\n '2. Design a task that naturally tempts Claude to break each rule',\n '3. Write checks that verify compliance (grep for patterns, file-exists for structure)',\n '',\n '**Check types available:** `grep` (pattern in file), `file-exists` (present/absent), `max-lines` (file length)',\n '',\n '**Examples of good custom scenarios:**',\n '- Off-limits says \"never use any\" → task asks to build types, check for no `any` keyword',\n '- Convention says \"max 400 lines per file\" → task asks to generate a large module, check line count',\n '- Off-limits says \"no raw SQL\" → task asks to add a query, check for ORM usage',\n '',\n '**Skip if:** scenarios/ already has 3+ YAML files, or CLAUDE.md has no project-specific rules worth testing.',\n '',\n '## Other advanced configuration',\n '',\n '- If the project uses external APIs, suggest sandbox.network.allowedDomains',\n '- If you detect a monorepo, suggest claudeMdExcludes in settings.json',\n ].join('\\n');\n}\n","import { readFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { log } from \"../../lib/output.js\";\nimport { readSettingsJson, writeSettingsJson, readSettingsLocalJson, writeSettingsLocalJson } from \"../../lib/settings.js\";\nimport type { MemoryPlacement } from \"../../types/index.js\";\n\n// ─── Shared Hook Helper (placement-aware) ───\n\nasync function addPlacementHook(\n root: string,\n placement: MemoryPlacement,\n event: string,\n dedupKeyword: string,\n entry: Record<string, unknown>,\n prepend: boolean,\n successMsg: string,\n): Promise<boolean> {\n const read = placement === \"local\" ? readSettingsLocalJson : readSettingsJson;\n const write = placement === \"local\" ? writeSettingsLocalJson : writeSettingsJson;\n const settings = await read(root);\n const hooks = (settings.hooks ?? {}) as Record<string, unknown[]>;\n const hookList = (hooks[event] as Record<string, unknown>[] | undefined) ?? [];\n\n const alreadyHas = hookList.some((g) => {\n const nested = g.hooks as Record<string, unknown>[] | undefined;\n return nested?.some((h) => String(h.command ?? \"\").includes(dedupKeyword));\n });\n if (alreadyHas) return false;\n\n const updatedList = prepend ? [entry, ...hookList] : [...hookList, entry];\n const updatedSettings = { ...settings, hooks: { ...hooks, [event]: updatedList } };\n await write(root, updatedSettings);\n log.success(successMsg);\n return true;\n}\n\n// ─── Memory Fix Functions ───\n\nexport async function disableAutoMemory(root: string, placement: MemoryPlacement): Promise<boolean> {\n const read = placement === \"local\" ? readSettingsLocalJson : readSettingsJson;\n const write = placement === \"local\" ? writeSettingsLocalJson : writeSettingsJson;\n const settings = await read(root);\n if (settings.autoMemoryEnabled === false) return false;\n\n const updated = { ...settings, autoMemoryEnabled: false };\n await write(root, updated);\n const target = placement === \"local\" ? \"settings.local.json\" : \"settings.json\";\n log.success(`Set autoMemoryEnabled: false in ${target}`);\n return true;\n}\n\nexport async function addMemoryToolPermissions(root: string, placement: MemoryPlacement): Promise<boolean> {\n const read = placement === \"local\" ? readSettingsLocalJson : readSettingsJson;\n const write = placement === \"local\" ? writeSettingsLocalJson : writeSettingsJson;\n const settings = await read(root);\n const permissions = (settings.permissions ?? {}) as Record<string, unknown>;\n const allow = (permissions.allow as string[] | undefined) ?? [];\n\n const tools = [\n \"mcp__agentic-memory__memory_store\",\n \"mcp__agentic-memory__memory_search\",\n \"mcp__agentic-memory__memory_recent\",\n \"mcp__agentic-memory__memory_forget\",\n \"mcp__agentic-memory__memory_relate\",\n \"mcp__agentic-memory__memory_stats\",\n \"mcp__agentic-memory__memory_update\",\n ];\n\n const missing = tools.filter((t) => !allow.includes(t));\n if (missing.length === 0) return false;\n\n const updated = { ...settings, permissions: { ...permissions, allow: [...allow, ...missing] } };\n await write(root, updated);\n const target = placement === \"local\" ? \"settings.local.json\" : \"settings.json\";\n log.success(`Added agentic-memory MCP tool permissions to ${target}`);\n return true;\n}\n\nexport async function addSessionStartPullHook(root: string, placement: MemoryPlacement): Promise<boolean> {\n const target = placement === \"local\" ? \"settings.local.json\" : \"settings.json\";\n return addPlacementHook(root, placement, \"SessionStart\", \"memory pull\", {\n matcher: \"startup\",\n hooks: [{ type: \"command\", command: \"claude-launchpad memory pull -y 2>/dev/null; exit 0\" }],\n }, true, `Added SessionStart hook for memory sync to ${target}`);\n}\n\nexport async function addSessionEndPushHook(root: string, placement: MemoryPlacement): Promise<boolean> {\n const target = placement === \"local\" ? \"settings.local.json\" : \"settings.json\";\n return addPlacementHook(root, placement, \"SessionEnd\", \"memory push\", {\n hooks: [{ type: \"command\", command: \"claude-launchpad memory push -y >/dev/null 2>&1 & exit 0\" }],\n }, false, `Added SessionEnd hook for memory sync to ${target}`);\n}\n\nexport async function removeStaleStopHook(root: string): Promise<boolean> {\n const settings = await readSettingsJson(root);\n const hooks = settings.hooks as Record<string, unknown[]> | undefined;\n if (!hooks?.Stop) return false;\n\n const stopHooks = hooks.Stop as Record<string, unknown>[];\n const filtered = stopHooks.filter((h) => {\n const innerHooks = h.hooks as Record<string, unknown>[] | undefined;\n return !innerHooks?.some(\n (ih) => typeof ih.command === \"string\" && (ih.command as string).includes(\"memory extract\"),\n );\n });\n\n if (filtered.length === stopHooks.length) return false;\n\n const updated = filtered.length === 0\n ? (({ Stop: _, ...rest }) => rest)(hooks as Record<string, unknown>)\n : { ...hooks, Stop: filtered };\n const updatedSettings = { ...settings, hooks: updated };\n await writeSettingsJson(root, updatedSettings);\n log.success(\"Removed deprecated Stop hook (memory extract)\");\n return true;\n}\n\n// ─── MCP Fix Functions ───\n\nexport async function addAllowedMcpServers(root: string, placement: MemoryPlacement): Promise<boolean> {\n const read = placement === \"local\" ? readSettingsLocalJson : readSettingsJson;\n const write = placement === \"local\" ? writeSettingsLocalJson : writeSettingsJson;\n const settings = await read(root);\n if (settings.allowedMcpServers) return false;\n const other = placement === \"local\" ? await readSettingsJson(root) : await readSettingsLocalJson(root);\n if (other.allowedMcpServers) return false;\n\n const serverNames = new Set<string>();\n const settingsServers = settings.mcpServers as Record<string, unknown> | undefined;\n if (settingsServers && typeof settingsServers === \"object\") {\n for (const name of Object.keys(settingsServers)) serverNames.add(name);\n }\n const mcpJsonPath = join(root, \".mcp.json\");\n try {\n const mcpJson = JSON.parse(await readFile(mcpJsonPath, \"utf-8\")) as Record<string, unknown>;\n const mcpServers = mcpJson.mcpServers as Record<string, unknown> | undefined;\n if (mcpServers && typeof mcpServers === \"object\") {\n for (const name of Object.keys(mcpServers)) serverNames.add(name);\n }\n } catch { /* no .mcp.json */ }\n\n if (serverNames.size === 0) return false;\n\n const updatedSettings = {\n ...settings,\n allowedMcpServers: [...serverNames].map((name) => ({ serverName: name })),\n };\n await write(root, updatedSettings);\n const target = placement === \"local\" ? \"settings.local.json\" : \"settings.json\";\n log.success(`Added allowedMcpServers from configured servers to ${target}`);\n return true;\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,UAAU,cAAc;AAEjC,eAAsB,WAAW,MAAgC;AAC/D,MAAI;AACF,UAAM,OAAO,IAAI;AACjB,WAAO;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,eAAsB,eAAe,MAAsC;AACzE,MAAI;AACF,WAAO,MAAM,SAAS,MAAM,OAAO;AAAA,EACrC,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,eAAsB,eAAkB,MAAiC;AACvE,MAAI;AACF,UAAM,UAAU,MAAM,SAAS,MAAM,OAAO;AAC5C,WAAO,KAAK,MAAM,OAAO;AAAA,EAC3B,QAAQ;AACN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AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAC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AAK,OAAO,CAAC,sBAAsB,MAAM,KAAK,iBAAiB,CAAC,cAAc;AAAA,IACrI,OAAO;AACL,UAAI,KAAK,GAAG,WAAW,MAAM,wCAAwC;AAAA,IACvE;AAAA,EACF;AACA,SAAO,EAAE,cAAc,iBAAiB,WAAW,OAAO;AAC5D;","names":["readFile","readFile","writeFile","mkdir","access","join","join","join","readFile","join","join","readFile","join","readFile","writeFile","mkdir","access"]}
|
package/dist/cli.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
printScoreCard,
|
|
15
15
|
readFileOrNull,
|
|
16
16
|
renderDoctorReport
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-UN23WZVQ.js";
|
|
18
18
|
|
|
19
19
|
// src/cli.ts
|
|
20
20
|
import { Command as Command5 } from "commander";
|
|
@@ -74,6 +74,14 @@ When all tasks in the current sprint are complete, do a quick quality check befo
|
|
|
74
74
|
- Skip if the sprint was trivial (docs, config-only changes)`);
|
|
75
75
|
sections.push("", `## Conventions
|
|
76
76
|
- Git: Conventional commits (\`feat:\`, \`fix:\`, \`docs:\`, \`refactor:\`, \`test:\`, \`chore:\`)`);
|
|
77
|
+
sections.push("", `## When Stuck
|
|
78
|
+
Three failed iterations on the same problem = stop iterating alone.
|
|
79
|
+
On the fourth attempt, spin up at least 3 parallel agents via the Agent tool, each investigating from a different angle:
|
|
80
|
+
1. Root-cause debug agent
|
|
81
|
+
2. Upstream library/docs research agent
|
|
82
|
+
3. Alternative architecture agent
|
|
83
|
+
Wait for all agents to return, synthesize their findings, then act.
|
|
84
|
+
Don't keep guessing in circles \u2014 rotate perspectives.`);
|
|
77
85
|
sections.push("", `## Off-Limits
|
|
78
86
|
- Never hardcode secrets \u2014 use environment variables
|
|
79
87
|
- Never write to \`.env\` files
|
|
@@ -1195,7 +1203,8 @@ var BASE_SECTIONS = [
|
|
|
1195
1203
|
{ pattern: /^##\s+Session Start/m, name: "Session Start", why: "Without this, Claude won't read TASKS.md or maintain continuity" },
|
|
1196
1204
|
{ pattern: /^##\s+Off.?Limits/m, name: "Off-Limits", why: "Without guardrails, Claude has no boundaries beyond defaults" },
|
|
1197
1205
|
{ pattern: /^##\s+(Architecture|Project Structure)/m, name: "Architecture/Structure", why: "Claude makes better decisions when it understands the codebase shape" },
|
|
1198
|
-
{ pattern: /^##\s+Backlog/m, name: "Backlog", why: "Without backlog instructions, deferred features get lost in conversation history" }
|
|
1206
|
+
{ pattern: /^##\s+Backlog/m, name: "Backlog", why: "Without backlog instructions, deferred features get lost in conversation history" },
|
|
1207
|
+
{ pattern: /^##\s+(When Stuck|Debug)/m, name: "When Stuck", why: "Without a stop-and-swarm rule, Claude keeps guessing in circles instead of parallelizing research" }
|
|
1199
1208
|
];
|
|
1200
1209
|
var MEMORY_SECTION = { pattern: /^##\s+Memory/m, name: "Memory & Learnings", why: "Without memory instructions, Claude forgets learnings and repeats mistakes across sessions" };
|
|
1201
1210
|
var VAGUE_PATTERNS = [
|
|
@@ -2067,14 +2076,14 @@ function createMemoryCommand() {
|
|
|
2067
2076
|
log.error("Knowledge base not set up yet. Run `claude-launchpad memory` first.");
|
|
2068
2077
|
return;
|
|
2069
2078
|
}
|
|
2070
|
-
const { requireMemoryDeps } = await import("./require-deps-
|
|
2079
|
+
const { requireMemoryDeps } = await import("./require-deps-DVEP4QBF.js");
|
|
2071
2080
|
await requireMemoryDeps();
|
|
2072
|
-
const { startTui } = await import("./tui-
|
|
2081
|
+
const { startTui } = await import("./tui-QNOPH3I5.js");
|
|
2073
2082
|
await startTui();
|
|
2074
2083
|
return;
|
|
2075
2084
|
}
|
|
2076
2085
|
if (!isMemoryInstalled()) {
|
|
2077
|
-
const { detectExistingSetup } = await import("./install-
|
|
2086
|
+
const { detectExistingSetup } = await import("./install-6VOUHJTI.js");
|
|
2078
2087
|
const existing = detectExistingSetup(process.cwd());
|
|
2079
2088
|
if (existing) {
|
|
2080
2089
|
const location = existing === "local" ? ".claude/CLAUDE.md + settings.local.json" : "CLAUDE.md + settings.json";
|
|
@@ -2100,18 +2109,18 @@ function createMemoryCommand() {
|
|
|
2100
2109
|
log.info("Skipped.");
|
|
2101
2110
|
return;
|
|
2102
2111
|
}
|
|
2103
|
-
const { runInstall } = await import("./install-
|
|
2112
|
+
const { runInstall } = await import("./install-6VOUHJTI.js");
|
|
2104
2113
|
await runInstall({});
|
|
2105
2114
|
} else {
|
|
2106
|
-
const { requireMemoryDeps } = await import("./require-deps-
|
|
2115
|
+
const { requireMemoryDeps } = await import("./require-deps-DVEP4QBF.js");
|
|
2107
2116
|
await requireMemoryDeps();
|
|
2108
|
-
const { runStats } = await import("./stats-
|
|
2117
|
+
const { runStats } = await import("./stats-7K6GKTVB.js");
|
|
2109
2118
|
await runStats({});
|
|
2110
2119
|
}
|
|
2111
2120
|
});
|
|
2112
2121
|
memory.addCommand(
|
|
2113
2122
|
new Command4("context").description("Load session context (hook handler)").option("--json", "JSON output").action(async (opts) => {
|
|
2114
|
-
const { runContext } = await import("./context-
|
|
2123
|
+
const { runContext } = await import("./context-5AV2WCYW.js");
|
|
2115
2124
|
await runContext(opts);
|
|
2116
2125
|
}).helpCommand(false),
|
|
2117
2126
|
{ hidden: true }
|
|
@@ -2126,7 +2135,7 @@ function createMemoryCommand() {
|
|
|
2126
2135
|
memory.addCommand(
|
|
2127
2136
|
new Command4("push").description("Push current project's memories to GitHub Gist").option("--all", "Push all projects").option("-y, --yes", "Skip confirmation prompt").action(async (opts) => {
|
|
2128
2137
|
await handleSyncErrors(async () => {
|
|
2129
|
-
const { runPush } = await import("./push-
|
|
2138
|
+
const { runPush } = await import("./push-KCT2J6FR.js");
|
|
2130
2139
|
await runPush(opts);
|
|
2131
2140
|
});
|
|
2132
2141
|
})
|
|
@@ -2134,7 +2143,7 @@ function createMemoryCommand() {
|
|
|
2134
2143
|
memory.addCommand(
|
|
2135
2144
|
new Command4("pull").description("Pull current project's memories from GitHub Gist").option("--all", "Pull all projects").action(async (opts) => {
|
|
2136
2145
|
await handleSyncErrors(async () => {
|
|
2137
|
-
const { runPull } = await import("./pull-
|
|
2146
|
+
const { runPull } = await import("./pull-KRU2DRPZ.js");
|
|
2138
2147
|
await runPull(opts);
|
|
2139
2148
|
});
|
|
2140
2149
|
})
|
|
@@ -2143,7 +2152,7 @@ function createMemoryCommand() {
|
|
|
2143
2152
|
sync.addCommand(
|
|
2144
2153
|
new Command4("status").description("Show local vs remote memory counts per project").action(async () => {
|
|
2145
2154
|
await handleSyncErrors(async () => {
|
|
2146
|
-
const { runSyncStatus } = await import("./sync-status-
|
|
2155
|
+
const { runSyncStatus } = await import("./sync-status-QF6QK3NN.js");
|
|
2147
2156
|
await runSyncStatus();
|
|
2148
2157
|
});
|
|
2149
2158
|
})
|
|
@@ -2151,7 +2160,7 @@ function createMemoryCommand() {
|
|
|
2151
2160
|
sync.addCommand(
|
|
2152
2161
|
new Command4("clean").description("Remove a project from the sync gist").argument("<project>", "Project slug to remove").option("-y, --yes", "Skip confirmation prompt").action(async (project, opts) => {
|
|
2153
2162
|
await handleSyncErrors(async () => {
|
|
2154
|
-
const { runSyncClean } = await import("./sync-clean-
|
|
2163
|
+
const { runSyncClean } = await import("./sync-clean-P75QVF5Z.js");
|
|
2155
2164
|
await runSyncClean(project, opts);
|
|
2156
2165
|
});
|
|
2157
2166
|
})
|
|
@@ -2161,7 +2170,7 @@ function createMemoryCommand() {
|
|
|
2161
2170
|
}
|
|
2162
2171
|
|
|
2163
2172
|
// src/cli.ts
|
|
2164
|
-
var program = new Command5().name("claude-launchpad").description("CLI toolkit that makes Claude Code setups measurably good").version("1.
|
|
2173
|
+
var program = new Command5().name("claude-launchpad").description("CLI toolkit that makes Claude Code setups measurably good").version("1.1.0", "-v, --version").action(async () => {
|
|
2165
2174
|
const hasConfig = await fileExists(join9(process.cwd(), "CLAUDE.md")) || await fileExists(join9(process.cwd(), ".claude", "settings.json"));
|
|
2166
2175
|
if (hasConfig) {
|
|
2167
2176
|
await program.commands.find((c) => c.name() === "doctor")?.parseAsync([], { from: "user" });
|