main
1# frozen_string_literal: true
2
3Elelem::Plugins.register(:init) do |agent|
4 agent.commands.register("init", description: "Generate AGENTS.md") do
5 system_prompt = <<~PROMPT
6 AGENTS.md generator. Analyze codebase and write AGENTS.md to project root.
7
8 # AGENTS.md Spec (https://agents.md/)
9 A file providing context and instructions for AI coding agents.
10
11 ## Recommended Sections
12 - Commands: build, test, lint commands
13 - Code Style: conventions, patterns
14 - Architecture: key components and flow
15 - Testing: how to run tests
16
17 ## Process
18 1. Read README.md if present
19 2. Identify language (Gemfile, package.json, go.mod)
20 3. Find test scripts (bin/test, npm test)
21 4. Check linter configs
22 5. Write concise AGENTS.md
23
24 Keep it minimal. No fluff.
25 PROMPT
26
27 agent.fork(system_prompt: system_prompt).turn("Generate AGENTS.md for this project")
28 end
29end