agent-implementation
Implement or update support for an underlying agent CLI in Ralph after specs are defined, including factory wiring and tests.
- License 许可
- MIT
- 所属仓库
- iyaki/specralph
- 最近更新
- 2026-11-14
- Stars
- ★ 6
- Forks
- 0
01 前言 Front Matter
- name
- agent-implementation
- description
- Implement or update support for an underlying agent CLI in Ralph after specs are defined, including factory wiring and tests.
03 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
- 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 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.mdin the same change.
04 同仓库更多 Skills
commands
暂无简介
specralph-prompts
Author, install, and validate custom prompt files for specralph (the ralph CLI agentic loop runner). Use this skill whenever creating or editing ralph prompt files, preparing tasks to run with ralph run, writing prompts that must stop the loop via the completion signal, or debugging a ralph loop that never stops or stops too early.
specralph-prompts
暂无简介
spec-creator
Create, update, or review engineering-grade technical specifications for a codebase, following spec-driven development (SDD) conventions. Use whenever the user asks for a spec, requirements or design doc, feature specification, API contract, data model, or wants a feature planned on paper before implementation — including phrases like "write a spec for X", "draft the spec first", "update the specs", or any spec-first workflow (e.g. with Ralph). Produces implementation-ready, testable specs using the bundled SPEC_TEMPLATE.md.
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
agent-spec-creation
Create or update agent integration specs before implementation. Use this whenever a request is about defining how a new or existing agent should behave in Ralph.