specralph / specs
AGENTS.md7 starsChanged 11 days agoMITView on GitHub
Status: Implemented
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,439 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository5 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-implementationSkill
- agent-spec-creationSkill
- skill-creatorSkill
- spec-creatorSkill
The file
We split this agents.md into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 117
Read AgentName from config (see configuration spec).
- Very specific: line 123
Read AgentName from config/flags/environment (see configuration spec).
- Very specific: line 125
If AgentName is unknown, return an error and stop before agent execution.
- Distinctive: line 171
Should agent selection fail fast when the CLI binary is missing?
- Distinctive: line 172
Should agent output be sanitized before logging?
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Agents
Status: Implemented
Overview
Purpose
- Define how Ralph selects and executes external AI agent CLIs.
- Provide a testable description of the agent interface and supported agents.
Goals
- Specify the agent selection behavior.
- Describe availability checks and error handling.
Non-Goals
- Implementing new agent types.
- Standardizing outputs from external agent CLIs.
Scope
- In scope: agent interface, selection logic, and CLI invocation rules.
- Out of scope: prompt resolution (see prompts spec) and config precedence (see configuration spec).
Architecture
Module/package layout (tree format)
internal/
agent/
agent.go
opencode.go
claude.go
cursor.go
oh-my-pi.go
codex.go
copilot.go
antigravity.go
specs/
agents/
opencode.md
claude.md
cursor.md
oh-my-pi.md
codex.md
copilot.md
antigravity.mdComponent diagram (ASCII)
+------------------+
| Agent Factory |
| internal/agent |
+---------+--------+
|
v
+---------+--------+
| Agent Implementation|
+---------+--------+
|
v
+---------+--------+
| External CLI |
+------------------+Data flow summary
- CLI resolves
AgentName,Model, andAgentMode(see configuration spec). - Agent factory returns a concrete agent implementation.
- Availability check runs via
LookPath. - Agent executes the external CLI command and returns output.
- Oh My Pi (omp): specs/agents/oh-my-pi.md
- Opencode: specs/agents/opencode.md
- Claude: specs/agents/claude.md
- Cursor: specs/agents/cursor.md
- OpenAI Codex: specs/agents/codex.md
- GitHub Copilot: specs/agents/copilot.md
- Google Antigravity: specs/agents/antigravity.md
Data model
Core Entities
- Agent (interface)
Execute(prompt string, output io.Writer) (string, error)Name() stringIsAvailable() bool
- Agent registry (package-level helpers in
internal/agent)SupportedAgents() []string— canonical agent names; the single source of truth feedingralph initoptions/prompt and unknown-agent error messages.IsSupportedAgent(name string) bool— true for canonical names and accepted aliases.
- AgentSelection
- Fields:
AgentName,Model,AgentMode. - Derived from config/flags/environment variables.
- Fields:
Relationships
AgentSelectiondetermines which implementation is returned byGetAgent.Agentexecution streams output to stdout and optional log file.
Persistence Notes
- None. Agent selection is runtime-only.
Workflows
Select agent (happy path)
- Read
AgentNamefrom config (see configuration spec). - Map
AgentNameto a concrete agent implementation. - Accepted names are canonical names plus aliases; alias
agymaps toAntigravityAgent(canonicalantigravity) and aliasompmaps toOmpAgent(canonicaloh-my-pi);Name()returns the canonical name.
Select agent (unknown configured agent)
- Read
AgentNamefrom config/flags/environment (see configuration spec). - Attempt to map
AgentNameto a concrete agent implementation. - If
AgentNameis unknown, return an error and stop before agent execution.
Execute agent (happy path)
- Build CLI arguments from
ModelandAgentMode. - Execute the agent CLI with the prompt as a final argument.
- Capture stdout and stderr; return combined output. Output is monitored for the completion signal
<promise>COMPLETE</promise>to determine when the loop should stop.
Execute agent (CLI missing)
IsAvailable()returns false.- CLI prints a warning and still attempts execution.
Execute agent (error)
- External CLI exits non-zero.
- Error is returned, but output is still provided.
APIs
- None. Agents are local CLI integrations.
Client SDK Design
- Not applicable.
Configuration
- Relevant fields:
AgentName,Model,AgentMode. - See configuration spec for full definitions and precedence.
Permissions
- Requires OS permission to execute external agent CLIs.
Security Considerations
- Prompts are passed as CLI arguments; sensitive data may appear in process lists.
- Agent binaries are resolved from PATH; ensure trusted binaries are used.
Dependencies
- Standard library only (
os/exec,bytes,io).
Open Questions / Risks
- Should agent selection fail fast when the CLI binary is missing?
- Should agent output be sanitized before logging?
Verifications
ralph --agent opencode buildselectsopencode.ralph --agent claude --model claude-sonnet-4 buildpasses model arg.ralph --agent cursor buildexecutescursorCLI.ralph --agent copilot buildinvokescopilot -p.ralph --agent copilot --model gpt-4o buildincludes--model gpt-4o.ralph --agent copilot --agent explore buildincludes--agent explore.ralph --agent antigravity buildinvokesagy -p "build".ralph --agent antigravity --model "Gemini 2.5 Flash" buildincludes--model "Gemini 2.5 Flash".ralph --agent agy buildinvokesagy -p "build"(same asantigravity).ralph --agent oh-my-pi buildinvokesomp.ralph --agent omp buildbehaves identically tooh-my-pi.- Configuring an unknown agent fails with an error listing every supported agent name.
Appendices
- None.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

