Skip to content

[rig-claude] Improve Claude dynamic-workflow compatibility for rig - #309

Merged
pelikhan merged 1 commit into
mainfrom
rig-claude-compat/2026-07-30-06ea2ca77f548af4
Jul 30, 2026
Merged

[rig-claude] Improve Claude dynamic-workflow compatibility for rig#309
pelikhan merged 1 commit into
mainfrom
rig-claude-compat/2026-07-30-06ea2ca77f548af4

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Compatibility gap addressed

log, budget, and until are three Claude dynamic-workflow primitives with direct rig equivalents documented in claude-workflow-conversion.md, but no existing sample demonstrated their use. A developer porting a Claude workflow that uses log(message), guards a loop with budget.remaining(), or replaces an open-ended while loop with until had nowhere to look for a working rig example.

Why this improves transfer

Sample 320 (320-budget-aware-crawler.md) shows all three concepts together in a realistic, runnable program:

  • log(...) — structured progress messages visible in the event stream
  • budget.remaining() — agent-call budget guard inside a loop
  • until({ max, noProgressRounds }, step) — bounded convergence replacing an open-ended while

The header comment references claude-workflow-conversion.md so the sample serves as a direct bridge for anyone searching after reading the conversion table.

Files changed

  • skills/rig/samples/320-budget-aware-crawler.md — new sample

Validation run

npm run sample -- --testNamePattern="skill markdown samples typecheck"

391 tests, 1 passed (390 skipped/unrelated). TypeScript extracted from the new sample typechecks cleanly.

Remaining intentional differences

None introduced. Existing documented differences (effort, agentType, resume journal, sandboxing) are unchanged.

Generated by Daily Rig Claude Dynamic Workflow Compatibility · sonnet46 34.4 AIC · ⌖ 8.09 AIC · ⊞ 5.4K ·

Demonstrates the three Claude dynamic-workflow primitives (log, budget,
until) that had no sample-level example. Maps directly to Claude's
log(message), budget.remaining(), and open-ended while convergence loops.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review July 30, 2026 20:46
@pelikhan
pelikhan merged commit 3d908e9 into main Jul 30, 2026
1 check passed
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 58.3 AIC · ⌖ 4.07 AIC · ⊞ 6.3K
Comment /matt to run again

phase("Crawl");
const pages: { url: string; summary: string }[] = [];

await until({ max: 20, noProgressRounds: 3 }, async (_, round) => {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/grill-with-docs] until state accumulator is ignored — pages is mutated via closure rather than threaded through the state parameter.

The UntilStep<S> contract passes the previous return's state value into the next call as the first argument. The sample names it _ and instead mutates pages via closure, which works (same reference), but obscures the state-threading contract — especially confusing for developers porting a Claude dynamic workflow who expect state to flow through until.

💡 Idiomatic rewrite

Thread state explicitly:

await until({ max: 20, noProgressRounds: 3 }, async (state: typeof pages = [], round) => {
  // ...
  if (result) state.push({ url, summary: result.summary });
  return { state, done, progressKey: `${visited.size}` };
});

Or add a comment explaining the identity relationship if the closure style is intentional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant