Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/rally-workflow-build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ fn default_state_version() -> u32 {
}

fn default_implementer() -> String {
"implementer".to_string()
"implement".to_string()
}

impl BuildWorkflowState {
Expand Down Expand Up @@ -580,7 +580,7 @@ pub fn process_review_state(state: &mut SessionState) -> Result<Option<String>>
pub fn is_implementer(state: &SessionState, agent: &str) -> bool {
match read_workflow_state(state) {
Ok(workflow_state) => is_implementer_with_state(&workflow_state, agent),
Err(_) => agent == "implementer",
Err(_) => agent == "implement",
}
}

Expand Down
67 changes: 64 additions & 3 deletions prompts/skill-wrapper.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,71 @@ rally-managed: true

# Rally

Run this command first with the user's arguments:
Rally coordinates multi-agent coding sessions. Your job is to figure out what the user wants, construct the right `{{RALLY_BIN}} skill run` command, execute it, and follow the instruction loop.

## Step 1: Determine the command

The user said: `$ARGUMENTS`

### If the arguments clearly match a known command syntax

Run it directly. Examples of clear, structured arguments:

| User says | Run |
|-----------|-----|
| `implement todos/foo.md implement` | `{{RALLY_BIN}} skill run implement todos/foo.md implement` |
| `implement todos/foo.md review --reviewers 2` | `{{RALLY_BIN}} skill run implement todos/foo.md review --reviewers 2` |
| `negotiate "auth design" agent-alpha --agents 3` | `{{RALLY_BIN}} skill run negotiate "auth design" agent-alpha --agents 3` |
| (empty / no arguments) | `{{RALLY_BIN}} skill run` (resumes last session) |

### If the arguments are natural language or ambiguous

Interpret the user's intent to construct a `{{RALLY_BIN}} skill run` command. Use these rules:

**Available workflows:**

- `{{RALLY_BIN}} skill run implement <todo-file> <role> [--reviewers N]` — implement a todo with code review
- `{{RALLY_BIN}} skill run negotiate <topic> <role> [--agents N]` — multi-agent planning/negotiation

**Roles for implement sessions:**

- `implement` — writes the code (use when the user says "implement", "build", "code", etc.)
- `review` — reviews checkpoints (use when the user says "review", "check", etc.)

**Rally auto-assigns reviewer names.** Always pass `review` as the role — rally will automatically assign unique names (review-1, review-2, etc.). Never pick your own reviewer number.

**Mapping examples:**

| User says | Interpretation |
|-----------|---------------|
| `impl todos/foo.md 2 reviewers` | `{{RALLY_BIN}} skill run implement todos/foo.md implement --reviewers 2` |
| `impl todos/foo.md you implement with 2 reviewers` | `{{RALLY_BIN}} skill run implement todos/foo.md implement --reviewers 2` |
| `review todos/foo.md` | `{{RALLY_BIN}} skill run implement todos/foo.md review` |
| `implement the microvm todo as reviewer` | Find the todo file, run as review |
| `impl todos/foo.md` | If role is ambiguous, ask the user |

### If you need more workspace context

Run this to discover todo files, active sessions, and saved context:

```bash
{{RALLY_BIN}} skill agent-howto $ARGUMENTS
{{RALLY_BIN}} skill context
```

Then follow the printed instructions exactly.
## Step 2: Run the command

Run the `{{RALLY_BIN}} skill run ...` command you determined above.

## Step 3: Follow the instruction loop

1. **READ** the instruction printed by the command.
2. **DO** exactly what it says — write files, run tests, git commit, etc.
3. **RUN** the follow-up commands listed at the end of your instruction (checkpoint, review, etc). Run them ALL, in order.
4. **RUN** `{{RALLY_BIN}} skill run` again with no arguments to get your next instruction.
5. **REPEAT** from step 1. Do NOT stop until the output says "session complete; stop working".

**IMPORTANT: You are ONE agent in a multi-agent session. Other agents are running in separate terminals.**

- If the command prints "Waiting for ..." — just wait and poll. Do NOT try to spawn or recruit other agents.
- If the command exits with code 2 or prints "session complete" — you are done. Stop.
- Rally tells you your assigned name (e.g. "registered 'review-2'"). Use that name for all subsequent commands.
18 changes: 17 additions & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ pub enum Command {
Status(StatusArgs),
#[command(about = "List all sessions")]
Sessions,
#[command(about = "Interactively select and delete a session")]
Reset,
#[command(about = "File a divergence issue (plan sessions)")]
FileIssue(FileIssueArgs),
#[command(about = "Challenge another agent's position (plan sessions)")]
Expand Down Expand Up @@ -114,7 +116,7 @@ pub struct CreateArgs {
pub workflow: Option<String>,
#[arg(
long,
default_value = "implementer",
default_value = "implement",
help = "Implementer agent name for implement sessions"
)]
pub implementer: String,
Expand Down Expand Up @@ -346,6 +348,11 @@ pub enum SkillSubcommand {
long_about = "Print the latest Rally agent instructions for `/rally` wrappers.\n\nPass the same wrapper args so this command can print the exact follow-up `rally skill run ...` command to execute."
)]
AgentHowto(SkillAgentHowtoArgs),
#[command(
about = "Print workspace context for intelligent command resolution",
long_about = "Print workspace context for intelligent command resolution.\n\nOutputs available workflows, todo files in the workspace, active sessions, and saved session context. Designed to be read by a coding agent to determine the right `rally skill run` command."
)]
Context(SkillContextArgs),
#[command(about = "Validate wrapper installation and target paths")]
Doctor(SkillDoctorArgs),
#[command(about = "Uninstall Rally-managed wrapper artifacts")]
Expand Down Expand Up @@ -399,6 +406,15 @@ pub struct SkillAgentHowtoArgs {
pub args: Vec<String>,
}

#[derive(Args, Debug)]
pub struct SkillContextArgs {
#[arg(
long,
help = "Workspace directory to scan for todo files (defaults to current directory)"
)]
pub workspace: Option<PathBuf>,
}

#[derive(Args, Debug)]
pub struct SkillDoctorArgs {
#[arg(
Expand Down
Loading