agentbadge-core 0.1.0 → 0.1.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/LICENSE +21 -0
- package/dist/badge.js +20 -20
- package/dist/remediator.js +61 -61
- package/package.json +9 -7
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Emre Ceyhan
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/badge.js
CHANGED
|
@@ -29,26 +29,26 @@ function generateSvgBadge(score, tier, grade) {
|
|
|
29
29
|
const rightWidth = Math.max(80, rightText.length * 7 + 16);
|
|
30
30
|
const totalWidth = leftWidth + rightWidth;
|
|
31
31
|
const height = 20;
|
|
32
|
-
return `<svg xmlns="http://www.w3.org/2000/svg" width="${totalWidth}" height="${height}" role="img" aria-label="agentbadge: ${rightText}">
|
|
33
|
-
<title>agentbadge: ${rightText}</title>
|
|
34
|
-
<linearGradient id="s" x2="0" y2="100%">
|
|
35
|
-
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|
|
36
|
-
<stop offset="1" stop-opacity=".1"/>
|
|
37
|
-
</linearGradient>
|
|
38
|
-
<clipPath id="r">
|
|
39
|
-
<rect width="${totalWidth}" height="${height}" rx="3" fill="#fff"/>
|
|
40
|
-
</clipPath>
|
|
41
|
-
<g clip-path="url(#r)">
|
|
42
|
-
<rect width="${leftWidth}" height="${height}" fill="#1e293b"/>
|
|
43
|
-
<rect x="${leftWidth}" width="${rightWidth}" height="${height}" fill="${bg}"/>
|
|
44
|
-
<rect width="${totalWidth}" height="${height}" fill="url(#s)"/>
|
|
45
|
-
</g>
|
|
46
|
-
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110">
|
|
47
|
-
<text aria-hidden="true" x="${(leftWidth / 2) * 10}" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="${(leftWidth - 14) * 10}">agentbadge</text>
|
|
48
|
-
<text x="${(leftWidth / 2) * 10}" y="140" fill="#fff" transform="scale(.1)" textLength="${(leftWidth - 14) * 10}">agentbadge</text>
|
|
49
|
-
<text aria-hidden="true" x="${(leftWidth + rightWidth / 2) * 10}" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="${(rightWidth - 14) * 10}">${rightText}</text>
|
|
50
|
-
<text x="${(leftWidth + rightWidth / 2) * 10}" y="140" fill="${text}" transform="scale(.1)" textLength="${(rightWidth - 14) * 10}">${rightText}</text>
|
|
51
|
-
</g>
|
|
32
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="${totalWidth}" height="${height}" role="img" aria-label="agentbadge: ${rightText}">
|
|
33
|
+
<title>agentbadge: ${rightText}</title>
|
|
34
|
+
<linearGradient id="s" x2="0" y2="100%">
|
|
35
|
+
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|
|
36
|
+
<stop offset="1" stop-opacity=".1"/>
|
|
37
|
+
</linearGradient>
|
|
38
|
+
<clipPath id="r">
|
|
39
|
+
<rect width="${totalWidth}" height="${height}" rx="3" fill="#fff"/>
|
|
40
|
+
</clipPath>
|
|
41
|
+
<g clip-path="url(#r)">
|
|
42
|
+
<rect width="${leftWidth}" height="${height}" fill="#1e293b"/>
|
|
43
|
+
<rect x="${leftWidth}" width="${rightWidth}" height="${height}" fill="${bg}"/>
|
|
44
|
+
<rect width="${totalWidth}" height="${height}" fill="url(#s)"/>
|
|
45
|
+
</g>
|
|
46
|
+
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110">
|
|
47
|
+
<text aria-hidden="true" x="${(leftWidth / 2) * 10}" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="${(leftWidth - 14) * 10}">agentbadge</text>
|
|
48
|
+
<text x="${(leftWidth / 2) * 10}" y="140" fill="#fff" transform="scale(.1)" textLength="${(leftWidth - 14) * 10}">agentbadge</text>
|
|
49
|
+
<text aria-hidden="true" x="${(leftWidth + rightWidth / 2) * 10}" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="${(rightWidth - 14) * 10}">${rightText}</text>
|
|
50
|
+
<text x="${(leftWidth + rightWidth / 2) * 10}" y="140" fill="${text}" transform="scale(.1)" textLength="${(rightWidth - 14) * 10}">${rightText}</text>
|
|
51
|
+
</g>
|
|
52
52
|
</svg>`;
|
|
53
53
|
}
|
|
54
54
|
//# sourceMappingURL=badge.js.map
|
package/dist/remediator.js
CHANGED
|
@@ -18,75 +18,75 @@ function generateRemediationAgentsMd(scan, options) {
|
|
|
18
18
|
}
|
|
19
19
|
const missingItems = [];
|
|
20
20
|
if (scan.pillars.verification.score < scan.pillars.verification.maxScore) {
|
|
21
|
-
missingItems.push(`### Verification Fast Loops
|
|
22
|
-
Add/verify the following execution scripts:
|
|
23
|
-
\`\`\`bash
|
|
24
|
-
${runPrefix} type-check
|
|
25
|
-
${runPrefix} lint
|
|
26
|
-
${pm === 'npm' ? 'npm test' : `${pm} test`}
|
|
21
|
+
missingItems.push(`### Verification Fast Loops
|
|
22
|
+
Add/verify the following execution scripts:
|
|
23
|
+
\`\`\`bash
|
|
24
|
+
${runPrefix} type-check
|
|
25
|
+
${runPrefix} lint
|
|
26
|
+
${pm === 'npm' ? 'npm test' : `${pm} test`}
|
|
27
27
|
\`\`\``);
|
|
28
28
|
}
|
|
29
29
|
if (scan.pillars.setup.score < scan.pillars.setup.maxScore) {
|
|
30
|
-
missingItems.push(`### Setup & Secrets
|
|
31
|
-
Make sure required environment variables are copied from \`.env.example\`:
|
|
32
|
-
\`\`\`bash
|
|
33
|
-
cp .env.example .env
|
|
34
|
-
${installCmd}
|
|
30
|
+
missingItems.push(`### Setup & Secrets
|
|
31
|
+
Make sure required environment variables are copied from \`.env.example\`:
|
|
32
|
+
\`\`\`bash
|
|
33
|
+
cp .env.example .env
|
|
34
|
+
${installCmd}
|
|
35
35
|
\`\`\``);
|
|
36
36
|
}
|
|
37
|
-
return `${cleanExisting}
|
|
38
|
-
|
|
39
|
-
---
|
|
40
|
-
|
|
41
|
-
${PATCH_HEADER} — Score: ${scan.score}/100)
|
|
42
|
-
${missingItems.length > 0 ? missingItems.join('\n\n') : '- Codebase meets core verification and setup guardrails.'}
|
|
37
|
+
return `${cleanExisting}
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
${PATCH_HEADER} — Score: ${scan.score}/100)
|
|
42
|
+
${missingItems.length > 0 ? missingItems.join('\n\n') : '- Codebase meets core verification and setup guardrails.'}
|
|
43
43
|
`;
|
|
44
44
|
}
|
|
45
45
|
// Generate complete boilerplate if no AGENTS.md exists yet
|
|
46
|
-
return `# AGENTS.md — Repository Operating Instructions for AI Agents
|
|
47
|
-
|
|
48
|
-
> **Auto-generated by agentbadge audit.**
|
|
49
|
-
> This file gives AI coding agents (Claude Code, Cursor, Copilot, Codex, Devin) the direct context required to build, test, and navigate this codebase without hallucination.
|
|
50
|
-
|
|
51
|
-
---
|
|
52
|
-
|
|
53
|
-
## 1. Project Overview & Boundaries
|
|
54
|
-
- **Project Name:** ${scan.repoName || 'Project'}
|
|
55
|
-
- **Current Readiness Score:** ${scan.score}/100 (${scan.tier})
|
|
56
|
-
- **Architecture Philosophy:** Maintain strict typing, modular separation of concerns, and clean contracts.
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
## 2. Setup & Environment
|
|
61
|
-
Run these commands to prepare your local development environment:
|
|
62
|
-
\`\`\`bash
|
|
63
|
-
# Bootstrap dependencies
|
|
64
|
-
${installCmd}
|
|
65
|
-
cp .env.example .env
|
|
66
|
-
\`\`\`
|
|
67
|
-
|
|
68
|
-
---
|
|
69
|
-
|
|
70
|
-
## 3. Verification & Fast Feedback Loops
|
|
71
|
-
Always verify changes locally before committing:
|
|
72
|
-
\`\`\`bash
|
|
73
|
-
# 1. Type Check
|
|
74
|
-
${runPrefix} type-check
|
|
75
|
-
|
|
76
|
-
# 2. Linting
|
|
77
|
-
${runPrefix} lint
|
|
78
|
-
|
|
79
|
-
# 3. Automated Tests
|
|
80
|
-
${pm === 'npm' ? 'npm test' : `${pm} test`}
|
|
81
|
-
\`\`\`
|
|
82
|
-
|
|
83
|
-
---
|
|
84
|
-
|
|
85
|
-
## 4. Key Rules for Agents
|
|
86
|
-
- **Zero \`any\` policy:** Explicit typing only.
|
|
87
|
-
- **Fail fast:** Run verification commands after modifying code.
|
|
88
|
-
- **Do not bypass git hooks or CI checks.**
|
|
89
|
-
- Document all architectural decisions and API models explicitly.
|
|
46
|
+
return `# AGENTS.md — Repository Operating Instructions for AI Agents
|
|
47
|
+
|
|
48
|
+
> **Auto-generated by agentbadge audit.**
|
|
49
|
+
> This file gives AI coding agents (Claude Code, Cursor, Copilot, Codex, Devin) the direct context required to build, test, and navigate this codebase without hallucination.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## 1. Project Overview & Boundaries
|
|
54
|
+
- **Project Name:** ${scan.repoName || 'Project'}
|
|
55
|
+
- **Current Readiness Score:** ${scan.score}/100 (${scan.tier})
|
|
56
|
+
- **Architecture Philosophy:** Maintain strict typing, modular separation of concerns, and clean contracts.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## 2. Setup & Environment
|
|
61
|
+
Run these commands to prepare your local development environment:
|
|
62
|
+
\`\`\`bash
|
|
63
|
+
# Bootstrap dependencies
|
|
64
|
+
${installCmd}
|
|
65
|
+
cp .env.example .env
|
|
66
|
+
\`\`\`
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## 3. Verification & Fast Feedback Loops
|
|
71
|
+
Always verify changes locally before committing:
|
|
72
|
+
\`\`\`bash
|
|
73
|
+
# 1. Type Check
|
|
74
|
+
${runPrefix} type-check
|
|
75
|
+
|
|
76
|
+
# 2. Linting
|
|
77
|
+
${runPrefix} lint
|
|
78
|
+
|
|
79
|
+
# 3. Automated Tests
|
|
80
|
+
${pm === 'npm' ? 'npm test' : `${pm} test`}
|
|
81
|
+
\`\`\`
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 4. Key Rules for Agents
|
|
86
|
+
- **Zero \`any\` policy:** Explicit typing only.
|
|
87
|
+
- **Fail fast:** Run verification commands after modifying code.
|
|
88
|
+
- **Do not bypass git hooks or CI checks.**
|
|
89
|
+
- Document all architectural decisions and API models explicitly.
|
|
90
90
|
`;
|
|
91
91
|
}
|
|
92
92
|
//# sourceMappingURL=remediator.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentbadge-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Core deterministic scanning engine and rule evaluator for agent readiness",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Emre Ceyhan",
|
|
@@ -12,15 +12,17 @@
|
|
|
12
12
|
"homepage": "https://agentbadge.emreceyhan.xyz",
|
|
13
13
|
"main": "dist/index.js",
|
|
14
14
|
"types": "dist/index.d.ts",
|
|
15
|
-
"files": [
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@types/node": "^22.10.2",
|
|
20
|
+
"typescript": "^5.7.2"
|
|
21
|
+
},
|
|
16
22
|
"scripts": {
|
|
17
23
|
"build": "tsc",
|
|
18
24
|
"test": "node --test dist/**/*.test.js",
|
|
19
25
|
"lint": "tsc --noEmit",
|
|
20
26
|
"type-check": "tsc --noEmit"
|
|
21
|
-
},
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"@types/node": "^22.10.2",
|
|
24
|
-
"typescript": "^5.7.2"
|
|
25
27
|
}
|
|
26
|
-
}
|
|
28
|
+
}
|