[rig-claude] Improve Claude dynamic-workflow compatibility for rig - #411
Conversation
Add 411-anthropic-engine-workflow.md: a new sample that demonstrates configuring anthropicEngine() and selecting Claude model tiers per-call (claude-haiku-3-5 for cheap triage, claude-sonnet-4-5 for fix planning). This is the highest-discoverability gap for Claude dynamic workflow users completing a port to rig — every other primitive has a sample, but the final 'run against Claude' step had no standalone example. Also update claude-workflow-conversion.md to include the new sample in the Example programs table. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅ |
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /codebase-design — requesting one change on pipeline stage convention.
📋 Key Themes & Highlights
Issue
- Pipeline stage signature mismatch: Both
pipelinestage lambdas use(issue: string) =>— a single argument — butPipelineStagepasses(prev, item, index). For a first-stage this silently works (sinceprev === item), but it contradicts the documented shape and misleads readers who extend the sample to a second stage. Sample 401 demonstrates the correct form:(_prev: string, issue: string) =>.
Positive Highlights
- ✅ Clean model-tier table and concise preamble — exactly the kind of orientation a porting user needs
- ✅
configureAgent(anthropicEngine())placement andRIG_ENGINE=anthropicenv-var note are both documented - ✅ Reference table entry in
claude-workflow-conversion.mdis precise and well-linked - ✅ Both pipeline stages use
label:for progress tracking — good habit
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 32.5 AIC · ⌖ 4.2 AIC · ⊞ 6.3K
Comment /matt to run again
| // Fast model for cheap classification — equivalent to { model: "haiku" } in a dynamic workflow. | ||
| const triaged = await pipeline(input.issues, (issue: string) => | ||
| call.json( | ||
| `Classify the priority of this issue: "${issue}"`, |
There was a problem hiding this comment.
[/codebase-design] The pipeline stage lambdas use (issue: string) => but the PipelineStage contract is (prev, item, index) — for stage 1 prev === item so it works at runtime, but it teaches the wrong convention and breaks the mental model if a second stage is added.
💡 Suggested fix
Match the canonical three-argument form shown in sample 401:
const triaged = await pipeline(input.issues,
(_prev: string, issue: string) =>
call.json(
`Classify the priority of this issue: "${issue}"`,
s.object({ priority: s.enum("high", "medium", "low") }),
{ model: "claude-haiku-3-5", label: issue.slice(0, 32) },
));_prev (or _p) signals "first stage; prev === item" and keeps the shape readable for anyone extending to multi-stage.
Compatibility gap addressed
Every Claude dynamic-workflow primitive had a sample demonstrating how to port it to rig — except for the final step: running the ported workflow against Claude using
anthropicEngine()and selecting Claude model tiers per-call. This left a discoverable gap for Claude dynamic-workflow users who completed porting but had no concrete example of the last step.Why this improves transfer from Claude dynamic workflows to Rig
Claude dynamic workflows run on Claude by default; rig requires explicitly selecting an engine. A user completing a port needs to:
configureAgent(anthropicEngine())"sonnet","haiku") to full Claude model IDs ("claude-sonnet-4-5","claude-haiku-3-5")The existing conversion doc had a code snippet for this, but no dedicated standalone sample that someone would land on when searching
anthropicEngine,claude-sonnet, orANTHROPIC_API_KEY.Files changed
skills/rig/samples/411-anthropic-engine-workflow.md— new sample showingconfigureAgent(anthropicEngine())at program top-level, a two-phase workflow (Triage + Plan), per-call model overrides (claude-haiku-3-5for cheap classification,claude-sonnet-4-5for fix planning), and a model tier table in the preamble.skills/rig/references/claude-workflow-conversion.md— added the new sample to the Example programs table.Validation
Remaining intentional differences
effortoption; model tier selection is explicit (useclaude-opus-4-5overclaude-haiku-3-5when quality matters).agentType: "Explore"— expressed through prompt wording and a narrowtoolslist.