Add "minimal" pipeline template for trivial single-file fixes#241
Add "minimal" pipeline template for trivial single-file fixes#241
Conversation
- New `minimal` template: intake → build → test → PR with no quality gates, no intelligence, haiku model, and max 3 build iterations - Project detection recommends `minimal` for projects with ≤5 source files - Daemon triage selects `minimal` for score ≥90 (very simple issues) - Updated CLAUDE.md pipeline template tables - Added to upgrade file list for `shipwright upgrade` - Updated tests for project-detect and daemon-triage Closes #122 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The pipeline test suite was failing when run inside a pipeline (e.g., via `shipwright loop`) because parent environment variables like PIPELINE_TEMPLATE, ARTIFACTS_DIR, and SCRIPT_DIR leaked into the test subprocess, causing it to load the wrong template and skip stages. Fixes: - Clear pipeline-related env vars in invoke_pipeline() before running the subprocess - Handle --effort, --fallback-model, --dangerously-skip-permissions flags in mock claude CLI to prevent prompt corruption Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
📝 WalkthroughWalkthroughA new "minimal" pipeline template is introduced for trivial single-file fixes, featuring only build and test stages. Detection logic is added to identify trivial projects and high-scoring tasks to select this template. Infrastructure, tests, and documentation are updated to support the new template throughout the system. Changes
Sequence DiagramsequenceDiagram
participant PR as Pull Request
participant PD as Project Detector
participant DT as Daemon Triage
participant TS as Template System
participant PE as Pipeline Executor
PR->>PD: Analyze project characteristics
alt Trivial Project (≤5 files, no CI/deploy)
PD->>TS: Select minimal template (90% confidence)
else Non-trivial Project
PD->>DT: Calculate quality score
alt High Score (≥90)
DT->>TS: Select minimal template
else Medium Score (≥70)
DT->>TS: Select fast template
else Low Score
DT->>TS: Select standard/full template
end
end
TS->>PE: Load selected template (minimal: intake+build+test)
PE->>PE: Execute with max 3 iterations, no quality gates
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.claude/loop-state.md:
- Around line 81-82: The JSON result under "Iteration 1 (2026-03-09T11:11:31Z)"
is truncated (it ends at "resu") and breaks structured parsing; open
.claude/loop-state.md, locate the Iteration 1 block header and the following
JSON blob, then either remove that incomplete JSON entry or replace it with a
fully-formed JSON result (regenerate the complete iteration object so it matches
other iterations' structure), ensuring the entry no longer ends with the partial
token "resu" and that the JSON is valid.
- Line 2: The YAML-like `goal` value is broken by unescaped double quotes around
minimal, causing the field to end early; update the `goal` entry in
.claude/loop-state.md so the embedded quotes are either escaped or the whole
value is wrapped in single quotes (e.g., goal: 'Add "minimal" pipeline template
for trivial single-file fixes') to preserve the full string.
In `@scripts/sw-pipeline-test.sh`:
- Around line 139-140: The mock CLI parser currently treats --output-format as a
valueless flag (in the case branch matching
"--print|--output-format|--dangerously-skip-permissions") so the following
"json" is left as the prompt; remove --output-format from that valueless group
and add it to the value-taking group (the branch handling
"--model|--max-turns|--effort|--fallback-model|-p") so that --output-format
causes a shift 2 like other flags that accept an argument, ensuring
"--output-format json" is consumed together.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ca2368fe-36f4-423e-947a-9761650eb3b0
⛔ Files ignored due to path filters (4)
.claude/loop-logs/iteration-1.logis excluded by!**/*.log.claude/loop-logs/iteration-2.logis excluded by!**/*.log.claude/loop-logs/tests-iter-1.logis excluded by!**/*.log.claude/loop-logs/tests-iter-2.logis excluded by!**/*.log
📒 Files selected for processing (12)
.claude/CLAUDE.md.claude/daemon-config.json.claude/intelligence-cache.json.claude/loop-state.md.claude/platform-hygiene.jsonscripts/lib/daemon-triage.shscripts/lib/project-detect.shscripts/sw-lib-daemon-triage-test.shscripts/sw-pipeline-test.shscripts/sw-project-detect-test.shscripts/sw-upgrade.shtemplates/pipelines/minimal.json
| # stderr: (empty) | ||
| # exit: 0 | ||
| [... full design in .claude/pipeline-artifacts/design.md] | ||
| goal: "Add "minimal" pipeline template for trivial single-file fixes |
There was a problem hiding this comment.
Quote the goal value correctly.
The embedded " around minimal terminates the field early, so any parser reading goal: will only recover Add instead of the full objective.
Suggested fix
-goal: "Add "minimal" pipeline template for trivial single-file fixes
+goal: 'Add "minimal" pipeline template for trivial single-file fixes'📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| goal: "Add "minimal" pipeline template for trivial single-file fixes | |
| goal: 'Add "minimal" pipeline template for trivial single-file fixes' |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.claude/loop-state.md at line 2, The YAML-like `goal` value is broken by
unescaped double quotes around minimal, causing the field to end early; update
the `goal` entry in .claude/loop-state.md so the embedded quotes are either
escaped or the whole value is wrapped in single quotes (e.g., goal: 'Add
"minimal" pipeline template for trivial single-file fixes') to preserve the full
string.
| ### Iteration 1 (2026-03-09T11:11:31Z) | ||
| {"type":"result","subtype":"success","is_error":false,"duration_ms":529352,"duration_api_ms":415316,"num_turns":65,"resu |
There was a problem hiding this comment.
Remove or regenerate the truncated JSON log entry.
This record stops at resu, so it is no longer valid JSON. Anything consuming structured iteration results from loop-state.md will fail or silently ignore the success event.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.claude/loop-state.md around lines 81 - 82, The JSON result under "Iteration
1 (2026-03-09T11:11:31Z)" is truncated (it ends at "resu") and breaks structured
parsing; open .claude/loop-state.md, locate the Iteration 1 block header and the
following JSON blob, then either remove that incomplete JSON entry or replace it
with a fully-formed JSON result (regenerate the complete iteration object so it
matches other iterations' structure), ensuring the entry no longer ends with the
partial token "resu" and that the JSON is valid.
| --print|--output-format|--dangerously-skip-permissions) shift ;; | ||
| --model|--max-turns|--effort|--fallback-model|-p) shift 2 ;; |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Inspect Claude CLI call sites and confirm whether --output-format is followed by a value.
rg -n -C3 --type=sh --pcre2 'claude\b|--output-format\b|-p\b|--model\b|--max-turns\b|--effort\b|--fallback-model\b' scripts .claudeRepository: sethdford/shipwright
Length of output: 50377
🏁 Script executed:
# Search specifically for claude command invocations with --output-format context
rg -n -B2 -A2 '(claude\s+.*--output-format|--output-format\s+)' scripts/*.sh | head -100Repository: sethdford/shipwright
Length of output: 2110
🏁 Script executed:
# Look at the actual sw-pipeline.sh file to see how claude is invoked
fd -name 'sw-pipeline.sh' -type f | head -5 | xargs wc -lRepository: sethdford/shipwright
Length of output: 313
🏁 Script executed:
# Examine the create_mock_claude function and actual invocations
rg -n -A20 'create_mock_claude' scripts/sw-pipeline-test.sh | head -80Repository: sethdford/shipwright
Length of output: 1747
🏁 Script executed:
# Search for how --output-format is actually passed with values
rg -n '(--output-format\s+json|--output-format\s+\$)' scripts/ lib/Repository: sethdford/shipwright
Length of output: 851
🏁 Script executed:
# Look at build_claude_flags to understand actual invocation pattern
rg -n -A10 'build_claude_flags' scripts/ lib/ | head -60Repository: sethdford/shipwright
Length of output: 3591
🏁 Script executed:
# Confirm by examining lines around sw-loop.sh:1878 for exact invocation
sed -n '1870,1890p' scripts/sw-loop.shRepository: sethdford/shipwright
Length of output: 927
🏁 Script executed:
# Verify the exact invocation of claude in the real pipeline
rg -n 'claude.*-p.*PROMPT' scripts/ --type=sh | head -20Repository: sethdford/shipwright
Length of output: 162
🏁 Script executed:
# Look at the actual argument expansion in create_mock_claude again more carefully
sed -n '132,150p' scripts/sw-pipeline-test.shRepository: sethdford/shipwright
Length of output: 623
🏁 Script executed:
# Check if there are other test mocks that might show the issue
rg -n -B5 -A10 'shift 2' scripts/sw-pipeline-test.shRepository: sethdford/shipwright
Length of output: 591
Move --output-format from valueless flags to value-taking flags in the mock CLI parser.
The real Claude CLI passes --output-format json as two arguments. The mock currently consumes only the flag with shift, leaving json to be parsed as the prompt in the next iteration. This corrupts prompt detection and invalidates E2E test outcomes.
Fix
- --print|--output-format|--dangerously-skip-permissions) shift ;;
- --model|--max-turns|--effort|--fallback-model|-p) shift 2 ;;
+ --print|--dangerously-skip-permissions) shift ;;
+ --output-format|--model|--max-turns|--effort|--fallback-model|-p) shift 2 ;;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| --print|--output-format|--dangerously-skip-permissions) shift ;; | |
| --model|--max-turns|--effort|--fallback-model|-p) shift 2 ;; | |
| --print|--dangerously-skip-permissions) shift ;; | |
| --output-format|--model|--max-turns|--effort|--fallback-model|-p) shift 2 ;; |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@scripts/sw-pipeline-test.sh` around lines 139 - 140, The mock CLI parser
currently treats --output-format as a valueless flag (in the case branch
matching "--print|--output-format|--dangerously-skip-permissions") so the
following "json" is left as the prompt; remove --output-format from that
valueless group and add it to the value-taking group (the branch handling
"--model|--max-turns|--effort|--fallback-model|-p") so that --output-format
causes a shift 2 like other flags that accept an argument, ensuring
"--output-format json" is consumed together.
Summary
Add "minimal" pipeline template for trivial single-file fixes
Changes
16 files changed, 12331 insertions(+), 1342 deletions(-)
8 commit(s) via
shipwright pipeline(fast)Test Results
Developer simulation: 0 reviewer concerns pre-addressed
Architecture validation: 0 violations
Closes #122
fastGenerated by
shipwright pipelineSummary by CodeRabbit
New Features
Improvements
Tests