计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
create-hat-collection【效率与协作】Generates new Ralph hat collection presets through guided conversation. Asks clarifying questions, validates against schema constraints, and outputs production-ready YAML files.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
This skill generates Ralph hat collection presets through a guided, conversational workflow. It asks clarifying questions about your workflow, validates the configuration against schema constraints, and produces a production-ready YAML preset file.
Output: A complete .yml preset file in the presets/ directory.
Not for: Modifying existing presets (use /creating-hat-collections reference instead)
Ask clarifying questions to understand:
Map the workflow as an event chain:
task.start → [Role A] → event.a → [Role B] → event.b → [Role C] → LOOP_COMPLETE
↓
event.rejected → [Role A]
Constraints to validate:
task.start and task.resume are RESERVED (never use as triggers)Create the YAML file with these sections:
# <Preset Name>
# Pattern: <Architecture Pattern>
# <One-line description>
#
# Usage:
# ralph run --config presets/<name>.yml --prompt "<example prompt>"
event_loop:
starting_event: "<first.event>" # Ralph publishes this
hats:
hat_key:
name: "<Emoji> Display Name"
description: "<Short description of the hat's purpose>"
triggers: ["event.triggers.this"]
publishes: ["event.this.publishes", "alternate.event"]
default_publishes: "event.this.publishes"
instructions: |
## <HAT NAME> MODE
<Clear role definition - what this hat does>
### Process
1. <Step one>
2. <Step two>
3. Publish appropriate event
### Event Format
```
<event topic="event.name">
key: value
</event>
```
### DON'T
- <Common mistake to avoid>
- <Another mistake>
| Field | Description |
|---|---|
event_loop.starting_event | First event Ralph publishes |
| Field | Required | Description |
|---|---|---|
name | Yes | Display name with optional emoji (e.g., "🔍 Analyzer") |
description | Yes | Short description of the hat's purpose (one sentence) |
triggers | Yes | Events this hat responds to (list) |
publishes | Yes | Events this hat can emit (list) |
default_publishes | Recommended | Fallback event if hat forgets to publish |
instructions | Yes | Role-specific prompt (use | for multiline) |
Never use these—they're not in the schema:
emoji (put emoji in name instead)system_prompt (use instructions)subscriptions / publications (use triggers / publishes)<phase>.ready / <phase>.done # Phase transitions
<thing>.approved / <thing>.rejected # Review gates
<noun>.found / <noun>.missing # Discovery events
<action>.request / <action>.complete # Request-response
Examples: analysis.complete, review.approved, build.blocked, spec.rejected
Before finalizing the preset, verify:
task.start or task.resume as triggersname, description, triggers, publishes, and instructionsdefault_publishes is set for hats with multiple publish optionsSave generated presets to: presets/<name>.yml
For minimal/embedded presets: presets/minimal/<name>.yml
After generation, test with:
# Dry run to validate config parsing
cargo run --bin ralph -- run -c presets/<name>.yml -p "test prompt" --dry-run
# Run smoke tests
cargo test -p ralph-core smoke_runner
Use /evaluate-presets for comprehensive validation.
User: I want a preset for doing code reviews with a security focus.
Assistant: I'll help create a security-focused code review preset. Let me ask a few questions:
Review depth: Should this be a quick scan or thorough analysis?
Roles needed: I'm thinking:
Does this cover your needs, or should we add/remove roles?
Iteration: If issues are found, should the code be fixed, or just reported?
User: Thorough analysis, those roles work, just report issues don't fix.
Assistant: Here's the event flow I'm designing:
task.start → [Security Analyst] → security.complete
↓
→ [Code Reviewer] → review.complete
↓
→ [Summarizer] → LOOP_COMPLETE
Let me generate the preset...
[Generates YAML with three hats following the schema]
A → B → C → done
Use for: analysis workflows, document processing
Actor → Critic → approved/rejected
↓
rejected → Actor (retry)
Use for: code review, quality gates
Supervisor → worker.task → Worker → work.done → Supervisor
Use for: complex task decomposition
Observe → Hypothesize → Test → confirmed/rejected
↓
rejected → Observe
Use for: debugging, investigation