feat(cli): add --workflow for sequential pattern composition#2069
Open
1rashiid wants to merge 5 commits into
Open
feat(cli): add --workflow for sequential pattern composition#20691rashiid wants to merge 5 commits into
1rashiid wants to merge 5 commits into
Conversation
Adds a lightweight pattern composition feature that lets users chain
multiple patterns together via a simple YAML/JSON workflow file,
piping each step's output into the next step's input.
* New --workflow flag parses YAML/JSON with steps: [{pattern, input?,
variables?, model?, vendor?}]
* Each step reuses the existing Chatter.Send path, so --stream,
--dry-run, -m/-V, -v, --context, --strategy, --language all continue
to work unchanged
* Pre-flight validation: empty steps, missing pattern, repeated
patterns, and unknown pattern names all fail before any LLM call
* Per-step input override: an optional `input:` field lets a step
ignore the carried output; whitespace-only values are treated as no
override
* Progress + errors use a consistent "[step N/TOTAL pattern]" prefix
on stderr so stdout stays pipe-clean
* Single-pattern -p path is untouched – workflow only activates when
--workflow is set
Tests cover loading, validation, input-override chaining, empty-output
handling, and bad/malformed workflow files.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
7 tasks
Collaborator
|
Please fix the |
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.
Adds a
--workflow <file>flag that runs multiple patterns in sequence, piping each step's output into the next step's input. Workflows are simple YAML/JSON files with asteps:list — each step names a pattern and may optionally overrideinput,variables,model, orvendor.Every step reuses the existing
Chatter.Sendpath, so all current flags (--stream,--dry-run,-m,-v,--context, etc.) keep working. Patterns are validated against the local store before any LLM call, and runtime failures stop immediately with a[step N/TOTAL pattern] failed: …error. Progress goes to stderr; final result to stdout. Single-pattern-pusage is untouched.cat article.txt | fabric --workflow wf.yaml --stream🤖 Generated with Claude Code