claudecode-linter 2.1.71 → 2.1.73
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/dist/contracts.js +1 -1
- package/dist/linters/agent-md.js +17 -11
- package/package.json +1 -1
package/dist/contracts.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Auto-generated from contracts/claude-code-contracts.json
|
|
2
|
-
// Claude Code v2.1.
|
|
2
|
+
// Claude Code v2.1.73 — extracted 2026-03-11T18:26:22.169Z
|
|
3
3
|
// Do not edit manually. Run: npm run generate-contracts
|
|
4
4
|
export const TOOLS = new Set([
|
|
5
5
|
"Agent",
|
package/dist/linters/agent-md.js
CHANGED
|
@@ -32,8 +32,10 @@ export const agentMdLinter = {
|
|
|
32
32
|
artifactType: "agent-md",
|
|
33
33
|
lint(filePath, content, config) {
|
|
34
34
|
const diagnostics = [];
|
|
35
|
-
const push = (d) => {
|
|
36
|
-
|
|
35
|
+
const push = (d) => {
|
|
36
|
+
if (d)
|
|
37
|
+
diagnostics.push(d);
|
|
38
|
+
};
|
|
37
39
|
const fm = parseFrontmatter(content);
|
|
38
40
|
if (!fm.valid) {
|
|
39
41
|
push(diag(config, filePath, "agent-md/valid-frontmatter", "error", fm.error ?? "Invalid frontmatter"));
|
|
@@ -41,17 +43,20 @@ export const agentMdLinter = {
|
|
|
41
43
|
}
|
|
42
44
|
// name
|
|
43
45
|
if (!("name" in fm.data) || typeof fm.data.name !== "string") {
|
|
44
|
-
push(diag(config, filePath, "agent-md/name-required", "error", "
|
|
46
|
+
push(diag(config, filePath, "agent-md/name-required", "error", '"name" is required in frontmatter'));
|
|
45
47
|
}
|
|
46
48
|
else {
|
|
47
49
|
const name = fm.data.name;
|
|
48
|
-
if (!/^[a-z][a-z0-9-]*[a-z0-9]$/.test(name) ||
|
|
50
|
+
if (!/^[a-z][a-z0-9-]*[a-z0-9]$/.test(name) ||
|
|
51
|
+
name.length < 3 ||
|
|
52
|
+
name.length > 50) {
|
|
49
53
|
push(diag(config, filePath, "agent-md/name-format", "error", `"name" must be 3-50 chars, lowercase alphanumeric + hyphens (got "${name}")`));
|
|
50
54
|
}
|
|
51
55
|
}
|
|
52
56
|
// description
|
|
53
|
-
if (!("description" in fm.data) ||
|
|
54
|
-
|
|
57
|
+
if (!("description" in fm.data) ||
|
|
58
|
+
typeof fm.data.description !== "string") {
|
|
59
|
+
push(diag(config, filePath, "agent-md/description-required", "error", '"description" is required in frontmatter'));
|
|
55
60
|
}
|
|
56
61
|
else {
|
|
57
62
|
if (!/<example>/i.test(fm.data.description)) {
|
|
@@ -60,14 +65,15 @@ export const agentMdLinter = {
|
|
|
60
65
|
}
|
|
61
66
|
// model
|
|
62
67
|
if (!("model" in fm.data) || typeof fm.data.model !== "string") {
|
|
63
|
-
push(diag(config, filePath, "agent-md/model-required", "error", "
|
|
68
|
+
push(diag(config, filePath, "agent-md/model-required", "error", '"model" is required in frontmatter'));
|
|
64
69
|
}
|
|
65
|
-
else if (!AGENT_MODELS.has(fm.data.model)
|
|
66
|
-
|
|
70
|
+
else if (!AGENT_MODELS.has(fm.data.model) &&
|
|
71
|
+
!fm.data.model.startsWith("claude-")) {
|
|
72
|
+
push(diag(config, filePath, "agent-md/model-valid", "warning", `"model" must be one of: ${[...AGENT_MODELS].join(", ")} or a versioned claude-* model ID (got "${fm.data.model}")`));
|
|
67
73
|
}
|
|
68
74
|
// color
|
|
69
75
|
if (!("color" in fm.data) || typeof fm.data.color !== "string") {
|
|
70
|
-
push(diag(config, filePath, "agent-md/color-required", "error", "
|
|
76
|
+
push(diag(config, filePath, "agent-md/color-required", "error", '"color" is required in frontmatter'));
|
|
71
77
|
}
|
|
72
78
|
else if (!AGENT_COLORS.has(fm.data.color)) {
|
|
73
79
|
push(diag(config, filePath, "agent-md/color-valid", "warning", `"color" must be one of: ${[...AGENT_COLORS].join(", ")} (got "${fm.data.color}")`));
|
|
@@ -89,7 +95,7 @@ export const agentMdLinter = {
|
|
|
89
95
|
push(diag(config, filePath, "agent-md/system-prompt-length", "warning", `System prompt is very short (${body.length} chars, recommended >= 20)`, fm.bodyStartLine));
|
|
90
96
|
}
|
|
91
97
|
if (!/\byou\b/i.test(body)) {
|
|
92
|
-
push(diag(config, filePath, "agent-md/system-prompt-second-person", "info",
|
|
98
|
+
push(diag(config, filePath, "agent-md/system-prompt-second-person", "info", 'System prompt should use second person ("You are...", "You will...")', fm.bodyStartLine));
|
|
93
99
|
}
|
|
94
100
|
}
|
|
95
101
|
return diagnostics;
|