feat(skills): rewrite skills to use CLI, reframe orchestrator as chat-first team lead
- paseo: add loop, schedule, chat command reference sections - paseo-loop: replace loop.sh with paseo loop CLI, document model selection and archive - paseo-chat: replace chat.sh with paseo chat CLI - paseo-orchestrator: reframe as team orchestrator using chat rooms as coordination backbone, agents as disposable workers, schedule heartbeat for oversight - paseo-handoff/committee: fix --mode bypass → --mode bypassPermissions - Delete loop.sh (541 lines) and chat.sh (635 lines) bash scripts
This commit is contained in:
+52
-270
@@ -6,13 +6,7 @@ user-invocable: true
|
||||
|
||||
# Paseo Loop Skill
|
||||
|
||||
You are setting up `/paseo-loop` as a flexible loop primitive.
|
||||
|
||||
Think of it like a `while` loop:
|
||||
- each iteration sends work to a target
|
||||
- an optional verifier judges completion
|
||||
- optional sleep schedules the next iteration
|
||||
- hard caps stop the loop if it runs too long
|
||||
You are setting up a loop — an iterative worker/verifier cycle managed by the Paseo daemon.
|
||||
|
||||
**User's arguments:** $ARGUMENTS
|
||||
|
||||
@@ -20,319 +14,107 @@ Think of it like a `while` loop:
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Load the **Paseo skill** first. It contains the CLI reference for `paseo run`, `paseo send`, `paseo wait`, and related commands.
|
||||
Load the **Paseo skill** first. It contains the CLI reference for `paseo loop` and related commands.
|
||||
|
||||
## Core Model
|
||||
|
||||
Every loop has these parts:
|
||||
A loop repeats: launch a worker → verify → repeat until done or limits hit.
|
||||
|
||||
1. **Target**: who acts each iteration
|
||||
2. **Prompt**: what the target does each iteration
|
||||
3. **Verifier**: optional independent judge
|
||||
4. **Sleep**: optional pause between iterations
|
||||
5. **Stop conditions**: max iterations and/or max total runtime
|
||||
1. **Worker prompt**: what the worker does each iteration
|
||||
2. **Verification**: verifier prompt and/or shell checks that judge success
|
||||
3. **Sleep**: optional pause between iterations
|
||||
4. **Stop conditions**: max iterations and/or max total runtime
|
||||
5. **Model selection**: different providers/models for worker vs verifier
|
||||
6. **Archive**: optionally preserve agent history after each iteration
|
||||
|
||||
### Target
|
||||
## Verification
|
||||
|
||||
There are two target modes:
|
||||
Every loop needs at least one form of verification:
|
||||
|
||||
#### `self`
|
||||
- `--verify "<prompt>"` — a verifier agent judges the worker's output
|
||||
- `--verify-check "<command>"` — a shell command that must exit 0 (repeatable)
|
||||
- Both can be combined: shell checks run first, then the verifier prompt
|
||||
|
||||
The loop sends the prompt back to the current agent each iteration. The current agent is identified by `$PASEO_AGENT_ID`.
|
||||
## Model Selection
|
||||
|
||||
Use `self` when:
|
||||
- the current agent should keep ownership of the task
|
||||
- the user says "babysit", "watch", "check every X", "poll", or "monitor"
|
||||
- waking the same agent is cheaper and more natural than starting fresh
|
||||
Choose the right provider/model for worker and verifier independently:
|
||||
|
||||
#### `new-agent`
|
||||
- `--provider`/`--model` — sets the worker's provider and model
|
||||
- `--verify-provider`/`--verify-model` — sets the verifier's provider and model
|
||||
|
||||
The loop launches a fresh worker agent each iteration.
|
||||
Default: both use Claude/sonnet. For implementation loops, use Codex for the worker and Claude for the verifier — each catches the other's blind spots.
|
||||
|
||||
Use `new-agent` when:
|
||||
- the user says "create a loop", "spin up a loop", or "launch a codex agent"
|
||||
- the task benefits from fresh context per iteration
|
||||
- you want isolated retries, often in a worktree
|
||||
## Archive
|
||||
|
||||
### Verifier
|
||||
|
||||
The verifier is orthogonal to the target:
|
||||
- no verifier: the target decides whether the loop is done
|
||||
- verifier present: the verifier decides whether the loop is done
|
||||
|
||||
If a verifier exists, it is the source of truth for loop completion.
|
||||
`--archive` preserves worker and verifier agents after each iteration instead of destroying them. Use this when you need to inspect conversation history for debugging.
|
||||
|
||||
## Defaults by User Intent
|
||||
|
||||
Infer defaults from the user's phrasing:
|
||||
|
||||
### Babysit / watch / check every X
|
||||
|
||||
Default to:
|
||||
- `target=self`
|
||||
- `sleep=<explicit value or sensible default>`
|
||||
- no verifier unless the user asks for independent verification
|
||||
- `max-time=1h` if the user gives no bound and the task could run indefinitely
|
||||
|
||||
### Ensure X is done
|
||||
|
||||
Default to:
|
||||
- `target=self`
|
||||
- verifier enabled
|
||||
- no sleep unless the task is waiting on an external system
|
||||
|
||||
Reason: by default, do not trust the same agent to judge its own completion when the user is asking for assurance.
|
||||
|
||||
### Create a loop / launch a loop / loop a codex agent
|
||||
|
||||
Default to:
|
||||
- `target=new-agent`
|
||||
- verifier enabled when success criteria need independent judgment
|
||||
- worktree enabled when code changes are involved
|
||||
|
||||
## Stop Conditions
|
||||
|
||||
Support both:
|
||||
- `--max-iterations N`
|
||||
- `--max-time DURATION`
|
||||
|
||||
Use at least one bound for open-ended or polling loops when the user does not specify one.
|
||||
|
||||
## Feedback Between Iterations
|
||||
|
||||
Each iteration should receive the previous result as `<previous-iteration-result>`.
|
||||
|
||||
This applies in all cases:
|
||||
- if there is a verifier, feed back the verifier's `reason`
|
||||
- otherwise feed back the target's `reason`
|
||||
|
||||
## Live Steering
|
||||
|
||||
Each loop persists state in:
|
||||
|
||||
```text
|
||||
~/.paseo/loops/<loop-id>/
|
||||
target-prompt.md # prompt sent to self or worker (live-editable)
|
||||
verifier-prompt.md # verifier prompt (live-editable, optional)
|
||||
last_reason.md # latest reason used for feedback
|
||||
history.log # per-iteration records
|
||||
```
|
||||
|
||||
Edits to prompt files are picked up on the next iteration without restarting the loop.
|
||||
|
||||
## Script Interface
|
||||
|
||||
The loop is implemented at:
|
||||
|
||||
```bash
|
||||
skills/paseo-loop/bin/loop.sh
|
||||
```
|
||||
|
||||
### Flags
|
||||
|
||||
| Flag | Required | Default | Description |
|
||||
|---|---|---|---|
|
||||
| `--target self|new-agent` | No | inferred / `new-agent` in raw script | Who acts each iteration |
|
||||
| `--target-prompt` | Yes* | — | Prompt given to the target each iteration |
|
||||
| `--target-prompt-file` | Yes* | — | Read the target prompt from a file |
|
||||
| `--worker` | No | `codex` | Worker agent for `new-agent` loops |
|
||||
| `--agent-id` | No | `$PASEO_AGENT_ID` | Existing agent id for `self` loops |
|
||||
| `--verifier-prompt` | No* | — | Prompt for an independent verifier |
|
||||
| `--verifier-prompt-file` | No* | — | Read verifier prompt from a file |
|
||||
| `--verifier` | No | `claude/sonnet` | Verifier agent |
|
||||
| `--name` | Yes | — | Name prefix for loop tracking |
|
||||
| `--sleep` | No | — | Delay between iterations |
|
||||
| `--max-iterations` | No | unlimited | Hard cap on iteration count |
|
||||
| `--max-time` | No | unlimited | Hard cap on total wall-clock runtime |
|
||||
| `--archive` | No | off | Archive newly created agents after iteration |
|
||||
| `--worktree` | No | — | Worktree name for `new-agent` loops |
|
||||
| `--thinking` | No | `medium` | Thinking level for worker |
|
||||
|
||||
\* Provide exactly one of `--target-prompt` or `--target-prompt-file`. Provide at most one of `--verifier-prompt` or `--verifier-prompt-file`.
|
||||
|
||||
## Behavior Rules
|
||||
|
||||
### `target=self`, no verifier
|
||||
|
||||
The current agent must return structured JSON:
|
||||
|
||||
```json
|
||||
{ "done": true, "reason": "..." }
|
||||
```
|
||||
|
||||
Use this for:
|
||||
- babysitting a PR
|
||||
- scheduled status checks
|
||||
- monitoring a deployment
|
||||
- repeating an objective task the current agent can judge itself
|
||||
|
||||
### `target=self`, verifier enabled
|
||||
|
||||
The current agent does the work. A separate verifier decides whether the loop is done.
|
||||
|
||||
Use this for:
|
||||
- "ensure X is done"
|
||||
- "work until the tests are passing"
|
||||
- cases where the user wants independent judgment but keeping the same agent is still the right execution model
|
||||
|
||||
### `target=new-agent`, no verifier
|
||||
|
||||
A fresh worker launches each iteration and must return structured JSON itself.
|
||||
|
||||
Use this when:
|
||||
- the task is naturally self-judging
|
||||
- you want fresh context each retry
|
||||
|
||||
### `target=new-agent`, verifier enabled
|
||||
|
||||
A fresh worker launches each iteration. After it finishes, a separate verifier judges completion.
|
||||
|
||||
Use this for:
|
||||
- implementation loops
|
||||
- fix-and-verify cycles
|
||||
- loops the user explicitly asks you to create
|
||||
|
||||
## Examples
|
||||
|
||||
### Babysit the PR
|
||||
|
||||
Interpretation:
|
||||
- `target=self`
|
||||
- `sleep=2m`
|
||||
- no verifier unless requested
|
||||
- reasonable `max-time` if none given
|
||||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
skills/paseo-loop/bin/loop.sh \
|
||||
--target self \
|
||||
--target-prompt "Check PR #42. Review CI, review comments, and branch status. Fix issues as they arise. Return JSON with done=true only when the PR is fully green and ready." \
|
||||
paseo loop run "Check PR #42. Review CI, comments, and branch status. Fix issues as they arise." \
|
||||
--verify-check "gh pr checks 42 --fail-fast" \
|
||||
--sleep 2m \
|
||||
--max-time 1h \
|
||||
--name babysit-pr-42
|
||||
```
|
||||
|
||||
### Launch a Codex agent to babysit the PR
|
||||
|
||||
Interpretation:
|
||||
- `target=new-agent`
|
||||
- `worker=codex`
|
||||
- `sleep=2m`
|
||||
- usually archive
|
||||
### Keep trying until tests pass
|
||||
|
||||
```bash
|
||||
skills/paseo-loop/bin/loop.sh \
|
||||
--target new-agent \
|
||||
--worker codex \
|
||||
--target-prompt "Check PR #42. Review CI, review comments, and branch status. Fix issues as they arise. Return JSON with done=true only when the PR is fully green and ready." \
|
||||
--sleep 2m \
|
||||
--max-time 1h \
|
||||
--archive \
|
||||
--name babysit-pr-42
|
||||
```
|
||||
|
||||
### Work until the tests are passing
|
||||
|
||||
Interpretation:
|
||||
- `target=self`
|
||||
- verifier enabled
|
||||
- no sleep
|
||||
|
||||
```bash
|
||||
skills/paseo-loop/bin/loop.sh \
|
||||
--target self \
|
||||
--target-prompt "Run the test suite, investigate failures, and fix the code. Stop after you have made a coherent attempt for this iteration." \
|
||||
--verifier-prompt "Run the relevant test suite. Return done=true only if all tests pass. Reason must cite the exact command and outcome." \
|
||||
paseo loop run "Run the test suite, investigate failures, and fix the code." \
|
||||
--provider codex \
|
||||
--verify "Run the test suite. Return done=true only if all tests pass. Cite the exact command and outcome." \
|
||||
--verify-check "npm test" \
|
||||
--max-iterations 10 \
|
||||
--name fix-tests
|
||||
```
|
||||
|
||||
### Create a loop to fix the tests
|
||||
|
||||
Interpretation:
|
||||
- `target=new-agent`
|
||||
- verifier enabled
|
||||
- often use a worktree
|
||||
### Implementation loop with cross-provider review
|
||||
|
||||
```bash
|
||||
skills/paseo-loop/bin/loop.sh \
|
||||
--target new-agent \
|
||||
--worker codex \
|
||||
--target-prompt "Run the test suite, investigate failures, fix the code, and leave the repo in a clean verifiable state for this iteration." \
|
||||
--verifier-prompt "Run the relevant test suite. Return done=true only if all tests pass. Reason must cite the exact command and outcome." \
|
||||
--worktree fix-tests \
|
||||
--max-iterations 10 \
|
||||
--name fix-tests
|
||||
```
|
||||
|
||||
### Loop a Codex agent to complete issue 456 in a worktree
|
||||
|
||||
Interpretation:
|
||||
- `target=new-agent`
|
||||
- worker codex
|
||||
- verifier enabled
|
||||
- worktree enabled
|
||||
|
||||
```bash
|
||||
skills/paseo-loop/bin/loop.sh \
|
||||
--target new-agent \
|
||||
--worker codex \
|
||||
--target-prompt "Implement issue #456 in this repo. Use the issue description and surrounding code as context. Make incremental progress each iteration and leave clear evidence of what changed." \
|
||||
--verifier-prompt "Verify issue #456 is complete. Check changed files, run typecheck and relevant tests, and return done=true only if the implementation meets the issue requirements with evidence." \
|
||||
--worktree issue-456 \
|
||||
paseo loop run "Implement issue #456. Make incremental progress each iteration." \
|
||||
--provider codex \
|
||||
--verify "Verify issue #456 is complete. Check changed files, run typecheck and tests." \
|
||||
--verify-provider claude --verify-model sonnet \
|
||||
--max-iterations 8 \
|
||||
--max-time 2h \
|
||||
--archive \
|
||||
--name issue-456
|
||||
```
|
||||
|
||||
## Managing Loops
|
||||
|
||||
```bash
|
||||
paseo loop ls # List all loops
|
||||
paseo loop inspect <id> # Show details and iteration history
|
||||
paseo loop logs <id> # Stream logs
|
||||
paseo loop stop <id> # Stop a running loop
|
||||
```
|
||||
|
||||
## Your Job
|
||||
|
||||
1. Understand the user's intent from the conversation and `$ARGUMENTS`
|
||||
2. Decide `target=self` or `target=new-agent`
|
||||
3. Decide whether a verifier is needed
|
||||
4. Write the target prompt so it is self-contained for the selected target
|
||||
5. Write the verifier prompt, if used, so it is factual and evidence-based
|
||||
6. Choose sleep only when the task is naturally scheduled or polling
|
||||
7. Add sensible stop conditions
|
||||
8. Choose worker / verifier agents
|
||||
9. Choose a short name
|
||||
10. Run `skills/paseo-loop/bin/loop.sh` with the final arguments
|
||||
2. Decide the worker prompt — self-contained, concrete about what to do
|
||||
3. Decide verification — shell checks for objective criteria, verifier prompt for judgment
|
||||
4. Choose providers/models for worker and verifier
|
||||
5. Choose sleep only when the task is polling or waiting on an external system
|
||||
6. Add sensible stop conditions
|
||||
7. Run `paseo loop run` with the final arguments
|
||||
|
||||
## Prompt Writing Rules
|
||||
|
||||
### Target prompt
|
||||
### Worker prompt
|
||||
|
||||
The target prompt must be:
|
||||
The worker prompt must be:
|
||||
- self-contained
|
||||
- concrete about commands, files, branches, tests, PRs, or systems to inspect
|
||||
- explicit about what counts as progress this iteration
|
||||
|
||||
If there is no verifier, the target prompt must instruct the target to end with strict JSON matching:
|
||||
|
||||
```json
|
||||
{ "done": boolean, "reason": "string" }
|
||||
```
|
||||
|
||||
### Verifier prompt
|
||||
|
||||
The verifier prompt should:
|
||||
- check facts, not offer fixes
|
||||
- cite commands, outputs, or file evidence
|
||||
- return strict JSON matching:
|
||||
|
||||
```json
|
||||
{ "done": boolean, "reason": "string" }
|
||||
```
|
||||
|
||||
## Skill Stacking
|
||||
|
||||
The target prompt can instruct the worker to use other skills:
|
||||
|
||||
```bash
|
||||
skills/paseo-loop/bin/loop.sh \
|
||||
--target new-agent \
|
||||
--target-prompt "Use /committee first if you are stuck, then fix the provider list bug." \
|
||||
--verifier-prompt "Verify the provider list renders correctly and typecheck passes." \
|
||||
--name provider-fix
|
||||
```
|
||||
- be specific about what "done" means
|
||||
|
||||
Reference in New Issue
Block a user