agents-md-gen 0.12.0 → 0.13.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,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.13.0
4
+
5
+ - **Multi-project repos**: when the root has no recognizable stack and isn't
6
+ a JS workspace monorepo, each immediate subdirectory is scanned. Every
7
+ stack found gets its own section, e.g. `## Go (\`api/\`)` with "Run these
8
+ commands from `api/`." Previously these repos only got "Couldn't
9
+ auto-detect a specific language/framework".
10
+
3
11
  ## 0.12.0
4
12
 
5
13
  - New **Typecheck** and **Format** commands in the generated file — what an
package/README.md CHANGED
@@ -77,6 +77,9 @@ docker run --rm -v "$PWD":/workdir ghcr.io/peshino2012/agents-md-gen
77
77
  - **Julia** — `Project.toml`, Pkg test detection
78
78
  - **Monorepos** — Turborepo, Nx, Lerna, Rush, npm/yarn/pnpm workspaces,
79
79
  listing each detected sub-package
80
+ - **Multi-project repos** — nothing at the root (e.g. `api/` in Go next to
81
+ `web/` in Node)? Each immediate subdirectory is scanned and gets its own
82
+ section saying where to run its commands
80
83
  - CI (GitHub Actions), license, and top-level project structure
81
84
 
82
85
  ## GitHub Action
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agents-md-gen",
3
- "version": "0.12.0",
3
+ "version": "0.13.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
  "homepage": "https://github.com/Peshino2012/homebrew-tap#readme",
package/src/detect.js CHANGED
@@ -601,6 +601,19 @@ function detectDotnet(root) {
601
601
  // never match a freshly rendered one, breaking `--check`.
602
602
  const OWN_OUTPUT_FILES = new Set(['AGENTS.md', 'CLAUDE.md']);
603
603
 
604
+ function listSubprojectDirs(root) {
605
+ let entries;
606
+ try {
607
+ entries = fs.readdirSync(root, { withFileTypes: true });
608
+ } catch {
609
+ return [];
610
+ }
611
+ return entries
612
+ .filter((e) => e.isDirectory() && !e.name.startsWith('.') && !IGNORE_DIRS.has(e.name))
613
+ .map((e) => e.name)
614
+ .sort();
615
+ }
616
+
604
617
  function listStructure(root) {
605
618
  let entries;
606
619
  try {
@@ -713,12 +726,21 @@ function detectMonorepo(root) {
713
726
 
714
727
  function detectProject(root) {
715
728
  const detectors = [detectNode, detectDeno, detectPython, detectRust, detectGo, detectRuby, detectJava, detectPhp, detectDotnet, detectSwift, detectDart, detectElixir, detectCpp, detectHaskell, detectScala, detectZig, detectJulia];
716
- const stacks = detectors.map((fn) => fn(root)).filter(Boolean);
729
+ let stacks = detectors.map((fn) => fn(root)).filter(Boolean);
730
+ const monorepo = detectMonorepo(root);
731
+
732
+ // Multi-project repos that aren't JS workspaces (e.g. api/ in Go next to
733
+ // web/ in Node) have nothing at the root; look one level down instead.
734
+ if (!stacks.length && !monorepo) {
735
+ stacks = listSubprojectDirs(root).flatMap((dir) =>
736
+ detectors.map((fn) => fn(path.join(root, dir))).filter(Boolean).map((stack) => ({ ...stack, dir })),
737
+ );
738
+ }
717
739
 
718
740
  return {
719
741
  root,
720
742
  stacks,
721
- monorepo: detectMonorepo(root),
743
+ monorepo,
722
744
  structure: listStructure(root),
723
745
  ci: detectCI(root),
724
746
  license: detectLicense(root),
package/src/render.js CHANGED
@@ -33,7 +33,8 @@ function renderCommands(stack) {
33
33
  }
34
34
 
35
35
  function renderStack(stack) {
36
- const parts = [`## ${stack.ecosystem}`];
36
+ const parts = [stack.dir ? `## ${stack.ecosystem} (\`${stack.dir}/\`)` : `## ${stack.ecosystem}`];
37
+ if (stack.dir) parts.push(`Run these commands from \`${stack.dir}/\`.`, '');
37
38
  const meta = [];
38
39
  if (stack.name) meta.push(`**${stack.name}**`);
39
40
  if (stack.frameworks && stack.frameworks.length) meta.push(stack.frameworks.join(', '));