claude-launchpad 0.16.1 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -5
- package/dist/{chunk-JQDMBE7W.js → chunk-3UJYOWGF.js} +18 -1
- package/dist/chunk-3UJYOWGF.js.map +1 -0
- package/dist/{chunk-S4WIADYE.js → chunk-4JNFXVVC.js} +49 -49
- package/dist/chunk-4JNFXVVC.js.map +1 -0
- package/dist/{chunk-SVWFSAYP.js → chunk-AUV2JTXX.js} +3 -3
- package/dist/{chunk-IZFQTQ4C.js → chunk-PGDSAUP4.js} +2 -2
- package/dist/{chunk-24VLPHJU.js → chunk-V4NXT4KB.js} +43 -16
- package/dist/chunk-V4NXT4KB.js.map +1 -0
- package/dist/{chunk-NLZGJHE5.js → chunk-ZXJK7CHB.js} +31 -4
- package/dist/chunk-ZXJK7CHB.js.map +1 -0
- package/dist/cli.js +49 -16
- package/dist/cli.js.map +1 -1
- package/dist/commands/memory/server.js +20 -11
- package/dist/commands/memory/server.js.map +1 -1
- package/dist/{context-53PKQOMI.js → context-Q5ZQBY7O.js} +6 -6
- package/dist/{install-PFTFTNIF.js → install-LS7DTMIE.js} +59 -55
- package/dist/install-LS7DTMIE.js.map +1 -0
- package/dist/{pull-4QTS57DQ.js → pull-4NRD4GQ4.js} +13 -9
- package/dist/pull-4NRD4GQ4.js.map +1 -0
- package/dist/{push-JOCEW3VG.js → push-BHYEETGP.js} +9 -9
- package/dist/{require-deps-SUGLVBM2.js → require-deps-3GIE6TAG.js} +3 -3
- package/dist/{stats-7WFCVXBX.js → stats-NQ5NRUZC.js} +7 -7
- package/dist/sync-clean-QWEQVAYO.js +53 -0
- package/dist/sync-clean-QWEQVAYO.js.map +1 -0
- package/dist/sync-status-ZMXMEBGC.js +70 -0
- package/dist/sync-status-ZMXMEBGC.js.map +1 -0
- package/dist/{tui-DKWRY5PT.js → tui-YL5NWME5.js} +5 -5
- package/package.json +1 -1
- package/dist/chunk-24VLPHJU.js.map +0 -1
- package/dist/chunk-JQDMBE7W.js.map +0 -1
- package/dist/chunk-NLZGJHE5.js.map +0 -1
- package/dist/chunk-S4WIADYE.js.map +0 -1
- package/dist/install-PFTFTNIF.js.map +0 -1
- package/dist/pull-4QTS57DQ.js.map +0 -1
- /package/dist/{chunk-SVWFSAYP.js.map → chunk-AUV2JTXX.js.map} +0 -0
- /package/dist/{chunk-IZFQTQ4C.js.map → chunk-PGDSAUP4.js.map} +0 -0
- /package/dist/{context-53PKQOMI.js.map → context-Q5ZQBY7O.js.map} +0 -0
- /package/dist/{push-JOCEW3VG.js.map → push-BHYEETGP.js.map} +0 -0
- /package/dist/{require-deps-SUGLVBM2.js.map → require-deps-3GIE6TAG.js.map} +0 -0
- /package/dist/{stats-7WFCVXBX.js.map → stats-NQ5NRUZC.js.map} +0 -0
- /package/dist/{tui-DKWRY5PT.js.map → tui-YL5NWME5.js.map} +0 -0
package/README.md
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|

|
|
9
9
|

|
|
10
10
|
|
|
11
|
-
**
|
|
11
|
+
**Claude follows CLAUDE.md ~80% of the time. Hooks run at 100%. Most setups have zero hooks.**
|
|
12
12
|
|
|
13
|
-
Claude
|
|
13
|
+
Claude Launchpad adds the hooks, scores your config, and tests that Claude actually follows your rules.
|
|
14
14
|
|
|
15
15
|
For developers using Claude Code who want consistent results: solo devs, vibe coders, AI-first teams.
|
|
16
16
|
|
|
@@ -56,7 +56,13 @@ Scores your config, auto-repairs everything it can.
|
|
|
56
56
|
|
|
57
57
|
## The Three-File System
|
|
58
58
|
|
|
59
|
-
Without structure, CLAUDE.md becomes a dumping ground
|
|
59
|
+
Without structure, CLAUDE.md becomes a dumping ground:
|
|
60
|
+
|
|
61
|
+
- Future ideas bury active guidance
|
|
62
|
+
- Sprint notes push conventions off-screen
|
|
63
|
+
- Past ~200 lines, Claude starts ignoring rules at the bottom
|
|
64
|
+
|
|
65
|
+
The three-file split keeps each concern where it belongs:
|
|
60
66
|
|
|
61
67
|
| File | Purpose | Example |
|
|
62
68
|
|---|---|---|
|
|
@@ -195,7 +201,7 @@ Results save to `.claude/eval/` as structured markdown. Feed them back to Claude
|
|
|
195
201
|
|
|
196
202
|
## Memory
|
|
197
203
|
|
|
198
|
-
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.
|
|
199
205
|
|
|
200
206
|
```bash
|
|
201
207
|
claude-launchpad memory
|
|
@@ -212,7 +218,7 @@ Use "local" when co-devs have different memory setups (e.g. you use agentic-memo
|
|
|
212
218
|
|
|
213
219
|
Every session, Claude loads what it needs to know and stores new knowledge as it works. Stale facts fade on their own. Knowledge Claude actually uses gets reinforced. Each project has its own isolated memory. When a session ends, memories auto-sync to a private GitHub Gist so they're available on any machine.
|
|
214
220
|
|
|
215
|
-
Browse everything with `--dashboard
|
|
221
|
+
Browse everything with `--dashboard`, a terminal UI with vim navigation, filtering, and search.
|
|
216
222
|
|
|
217
223
|
Data stays in `~/.agentic-memory/memory.db`. Sync requires the [GitHub CLI](https://cli.github.com/) (`gh`).
|
|
218
224
|
|
|
@@ -223,6 +229,9 @@ Data stays in `~/.agentic-memory/memory.db`. Sync requires the [GitHub CLI](http
|
|
|
223
229
|
| `pull` | Pull current project's memories from a private GitHub Gist |
|
|
224
230
|
| `push --all` | Push all projects |
|
|
225
231
|
| `pull --all` | Pull all projects |
|
|
232
|
+
| `push -y` | Skip confirmation prompt |
|
|
233
|
+
| `sync status` | Show local vs remote memory counts |
|
|
234
|
+
| `sync clean <project>` | Remove a project from the sync gist |
|
|
226
235
|
|
|
227
236
|
Sync stores one file per project inside a single private gist. Push/pull auto-detects the current project from your working directory. On a new device, the gist is auto-discovered from your GitHub account (no config to copy).
|
|
228
237
|
|
|
@@ -133,6 +133,22 @@ function listGistFiles(gistId) {
|
|
|
133
133
|
return [];
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
+
function deleteGistFile(gistId, filename) {
|
|
137
|
+
const payload = { files: { [filename]: null } };
|
|
138
|
+
const tmpFile = join(tmpdir(), `gist-delete-${Date.now()}.json`);
|
|
139
|
+
try {
|
|
140
|
+
writeFileSync(tmpFile, JSON.stringify(payload), "utf-8");
|
|
141
|
+
execSync(
|
|
142
|
+
`gh api --method PATCH "/gists/${gistId}" --input "${tmpFile}"`,
|
|
143
|
+
{ ...EXEC_OPTS, stdio: ["pipe", "pipe", "pipe"] }
|
|
144
|
+
);
|
|
145
|
+
} finally {
|
|
146
|
+
try {
|
|
147
|
+
unlinkSync(tmpFile);
|
|
148
|
+
} catch {
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
136
152
|
function updateGistFiles(gistId, files) {
|
|
137
153
|
const payload = {
|
|
138
154
|
files: Object.fromEntries(
|
|
@@ -163,6 +179,7 @@ export {
|
|
|
163
179
|
createGist,
|
|
164
180
|
readGistFile,
|
|
165
181
|
listGistFiles,
|
|
182
|
+
deleteGistFile,
|
|
166
183
|
updateGistFiles
|
|
167
184
|
};
|
|
168
|
-
//# sourceMappingURL=chunk-
|
|
185
|
+
//# sourceMappingURL=chunk-3UJYOWGF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/memory/utils/gist-transport.ts"],"sourcesContent":["import { execSync } from 'node:child_process';\nimport { readFileSync, writeFileSync, unlinkSync, mkdirSync } from 'node:fs';\nimport { join, dirname } from 'node:path';\nimport { tmpdir } from 'node:os';\nimport { homedir } from 'node:os';\n\nexport interface SyncConfig {\n readonly gistId: string;\n}\n\nconst EXEC_OPTS = { encoding: 'utf-8' as const, timeout: 30_000 };\nconst GIST_DESCRIPTION = 'agentic-memory sync';\nconst SYNC_CONFIG_FILE = 'sync-config.json';\nconst DATA_DIR = join(homedir(), '.agentic-memory');\n\nfunction syncConfigPath(): string {\n return join(DATA_DIR, SYNC_CONFIG_FILE);\n}\n\nfunction slugify(project: string): string {\n return project.replace(/[^a-zA-Z0-9._-]/g, '-');\n}\n\nexport function projectToFilename(project: string): string {\n if (!project) throw new Error('Project name cannot be empty');\n return `memories-${slugify(project)}.json`;\n}\n\nexport function filenameToProject(filename: string): string | null {\n const match = filename.match(/^memories-(.+)\\.json$/);\n return match?.[1] ?? null;\n}\n\n\nexport function assertGhAvailable(): void {\n try {\n execSync('gh --version', { ...EXEC_OPTS, stdio: 'pipe' });\n } catch {\n throw new Error(\n 'Memory sync requires the GitHub CLI.\\n' +\n 'Install: https://cli.github.com/\\n' +\n 'Then run: gh auth login'\n );\n }\n try {\n execSync('gh auth status', { ...EXEC_OPTS, stdio: 'pipe' });\n } catch {\n throw new Error(\n 'gh is installed but not authenticated.\\n' +\n 'Run: gh auth login'\n );\n }\n}\n\n/**\n * Read sync config from disk only — no network discovery.\n * Safe to call from lightweight contexts like doctor analyzers.\n */\nexport function readSyncConfig(): SyncConfig | null {\n try {\n const raw = readFileSync(syncConfigPath(), 'utf-8');\n const parsed = JSON.parse(raw) as Record<string, unknown>;\n if (typeof parsed.gistId === 'string' && /^[a-f0-9]+$/.test(parsed.gistId)) {\n return { gistId: parsed.gistId };\n }\n } catch { /* no config file */ }\n return null;\n}\n\nexport function loadSyncConfig(): SyncConfig | null {\n try {\n const raw = readFileSync(syncConfigPath(), 'utf-8');\n const parsed = JSON.parse(raw) as Record<string, unknown>;\n if (typeof parsed.gistId === 'string' && /^[a-f0-9]+$/.test(parsed.gistId)) {\n return { gistId: parsed.gistId };\n }\n } catch { /* no local config */ }\n\n const discovered = discoverSyncGist();\n if (discovered) {\n saveSyncConfig({ gistId: discovered });\n return { gistId: discovered };\n }\n return null;\n}\n\nfunction discoverSyncGist(): string | null {\n try {\n const output = execSync(\n 'gh gist list --limit 100',\n { ...EXEC_OPTS, stdio: ['pipe', 'pipe', 'pipe'] },\n );\n for (const line of output.split('\\n')) {\n const cols = line.split('\\t');\n if (cols[1]?.trim() === GIST_DESCRIPTION) {\n const gistId = cols[0]?.trim();\n if (gistId && /^[a-f0-9]+$/.test(gistId)) return gistId;\n }\n }\n } catch { /* gh list failed */ }\n return null;\n}\n\nexport function saveSyncConfig(config: SyncConfig): void {\n const filePath = syncConfigPath();\n mkdirSync(dirname(filePath), { recursive: true });\n writeFileSync(filePath, JSON.stringify(config, null, 2) + '\\n', 'utf-8');\n}\n\nexport function createGist(filename: string, content: string): string {\n const safeFilename = slugify(filename.replace(/\\.json$/, '')) + '.json';\n const tmpFile = join(tmpdir(), safeFilename);\n try {\n writeFileSync(tmpFile, content, 'utf-8');\n const result = execSync(\n `gh gist create \"${tmpFile}\" --desc \"${GIST_DESCRIPTION}\" --public=false`,\n { ...EXEC_OPTS, stdio: ['pipe', 'pipe', 'pipe'] },\n ).trim();\n const gistId = result.split('/').pop()?.trim() ?? '';\n if (!gistId || !/^[a-f0-9]+$/.test(gistId)) {\n throw new Error(`Failed to parse gist ID from: ${result}`);\n }\n saveSyncConfig({ gistId });\n return gistId;\n } finally {\n try { unlinkSync(tmpFile); } catch { /* ignore */ }\n }\n}\n\nexport function readGistFile(gistId: string, filename: string): string | null {\n try {\n const escapedFilename = JSON.stringify(filename);\n return execSync(\n `gh api \"/gists/${gistId}\" --jq '.files[${escapedFilename}].content'`,\n { ...EXEC_OPTS, stdio: ['pipe', 'pipe', 'pipe'] },\n ).trimEnd();\n } catch {\n return null;\n }\n}\n\nexport function listGistFiles(gistId: string): readonly string[] {\n try {\n const output = execSync(\n `gh api \"/gists/${gistId}\" --jq '.files | keys[]'`,\n { ...EXEC_OPTS, stdio: ['pipe', 'pipe', 'pipe'] },\n );\n return output.trim().split('\\n').filter(Boolean);\n } catch {\n return [];\n }\n}\n\nexport function deleteGistFile(gistId: string, filename: string): void {\n const payload = { files: { [filename]: null } };\n const tmpFile = join(tmpdir(), `gist-delete-${Date.now()}.json`);\n try {\n writeFileSync(tmpFile, JSON.stringify(payload), 'utf-8');\n execSync(\n `gh api --method PATCH \"/gists/${gistId}\" --input \"${tmpFile}\"`,\n { ...EXEC_OPTS, stdio: ['pipe', 'pipe', 'pipe'] },\n );\n } finally {\n try { unlinkSync(tmpFile); } catch { /* ignore */ }\n }\n}\n\nexport function updateGistFiles(\n gistId: string,\n files: Record<string, string>,\n): void {\n const payload = {\n files: Object.fromEntries(\n Object.entries(files).map(([name, content]) => [name, { content }]),\n ),\n };\n const tmpFile = join(tmpdir(), `gist-patch-${Date.now()}.json`);\n try {\n writeFileSync(tmpFile, JSON.stringify(payload), 'utf-8');\n execSync(\n `gh api --method PATCH \"/gists/${gistId}\" --input \"${tmpFile}\"`,\n { ...EXEC_OPTS, stdio: ['pipe', 'pipe', 'pipe'] },\n );\n } finally {\n try { unlinkSync(tmpFile); } catch { /* ignore */ }\n }\n}\n"],"mappings":";;;AAAA,SAAS,gBAAgB;AACzB,SAAS,cAAc,eAAe,YAAY,iBAAiB;AACnE,SAAS,MAAM,eAAe;AAC9B,SAAS,cAAc;AACvB,SAAS,eAAe;AAMxB,IAAM,YAAY,EAAE,UAAU,SAAkB,SAAS,IAAO;AAChE,IAAM,mBAAmB;AACzB,IAAM,mBAAmB;AACzB,IAAM,WAAW,KAAK,QAAQ,GAAG,iBAAiB;AAElD,SAAS,iBAAyB;AAChC,SAAO,KAAK,UAAU,gBAAgB;AACxC;AAEA,SAAS,QAAQ,SAAyB;AACxC,SAAO,QAAQ,QAAQ,oBAAoB,GAAG;AAChD;AAEO,SAAS,kBAAkB,SAAyB;AACzD,MAAI,CAAC,QAAS,OAAM,IAAI,MAAM,8BAA8B;AAC5D,SAAO,YAAY,QAAQ,OAAO,CAAC;AACrC;AAEO,SAAS,kBAAkB,UAAiC;AACjE,QAAM,QAAQ,SAAS,MAAM,uBAAuB;AACpD,SAAO,QAAQ,CAAC,KAAK;AACvB;AAGO,SAAS,oBAA0B;AACxC,MAAI;AACF,aAAS,gBAAgB,EAAE,GAAG,WAAW,OAAO,OAAO,CAAC;AAAA,EAC1D,QAAQ;AACN,UAAM,IAAI;AAAA,MACR;AAAA,IA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
|
const language = detectLanguage(manifests);
|
|
144
144
|
const framework = detectFramework(manifests);
|
|
145
145
|
const packageManager = detectPackageManager(manifests, lockfiles);
|
|
146
|
-
const scripts = detectScripts({ pkgJson, pyProject, goMod, gemfile, composerJson, language });
|
|
146
|
+
const scripts = detectScripts({ pkgJson, pyProject, goMod, gemfile, composerJson, language, packageManager });
|
|
147
147
|
return {
|
|
148
148
|
name,
|
|
149
149
|
language,
|
|
@@ -247,7 +247,7 @@ var LANGUAGE_SCRIPTS = {
|
|
|
247
247
|
function detectScripts(m) {
|
|
248
248
|
if (m.pkgJson) {
|
|
249
249
|
const scripts = m.pkgJson.scripts ?? {};
|
|
250
|
-
const run = pmRun(m.
|
|
250
|
+
const run = pmRun(m.packageManager);
|
|
251
251
|
return {
|
|
252
252
|
devCommand: scripts.dev ? `${run} dev` : null,
|
|
253
253
|
buildCommand: scripts.build ? `${run} build` : null,
|
|
@@ -265,11 +265,10 @@ function detectScripts(m) {
|
|
|
265
265
|
}
|
|
266
266
|
return { devCommand: null, buildCommand: null, testCommand: null, lintCommand: null, formatCommand: null };
|
|
267
267
|
}
|
|
268
|
-
function pmRun(
|
|
269
|
-
|
|
270
|
-
if (
|
|
271
|
-
if (
|
|
272
|
-
if (pm?.startsWith("bun")) return "bun";
|
|
268
|
+
function pmRun(packageManager) {
|
|
269
|
+
if (packageManager === "pnpm") return "pnpm";
|
|
270
|
+
if (packageManager === "yarn") return "yarn";
|
|
271
|
+
if (packageManager === "bun") return "bun";
|
|
273
272
|
return "npm run";
|
|
274
273
|
}
|
|
275
274
|
async function globExists(dir, pattern) {
|
|
@@ -286,27 +285,10 @@ async function globExists(dir, pattern) {
|
|
|
286
285
|
function generateClaudeignore(detected) {
|
|
287
286
|
const sections = ["# Generated by claude-launchpad"];
|
|
288
287
|
sections.push(`
|
|
289
|
-
# Dependencies
|
|
290
|
-
node_modules/
|
|
291
|
-
.pnp/
|
|
292
|
-
.yarn/
|
|
293
|
-
|
|
294
288
|
# Build output
|
|
295
289
|
dist/
|
|
296
290
|
build/
|
|
297
291
|
out/
|
|
298
|
-
.next/
|
|
299
|
-
.nuxt/
|
|
300
|
-
.output/
|
|
301
|
-
.svelte-kit/
|
|
302
|
-
.vercel/
|
|
303
|
-
.turbo/
|
|
304
|
-
|
|
305
|
-
# Package manager
|
|
306
|
-
pnpm-lock.yaml
|
|
307
|
-
package-lock.json
|
|
308
|
-
yarn.lock
|
|
309
|
-
bun.lockb
|
|
310
292
|
|
|
311
293
|
# IDE & OS
|
|
312
294
|
.vscode/
|
|
@@ -318,14 +300,31 @@ Thumbs.db
|
|
|
318
300
|
|
|
319
301
|
# Test & coverage
|
|
320
302
|
coverage/
|
|
321
|
-
.nyc_output/
|
|
322
|
-
__snapshots__/
|
|
323
303
|
|
|
324
304
|
# Environment (should never be read)
|
|
325
305
|
.env
|
|
326
306
|
.env.*
|
|
327
307
|
!.env.example`);
|
|
328
308
|
const lang = detected.language;
|
|
309
|
+
if (lang === "TypeScript" || lang === "JavaScript") {
|
|
310
|
+
sections.push(`
|
|
311
|
+
# Node
|
|
312
|
+
node_modules/
|
|
313
|
+
.pnp/
|
|
314
|
+
.yarn/
|
|
315
|
+
.next/
|
|
316
|
+
.nuxt/
|
|
317
|
+
.output/
|
|
318
|
+
.svelte-kit/
|
|
319
|
+
.vercel/
|
|
320
|
+
.turbo/
|
|
321
|
+
pnpm-lock.yaml
|
|
322
|
+
package-lock.json
|
|
323
|
+
yarn.lock
|
|
324
|
+
bun.lockb
|
|
325
|
+
.nyc_output/
|
|
326
|
+
__snapshots__/`);
|
|
327
|
+
}
|
|
329
328
|
if (lang === "Python") {
|
|
330
329
|
sections.push(`
|
|
331
330
|
# Python
|
|
@@ -624,9 +623,9 @@ async function addPlacementHook(root, placement, event, dedupKeyword, entry, pre
|
|
|
624
623
|
return nested?.some((h) => String(h.command ?? "").includes(dedupKeyword));
|
|
625
624
|
});
|
|
626
625
|
if (alreadyHas) return false;
|
|
627
|
-
|
|
628
|
-
settings
|
|
629
|
-
await write(root,
|
|
626
|
+
const updatedList = prepend ? [entry, ...hookList] : [...hookList, entry];
|
|
627
|
+
const updatedSettings = { ...settings, hooks: { ...hooks, [event]: updatedList } };
|
|
628
|
+
await write(root, updatedSettings);
|
|
630
629
|
log.success(successMsg);
|
|
631
630
|
return true;
|
|
632
631
|
}
|
|
@@ -635,8 +634,8 @@ async function disableAutoMemory(root, placement) {
|
|
|
635
634
|
const write = placement === "local" ? writeSettingsLocalJson : writeSettingsJson;
|
|
636
635
|
const settings = await read(root);
|
|
637
636
|
if (settings.autoMemoryEnabled === false) return false;
|
|
638
|
-
settings
|
|
639
|
-
await write(root,
|
|
637
|
+
const updated = { ...settings, autoMemoryEnabled: false };
|
|
638
|
+
await write(root, updated);
|
|
640
639
|
const target = placement === "local" ? "settings.local.json" : "settings.json";
|
|
641
640
|
log.success(`Set autoMemoryEnabled: false in ${target}`);
|
|
642
641
|
return true;
|
|
@@ -658,8 +657,8 @@ async function addMemoryToolPermissions(root, placement) {
|
|
|
658
657
|
];
|
|
659
658
|
const missing = tools.filter((t) => !allow.includes(t));
|
|
660
659
|
if (missing.length === 0) return false;
|
|
661
|
-
|
|
662
|
-
await write(root,
|
|
660
|
+
const updated = { ...settings, permissions: { ...permissions, allow: [...allow, ...missing] } };
|
|
661
|
+
await write(root, updated);
|
|
663
662
|
const target = placement === "local" ? "settings.local.json" : "settings.json";
|
|
664
663
|
log.success(`Added agentic-memory MCP tool permissions to ${target}`);
|
|
665
664
|
return true;
|
|
@@ -690,8 +689,8 @@ async function removeStaleStopHook(root) {
|
|
|
690
689
|
});
|
|
691
690
|
if (filtered.length === stopHooks.length) return false;
|
|
692
691
|
const updated = filtered.length === 0 ? (({ Stop: _, ...rest }) => rest)(hooks) : { ...hooks, Stop: filtered };
|
|
693
|
-
settings
|
|
694
|
-
await writeSettingsJson(root,
|
|
692
|
+
const updatedSettings = { ...settings, hooks: updated };
|
|
693
|
+
await writeSettingsJson(root, updatedSettings);
|
|
695
694
|
log.success("Removed deprecated Stop hook (memory extract)");
|
|
696
695
|
return true;
|
|
697
696
|
}
|
|
@@ -717,10 +716,11 @@ async function addAllowedMcpServers(root, placement) {
|
|
|
717
716
|
} catch {
|
|
718
717
|
}
|
|
719
718
|
if (serverNames.size === 0) return false;
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
719
|
+
const updatedSettings = {
|
|
720
|
+
...settings,
|
|
721
|
+
allowedMcpServers: [...serverNames].map((name) => ({ serverName: name }))
|
|
722
|
+
};
|
|
723
|
+
await write(root, updatedSettings);
|
|
724
724
|
const target = placement === "local" ? "settings.local.json" : "settings.json";
|
|
725
725
|
log.success(`Added allowedMcpServers from configured servers to ${target}`);
|
|
726
726
|
return true;
|
|
@@ -810,9 +810,9 @@ async function addHook(root, event, dedupKeyword, entry, successMsg) {
|
|
|
810
810
|
return nested?.some((h) => String(h.command ?? "").includes(dedupKeyword));
|
|
811
811
|
});
|
|
812
812
|
if (alreadyHas) return false;
|
|
813
|
-
hookList
|
|
814
|
-
|
|
815
|
-
await writeSettingsJson(root,
|
|
813
|
+
const updated = [...hookList, entry];
|
|
814
|
+
const updatedSettings = { ...settings, hooks: { ...hooks, [event]: updated } };
|
|
815
|
+
await writeSettingsJson(root, updatedSettings);
|
|
816
816
|
log.success(successMsg);
|
|
817
817
|
return true;
|
|
818
818
|
}
|
|
@@ -890,16 +890,16 @@ async function addCredentialDenyRules(root) {
|
|
|
890
890
|
const toAdd = ["Read(~/.ssh/*)", "Read(~/.aws/*)", "Read(~/.npmrc)"];
|
|
891
891
|
const missing = toAdd.filter((p) => !deny.includes(p));
|
|
892
892
|
if (missing.length === 0) return false;
|
|
893
|
-
|
|
894
|
-
await writeSettingsJson(root,
|
|
893
|
+
const updated = { ...settings, permissions: { ...permissions, deny: [...deny, ...missing] } };
|
|
894
|
+
await writeSettingsJson(root, updated);
|
|
895
895
|
log.success("Added credential deny rules (SSH, AWS, npm)");
|
|
896
896
|
return true;
|
|
897
897
|
}
|
|
898
898
|
async function addBypassDisable(root) {
|
|
899
899
|
const settings = await readSettingsJson(root);
|
|
900
900
|
if (settings.disableBypassPermissionsMode === "disable") return false;
|
|
901
|
-
settings
|
|
902
|
-
await writeSettingsJson(root,
|
|
901
|
+
const updated = { ...settings, disableBypassPermissionsMode: "disable" };
|
|
902
|
+
await writeSettingsJson(root, updated);
|
|
903
903
|
log.success("Added disableBypassPermissionsMode: disable");
|
|
904
904
|
return true;
|
|
905
905
|
}
|
|
@@ -907,8 +907,8 @@ async function addSandboxSettings(root) {
|
|
|
907
907
|
const settings = await readSettingsJson(root);
|
|
908
908
|
const sandbox = settings.sandbox;
|
|
909
909
|
if (sandbox?.enabled === true) return false;
|
|
910
|
-
|
|
911
|
-
await writeSettingsJson(root,
|
|
910
|
+
const updated = { ...settings, sandbox: { enabled: true, failIfUnavailable: true } };
|
|
911
|
+
await writeSettingsJson(root, updated);
|
|
912
912
|
log.success("Enabled sandbox with failIfUnavailable");
|
|
913
913
|
return true;
|
|
914
914
|
}
|
|
@@ -1136,4 +1136,4 @@ export {
|
|
|
1136
1136
|
printScoreCard,
|
|
1137
1137
|
renderDoctorReport
|
|
1138
1138
|
};
|
|
1139
|
-
//# sourceMappingURL=chunk-
|
|
1139
|
+
//# sourceMappingURL=chunk-4JNFXVVC.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: \"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,MAA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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,I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KAAK,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"]}
|
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
MemoryRepo,
|
|
4
4
|
RelationRepo,
|
|
5
5
|
SearchRepo
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-V4NXT4KB.js";
|
|
7
7
|
import {
|
|
8
8
|
closeDatabase,
|
|
9
9
|
createDatabase,
|
|
10
10
|
loadConfig,
|
|
11
11
|
migrate,
|
|
12
12
|
resolveDataDir
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ZXJK7CHB.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-AUV2JTXX.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
log
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4JNFXVVC.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-PGDSAUP4.js.map
|