agent-implementation
Skill7 starsChanged 11 days agoMITView on GitHub
Implement or update support for an underlying agent CLI in Ralph after specs are defined, including factory wiring and tests.
In this repository5 other files it gives its agents.
- AGENTS.mdAGENTS.md
- specs/agents.mdAGENTS.md
- agent-spec-creationSkill
- skill-creatorSkill
- spec-creatorSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 10 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Use this skill when the task involves any of the following:
- Distinctive: line 23
Read intent and constraints first:
- Distinctive: line 31
write or update failing tests before implementation
- Distinctive: line 32
verify tests fail for the expected reason
- Distinctive: line 34
Keep implementation aligned with existing patterns:
- Distinctive: line 39
Keep behavior deterministic and avoid logging sensitive prompt/match text.
- Distinctive: line 43
Do not run iterative Ralph loop automation.
- Distinctive: line 44
Keep args/env handling explicit and testable.
- Very specific: line 49
Add internal/agent/<new-agent>.go with an Agent interface implementation.
- Distinctive: line 66
Run in this order unless the user requests otherwise:
- Distinctive: line 75
Run mutation testing only in final validation stages:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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
Agent Implementation Workflow
Purpose
Implement or update agent CLI integrations in Ralph in a consistent, deterministic, test-first way.
When to Use
Use this skill when the task involves any of the following:
- Adding a new agent integration under
internal/agent/. - Updating command construction, flags, env vars, or output parsing for an existing agent.
- Updating agent factory selection in
internal/agent/agent.go. - Adding or fixing tests around agent selection/execution behavior.
Required Workflow
- Read intent and constraints first:
specs/README.mdspecs/agents.md- relevant files in
specs/agents/*.md
- Validate target agent CLI behavior before coding:
<agent-cli> --help- relevant subcommand help (for example
<agent-cli> run --help)
- Follow TDD strictly:
- write or update failing tests before implementation
- verify tests fail for the expected reason
- implement minimal code to pass
- Keep implementation aligned with existing patterns:
internal/agent/agent.gointernal/agent/opencode.gointernal/agent/claude.gointernal/agent/cursor.go
- Keep behavior deterministic and avoid logging sensitive prompt/match text.
Constraints
- Do not run iterative Ralph loop automation.
- Keep args/env handling explicit and testable.
- Reuse shared helpers when behavior is equivalent.
Implementation Checklist
- Add
internal/agent/<new-agent>.gowith anAgentinterface implementation. - Wire the new agent into the factory/switch in
internal/agent/agent.go. - Register the canonical name in
SupportedAgents()and any alias in the factory (internal/agent/agent.go);ralph initoptions/prompt and error messages derive from it automatically — no separate init list exists. - Reuse shared execution/helpers where possible instead of duplicating logic.
Test Checklist
At minimum, add coverage for:
- Factory returns the correct implementation for the agent name.
SupportedAgents/IsSupportedAgentcover the new name and aliases.- Unsupported/invalid names return expected errors.
- Command and argument composition for normal execution.
- Failure paths (missing binary, non-zero exit, malformed output when relevant).
Validation Commands
Run in this order unless the user requests otherwise:
go test -v ./internal/agent/...
make test # full Go suite, includes test/e2e
make test-e2e # end-to-end suite only
make qualityRun mutation testing only in final validation stages:
make mutationCompletion Criteria
- Tests cover factory mapping plus success and error execution paths.
- Local validation passes (or failures are clearly reported).
- Specs/docs are updated when behavior changes, including the README "Supported Agents" table and
specs/agents.mdin the same change.
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.

