agents-md-gen 0.1.0 → 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.
Files changed (3) hide show
  1. package/README.md +48 -0
  2. package/package.json +13 -2
  3. package/src/detect.js +45 -1
package/README.md CHANGED
@@ -20,8 +20,22 @@ on immediately.
20
20
  - **Rust** — Cargo, workspaces, clippy
21
21
  - **Go** — go.mod, golangci-lint
22
22
  - **Ruby** — Bundler, RSpec
23
+ - **Java/Kotlin** — Maven, Gradle (with wrapper detection)
23
24
  - CI (GitHub Actions), license, and top-level project structure
24
25
 
26
+ ## GitHub Action
27
+
28
+ Use it directly in CI without installing anything:
29
+
30
+ ```yaml
31
+ - uses: Peshino2012/PD1@claude/busy-newton-5h97oh
32
+ with:
33
+ directory: .
34
+ also-claude-md: 'true'
35
+ ```
36
+
37
+ (pin to a tagged release instead of a branch once one exists)
38
+
25
39
  A repo can match more than one of these (e.g. a Python backend next to a
26
40
  Node frontend) — each detected stack gets its own section.
27
41
 
@@ -39,6 +53,40 @@ It won't overwrite an existing `AGENTS.md`/`CLAUDE.md` unless you pass
39
53
  `--force` — this is meant to bootstrap a file you then edit by hand, not to
40
54
  clobber one you already wrote.
41
55
 
56
+ ## Example
57
+
58
+ Real output — this is what `npx agents-md-gen` produces when run against
59
+ this package's own repo:
60
+
61
+ ````markdown
62
+ # AGENTS.md
63
+
64
+ > Generated by [agents-md-gen](https://www.npmjs.com/package/agents-md-gen) — a starting point, edit freely.
65
+
66
+ ## Node.js
67
+ **agents-md-gen** — package manager: npm
68
+
69
+ ### Commands
70
+
71
+ - Install: `npm install`
72
+ - Test: `npm run test`
73
+
74
+ ## Structure
75
+
76
+ - `.github/` — GitHub config (CI, templates)
77
+ - `LICENSE`
78
+ - `README.md`
79
+ - `bin/` — CLI entry points
80
+ - `package.json`
81
+ - `src/` — source code
82
+ - `test/` — tests
83
+
84
+ ## Notes
85
+
86
+ - CI: GitHub Actions (test.yml)
87
+ - License: MIT
88
+ ````
89
+
42
90
  ## Why
43
91
 
44
92
  Most `AGENTS.md`/`CLAUDE.md` files either don't exist yet, or are a stale
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "agents-md-gen",
3
- "version": "0.1.0",
3
+ "version": "0.2.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
  "bin": {
7
- "agents-md-gen": "./bin/cli.js"
7
+ "agents-md-gen": "bin/cli.js"
8
8
  },
9
9
  "main": "src/index.js",
10
10
  "files": [
@@ -18,6 +18,17 @@
18
18
  "agents.md",
19
19
  "claude.md",
20
20
  "ai-agents",
21
+ "ai-coding-agent",
22
+ "coding-agent",
23
+ "claude-code",
24
+ "cursor",
25
+ "windsurf",
26
+ "github-copilot",
27
+ "openai-codex",
28
+ "readme-generator",
29
+ "java",
30
+ "maven",
31
+ "gradle",
21
32
  "cli",
22
33
  "codegen",
23
34
  "developer-tools"
package/src/detect.js CHANGED
@@ -165,6 +165,50 @@ function detectGo(root) {
165
165
  };
166
166
  }
167
167
 
168
+ function detectJava(root) {
169
+ const hasGradle = exists(root, 'build.gradle') || exists(root, 'build.gradle.kts');
170
+ const hasMaven = exists(root, 'pom.xml');
171
+ if (!hasGradle && !hasMaven) return null;
172
+
173
+ if (hasGradle) {
174
+ const gradleCmd = exists(root, 'gradlew') ? './gradlew' : 'gradle';
175
+ return {
176
+ ecosystem: 'Java/Kotlin (Gradle)',
177
+ name: null,
178
+ description: null,
179
+ packageManager: 'gradle',
180
+ frameworks: [],
181
+ testFramework: null,
182
+ commands: {
183
+ install: `${gradleCmd} build`,
184
+ build: `${gradleCmd} build`,
185
+ test: `${gradleCmd} test`,
186
+ lint: null,
187
+ dev: null,
188
+ },
189
+ };
190
+ }
191
+
192
+ const pom = readText(root, 'pom.xml') || '';
193
+ const nameMatch = pom.match(/<artifactId>([^<]+)<\/artifactId>/);
194
+ const mvnCmd = exists(root, 'mvnw') ? './mvnw' : 'mvn';
195
+ return {
196
+ ecosystem: 'Java (Maven)',
197
+ name: nameMatch ? nameMatch[1] : null,
198
+ description: null,
199
+ packageManager: 'maven',
200
+ frameworks: [],
201
+ testFramework: null,
202
+ commands: {
203
+ install: `${mvnCmd} install`,
204
+ build: `${mvnCmd} package`,
205
+ test: `${mvnCmd} test`,
206
+ lint: null,
207
+ dev: null,
208
+ },
209
+ };
210
+ }
211
+
168
212
  function detectRuby(root) {
169
213
  if (!exists(root, 'Gemfile')) return null;
170
214
  const hasRspec = exists(root, '.rspec') || exists(root, 'spec');
@@ -223,7 +267,7 @@ function detectLicense(root) {
223
267
  }
224
268
 
225
269
  function detectProject(root) {
226
- const detectors = [detectNode, detectPython, detectRust, detectGo, detectRuby];
270
+ const detectors = [detectNode, detectPython, detectRust, detectGo, detectRuby, detectJava];
227
271
  const stacks = detectors.map((fn) => fn(root)).filter(Boolean);
228
272
 
229
273
  return {