Deterministic, stage-driven workflow for AI-assisted development in OpenCode.
Project provides:
- 15 workflow stages (
/wf.discover->/wf.finish-report) - 6 service commands (
/wf.status,/wf.resume,/wf.gates,/wf.history,/wf.approve,/wf.reject) - state persistence and stage gating
- artifact tracking per feature/stage
- stage-exit contract with mandatory HR outcome + approval for completion
- deterministic dispatch/runner runtime for stage 8/9 execution
- task passport schema validation before dispatch
- local/global skill collision resolver with interactive source selection
opencode.json- slash command definitions.opencode/plugin.ts- plugin entry (tools + precommand gating hook).opencode/tools/*.ts- workflow tools (state, gates, artifacts, HR, feature init, dispatch/runner, skill resolver).opencode/skill-resolver.ts- local/global skill resolution with collision handling.opencode/skill/wf-*/SKILL.md- stage skills (15 stages)workflow/state/workflow_state.json- workflow state fileworkflow/features/<feature-id>/<stage-id>/- runtime artifactsworkflow/schemas/task-passport.schema.yaml- task passport schemaworkflow/command-index.md- command index
git clone https://github.com/Launchery/myworkflow.git && cd myworkflow && bash scripts/setup.sh- Install prerequisites:
- OpenCode CLI (with plugin/skill support)
- Node.js 18+
- Bun 1.0+ (required for test runner)
- Install plugin dependencies:
cd .opencode
bun install- Verify local setup:
bunx tsc --noEmit
bun test-
Return to repository root and open OpenCode in this project.
-
Start workflow from stage 1:
/wf.discover
Then continue through stages in order.
1. /wf.discover → define what you're building
2. /wf.arch → pick the architecture approach
3. /wf.implement → write the code (stage 8/9 dispatch)
4. /wf.review → human review gate
5. /wf.finish-report → summary and wrap-up
See docs/examples/ for full walkthroughs of common scenarios.
Stage commands:
/wf.discover,/wf.spike,/wf.arch,/wf.spec,/wf.plan,/wf.tasks,/wf.tooling,/wf.dispatch,/wf.implement,/wf.review,/wf.finish-branch,/wf.project-report,/wf.human-qa,/wf.debug,/wf.finish-report
Service commands:
/wf.status,/wf.resume,/wf.gates,/wf.history,/wf.approve <stage>,/wf.reject <stage>/wf.report-export <feature-id> [--format markdown|html] [--output <path>]
See full list in workflow/command-index.md.
/wf.arch/wf.spec/wf.plan/wf.tasks/wf.tooling
All stages now require a recorded HR outcome before stage completion. Governed stages above additionally enforce HR approval as a transition checkpoint.
Read docs/RUNNING.md for a complete setup and execution guide, including troubleshooting.
For detailed command-by-command behavior and safe skill editing process, read docs/COMMANDS_SKILLS.md.
Practical examples now live in docs/examples/:
greenfield-cli-tool.mdbugfix-regression.mdrefactor-command-router.mdmulti-contributor-handoff.md
Start with docs/examples/README.md to choose the closest scenario.
Extend the built-in 15 stages with project-specific steps.
wf_custom_stage_define({
id: "security-review",
name: "Security Review",
description: "Review code for security vulnerabilities before merging",
after: ["review"],
governed: true,
skills: ["wf-security-review"],
artifacts: ["security-report"]
})
This creates a new /wf.security-review command that:
- Runs after the built-in
reviewstage - Requires HR approval (governed)
- Expects a
wf-security-reviewskill and produces asecurity-reportartifact
wf_custom_stage_list()
wf_custom_stage_remove({ id: "security-review" })
Custom stages are stored in workflow/custom-stages.json. Example:
{
"version": "1.0",
"stages": [
{
"id": "security-review",
"name": "Security Review",
"description": "Review code for security vulnerabilities",
"after": ["review"],
"governed": true,
"skills": [],
"artifacts": ["security-report"]
}
]
}By default, custom stages are placed after their last after dependency. Use position for explicit ordering:
"position": "before:review"— insert before thereviewstage"position": "after:implement"— insert right afterimplement
8 pre-built templates for common workflow extensions:
| Template | Category | Stages | Description |
|---|---|---|---|
security-gate |
security | 1 | Security review after code review |
perf-benchmark |
testing | 1 | Performance benchmarking |
accessibility-check |
quality | 1 | WCAG 2.1 accessibility audit |
staging-deploy |
deployment | 2 | Staging deploy + verification |
compliance-check |
compliance | 1 | GDPR/HIPAA/SOC2 review |
docs-generation |
documentation | 1 | Auto-generate docs from code |
integration-test |
testing | 1 | Integration & E2E testing |
release-prep |
deployment | 1 | Version bump + release notes |
wf_template_list({ category: "security" })
wf_template_apply({ template_id: "security-gate" })