agents-md-gen 0.1.1 → 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 +14 -0
  2. package/package.json +4 -1
  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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agents-md-gen",
3
- "version": "0.1.1",
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": {
@@ -26,6 +26,9 @@
26
26
  "github-copilot",
27
27
  "openai-codex",
28
28
  "readme-generator",
29
+ "java",
30
+ "maven",
31
+ "gradle",
29
32
  "cli",
30
33
  "codegen",
31
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 {