agentleFS
iyakiiyaki/specralph/.agents/skills/agent-implementation/SKILL.md

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.

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
  1. Distinctive:

    Use this skill when the task involves any of the following:

    line 14
  2. Distinctive:

    Read intent and constraints first:

    line 23
  3. Distinctive:

    write or update failing tests before implementation

    line 31
  4. Distinctive:

    verify tests fail for the expected reason

    line 32
  5. Distinctive:

    Keep implementation aligned with existing patterns:

    line 34
  6. Distinctive:

    Keep behavior deterministic and avoid logging sensitive prompt/match text.

    line 39
  7. Distinctive:

    Do not run iterative Ralph loop automation.

    line 43
  8. Distinctive:

    Keep args/env handling explicit and testable.

    line 44
  9. Very specific:

    Add internal/agent/<new-agent>.go with an Agent interface implementation.

    line 49
  10. Distinctive:

    Run in this order unless the user requests otherwise:

    line 66
  11. Distinctive:

    Run mutation testing only in final validation stages:

    line 75

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. Read intent and constraints first:
    • specs/README.md
    • specs/agents.md
    • relevant files in specs/agents/*.md
  2. Validate target agent CLI behavior before coding:
    • <agent-cli> --help
    • relevant subcommand help (for example <agent-cli> run --help)
  3. Follow TDD strictly:
    • write or update failing tests before implementation
    • verify tests fail for the expected reason
    • implement minimal code to pass
  4. Keep implementation aligned with existing patterns:
    • internal/agent/agent.go
    • internal/agent/opencode.go
    • internal/agent/claude.go
    • internal/agent/cursor.go
  5. 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>.go with an Agent interface 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 init options/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/IsSupportedAgent cover 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 quality

Run mutation testing only in final validation stages:

make mutation

Completion 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.md in the same change.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.