No single truth source
Semantics drift across docs, prompts, and implementation.
Built for Claude Code workflow authors
Many workflows look impressive for the first few runs. Then the familiar problems appear: target files get overwritten, steps get skipped, failures cannot be replayed, and lessons never feed into the next run.
WorkflowProgram exists to solve those engineering problems directly. It treats a workflow as a product with a truth source, a control plane, a validation layer, and a feedback loop.
Step 1: See the failure modes
Semantics drift across docs, prompts, and implementation.
One run follows the intended sequence, the next skips or repeats steps.
Conflicts are hard to recover and user-maintained files get overwritten.
You know the run failed, but not whether design, execution, or judgment was wrong.
There is no state, event, or report trail to replay what happened.
"Finished" is treated as "correct".
The same mistakes repeat because they live only in chat history.
Similar requests route to different skills and produce different behavior.
Step 2: Understand the design
Behavior starts from one machine-readable source of truth. Human-facing guides come later.
Programs own transitions, boundaries, and evidence. The model works inside steps, not between them.
The generator should not be its own judge. Verdicts are produced independently from evidence.
Per-run lessons and long-lived rules are different things. Both are needed.
Step 3: Draw the boundaries
The source of capabilities: skills, scripts, templates, and plugin payloads.
The user project that receives the final `.claude/` assets.
The isolated workspace for one run: context, state, events, reports, and candidates.
Step 4: Split responsibilities
Route the request, clarify requirements, explore context, and settle the machine-readable design.
Generate candidate assets, apply them safely, and validate the workflow verdict independently.
Turn the run into lessons, constraint candidates, and the next improvement direction.
Step 5: Make sequencing deterministic
Defines the fixed order of checks and execution steps.
Advances state, enforces runtime constraints, and persists evidence.
Consumes evidence and gives the workflow-level verdict.
Step 6: Route before acting
Similar natural-language requests should not unpredictably land on different flows.
`workflowprogram-orchestrate` plus `route-intent.py` decide the intent and preserve route evidence before execution proceeds.
Step 7: Control target writes
Generate candidates first, classify changes, then apply them in a managed way.
`RUN_ROOT/outputs/candidate/`, `managed-change-plan.json`, `managed-change-result.json`, and `managed-files.json` preserve ownership and conflict evidence.
Step 8: Separate validation from generation
May the run proceed in this form? Boundaries, enums, minimum evidence, and runtime rules live here.
Does this run actually count as passing? This checks flow, artifacts, boundaries, and failure mapping.
Did a real run leave enough evidence to support the verdict?
Step 9: Feed the next run
Append-only history of failures, conflicts, and candidate constraints.
Long-lived ALWAYS/NEVER rules that new sessions can load directly.
The per-run delta that turns evidence into reusable guidance.
Step 10: Read the repository with the right map
High-level orientation and quick-start usage.
Design truth sources, plans, and tutorials.
Deterministic execution, validation, and control-plane tools.
Build and smoke-test tooling, including runtime harnesses.
Fixtures, expectations, and runtime transcripts.
Step 11: Start using it
git clone https://github.com/Logic70/WorkflowProgram-CN
cd WorkflowProgram-CN
pip install pyyaml
python tools/build_plugin.py
cd your-project
claude --plugin-dir /path/to/WorkflowProgram-CN/dist/plugin
"Design a code review workflow for this project"
"Audit the workflow structure of this project"
"Validate the workflow assets in this project"
Step 12: Go deeper
Read the full tutorial in chapter form, from failure modes to applying the pattern in your own project.
Open English chaptersSwitch back to the Chinese version if you want the original tutorial wording and examples.
Open Chinese chapters