agents-md-gen 0.7.0 → 0.9.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.9.0
4
+
5
+ - Point `funding`/homepage links at the public npm page (they pointed at
6
+ a private GitHub repo, so anyone clicking them got a 404).
7
+ - Detect Zig projects (`build.zig`, name from `build.zig.zon`).
8
+ - Detect Julia projects (`Project.toml`, `test/runtests.jl`).
9
+
10
+ ## 0.8.0
11
+
12
+ - Detect C/C++ projects (CMake/Make, CTest detection).
13
+ - Detect Haskell projects (Stack/Cabal).
14
+ - Detect Scala projects (sbt).
15
+
3
16
  ## 0.7.0
4
17
 
5
18
  - Detect Dart/Flutter projects (`pubspec.yaml`, Flutter vs. plain
package/README.md CHANGED
@@ -65,6 +65,11 @@ 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
71
+ - **Zig** — `build.zig`/`build.zig.zon`
72
+ - **Julia** — `Project.toml`, Pkg test detection
68
73
  - **Monorepos** — Turborepo, Nx, Lerna, Rush, npm/yarn/pnpm workspaces,
69
74
  listing each detected sub-package
70
75
  - CI (GitHub Actions), license, and top-level project structure
@@ -126,6 +131,8 @@ this package's own repo:
126
131
  ## Structure
127
132
 
128
133
  - `.github/` — GitHub config (CI, templates)
134
+ - `CHANGELOG.md`
135
+ - `Dockerfile`
129
136
  - `LICENSE`
130
137
  - `README.md`
131
138
  - `bin/` — CLI entry points
@@ -137,6 +144,7 @@ this package's own repo:
137
144
 
138
145
  - CI: GitHub Actions (test.yml)
139
146
  - License: MIT
147
+ - Docker: Dockerfile
140
148
  ````
141
149
 
142
150
  ## Why
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "agents-md-gen",
3
- "version": "0.7.0",
3
+ "version": "0.9.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": {
7
7
  "type": "individual",
8
- "url": "https://github.com/Peshino2012/PD1/tree/main/agents-md-gen#readme"
8
+ "url": "https://www.npmjs.com/package/agents-md-gen"
9
9
  },
10
10
  "bin": {
11
11
  "agents-md-gen": "bin/cli.js"
@@ -48,6 +48,12 @@
48
48
  "flutter",
49
49
  "elixir",
50
50
  "phoenix",
51
+ "cmake",
52
+ "cpp",
53
+ "haskell",
54
+ "scala",
55
+ "zig",
56
+ "julia",
51
57
  "cli",
52
58
  "codegen",
53
59
  "developer-tools"
package/src/detect.js CHANGED
@@ -229,6 +229,128 @@ function detectRuby(root) {
229
229
  };
230
230
  }
231
231
 
232
+ function detectZig(root) {
233
+ const buildZig = readText(root, 'build.zig');
234
+ if (!buildZig) return null;
235
+ const nameMatch = readText(root, 'build.zig.zon');
236
+ const zonNameMatch = nameMatch ? nameMatch.match(/\.name\s*=\s*\.?([A-Za-z0-9_]+)/) : null;
237
+
238
+ return {
239
+ ecosystem: 'Zig',
240
+ name: zonNameMatch ? zonNameMatch[1] : null,
241
+ description: null,
242
+ packageManager: 'zig',
243
+ frameworks: [],
244
+ testFramework: /test\s*\{/.test(buildZig) ? 'zig test' : null,
245
+ commands: {
246
+ install: null,
247
+ build: 'zig build',
248
+ test: 'zig build test',
249
+ lint: 'zig fmt --check .',
250
+ dev: null,
251
+ },
252
+ };
253
+ }
254
+
255
+ function detectJulia(root) {
256
+ const projectToml = readText(root, 'Project.toml');
257
+ if (!projectToml) return null;
258
+ const nameMatch = projectToml.match(/^name\s*=\s*"([^"]+)"/m);
259
+
260
+ return {
261
+ ecosystem: 'Julia',
262
+ name: nameMatch ? nameMatch[1] : null,
263
+ description: null,
264
+ packageManager: 'Pkg',
265
+ frameworks: [],
266
+ testFramework: exists(root, 'test', 'runtests.jl') ? 'Test' : null,
267
+ commands: {
268
+ install: 'julia --project -e "using Pkg; Pkg.instantiate()"',
269
+ build: null,
270
+ test: exists(root, 'test', 'runtests.jl') ? 'julia --project -e "using Pkg; Pkg.test()"' : null,
271
+ lint: null,
272
+ dev: null,
273
+ },
274
+ };
275
+ }
276
+
277
+ function detectCpp(root) {
278
+ const hasCMake = exists(root, 'CMakeLists.txt');
279
+ const hasMakefile = exists(root, 'Makefile') || exists(root, 'makefile');
280
+ if (!hasCMake && !hasMakefile) return null;
281
+
282
+ const cmakeText = hasCMake ? (readText(root, 'CMakeLists.txt') || '') : '';
283
+ const nameMatch = cmakeText.match(/project\s*\(\s*([^\s)]+)/i);
284
+ const usesCtest = hasCMake && /enable_testing|add_test/i.test(cmakeText);
285
+
286
+ return {
287
+ ecosystem: 'C/C++',
288
+ name: nameMatch ? nameMatch[1] : null,
289
+ description: null,
290
+ packageManager: hasCMake ? 'cmake' : 'make',
291
+ frameworks: [],
292
+ testFramework: usesCtest ? 'CTest' : null,
293
+ commands: {
294
+ install: null,
295
+ build: hasCMake ? 'cmake -B build && cmake --build build' : 'make',
296
+ test: usesCtest ? 'ctest --test-dir build' : null,
297
+ lint: null,
298
+ dev: null,
299
+ },
300
+ };
301
+ }
302
+
303
+ function detectHaskell(root) {
304
+ const hasStack = exists(root, 'stack.yaml');
305
+ const cabalFile = (() => {
306
+ try {
307
+ return fs.readdirSync(root).find((f) => f.endsWith('.cabal'));
308
+ } catch {
309
+ return null;
310
+ }
311
+ })();
312
+ if (!hasStack && !cabalFile) return null;
313
+
314
+ return {
315
+ ecosystem: 'Haskell',
316
+ name: cabalFile ? cabalFile.replace(/\.cabal$/, '') : null,
317
+ description: null,
318
+ packageManager: hasStack ? 'stack' : 'cabal',
319
+ frameworks: [],
320
+ testFramework: null,
321
+ commands: {
322
+ install: hasStack ? 'stack setup' : 'cabal build --only-dependencies',
323
+ build: hasStack ? 'stack build' : 'cabal build',
324
+ test: hasStack ? 'stack test' : 'cabal test',
325
+ lint: exists(root, '.hlint.yaml') ? 'hlint .' : null,
326
+ dev: null,
327
+ },
328
+ };
329
+ }
330
+
331
+ function detectScala(root) {
332
+ const hasSbt = exists(root, 'build.sbt');
333
+ if (!hasSbt) return null;
334
+ const sbtText = readText(root, 'build.sbt') || '';
335
+ const nameMatch = sbtText.match(/name\s*:=\s*"([^"]+)"/);
336
+
337
+ return {
338
+ ecosystem: 'Scala',
339
+ name: nameMatch ? nameMatch[1] : null,
340
+ description: null,
341
+ packageManager: 'sbt',
342
+ frameworks: [],
343
+ testFramework: /scalatest|munit|specs2/i.test(sbtText) ? 'sbt test' : null,
344
+ commands: {
345
+ install: null,
346
+ build: 'sbt compile',
347
+ test: 'sbt test',
348
+ lint: null,
349
+ dev: null,
350
+ },
351
+ };
352
+ }
353
+
232
354
  function detectDart(root) {
233
355
  const pubspec = readText(root, 'pubspec.yaml');
234
356
  if (!pubspec) return null;
@@ -478,7 +600,7 @@ function detectMonorepo(root) {
478
600
  }
479
601
 
480
602
  function detectProject(root) {
481
- const detectors = [detectNode, detectPython, detectRust, detectGo, detectRuby, detectJava, detectPhp, detectDotnet, detectSwift, detectDart, detectElixir];
603
+ const detectors = [detectNode, detectPython, detectRust, detectGo, detectRuby, detectJava, detectPhp, detectDotnet, detectSwift, detectDart, detectElixir, detectCpp, detectHaskell, detectScala, detectZig, detectJulia];
482
604
  const stacks = detectors.map((fn) => fn(root)).filter(Boolean);
483
605
 
484
606
  return {