[rig-claude] Improve Claude dynamic-workflow compatibility for rig - #357
Conversation
…ynamic workflows - Update claude-workflow-conversion.md to document rig/globals as the migration path for flat top-level Claude dynamic workflow scripts that use call, pipeline, and parallel outside a body function - Add sample 340-flat-workflow-port.md showing the minimal first-step port using rig/globals ambient proxies, with a pointer to the idiomatic body form as step 2 - Add sample 340 to the Example programs table in the conversion reference 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 /grill-with-docs — two minor suggestions, no blocking issues.
📋 Key Themes & Highlights
Key Themes
- Discoverability: The
rig/globalspath is introduced in prose below the primitive mapping table. Developers consulting the table forcall/pipeline/parallelwill find only thebody-destructured rig equivalents, with no in-table pointer to the flat-script path. - Implicit body pattern: Both the inline example and sample 340 use
body: async () => preComputedValuewithout comment. This is correct but non-obvious — the closured value was computed at module load time inside the active run.
Positive Highlights
- ✅ The two-step migration narrative (flat
rig/globals→ idiomaticbody) is exactly the right pattern and clearly communicated - ✅ Explicit "Step 2" pointer to 310 in sample 340 prevents dead-ends
- ✅ Sample numbering (340) is consistent with neighboring workflow-port samples
- ✅ All 464 tests passing as reported
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 35.3 AIC · ⌖ 2.62 AIC · ⊞ 6.3K
Comment /matt to run again
Comments that could not be inline-anchored
skills/rig/references/claude-workflow-conversion.md:21
[/grill-with-docs] The new section is placed between the "Globals" paragraph and "Schema conversion", which makes it hard to discover when following the primitive mapping table — a developer consulting the table for call/pipeline/parallel will find the rig equivalents pointing to body-destructured forms only, with no hint that a flat-script path exists. Consider adding a row to the mapping table (e.g. injected call/pipeline/parallelat top level | import from"rig/globals"``…
skills/rig/samples/340-flat-workflow-port.md:50
[/grill-with-docs] body: async () => verdicts.filter(...).length returns a pre-computed closure value — the real work happened at top-level before workflow() was declared. Without a comment, a reader might ask: why
skills/rig/samples/340-flat-workflow-port.md:50
[/grill-with-docs] body: async () => verdicts.filter(...).length returns a pre-computed closure value — the real work happened at top-level before workflow() was called. A reader might ask: "why is body async if it does nothing async?" A brief inline comment would make the flat-port pattern explicit.
<details>
<summary>💡 Suggested micro-annotation</summary>
// body returns the pre-computed top-level result (flat-port pattern; Step 2 moves this inside body)
body: async () …
</details>
Compatibility gap addressed
The
claude-workflow-conversion.mdreference described how to portargs,phase,log,parallel,pipeline, andcallinto aworkflow({ body }), but never explained how to do a minimal first-step port for flat Claude dynamic workflow scripts — those whose orchestration code runs at the module top-level using injected globals (call,pipeline,parallel) rather than inside abodyfunction.A developer porting such a script had no clear path to
rig/globals, which provides exactly those ambient proxies.Why this improves transfer from Claude dynamic workflows to rig
Claude dynamic workflows inject
call/pipeline/parallelas globals. The equivalent in rig isrig/globals, but it was only mentioned indynamic-workflows.mdandSKILL.md— not in the conversion reference a migrating developer would consult first.This PR:
Updates
claude-workflow-conversion.mdto documentrig/globalsas the minimal migration path for flat scripts — with a short inline example showing the pattern — and notes thatbodydestructuring is preferred for new programs.Adds sample
340-flat-workflow-port.mdshowing a side-by-side Claude flat workflow → rig minimal port, with an explicit "Step 2" pointer to the fully idiomaticbodyform (310-workflow-audit-verify.md). This closes the missing two-step migration sample.Adds the new sample to the Example programs table in the conversion reference so it's discoverable alongside the other ports.
Files changed
skills/rig/references/claude-workflow-conversion.md— addedrig/globalssection with inline example; added 340 to the example programs tableskills/rig/samples/340-flat-workflow-port.md— new sample showing flat Claude-style port viarig/globalswith pointer to idiomatic formValidation run
All 464 tests passed (1 typecheck test run, 463 skipped).
Remaining intentional differences
None introduced. The behavior differences table in
claude-workflow-conversion.mdis unchanged.