@trailstep/create-flows 0.3.2 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # @trailstep/create-flows
2
2
 
3
- `@trailstep/create-flows` is a public package of reusable, general-purpose TrailStep workflows. It demonstrates how TrailStep's small step model can grow into larger, long-horizon coding workflows with focused agent sessions, typed handoffs, review loops, and retryable boundaries.
3
+ `@trailstep/create-flows` is a public package of reusable, general-purpose TrailStep workflows. It demonstrates how TrailStep's small step model can grow into larger, long-horizon coding workflows with typed handoffs, review loops, and retryable boundaries.
4
4
 
5
5
  ## Workflows
6
6
 
7
7
  - `grillItAway`: default registered id `grill-it-away`; starts interactively by asking clarifying questions, then runs the implementation pipeline.
8
8
  - `takeItAway`: default registered id `take-it-away`; starts from an already-organic conversation, ticket, or feature request, then runs the implementation pipeline.
9
9
 
10
- Both workflows end with a typed output containing implementation status, feature/implementation document paths, completed story count, completed story titles, and a summary.
10
+ `grillItAway` and `takeItAway` end with a typed output containing implementation status, feature/implementation document paths, completed story count, completed story titles, and a summary.
11
11
 
12
12
  ## Recommended setup
13
13
 
@@ -31,7 +31,7 @@ trailstep init --scope project --install-skill
31
31
  # Preview without installing, registering, or writing skills.
32
32
  trailstep add @trailstep/create-flows@latest --scope project --workflow "*" --project-skill --dry-run
33
33
 
34
- # Install/register both workflows and generate project skills.
34
+ # Install/register the workflows and generate project skills.
35
35
  trailstep add @trailstep/create-flows@latest --scope project --workflow "*" --project-skill --yes
36
36
  ```
37
37
 
@@ -59,58 +59,108 @@ rough idea --> interactive grill step --> { conversation } --> implementation pi
59
59
 
60
60
  Use this when you already have enough context in a conversation, ticket, issue, or feature request. It skips the interactive grill step and starts the implementation pipeline directly.
61
61
 
62
- Input is a JSON object:
62
+ Input is a JSON object. `autoCommit` and `pullRequest.enabled` both default to `true`; disable them only when you want to manage commits or PR creation yourself. `planningCheckpoint.enabled` defaults to `false`; enable it to pause for human approval after plan/story slicing and before story execution.
63
63
 
64
64
  ```json
65
65
  {
66
- "conversation": "We need a workflow that exports widget reports..."
66
+ "conversation": "We need a workflow that exports widget reports...",
67
+ "autoCommit": true,
68
+ "pullRequest": {
69
+ "enabled": true,
70
+ "base": "main",
71
+ "remote": "origin",
72
+ "draft": false
73
+ },
74
+ "planningCheckpoint": {
75
+ "enabled": false
76
+ }
67
77
  }
68
78
  ```
69
79
 
70
80
  ## Step architecture
71
81
 
72
- The two workflows share the same implementation pipeline after initial intake:
82
+ `grill-it-away` and `take-it-away` share the same implementation pipeline after initial intake:
73
83
 
74
84
  ```mermaid
75
85
  flowchart TD
76
- A[grill-it-away interactive intake] --> C[create-feature-doc]
77
- B[take-it-away conversation input] --> C
78
- C --> D[create-or-improve-implementation-doc]
79
- D --> E[review-implementation-doc]
86
+ A[grill-it-away interactive intake] --> B1[initialize-take-it-away]
87
+ B[take-it-away conversation input] --> B1
88
+ B1 --> C[create-feature-doc]
89
+ C --> D[create-or-improve-implementation-strategy]
90
+ D --> E[review-implementation-strategy]
80
91
  E -->|needs work| D
81
- E -->|passes| F[split-implementation-stories]
82
- F --> G[implement-story]
83
- G --> H[review-story-implementation]
84
- H -->|needs work| G
92
+ E -->|passes| F[slice-implementation-stories]
93
+ F --> F2[split-implementation-stories]
94
+ F2 --> P{planning checkpoint enabled?}
95
+ P -->|yes| Q[planning-checkpoint]
96
+ Q -->|approve| R0[story-router]
97
+ Q -->|revise| D
98
+ P -->|no| R0
99
+ R0 --> G[story-isolation-preflight]
100
+ G --> G2[deterministic-context-preflight]
101
+ G2 --> R[write-red-tests]
102
+ R --> S[implement-green]
103
+ S --> T[validate-story deterministic code step]
104
+ T -->|failed validation| R0
105
+ T -->|passes| H[review-story-implementation]
106
+ H -->|failed review| R0
85
107
  H -->|passes| I[commit-reviewed-story / mark complete]
86
108
  I --> J{more stories?}
87
- J -->|yes| G
88
- J -->|no| K[done]
109
+ J -->|yes| R0
110
+ J -->|no| K[open-pull-request]
111
+ K --> L[done]
112
+ R0 -->|validation retry escalation| SD[story-doctor]
113
+ SD --> T
89
114
  ```
90
115
 
116
+ After `slice-implementation-stories`, `split-implementation-stories` turns the reviewed strategy into queued stories plus optional per-story context blocks. From there the `story-router` owns active-story routing: it starts each story, sends failed reviews and validations back through retry routes (escalating to `story-doctor` past the threshold), and either hands the next queued story back to `story-isolation-preflight` or ends the run at `open-pull-request`.
117
+
118
+ Stories run strictly one at a time. Full parallelization of create-flows (running multiple stories concurrently) is roadmap and is not yet implemented.
119
+
91
120
  The important TrailStep pattern is not the specific feature methodology; it is the architecture:
92
121
 
93
122
  - each stage is a focused step with its own prompt and agent role
94
123
  - each step passes structured output to the next step
95
124
  - planning and implementation have review loops
96
- - stories are split so implementation work happens one story at a time
125
+ - stories are split so implementation work happens one story at a time (sequential today; parallel story execution is roadmap, not yet implemented)
97
126
  - failed runs can be retried through TrailStep instead of restarting the entire conversation
98
127
 
128
+ ### Reliability and recovery
129
+
130
+ After `slice-implementation-stories`, the story router owns active-story routing. It records the active story, route, retry counts, retry limit, and latest concise review or validation evidence so retryable story work can resume from `.trailstep/runs/<runName>/` artifacts.
131
+
132
+ The review retry cap is 3 failed reviews. Failed reviews route back through `implement-green` until that finite cap is reached; exhausted review routes fail explicitly and leave router state available for inspection.
133
+
134
+ The validation retry cap is 3 failed validations. Validation failures first route back through `implement-green`; the story-doctor threshold is 2 validation failures, so repeated failures escalate to `story-doctor` before the finite cap is exhausted. Exhausted validation routes fail explicitly and preserve their router state.
135
+
136
+ Blocked story phases fail explicitly without guessing a next step. Resolve the underlying blocked condition, then recover the run with `trailstep retry` or `trailstep continue`; do not manually edit `.trailstep/runs` state files.
137
+
138
+ Starting a new story resets per-story clean state and retry budgets, including phase attempts and latest phase summaries, while preserving completed-story progress and the remaining story queue.
139
+
140
+ Reviewer prompt hygiene keeps reviews bounded: reviewer prompts include the active story, concise phase summaries, file lists, git status, the story baseline, and committed/uncommitted diffstat, without full diff bodies or hunks.
141
+
142
+ The `autoCommit` input option controls automatic story commits and defaults to `true`. `commit-reviewed-story` creates one commit per passing story; when `autoCommit` is `false`, TrailStep requires a clean story boundary before prompting the next story.
143
+
144
+ The `pullRequest` input option controls the final code-only PR step and defaults to enabled. At the end of a successful run, TrailStep uses the existing feature doc, implementation strategy, completed-story list, and reviewed commits to push the current branch and run `gh pr create`. If the working tree is dirty or PR creation is unsafe, the workflow still completes and returns a warning with suggested `git`/`gh` commands to run after review.
145
+
99
146
  ## Agent roles
100
147
 
101
148
  The workflows declare role defaults so TrailStep can target different kinds of agent work:
102
149
 
103
150
  - **grillingAgent**: clarifies vague requests interactively.
104
151
  - **featureWriter**: turns the request/conversation into a standalone feature document.
105
- - **planner**: creates or improves an architecture-aware implementation plan.
106
- - **reviewer**: reviews implementation docs and story diffs.
107
- - **implementer**: implements one story at a time.
152
+ - **planner**: creates or improves an architecture-aware implementation strategy.
153
+ - **reviewer**: reviews the implementation strategy before story slicing.
154
+ - **slicer**: turns the reviewed strategy into implementation-ready stories.
155
+ - **testWriter**: writes red tests for the active story.
156
+ - **storyImplementer**: implements one story at a time until validation passes.
157
+ - **storyReviewer**: reviews the isolated active-story changes before commit.
108
158
 
109
159
  ## Safety notes
110
160
 
111
161
  These workflows are intended to change the current project when they reach implementation steps. Review your working tree before and after runs.
112
162
 
113
- By default, the `commit-reviewed-story` step marks reviewed stories complete without creating commits. Automatic story commits are enabled only when `TRAILSTEP_STORY_COMMIT_MODE` is set to `1`, `true`, `enabled`, or `worktree`.
163
+ By default, `commit-reviewed-story` creates reviewed story commits and the final `open-pull-request` step opens a PR with the GitHub CLI. Set `autoCommit` or `pullRequest.enabled` to `false` in workflow input when you want to manage those actions manually.
114
164
 
115
165
  Generated run artifacts live under `.trailstep/runs` by default. Inspect them when needed, but do not edit them to recover workflow state; use `trailstep continue` or `trailstep retry`.
116
166