← 返回 Skills 市场
austindixson

Better Ralph

作者 austindixson · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
843
总下载
0
收藏
3
当前安装
1
版本数
在 OpenClaw 中安装
/install better-ralph
功能描述
Run one Better Ralph iteration: pick next incomplete PRD story by priority, implement it, run checks, commit, mark passed, and append progress, using only st...
使用说明 (SKILL.md)

Better Ralph – One Iteration (OpenClaw)

Execute one iteration of the Better Ralph workflow: pick the next PRD story, implement it, run quality checks, commit, update the PRD, and append progress. Uses only standard tools (read_file, write_file, edit, exec, git). No external runner or Aether-Claw required.


When to Use

  • User says: "run better ralph", "do one better ralph iteration", "next prd story", "ralph loop", "implement next story from prd".
  • Project has a prd.json in the workspace root (see Output Format below for schema).

One-Iteration Workflow

Do these steps in order. Use only your standard file, exec, and git tools.

1. Read state

  • Read prd.json (workspace root). Parse the JSON.
  • Read progress.txt if it exists. If it has a section ## Codebase Patterns near the top (up to the next ## or end of file), use that as context for implementation patterns. Otherwise proceed without it.

2. Pick the next story

  • From prd.json.userStories, find all with passes === false.
  • Sort by priority ascending (lower number = higher priority).
  • Take the first (highest priority incomplete story).
  • If every story has passes === true, reply: "All PRD stories are complete. Nothing left to do." and stop.

3. Ensure git branch

  • Check current git branch (e.g. run git branch --show-current or use your git tool).
  • If prd.json has a branchName and it differs from the current branch, checkout or create that branch (e.g. git checkout -b \x3CbranchName> or git checkout \x3CbranchName>).

4. Implement the story

  • Story = the one you picked. It has: id, title, description, acceptanceCriteria, priority, passes.
  • Implement the story: write or edit code so that every item in acceptanceCriteria is satisfied.
  • Work on this story only. Do not start the next story.

5. Run quality checks

  • Run the project’s quality commands (e.g. npm test, npm run lint, npm run typecheck, or whatever the project uses).
  • If any check fails, do not commit. Tell the user what failed and stop. Do not update prd.json or progress.txt for a failed story.

6. Commit (only if checks passed)

  • Stage all changes (e.g. git add -A or your git tool’s equivalent).
  • Commit with message exactly: feat: [Story ID] - [Story Title]
    Example: feat: US-002 - Display priority on task cards

7. Mark story passed in prd.json

  • Read prd.json again (in case it changed).
  • Find the user story with the same id you just completed. Set its passes to true.
  • Write the full updated prd.json back (preserve structure and other fields; only change that story’s passes).

8. Append progress to progress.txt

  • Append (do not overwrite) a new block to progress.txt with this format:
## [Current date/time] - [Story ID]
- What was implemented (1–2 sentences)
- Files changed (list paths)
- **Learnings for future iterations:**
  - Patterns or gotchas (e.g. "this codebase uses X for Y", "remember to update Z when changing W")
---
  • If progress.txt does not exist, create it with a first line like # Better Ralph Progress then the block above.

9. Report to user

  • Say which story you completed (ID and title) and that you updated the PRD and progress.
  • If there are still stories with passes === false, say: "Run another iteration to do the next story." If all are complete, say: "All PRD stories are complete."

prd.json format

If the user wants to create a new prd.json (no file yet), create it with this shape:

{
  "project": "ProjectName",
  "branchName": "ralph/feature-kebab-case",
  "description": "Short feature description",
  "userStories": [
    {
      "id": "US-001",
      "title": "Short title",
      "description": "As a [role], I want [thing] so that [benefit].",
      "acceptanceCriteria": [
        "Verifiable criterion 1",
        "Verifiable criterion 2",
        "Typecheck passes"
      ],
      "priority": 1,
      "passes": false,
      "notes": ""
    }
  ]
}
  • priority: Lower number = higher priority. Order by dependency (e.g. schema before UI).
  • passes: Start as false; set to true only after the story is implemented and committed.
  • acceptanceCriteria: Each item must be checkable (e.g. "Typecheck passes", "Tests pass").

Codebase Patterns (progress.txt)

Optionally keep a Codebase Patterns section at the top of progress.txt so future iterations (or you in the next run) see it first:

# Better Ralph Progress

## Codebase Patterns
- Use X for Y in this codebase
- Always run Z after changing W
- Tests require PORT=3000

---

When you read progress.txt at the start of an iteration, use this section as context. When you discover a reusable pattern, add it here (edit the top of the file and keep the rest intact). Do not put story-specific details in Codebase Patterns.


Rules

  • One story per invocation. Do not implement multiple stories in one go.
  • Do not commit failing code. Only commit after quality checks pass.
  • Do not mark a story as passed if you did not commit (e.g. checks failed).
  • Append to progress.txt; never replace the whole file (except when creating it for the first time).
  • Keep changes minimal and focused on the current story’s acceptance criteria.

Checklist (one iteration)

  • Read prd.json and progress.txt (and Codebase Patterns if present)
  • Picked next story (passes=false, lowest priority number)
  • Git branch matches prd.json.branchName
  • Implemented story and satisfied all acceptance criteria
  • Quality checks passed (test/lint/typecheck)
  • Committed with message feat: [ID] - [Title]
  • Set that story’s passes to true in prd.json
  • Appended progress block to progress.txt
安全使用建议
This skill will modify files in your repository and commit changes automatically after running the project's tests/lints. Before using it: (1) review prd.json and progress.txt so the agent has the right instructions; (2) ensure the project's test/lint scripts are safe to run locally (they can execute arbitrary code or call external services); (3) run the skill in a disposable branch or a sandboxed environment first; (4) if tests require secrets or environment variables, provide them only if you're comfortable (the skill does not request them explicitly); (5) consider invoking it manually the first time to observe behavior rather than enabling autonomous invocation.
功能分析
Type: OpenClaw Skill Name: better-ralph Version: 1.0.0 The skill is classified as suspicious due to multiple critical vulnerabilities that could lead to arbitrary command execution and prompt injection. Specifically, `SKILL.md` instructs the agent to execute `git checkout` and `git commit` commands using unsanitized `branchName`, `Story ID`, and `Story Title` values from the user-controlled `prd.json`, creating shell injection risks. Additionally, the agent is instructed to run 'quality commands' (e.g., `npm test`) defined by the project, which could execute arbitrary malicious scripts. Finally, the agent is instructed to read `progress.txt` and use its 'Codebase Patterns' section as 'context', creating a direct prompt injection vector where a user could inject malicious instructions into the agent's operational context.
能力评估
Purpose & Capability
Name/description (one-iteration PRD-driven implementation) match the runtime instructions: reading prd.json and progress.txt, selecting a story, editing code, running project checks, committing, and updating progress. The skill requests no unrelated credentials, binaries, or config paths.
Instruction Scope
Instructions are explicit and confined to repository-local actions (read/write prd.json and progress.txt, use git, run project quality commands). However, the skill is permitted to run whatever the project's test/lint/typecheck scripts are defined to run — those scripts may execute arbitrary code, access the network, or require environment variables. The guidance to 'implement the story' means the agent will edit repository source files; this is intended but important to be aware of.
Install Mechanism
No install spec or external downloads — instruction-only skill. Nothing is written to disk by an installer and no third-party packages are pulled by the skill itself.
Credentials
Skill declares no environment variables or credentials, which is appropriate. Be aware tests or acceptance criteria may require environment variables, secrets, or service credentials at runtime (not declared by the skill). The skill itself does not request broad credential access.
Persistence & Privilege
always is false and the skill is user-invocable. It does not request persistent system-wide privileges or attempt to modify other skills or global agent settings. Its actions are limited to the workspace/git repository as described.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install better-ralph
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /better-ralph 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of Better Ralph: Automated, PRD-driven coding iteration. - Runs a full Better Ralph workflow: picks the next PRD story, implements it, commits only after passing all checks, and updates progress. - Uses only standard OpenClaw tools (read, write, exec, git); no external dependencies required. - Ensures precise control: strictly one story per run, clear branch management, and acceptance criteria–focused commits. - Tracks progress and codifies patterns for future iterations using progress.txt and an optional codebase patterns section. - Triggers on intuitive user commands like "run better ralph" or "next prd story."
元数据
Slug better-ralph
版本 1.0.0
许可证
累计安装 3
当前安装数 3
历史版本数 1
常见问题

Better Ralph 是什么?

Run one Better Ralph iteration: pick next incomplete PRD story by priority, implement it, run checks, commit, mark passed, and append progress, using only st... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 843 次。

如何安装 Better Ralph?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install better-ralph」即可一键安装,无需额外配置。

Better Ralph 是免费的吗?

是的,Better Ralph 完全免费(开源免费),可自由下载、安装和使用。

Better Ralph 支持哪些平台?

Better Ralph 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Better Ralph?

由 austindixson(@austindixson)开发并维护,当前版本 v1.0.0。

💬 留言讨论