[rig-claude] Improve Claude dynamic-workflow compatibility for rig - #454
Draft
github-actions[bot] wants to merge 1 commit into
Draft
[rig-claude] Improve Claude dynamic-workflow compatibility for rig#454github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
Clarify that rig's parallel() requires all thunks to return the same TypeScript type (single generic Result), while Claude dynamic workflows accept heterogeneous thunk return types. Three samples (390, 412, 430) were using Promise.all with a comment explaining that parallel() requires uniform thunk types. Add the same clarification to the primitive mapping table in claude-workflow-conversion.md so porters know when to use Promise.all instead. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Compatibility gap addressed
parallel(thunks)in rig uses a single TypeScript genericResult, meaning all thunks must return the same type. Claude dynamic workflows have no such restriction —parallelaccepts heterogeneous thunks freely. This mismatch was undocumented, causing confusion when porting workflows where agents produce different output shapes.Why this improves transfer from Claude dynamic workflows
A porter following the primitive mapping table would read
parallel(thunks) → parallel(thunks)and assume exact behavior parity. When they try to useparallelwith two agents that have different output types (a very common case), TypeScript fails silently or with an opaque error. The fix makes the limitation explicit at the first place a porter would look: the mapping table.Three samples (390, 412, 430) were already using
Promise.allfor heterogeneous agents but without explanation. Adding a brief comment in each sample and an explicit note in the conversion doc ensures consistent, discoverable guidance.Files changed
skills/rig/references/claude-workflow-conversion.md— added TypeScript note to theparallelrow explaining the uniform-type constraint and thePromise.allfallbackskills/rig/samples/390-parallel-multi-tool-workflow.md— added comment clarifying whyPromise.allis used (heterogeneous agent types)skills/rig/samples/412-parallel-branch-analysis-workflow.md— sameskills/rig/samples/430-parallel-git-stats-workflow.md— sameValidation run
Remaining intentional differences
parallelin Claude dynamic workflows is type-heterogeneous; rig'sparallel<Result>is homogeneous. Workaround: cast withparallel<A | B>([...]) as Promise<[A | null, B | null]>or usePromise.allwhen limiter semantics are not needed.{ effort: "high" }has no rig equivalent; use a more capable model ID.{ agentType: "Explore" }has no rig equivalent; use prompt wording + narrowtoolslist.