mit einem Klick
feature-pipeline-abstraction
// Use when working with pipeline stages, completion strategies, build loop orchestration, or the web GUI for spectre-build
// Use when working with pipeline stages, completion strategies, build loop orchestration, or the web GUI for spectre-build
| name | feature-pipeline-abstraction |
| description | Use when working with pipeline stages, completion strategies, build loop orchestration, or the web GUI for spectre-build |
| user-invocable | false |
Trigger: pipeline, stages, completion strategy, build loop, web gui, spectre-build serve Confidence: high Created: 2025-02-03 Updated: 2026-02-08 Version: 2
A generic stage-based pipeline system that replaces the hardcoded build→validate cycle. Pipelines are defined in YAML files with configurable stages, completion strategies, and signal-based transitions. Includes a web GUI for visual pipeline editing and live execution monitoring.
| Scenario | Solution |
|---|---|
| Need more than build→validate (e.g., code review stage) | Define custom pipeline YAML with additional stages |
| Want visual feedback on pipeline execution | Use spectre-build serve for web GUI |
| Need different completion detection per stage | Use Promise (tag-based) or JSON (structured) completion strategies |
| Want loops/retries in pipeline (gaps found → rebuild) | Define transition signals that loop back to earlier stages |
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ YAML Config │───▶│ Loader │───▶│ PipelineConfig │
└─────────────┘ │ (Pydantic) │ └───────┬─────┘
└─────────────┘ │
▼
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Agent │◀───│ Stage │◀───│ Executor │
│ (Claude) │ │ (iteration) │ │ (orchestrate)│
└─────────────┘ └─────────────┘ └─────────────┘
│
▼
┌─────────────┐
│ Completion │ Promise: [[PROMISE:SIGNAL]]
│ Strategy │ JSON: ```json {"status": "..."}```
└─────────────┘
| File | Purpose |
|---|---|
src/build_loop/pipeline/completion.py | CompletionStrategy ABC + PromiseCompletion, JsonCompletion, CompositeCompletion |
src/build_loop/pipeline/stage.py | Stage class - runs iterations, handles transitions |
src/build_loop/pipeline/executor.py | PipelineExecutor - graph traversal, event emission, before/after stage hooks |
src/build_loop/pipeline/loader.py | YAML parsing, Pydantic validation, create_default_pipeline() factory |
src/build_loop/server/app.py | FastAPI app for web GUI |
src/build_loop/server/routes/pipelines.py | Pipeline CRUD REST API + demo pipeline creation |
src/build_loop/server/routes/execution.py | Execution control (start/stop/status) |
src/build_loop/server/routes/ws.py | WebSocket for live event streaming |
src/build_loop/server/static/pipeline-builder.js | Canvas-based visual editor |
.spectre/pipelines/*.yaml | Pipeline definitions (created per-project) |
# Legacy mode (still works)
spectre-build --tasks docs/tasks.md --validate
# Pipeline mode
spectre-build --pipeline .spectre/pipelines/full-feature.yaml --tasks docs/tasks.md
# Web GUI
spectre-build serve
spectre-build serve --port 9000 --host 0.0.0.0
name: full-feature
description: "Build → Code Review → Validate cycle"
start_stage: build
end_signals: [COMPLETE]
stages:
- name: build
prompt: prompts/build.md
completion:
type: promise
signals: [TASK_COMPLETE, BUILD_COMPLETE]
max_iterations: 10
transitions:
BUILD_COMPLETE: code_review
TASK_COMPLETE: build # loop for more tasks
- name: code_review
prompt: prompts/code_review.md
completion:
type: json
statuses: [APPROVED, CHANGES_REQUESTED]
max_iterations: 1
transitions:
APPROVED: validate
CHANGES_REQUESTED: build # loop back
- name: validate
prompt: prompts/validate.md
completion:
type: json
statuses: [COMPLETE, GAPS_FOUND]
max_iterations: 1
transitions:
GAPS_FOUND: build # loop back
| Type | Detection | Use When |
|---|---|---|
promise | [[PROMISE:SIGNAL]] tags in output | Simple signal-based completion |
json | ```json {"status": "..."}``` blocks | Need structured artifacts/metadata |
composite | Tries multiple strategies | Backward compat (JSON with promise fallback) |
stages listprompts/ directoryspectre-build --pipeline your-pipeline.yaml --tasks test.md# In pipeline/completion.py
class MyCompletion(CompletionStrategy):
def evaluate(self, output: str, exit_code: int) -> CompletionResult:
# Parse output, return CompletionResult
return CompletionResult(
is_complete=True,
signal="MY_SIGNAL",
artifacts={"key": "value"}
)
# pyproject.toml
dependencies = [
"fastapi>=0.109.0",
"uvicorn[standard]>=0.27.0",
"pyyaml>=6.0",
"pydantic>=2.0",
"websockets>=12.0",
]
After pipx install, inject dependencies:
pipx inject spectre-build 'uvicorn[standard]' fastapi pyyaml pydantic websockets
.spectre/pipelines/ in current working directory, not package directorydemo-build-validate.yaml and demo-full-feature.yaml[→->] is invalid). Use (?:→|->|=>) insteadpipx install -e . --force clears injected deps, must re-injectUse when modifying build loop code, debugging stats/token tracking, adding CLI features, changing iteration prompts, or understanding how spectre-build works end-to-end
Use when modifying the plan loop, debugging plan stages, changing clarification flow, scope isolation, or understanding how spectre-build --plan works end-to-end
Use when modifying the ship loop, debugging ship stages, changing clean/test/rebase behavior, or understanding how spectre-build --ship works end-to-end
Use when user wants to search for existing knowledge, recall a specific learning, or discover what knowledge is available.
Use when planning product scaling, adding GUI/server layers, multi-model support, adversarial reviews, live steering, telemetry, scheduling/triggers, or node-based pipeline editors to spectre-build
Use this skill when you see @name or /name patterns in user input without file identifiers. This means the user is trying to call a subagent or slash command using Spectre Agent Tools. The @ prefix dispatches to a subagent (e.g., '@tdd-agent write tests', '@code-reviewer check this file'). The / prefix executes a slash command (e.g., '/spectre:scope', '/spectre:plan'). Both require Spectre CLI to run specialized agents and predefined prompts.