agents-md-gen 0.7.0 → 0.8.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/CHANGELOG.md +6 -0
- package/README.md +3 -0
- package/package.json +5 -1
- package/src/detect.js +78 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -65,6 +65,9 @@ docker run --rm -v "$PWD":/workdir ghcr.io/peshino2012/agents-md-gen
|
|
|
65
65
|
- **Swift** — Swift Package Manager, XCTest detection
|
|
66
66
|
- **Dart/Flutter** — pub, `flutter test`/`dart test` detection
|
|
67
67
|
- **Elixir** — Mix, Phoenix framework detection, ExUnit
|
|
68
|
+
- **C/C++** — CMake, Make, CTest detection
|
|
69
|
+
- **Haskell** — Stack, Cabal
|
|
70
|
+
- **Scala** — sbt
|
|
68
71
|
- **Monorepos** — Turborepo, Nx, Lerna, Rush, npm/yarn/pnpm workspaces,
|
|
69
72
|
listing each detected sub-package
|
|
70
73
|
- CI (GitHub Actions), license, and top-level project structure
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agents-md-gen",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Generate a solid AGENTS.md / CLAUDE.md for any repo by detecting its stack, commands, and structure",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"funding": {
|
|
@@ -48,6 +48,10 @@
|
|
|
48
48
|
"flutter",
|
|
49
49
|
"elixir",
|
|
50
50
|
"phoenix",
|
|
51
|
+
"cmake",
|
|
52
|
+
"cpp",
|
|
53
|
+
"haskell",
|
|
54
|
+
"scala",
|
|
51
55
|
"cli",
|
|
52
56
|
"codegen",
|
|
53
57
|
"developer-tools"
|
package/src/detect.js
CHANGED
|
@@ -229,6 +229,83 @@ function detectRuby(root) {
|
|
|
229
229
|
};
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
+
function detectCpp(root) {
|
|
233
|
+
const hasCMake = exists(root, 'CMakeLists.txt');
|
|
234
|
+
const hasMakefile = exists(root, 'Makefile') || exists(root, 'makefile');
|
|
235
|
+
if (!hasCMake && !hasMakefile) return null;
|
|
236
|
+
|
|
237
|
+
const cmakeText = hasCMake ? (readText(root, 'CMakeLists.txt') || '') : '';
|
|
238
|
+
const nameMatch = cmakeText.match(/project\s*\(\s*([^\s)]+)/i);
|
|
239
|
+
const usesCtest = hasCMake && /enable_testing|add_test/i.test(cmakeText);
|
|
240
|
+
|
|
241
|
+
return {
|
|
242
|
+
ecosystem: 'C/C++',
|
|
243
|
+
name: nameMatch ? nameMatch[1] : null,
|
|
244
|
+
description: null,
|
|
245
|
+
packageManager: hasCMake ? 'cmake' : 'make',
|
|
246
|
+
frameworks: [],
|
|
247
|
+
testFramework: usesCtest ? 'CTest' : null,
|
|
248
|
+
commands: {
|
|
249
|
+
install: null,
|
|
250
|
+
build: hasCMake ? 'cmake -B build && cmake --build build' : 'make',
|
|
251
|
+
test: usesCtest ? 'ctest --test-dir build' : null,
|
|
252
|
+
lint: null,
|
|
253
|
+
dev: null,
|
|
254
|
+
},
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
function detectHaskell(root) {
|
|
259
|
+
const hasStack = exists(root, 'stack.yaml');
|
|
260
|
+
const cabalFile = (() => {
|
|
261
|
+
try {
|
|
262
|
+
return fs.readdirSync(root).find((f) => f.endsWith('.cabal'));
|
|
263
|
+
} catch {
|
|
264
|
+
return null;
|
|
265
|
+
}
|
|
266
|
+
})();
|
|
267
|
+
if (!hasStack && !cabalFile) return null;
|
|
268
|
+
|
|
269
|
+
return {
|
|
270
|
+
ecosystem: 'Haskell',
|
|
271
|
+
name: cabalFile ? cabalFile.replace(/\.cabal$/, '') : null,
|
|
272
|
+
description: null,
|
|
273
|
+
packageManager: hasStack ? 'stack' : 'cabal',
|
|
274
|
+
frameworks: [],
|
|
275
|
+
testFramework: null,
|
|
276
|
+
commands: {
|
|
277
|
+
install: hasStack ? 'stack setup' : 'cabal build --only-dependencies',
|
|
278
|
+
build: hasStack ? 'stack build' : 'cabal build',
|
|
279
|
+
test: hasStack ? 'stack test' : 'cabal test',
|
|
280
|
+
lint: exists(root, '.hlint.yaml') ? 'hlint .' : null,
|
|
281
|
+
dev: null,
|
|
282
|
+
},
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
function detectScala(root) {
|
|
287
|
+
const hasSbt = exists(root, 'build.sbt');
|
|
288
|
+
if (!hasSbt) return null;
|
|
289
|
+
const sbtText = readText(root, 'build.sbt') || '';
|
|
290
|
+
const nameMatch = sbtText.match(/name\s*:=\s*"([^"]+)"/);
|
|
291
|
+
|
|
292
|
+
return {
|
|
293
|
+
ecosystem: 'Scala',
|
|
294
|
+
name: nameMatch ? nameMatch[1] : null,
|
|
295
|
+
description: null,
|
|
296
|
+
packageManager: 'sbt',
|
|
297
|
+
frameworks: [],
|
|
298
|
+
testFramework: /scalatest|munit|specs2/i.test(sbtText) ? 'sbt test' : null,
|
|
299
|
+
commands: {
|
|
300
|
+
install: null,
|
|
301
|
+
build: 'sbt compile',
|
|
302
|
+
test: 'sbt test',
|
|
303
|
+
lint: null,
|
|
304
|
+
dev: null,
|
|
305
|
+
},
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
|
|
232
309
|
function detectDart(root) {
|
|
233
310
|
const pubspec = readText(root, 'pubspec.yaml');
|
|
234
311
|
if (!pubspec) return null;
|
|
@@ -478,7 +555,7 @@ function detectMonorepo(root) {
|
|
|
478
555
|
}
|
|
479
556
|
|
|
480
557
|
function detectProject(root) {
|
|
481
|
-
const detectors = [detectNode, detectPython, detectRust, detectGo, detectRuby, detectJava, detectPhp, detectDotnet, detectSwift, detectDart, detectElixir];
|
|
558
|
+
const detectors = [detectNode, detectPython, detectRust, detectGo, detectRuby, detectJava, detectPhp, detectDotnet, detectSwift, detectDart, detectElixir, detectCpp, detectHaskell, detectScala];
|
|
482
559
|
const stacks = detectors.map((fn) => fn(root)).filter(Boolean);
|
|
483
560
|
|
|
484
561
|
return {
|