leadcode 0.2.0 → 0.2.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 +7 -12
- package/dist/index.js +10 -10
- package/dist/index.js.map +1 -1
- package/dist/tools/generate-claude-md.d.ts.map +1 -1
- package/dist/tools/generate-claude-md.js +4 -12
- package/dist/tools/generate-claude-md.js.map +1 -1
- package/dist/tools/suggest.d.ts.map +1 -1
- package/dist/tools/suggest.js +25 -84
- package/dist/tools/suggest.js.map +1 -1
- package/dist/tools/update-claude-md.d.ts.map +1 -1
- package/dist/tools/update-claude-md.js +6 -25
- package/dist/tools/update-claude-md.js.map +1 -1
- package/dist/tools/validate-claude-md.d.ts.map +1 -1
- package/dist/tools/validate-claude-md.js +18 -25
- package/dist/tools/validate-claude-md.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,20 +35,15 @@ Your Project ──→ LeadCode ──→ CLAUDE.md ──→ Claude Code knows
|
|
|
35
35
|
|
|
36
36
|
LeadCode is an MCP server — it's used through Claude Code, not as a standalone CLI.
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
"mcpServers": {
|
|
43
|
-
"leadcode": {
|
|
44
|
-
"command": "npx",
|
|
45
|
-
"args": ["-y", "leadcode"]
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
38
|
+
**One command:**
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
claude mcp add --scope project leadcode -- npx -y leadcode@latest
|
|
49
42
|
```
|
|
50
43
|
|
|
51
|
-
|
|
44
|
+
That's it. Restart Claude Code and LeadCode's tools are available.
|
|
45
|
+
|
|
46
|
+
> Use `--scope user` instead of `--scope project` to install globally across all your projects.
|
|
52
47
|
|
|
53
48
|
## Usage
|
|
54
49
|
|
package/dist/index.js
CHANGED
|
@@ -23,17 +23,17 @@ server.prompt("setup-project", "Full LeadCode workflow: analyze → detect gaps
|
|
|
23
23
|
projectPath: z.string().describe("Absolute path to the project root"),
|
|
24
24
|
language: z.string().optional().describe("Output language: 'fr' for French, 'en' for English (default: en)"),
|
|
25
25
|
}, ({ projectPath, language }) => {
|
|
26
|
-
const
|
|
27
|
-
const steps =
|
|
26
|
+
const isFr = language === "fr";
|
|
27
|
+
const steps = isFr
|
|
28
28
|
? [
|
|
29
29
|
`Configure LeadCode pour le projet à ${projectPath}. Suis ces étapes :`,
|
|
30
30
|
"",
|
|
31
31
|
`1. Lance analyze-repo avec projectPath="${projectPath}" pour scanner le projet.`,
|
|
32
32
|
"2. Lance detect-gaps avec l'analyse pour identifier les manques structurels.",
|
|
33
|
-
|
|
33
|
+
"3. Lance suggest-conventions avec l'analyse et les gaps pour obtenir des propositions.",
|
|
34
34
|
"4. Présente un résumé clair : ce qui est détecté, ce qui manque, et les options.",
|
|
35
35
|
"5. Demande-moi mes préférences pour chaque point (simple / clean / scalable).",
|
|
36
|
-
|
|
36
|
+
"6. Une fois mes choix faits, lance generate-claude-md avec mes choix pour créer le CLAUDE.md.",
|
|
37
37
|
"",
|
|
38
38
|
"Explique chaque étape simplement. Réponds en français.",
|
|
39
39
|
]
|
|
@@ -42,10 +42,10 @@ server.prompt("setup-project", "Full LeadCode workflow: analyze → detect gaps
|
|
|
42
42
|
"",
|
|
43
43
|
`1. Call analyze-repo with projectPath="${projectPath}" to scan the project.`,
|
|
44
44
|
"2. Call detect-gaps with the analysis to identify structural gaps.",
|
|
45
|
-
|
|
45
|
+
"3. Call suggest-conventions with the analysis and gaps to get improvement options.",
|
|
46
46
|
"4. Present the analysis, gaps, and suggestions to me in a clear summary.",
|
|
47
47
|
"5. Ask me which options I prefer for each gap (simple / clean / scalable).",
|
|
48
|
-
|
|
48
|
+
"6. Once I've chosen, call generate-claude-md with my choices to create the CLAUDE.md file.",
|
|
49
49
|
"",
|
|
50
50
|
"Be thorough and explain each gap and suggestion clearly.",
|
|
51
51
|
];
|
|
@@ -65,12 +65,12 @@ server.prompt("validate-project", "Check if an existing CLAUDE.md is still in sy
|
|
|
65
65
|
projectPath: z.string().describe("Absolute path to the project root"),
|
|
66
66
|
language: z.string().optional().describe("Output language: 'fr' for French, 'en' for English (default: en)"),
|
|
67
67
|
}, ({ projectPath, language }) => {
|
|
68
|
-
const
|
|
69
|
-
const steps =
|
|
68
|
+
const isFr = language === "fr";
|
|
69
|
+
const steps = isFr
|
|
70
70
|
? [
|
|
71
71
|
`Vérifie le CLAUDE.md du projet à ${projectPath}.`,
|
|
72
72
|
"",
|
|
73
|
-
`1. Lance validate-claude-md avec projectPath="${projectPath}"
|
|
73
|
+
`1. Lance validate-claude-md avec projectPath="${projectPath}".`,
|
|
74
74
|
"2. Présente les décalages trouvés avec des explications claires.",
|
|
75
75
|
"3. Si des décalages existent, suggère s'il faut régénérer ou corriger manuellement.",
|
|
76
76
|
"",
|
|
@@ -79,7 +79,7 @@ server.prompt("validate-project", "Check if an existing CLAUDE.md is still in sy
|
|
|
79
79
|
: [
|
|
80
80
|
`Please validate the CLAUDE.md for the project at ${projectPath}.`,
|
|
81
81
|
"",
|
|
82
|
-
`1. Call validate-claude-md with projectPath="${projectPath}"
|
|
82
|
+
`1. Call validate-claude-md with projectPath="${projectPath}".`,
|
|
83
83
|
"2. Present any drifts found with clear explanations.",
|
|
84
84
|
"3. If drifts are found, suggest whether to regenerate or manually fix the CLAUDE.md.",
|
|
85
85
|
];
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,w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AAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-claude-md.d.ts","sourceRoot":"","sources":["../../src/tools/generate-claude-md.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"generate-claude-md.d.ts","sourceRoot":"","sources":["../../src/tools/generate-claude-md.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAWzE,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAmFhE"}
|
|
@@ -4,7 +4,6 @@ import * as z from "zod";
|
|
|
4
4
|
import { getConventions, getInterdictions, getActiveCrossRefs, } from "../rules/index.js";
|
|
5
5
|
import { generateClaudeMd } from "../templates/claude-md.js";
|
|
6
6
|
import { analyzePatterns } from "../analyzers/patterns.js";
|
|
7
|
-
import { getMessages, interpolate } from "../i18n/index.js";
|
|
8
7
|
export function registerGenerateClaudeMd(server) {
|
|
9
8
|
server.registerTool("generate-claude-md", {
|
|
10
9
|
title: "Generate CLAUDE.md",
|
|
@@ -17,15 +16,9 @@ export function registerGenerateClaudeMd(server) {
|
|
|
17
16
|
.string()
|
|
18
17
|
.optional()
|
|
19
18
|
.describe("JSON string of user choices: Record<string, string> mapping topic to chosen option. Optional."),
|
|
20
|
-
language: z
|
|
21
|
-
.enum(["en", "fr"])
|
|
22
|
-
.optional()
|
|
23
|
-
.describe("Output language for the generated CLAUDE.md (default: en)"),
|
|
24
19
|
},
|
|
25
|
-
}, async ({ analysis: analysisStr, choices: choicesStr
|
|
20
|
+
}, async ({ analysis: analysisStr, choices: choicesStr }) => {
|
|
26
21
|
try {
|
|
27
|
-
const locale = language ?? "en";
|
|
28
|
-
const msg = getMessages(locale);
|
|
29
22
|
const analysis = JSON.parse(analysisStr);
|
|
30
23
|
const choices = choicesStr
|
|
31
24
|
? JSON.parse(choicesStr)
|
|
@@ -37,14 +30,14 @@ export function registerGenerateClaudeMd(server) {
|
|
|
37
30
|
catch {
|
|
38
31
|
return {
|
|
39
32
|
isError: true,
|
|
40
|
-
content: [{ type: "text", text:
|
|
33
|
+
content: [{ type: "text", text: `Project directory not found: ${analysis.projectPath}` }],
|
|
41
34
|
};
|
|
42
35
|
}
|
|
43
36
|
const conventions = getConventions(analysis);
|
|
44
37
|
const interdictions = getInterdictions(analysis);
|
|
45
38
|
const crossRefs = getActiveCrossRefs(analysis);
|
|
46
39
|
const patterns = await analyzePatterns(analysis.projectPath);
|
|
47
|
-
const content = generateClaudeMd(analysis, conventions, interdictions, crossRefs, choices, patterns
|
|
40
|
+
const content = generateClaudeMd(analysis, conventions, interdictions, crossRefs, choices, patterns);
|
|
48
41
|
const outputPath = join(analysis.projectPath, "CLAUDE.md");
|
|
49
42
|
await writeFile(outputPath, content, "utf-8");
|
|
50
43
|
return {
|
|
@@ -53,8 +46,7 @@ export function registerGenerateClaudeMd(server) {
|
|
|
53
46
|
type: "text",
|
|
54
47
|
text: JSON.stringify({
|
|
55
48
|
path: outputPath,
|
|
56
|
-
message:
|
|
57
|
-
language: locale,
|
|
49
|
+
message: "CLAUDE.md generated successfully",
|
|
58
50
|
sections: {
|
|
59
51
|
conventions: conventions.length,
|
|
60
52
|
interdictions: interdictions.length,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-claude-md.js","sourceRoot":"","sources":["../../src/tools/generate-claude-md.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAA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AC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACjE,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,8BAA8B,OAAO,EAAE,EAAE,CAAC;aACpF,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggest.d.ts","sourceRoot":"","sources":["../../src/tools/suggest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"suggest.d.ts","sourceRoot":"","sources":["../../src/tools/suggest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AA8EzE,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA+BvD"}
|
package/dist/tools/suggest.js
CHANGED
|
@@ -1,113 +1,68 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
-
import { getMessages
|
|
2
|
+
import { getMessages } from "../i18n/index.js";
|
|
3
3
|
function opt(o, level) {
|
|
4
4
|
return { level, description: o.description, pros: o.pros, cons: o.cons, claudeImpact: o.claudeImpact };
|
|
5
5
|
}
|
|
6
|
-
function buildSuggestions(analysis, gaps
|
|
7
|
-
const m = getMessages(
|
|
6
|
+
function buildSuggestions(analysis, gaps) {
|
|
7
|
+
const m = getMessages("en").suggestions;
|
|
8
8
|
const suggestions = [];
|
|
9
9
|
for (const gap of gaps) {
|
|
10
10
|
switch (gap.category) {
|
|
11
11
|
case "testing":
|
|
12
12
|
suggestions.push({
|
|
13
13
|
topic: m.testing.topic,
|
|
14
|
-
options: [
|
|
15
|
-
opt(m.testing.simple, "simple"),
|
|
16
|
-
opt(m.testing.clean, "clean"),
|
|
17
|
-
opt(m.testing.scalable, "scalable"),
|
|
18
|
-
],
|
|
14
|
+
options: [opt(m.testing.simple, "simple"), opt(m.testing.clean, "clean"), opt(m.testing.scalable, "scalable")],
|
|
19
15
|
});
|
|
20
16
|
break;
|
|
21
17
|
case "input-validation":
|
|
22
|
-
suggestions.push({
|
|
23
|
-
topic: m.inputValidation.topic,
|
|
24
|
-
options: [opt(m.inputValidation.simple, "simple"), opt(m.inputValidation.clean, "clean")],
|
|
25
|
-
});
|
|
18
|
+
suggestions.push({ topic: m.inputValidation.topic, options: [opt(m.inputValidation.simple, "simple"), opt(m.inputValidation.clean, "clean")] });
|
|
26
19
|
break;
|
|
27
20
|
case "error-handling":
|
|
28
|
-
suggestions.push({
|
|
29
|
-
topic: m.errorHandling.topic,
|
|
30
|
-
options: [opt(m.errorHandling.simple, "simple"), opt(m.errorHandling.clean, "clean")],
|
|
31
|
-
});
|
|
21
|
+
suggestions.push({ topic: m.errorHandling.topic, options: [opt(m.errorHandling.simple, "simple"), opt(m.errorHandling.clean, "clean")] });
|
|
32
22
|
break;
|
|
33
23
|
case "shared-schemas":
|
|
34
|
-
suggestions.push({
|
|
35
|
-
topic: m.schemaOrg.topic,
|
|
36
|
-
options: [opt(m.schemaOrg.simple, "simple"), opt(m.schemaOrg.clean, "clean")],
|
|
37
|
-
});
|
|
24
|
+
suggestions.push({ topic: m.schemaOrg.topic, options: [opt(m.schemaOrg.simple, "simple"), opt(m.schemaOrg.clean, "clean")] });
|
|
38
25
|
break;
|
|
39
26
|
case "component-structure":
|
|
40
|
-
suggestions.push({
|
|
41
|
-
topic: m.componentStructure.topic,
|
|
42
|
-
options: [opt(m.componentStructure.simple, "simple"), opt(m.componentStructure.clean, "clean")],
|
|
43
|
-
});
|
|
27
|
+
suggestions.push({ topic: m.componentStructure.topic, options: [opt(m.componentStructure.simple, "simple"), opt(m.componentStructure.clean, "clean")] });
|
|
44
28
|
break;
|
|
45
29
|
case "auth-middleware":
|
|
46
|
-
suggestions.push({
|
|
47
|
-
topic: m.authMiddleware.topic,
|
|
48
|
-
options: [opt(m.authMiddleware.simple, "simple"), opt(m.authMiddleware.clean, "clean")],
|
|
49
|
-
});
|
|
30
|
+
suggestions.push({ topic: m.authMiddleware.topic, options: [opt(m.authMiddleware.simple, "simple"), opt(m.authMiddleware.clean, "clean")] });
|
|
50
31
|
break;
|
|
51
32
|
case "loading-states":
|
|
52
|
-
suggestions.push({
|
|
53
|
-
topic: m.loadingStates.topic,
|
|
54
|
-
options: [opt(m.loadingStates.simple, "simple"), opt(m.loadingStates.clean, "clean")],
|
|
55
|
-
});
|
|
33
|
+
suggestions.push({ topic: m.loadingStates.topic, options: [opt(m.loadingStates.simple, "simple"), opt(m.loadingStates.clean, "clean")] });
|
|
56
34
|
break;
|
|
57
35
|
case "metadata":
|
|
58
|
-
suggestions.push({
|
|
59
|
-
topic: m.metadata.topic,
|
|
60
|
-
options: [opt(m.metadata.simple, "simple"), opt(m.metadata.clean, "clean")],
|
|
61
|
-
});
|
|
36
|
+
suggestions.push({ topic: m.metadata.topic, options: [opt(m.metadata.simple, "simple"), opt(m.metadata.clean, "clean")] });
|
|
62
37
|
break;
|
|
63
38
|
case "prisma-client-singleton":
|
|
64
|
-
suggestions.push({
|
|
65
|
-
topic: m.prismaClient.topic,
|
|
66
|
-
options: [opt(m.prismaClient.simple, "simple")],
|
|
67
|
-
});
|
|
39
|
+
suggestions.push({ topic: m.prismaClient.topic, options: [opt(m.prismaClient.simple, "simple")] });
|
|
68
40
|
break;
|
|
69
41
|
case "auth-session":
|
|
70
|
-
suggestions.push({
|
|
71
|
-
topic: m.authSession.topic,
|
|
72
|
-
options: [opt(m.authSession.simple, "simple"), opt(m.authSession.clean, "clean")],
|
|
73
|
-
});
|
|
42
|
+
suggestions.push({ topic: m.authSession.topic, options: [opt(m.authSession.simple, "simple"), opt(m.authSession.clean, "clean")] });
|
|
74
43
|
break;
|
|
75
44
|
case "env-validation":
|
|
76
|
-
suggestions.push({
|
|
77
|
-
topic: m.envValidation.topic,
|
|
78
|
-
options: [opt(m.envValidation.simple, "simple"), opt(m.envValidation.clean, "clean")],
|
|
79
|
-
});
|
|
45
|
+
suggestions.push({ topic: m.envValidation.topic, options: [opt(m.envValidation.simple, "simple"), opt(m.envValidation.clean, "clean")] });
|
|
80
46
|
break;
|
|
81
47
|
case "types-dir":
|
|
82
|
-
suggestions.push({
|
|
83
|
-
topic: m.typesDir.topic,
|
|
84
|
-
options: [opt(m.typesDir.simple, "simple")],
|
|
85
|
-
});
|
|
48
|
+
suggestions.push({ topic: m.typesDir.topic, options: [opt(m.typesDir.simple, "simple")] });
|
|
86
49
|
break;
|
|
87
50
|
case "store-organization":
|
|
88
|
-
suggestions.push({
|
|
89
|
-
topic: m.storeOrg.topic,
|
|
90
|
-
options: [opt(m.storeOrg.simple, "simple")],
|
|
91
|
-
});
|
|
51
|
+
suggestions.push({ topic: m.storeOrg.topic, options: [opt(m.storeOrg.simple, "simple")] });
|
|
92
52
|
break;
|
|
93
53
|
case "drizzle-schema-org":
|
|
94
|
-
suggestions.push({
|
|
95
|
-
topic: m.drizzleSchema.topic,
|
|
96
|
-
options: [opt(m.drizzleSchema.simple, "simple"), opt(m.drizzleSchema.clean, "clean")],
|
|
97
|
-
});
|
|
54
|
+
suggestions.push({ topic: m.drizzleSchema.topic, options: [opt(m.drizzleSchema.simple, "simple"), opt(m.drizzleSchema.clean, "clean")] });
|
|
98
55
|
break;
|
|
99
56
|
default:
|
|
100
57
|
suggestions.push({
|
|
101
58
|
topic: gap.message,
|
|
102
|
-
options: [
|
|
103
|
-
{
|
|
59
|
+
options: [{
|
|
104
60
|
level: "simple",
|
|
105
|
-
description:
|
|
61
|
+
description: `Address: ${gap.message}`,
|
|
106
62
|
pros: m.genericPros,
|
|
107
63
|
cons: m.genericCons,
|
|
108
64
|
claudeImpact: m.genericClaudeImpact,
|
|
109
|
-
},
|
|
110
|
-
],
|
|
65
|
+
}],
|
|
111
66
|
});
|
|
112
67
|
break;
|
|
113
68
|
}
|
|
@@ -119,31 +74,17 @@ export function registerSuggest(server) {
|
|
|
119
74
|
title: "Suggest Conventions",
|
|
120
75
|
description: "Given a repo analysis and detected gaps, proposes structured options (simple / clean / scalable) for each gap. Each option includes pros, cons, and impact on Claude Code behavior.",
|
|
121
76
|
inputSchema: {
|
|
122
|
-
analysis: z
|
|
123
|
-
|
|
124
|
-
.describe("JSON string of RepoAnalysis"),
|
|
125
|
-
gaps: z
|
|
126
|
-
.string()
|
|
127
|
-
.describe("JSON string of gaps array (output of detect-gaps)"),
|
|
128
|
-
language: z
|
|
129
|
-
.enum(["en", "fr"])
|
|
130
|
-
.optional()
|
|
131
|
-
.describe("Output language for suggestions (default: en)"),
|
|
77
|
+
analysis: z.string().describe("JSON string of RepoAnalysis"),
|
|
78
|
+
gaps: z.string().describe("JSON string of gaps array (output of detect-gaps)"),
|
|
132
79
|
},
|
|
133
|
-
}, async ({ analysis: analysisStr, gaps: gapsStr
|
|
80
|
+
}, async ({ analysis: analysisStr, gaps: gapsStr }) => {
|
|
134
81
|
try {
|
|
135
|
-
const locale = language ?? "en";
|
|
136
82
|
const analysis = JSON.parse(analysisStr);
|
|
137
83
|
const parsed = JSON.parse(gapsStr);
|
|
138
84
|
const gaps = Array.isArray(parsed) ? parsed : parsed.gaps;
|
|
139
|
-
const suggestions = buildSuggestions(analysis, gaps
|
|
85
|
+
const suggestions = buildSuggestions(analysis, gaps);
|
|
140
86
|
return {
|
|
141
|
-
content: [
|
|
142
|
-
{
|
|
143
|
-
type: "text",
|
|
144
|
-
text: JSON.stringify({ suggestions }, null, 2),
|
|
145
|
-
},
|
|
146
|
-
],
|
|
87
|
+
content: [{ type: "text", text: JSON.stringify({ suggestions }, null, 2) }],
|
|
147
88
|
};
|
|
148
89
|
}
|
|
149
90
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggest.js","sourceRoot":"","sources":["../../src/tools/suggest.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,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AA+B,OAAO,EAAE,EAAE,CAAC;aACrF,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-claude-md.d.ts","sourceRoot":"","sources":["../../src/tools/update-claude-md.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"update-claude-md.d.ts","sourceRoot":"","sources":["../../src/tools/update-claude-md.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAmCzE,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAoG9D"}
|
|
@@ -7,15 +7,13 @@ import { detectFramework, detectStack } from "../analyzers/detection.js";
|
|
|
7
7
|
import { analyzePatterns } from "../analyzers/patterns.js";
|
|
8
8
|
import { getConventions, getInterdictions, getActiveCrossRefs, } from "../rules/index.js";
|
|
9
9
|
import { generateClaudeMd } from "../templates/claude-md.js";
|
|
10
|
-
import { getMessages, interpolate } from "../i18n/index.js";
|
|
11
10
|
/**
|
|
12
11
|
* Extract user-added sections from an existing CLAUDE.md.
|
|
13
12
|
* Preserves "Project Decisions" and any section not generated by LeadCode.
|
|
14
13
|
*/
|
|
15
14
|
function extractUserChoices(existingContent) {
|
|
16
15
|
const choices = {};
|
|
17
|
-
|
|
18
|
-
const decisionsMatch = existingContent.match(/## (?:Project Decisions|Décisions du projet)\n+([\s\S]*?)(?=\n## |$)/);
|
|
16
|
+
const decisionsMatch = existingContent.match(/## Project Decisions\n+([\s\S]*?)(?=\n## |$)/);
|
|
19
17
|
if (decisionsMatch) {
|
|
20
18
|
const lines = decisionsMatch[1].trim().split("\n");
|
|
21
19
|
for (const line of lines) {
|
|
@@ -27,13 +25,6 @@ function extractUserChoices(existingContent) {
|
|
|
27
25
|
}
|
|
28
26
|
return choices;
|
|
29
27
|
}
|
|
30
|
-
/** Detect locale of existing CLAUDE.md by checking for French section headers */
|
|
31
|
-
function detectExistingLocale(content) {
|
|
32
|
-
if (content.includes("## Vue d'ensemble") || content.includes("## Stack technique") || content.includes("## Décisions du projet")) {
|
|
33
|
-
return "fr";
|
|
34
|
-
}
|
|
35
|
-
return "en";
|
|
36
|
-
}
|
|
37
28
|
export function registerUpdateClaudeMd(server) {
|
|
38
29
|
server.registerTool("update-claude-md", {
|
|
39
30
|
title: "Update CLAUDE.md",
|
|
@@ -42,38 +33,29 @@ export function registerUpdateClaudeMd(server) {
|
|
|
42
33
|
projectPath: z
|
|
43
34
|
.string()
|
|
44
35
|
.describe("Absolute path to the project root directory"),
|
|
45
|
-
language: z
|
|
46
|
-
.enum(["en", "fr"])
|
|
47
|
-
.optional()
|
|
48
|
-
.describe("Output language. If omitted, keeps the language of the existing CLAUDE.md (default: en for new files)"),
|
|
49
36
|
},
|
|
50
|
-
}, async ({ projectPath
|
|
37
|
+
}, async ({ projectPath }) => {
|
|
51
38
|
try {
|
|
52
39
|
// Verify project path
|
|
53
40
|
try {
|
|
54
41
|
await stat(projectPath);
|
|
55
42
|
}
|
|
56
43
|
catch {
|
|
57
|
-
const msg = getMessages(language ?? "en");
|
|
58
44
|
return {
|
|
59
45
|
isError: true,
|
|
60
|
-
content: [{ type: "text", text:
|
|
46
|
+
content: [{ type: "text", text: `Project directory not found: ${projectPath}` }],
|
|
61
47
|
};
|
|
62
48
|
}
|
|
63
49
|
const claudeMdPath = join(projectPath, "CLAUDE.md");
|
|
64
|
-
// Extract existing choices
|
|
50
|
+
// Extract existing choices if CLAUDE.md exists
|
|
65
51
|
let previousChoices = {};
|
|
66
|
-
let detectedLocale = "en";
|
|
67
52
|
try {
|
|
68
53
|
const existing = await readFile(claudeMdPath, "utf-8");
|
|
69
54
|
previousChoices = extractUserChoices(existing);
|
|
70
|
-
detectedLocale = detectExistingLocale(existing);
|
|
71
55
|
}
|
|
72
56
|
catch {
|
|
73
57
|
// No existing file — that's fine
|
|
74
58
|
}
|
|
75
|
-
const locale = language ?? detectedLocale;
|
|
76
|
-
const msg = getMessages(locale);
|
|
77
59
|
// Re-analyze
|
|
78
60
|
const pkg = await analyzeDependencies(projectPath);
|
|
79
61
|
const structure = await analyzeStructure(projectPath);
|
|
@@ -94,7 +76,7 @@ export function registerUpdateClaudeMd(server) {
|
|
|
94
76
|
const conventions = getConventions(analysis);
|
|
95
77
|
const interdictions = getInterdictions(analysis);
|
|
96
78
|
const crossRefs = getActiveCrossRefs(analysis);
|
|
97
|
-
const content = generateClaudeMd(analysis, conventions, interdictions, crossRefs, previousChoices, patterns
|
|
79
|
+
const content = generateClaudeMd(analysis, conventions, interdictions, crossRefs, previousChoices, patterns);
|
|
98
80
|
await writeFile(claudeMdPath, content, "utf-8");
|
|
99
81
|
return {
|
|
100
82
|
content: [
|
|
@@ -102,8 +84,7 @@ export function registerUpdateClaudeMd(server) {
|
|
|
102
84
|
type: "text",
|
|
103
85
|
text: JSON.stringify({
|
|
104
86
|
path: claudeMdPath,
|
|
105
|
-
message:
|
|
106
|
-
language: locale,
|
|
87
|
+
message: "CLAUDE.md updated successfully",
|
|
107
88
|
preservedChoices: Object.keys(previousChoices).length,
|
|
108
89
|
sections: {
|
|
109
90
|
conventions: conventions.length,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-claude-md.js","sourceRoot":"","sources":["../../src/tools/update-claude-md.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,2BAA2B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D,IAAI,EACJ,CAAC,CACF;qBACF;iBACF;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACjE,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,4BAA4B,OAAO,EAAE,EAAE,CAAC;aAClF,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-claude-md.d.ts","sourceRoot":"","sources":["../../src/tools/validate-claude-md.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"validate-claude-md.d.ts","sourceRoot":"","sources":["../../src/tools/validate-claude-md.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAmBzE,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAkJhE"}
|
|
@@ -5,7 +5,6 @@ import { analyzeDependencies } from "../analyzers/dependencies.js";
|
|
|
5
5
|
import { analyzeStructure } from "../analyzers/structure.js";
|
|
6
6
|
import { detectFramework, detectStack } from "../analyzers/detection.js";
|
|
7
7
|
import { getConventions, getActiveCrossRefs, detectGaps, } from "../rules/index.js";
|
|
8
|
-
import { getMessages, interpolate } from "../i18n/index.js";
|
|
9
8
|
export function registerValidateClaudeMd(server) {
|
|
10
9
|
server.registerTool("validate-claude-md", {
|
|
11
10
|
title: "Validate CLAUDE.md",
|
|
@@ -14,15 +13,9 @@ export function registerValidateClaudeMd(server) {
|
|
|
14
13
|
projectPath: z
|
|
15
14
|
.string()
|
|
16
15
|
.describe("Absolute path to the project root directory"),
|
|
17
|
-
language: z
|
|
18
|
-
.enum(["en", "fr"])
|
|
19
|
-
.optional()
|
|
20
|
-
.describe("Output language for validation messages (default: en)"),
|
|
21
16
|
},
|
|
22
|
-
}, async ({ projectPath
|
|
17
|
+
}, async ({ projectPath }) => {
|
|
23
18
|
try {
|
|
24
|
-
const locale = language ?? "en";
|
|
25
|
-
const msg = getMessages(locale);
|
|
26
19
|
const claudeMdPath = join(projectPath, "CLAUDE.md");
|
|
27
20
|
try {
|
|
28
21
|
await stat(claudeMdPath);
|
|
@@ -30,7 +23,7 @@ export function registerValidateClaudeMd(server) {
|
|
|
30
23
|
catch {
|
|
31
24
|
return {
|
|
32
25
|
isError: true,
|
|
33
|
-
content: [{ type: "text", text:
|
|
26
|
+
content: [{ type: "text", text: `No CLAUDE.md found at ${claudeMdPath}. Use generate-claude-md first.` }],
|
|
34
27
|
};
|
|
35
28
|
}
|
|
36
29
|
const claudeMd = await readFile(claudeMdPath, "utf-8");
|
|
@@ -58,28 +51,28 @@ export function registerValidateClaudeMd(server) {
|
|
|
58
51
|
drifts.push({
|
|
59
52
|
type: "outdated",
|
|
60
53
|
section: "Stack",
|
|
61
|
-
message:
|
|
54
|
+
message: `Framework version ${framework.version} not found in CLAUDE.md. Version may have been updated.`,
|
|
62
55
|
});
|
|
63
56
|
}
|
|
64
57
|
}
|
|
65
58
|
// Check for new techs not mentioned
|
|
66
59
|
const techFields = [
|
|
67
|
-
[
|
|
68
|
-
[
|
|
69
|
-
[
|
|
70
|
-
[
|
|
71
|
-
[
|
|
72
|
-
[
|
|
73
|
-
[
|
|
74
|
-
[
|
|
75
|
-
[
|
|
60
|
+
["ORM", detected.orm],
|
|
61
|
+
["Auth", detected.auth],
|
|
62
|
+
["Validation", detected.validation],
|
|
63
|
+
["CSS", detected.css],
|
|
64
|
+
["Testing", detected.testing],
|
|
65
|
+
["i18n", detected.i18n],
|
|
66
|
+
["Payments", detected.payments],
|
|
67
|
+
["State Management", detected.stateManagement],
|
|
68
|
+
["UI Components", detected.uiComponents],
|
|
76
69
|
];
|
|
77
70
|
for (const [label, value] of techFields) {
|
|
78
71
|
if (value && !claudeMd.toLowerCase().includes(value.toLowerCase())) {
|
|
79
72
|
drifts.push({
|
|
80
73
|
type: "missing",
|
|
81
74
|
section: "Stack",
|
|
82
|
-
message:
|
|
75
|
+
message: `${label}: ${value} is in the project but not mentioned in CLAUDE.md.`,
|
|
83
76
|
});
|
|
84
77
|
}
|
|
85
78
|
}
|
|
@@ -90,7 +83,7 @@ export function registerValidateClaudeMd(server) {
|
|
|
90
83
|
drifts.push({
|
|
91
84
|
type: "missing",
|
|
92
85
|
section: "Conventions",
|
|
93
|
-
message:
|
|
86
|
+
message: `Convention "${conv.description}" is applicable but not in CLAUDE.md.`,
|
|
94
87
|
});
|
|
95
88
|
}
|
|
96
89
|
}
|
|
@@ -102,7 +95,7 @@ export function registerValidateClaudeMd(server) {
|
|
|
102
95
|
drifts.push({
|
|
103
96
|
type: "missing",
|
|
104
97
|
section: "Cross-Stack Rules",
|
|
105
|
-
message:
|
|
98
|
+
message: `Cross-stack rule for ${combo} is applicable but not in CLAUDE.md.`,
|
|
106
99
|
});
|
|
107
100
|
}
|
|
108
101
|
}
|
|
@@ -113,7 +106,7 @@ export function registerValidateClaudeMd(server) {
|
|
|
113
106
|
drifts.push({
|
|
114
107
|
type: "missing",
|
|
115
108
|
section: "Gaps",
|
|
116
|
-
message:
|
|
109
|
+
message: `High-severity gap still exists: ${gap.message}`,
|
|
117
110
|
});
|
|
118
111
|
}
|
|
119
112
|
return {
|
|
@@ -125,8 +118,8 @@ export function registerValidateClaudeMd(server) {
|
|
|
125
118
|
drifts,
|
|
126
119
|
total: drifts.length,
|
|
127
120
|
summary: drifts.length === 0
|
|
128
|
-
?
|
|
129
|
-
:
|
|
121
|
+
? "CLAUDE.md is in sync with the project."
|
|
122
|
+
: `Found ${drifts.length} drift(s). Consider running generate-claude-md to update.`,
|
|
130
123
|
}, null, 2),
|
|
131
124
|
},
|
|
132
125
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-claude-md.js","sourceRoot":"","sources":["../../src/tools/validate-claude-md.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EACL,cAAc,EAEd,kBAAkB,EAClB,UAAU,GACX,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"validate-claude-md.js","sourceRoot":"","sources":["../../src/tools/validate-claude-md.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EACL,cAAc,EAEd,kBAAkB,EAClB,UAAU,GACX,MAAM,mBAAmB,CAAC;AAS3B,MAAM,UAAU,wBAAwB,CAAC,MAAiB;IACxD,MAAM,CAAC,YAAY,CACjB,oBAAoB,EACpB;QACE,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EACT,2JAA2J;QAC7J,WAAW,EAAE;YACX,WAAW,EAAE,CAAC;iBACX,MAAM,EAAE;iB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