@netanelyasi/agent-ready 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +457 -0
- package/dist/analyzers/scoreReadiness.d.ts +2 -0
- package/dist/analyzers/scoreReadiness.js +49 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +73 -0
- package/dist/generators/generate.d.ts +2 -0
- package/dist/generators/generate.js +482 -0
- package/dist/scanner/scanProject.d.ts +2 -0
- package/dist/scanner/scanProject.js +544 -0
- package/dist/types.d.ts +97 -0
- package/dist/types.js +1 -0
- package/dist/utils/fs.d.ts +12 -0
- package/dist/utils/fs.js +102 -0
- package/package.json +51 -0
package/dist/utils/fs.js
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { promises as fs } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
export const DEFAULT_IGNORES = new Set([
|
|
4
|
+
".git",
|
|
5
|
+
"node_modules",
|
|
6
|
+
".next",
|
|
7
|
+
".nuxt",
|
|
8
|
+
"dist",
|
|
9
|
+
"build",
|
|
10
|
+
"coverage",
|
|
11
|
+
".turbo",
|
|
12
|
+
".agent-ready",
|
|
13
|
+
".claude",
|
|
14
|
+
".cache",
|
|
15
|
+
".venv",
|
|
16
|
+
"venv",
|
|
17
|
+
"__pycache__",
|
|
18
|
+
"vendor",
|
|
19
|
+
"target",
|
|
20
|
+
"bin",
|
|
21
|
+
"obj",
|
|
22
|
+
]);
|
|
23
|
+
export async function pathExists(filePath) {
|
|
24
|
+
try {
|
|
25
|
+
await fs.access(filePath);
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export async function readJson(filePath) {
|
|
33
|
+
try {
|
|
34
|
+
return JSON.parse(await fs.readFile(filePath, "utf8"));
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export async function readText(filePath) {
|
|
41
|
+
try {
|
|
42
|
+
return await fs.readFile(filePath, "utf8");
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export async function safeWriteFile(filePath, content, force) {
|
|
49
|
+
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
50
|
+
if (force || !(await pathExists(filePath))) {
|
|
51
|
+
const existed = await pathExists(filePath);
|
|
52
|
+
await fs.writeFile(filePath, content, "utf8");
|
|
53
|
+
return existed ? "overwritten" : "created";
|
|
54
|
+
}
|
|
55
|
+
const proposedPath = `${filePath}.agent-ready-proposed`;
|
|
56
|
+
await fs.writeFile(proposedPath, content, "utf8");
|
|
57
|
+
return "proposed";
|
|
58
|
+
}
|
|
59
|
+
export async function listDirSafe(dir) {
|
|
60
|
+
try {
|
|
61
|
+
return await fs.readdir(dir);
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
return [];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export async function walkFiles(root, options) {
|
|
68
|
+
const maxDepth = options?.maxDepth ?? 5;
|
|
69
|
+
const maxFiles = options?.maxFiles ?? 3000;
|
|
70
|
+
const includeHidden = options?.includeHidden ?? true;
|
|
71
|
+
const out = [];
|
|
72
|
+
async function walk(current, depth) {
|
|
73
|
+
if (out.length >= maxFiles || depth > maxDepth)
|
|
74
|
+
return;
|
|
75
|
+
let entries;
|
|
76
|
+
try {
|
|
77
|
+
entries = await fs.readdir(current, { withFileTypes: true });
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
for (const entry of entries) {
|
|
83
|
+
if (out.length >= maxFiles)
|
|
84
|
+
return;
|
|
85
|
+
if (!includeHidden && entry.name.startsWith("."))
|
|
86
|
+
continue;
|
|
87
|
+
if (entry.isDirectory() && DEFAULT_IGNORES.has(entry.name))
|
|
88
|
+
continue;
|
|
89
|
+
const full = path.join(current, entry.name);
|
|
90
|
+
if (entry.isDirectory())
|
|
91
|
+
await walk(full, depth + 1);
|
|
92
|
+
else if (entry.isFile())
|
|
93
|
+
out.push(full);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
await walk(root, 0);
|
|
97
|
+
return out;
|
|
98
|
+
}
|
|
99
|
+
export function rel(root, target) {
|
|
100
|
+
const relative = path.relative(root, target).replaceAll(path.sep, "/");
|
|
101
|
+
return relative || ".";
|
|
102
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@netanelyasi/agent-ready",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Generate an AI-agent harness for any codebase: CLAUDE.md, CODEMAP.md, skills, ignore rules, and readiness reports.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"agent-ready": "dist/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"README.md",
|
|
12
|
+
"LICENSE"
|
|
13
|
+
],
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": ">=20"
|
|
16
|
+
},
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc -p tsconfig.json",
|
|
22
|
+
"dev": "tsx src/cli.ts",
|
|
23
|
+
"check": "tsc -p tsconfig.json --noEmit",
|
|
24
|
+
"lint": "tsc -p tsconfig.json --noEmit",
|
|
25
|
+
"test": "npm run build && node --test tests/*.test.mjs",
|
|
26
|
+
"prepack": "npm run build",
|
|
27
|
+
"prepublishOnly": "npm run check && npm test"
|
|
28
|
+
},
|
|
29
|
+
"keywords": [
|
|
30
|
+
"ai-agents",
|
|
31
|
+
"claude-code",
|
|
32
|
+
"codemap",
|
|
33
|
+
"developer-tools",
|
|
34
|
+
"cli"
|
|
35
|
+
],
|
|
36
|
+
"author": "BrainboxAI",
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "git+https://github.com/Brainboxai-IL/agent-ready.git"
|
|
41
|
+
},
|
|
42
|
+
"bugs": {
|
|
43
|
+
"url": "https://github.com/Brainboxai-IL/agent-ready/issues"
|
|
44
|
+
},
|
|
45
|
+
"homepage": "https://github.com/Brainboxai-IL/agent-ready#readme",
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@types/node": "latest",
|
|
48
|
+
"tsx": "latest",
|
|
49
|
+
"typescript": "latest"
|
|
50
|
+
}
|
|
51
|
+
}
|