agents-md-gen 0.6.1 → 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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.8.0
4
+
5
+ - Detect C/C++ projects (CMake/Make, CTest detection).
6
+ - Detect Haskell projects (Stack/Cabal).
7
+ - Detect Scala projects (sbt).
8
+
9
+ ## 0.7.0
10
+
11
+ - Detect Dart/Flutter projects (`pubspec.yaml`, Flutter vs. plain
12
+ Dart, `flutter test`/`dart test`).
13
+ - Detect Elixir projects (`mix.exs`, Phoenix framework detection,
14
+ ExUnit).
15
+
3
16
  ## 0.6.1
4
17
 
5
18
  - Detect Rush monorepos (`rush.json`, including the `//` line
package/README.md CHANGED
@@ -63,6 +63,11 @@ docker run --rm -v "$PWD":/workdir ghcr.io/peshino2012/agents-md-gen
63
63
  - **PHP** — Composer, Laravel/Symfony detection, PHPUnit
64
64
  - **.NET/C#** — NuGet, xUnit/NUnit/MSTest detection
65
65
  - **Swift** — Swift Package Manager, XCTest detection
66
+ - **Dart/Flutter** — pub, `flutter test`/`dart test` detection
67
+ - **Elixir** — Mix, Phoenix framework detection, ExUnit
68
+ - **C/C++** — CMake, Make, CTest detection
69
+ - **Haskell** — Stack, Cabal
70
+ - **Scala** — sbt
66
71
  - **Monorepos** — Turborepo, Nx, Lerna, Rush, npm/yarn/pnpm workspaces,
67
72
  listing each detected sub-package
68
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.6.1",
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": {
@@ -44,6 +44,14 @@
44
44
  "csharp",
45
45
  "swift",
46
46
  "swiftpm",
47
+ "dart",
48
+ "flutter",
49
+ "elixir",
50
+ "phoenix",
51
+ "cmake",
52
+ "cpp",
53
+ "haskell",
54
+ "scala",
47
55
  "cli",
48
56
  "codegen",
49
57
  "developer-tools"
package/src/detect.js CHANGED
@@ -229,6 +229,128 @@ 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
+
309
+ function detectDart(root) {
310
+ const pubspec = readText(root, 'pubspec.yaml');
311
+ if (!pubspec) return null;
312
+ const nameMatch = pubspec.match(/^name:\s*(\S+)/m);
313
+ const isFlutter = /^\s*flutter:/m.test(pubspec) || /flutter:\s*\n\s*sdk:\s*flutter/.test(pubspec);
314
+
315
+ return {
316
+ ecosystem: isFlutter ? 'Flutter' : 'Dart',
317
+ name: nameMatch ? nameMatch[1] : null,
318
+ description: null,
319
+ packageManager: 'pub',
320
+ frameworks: [],
321
+ testFramework: exists(root, 'test') ? 'test' : null,
322
+ commands: {
323
+ install: 'dart pub get',
324
+ build: isFlutter ? 'flutter build' : null,
325
+ test: isFlutter ? 'flutter test' : 'dart test',
326
+ lint: 'dart analyze',
327
+ dev: isFlutter ? 'flutter run' : null,
328
+ },
329
+ };
330
+ }
331
+
332
+ function detectElixir(root) {
333
+ const mixExs = readText(root, 'mix.exs');
334
+ if (!mixExs) return null;
335
+ const nameMatch = mixExs.match(/app:\s*:(\w+)/);
336
+
337
+ return {
338
+ ecosystem: 'Elixir',
339
+ name: nameMatch ? nameMatch[1] : null,
340
+ description: null,
341
+ packageManager: 'mix',
342
+ frameworks: /phoenix/i.test(mixExs) ? ['Phoenix'] : [],
343
+ testFramework: exists(root, 'test') ? 'ExUnit' : null,
344
+ commands: {
345
+ install: 'mix deps.get',
346
+ build: 'mix compile',
347
+ test: exists(root, 'test') ? 'mix test' : null,
348
+ lint: exists(root, '.credo.exs') ? 'mix credo' : null,
349
+ dev: null,
350
+ },
351
+ };
352
+ }
353
+
232
354
  function detectSwift(root) {
233
355
  const manifest = readText(root, 'Package.swift');
234
356
  if (!manifest) return null;
@@ -433,7 +555,7 @@ function detectMonorepo(root) {
433
555
  }
434
556
 
435
557
  function detectProject(root) {
436
- const detectors = [detectNode, detectPython, detectRust, detectGo, detectRuby, detectJava, detectPhp, detectDotnet, detectSwift];
558
+ const detectors = [detectNode, detectPython, detectRust, detectGo, detectRuby, detectJava, detectPhp, detectDotnet, detectSwift, detectDart, detectElixir, detectCpp, detectHaskell, detectScala];
437
559
  const stacks = detectors.map((fn) => fn(root)).filter(Boolean);
438
560
 
439
561
  return {