owflow 0.6.0 → 0.7.0
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/LICENSE +21 -21
- package/README.md +448 -283
- package/dist/agents/bottleneck-analyzer.md +332 -333
- package/dist/agents/code-quality-pragmatist.md +353 -354
- package/dist/agents/code-reviewer.md +238 -239
- package/dist/agents/codebase-analysis-reporter.md +245 -246
- package/dist/agents/docs-operator.md +22 -23
- package/dist/agents/e2e-test-verifier.md +447 -448
- package/dist/agents/gap-analyzer.md +501 -502
- package/dist/agents/implementation-completeness-checker.md +219 -220
- package/dist/agents/implementation-planner.md +308 -309
- package/dist/agents/information-gatherer.md +690 -691
- package/dist/agents/production-readiness-checker.md +278 -279
- package/dist/agents/project-analyzer.md +403 -403
- package/dist/agents/reality-assessor.md +365 -366
- package/dist/agents/research-planner.md +449 -450
- package/dist/agents/research-synthesizer.md +402 -403
- package/dist/agents/solution-brainstormer.md +256 -257
- package/dist/agents/solution-designer.md +371 -372
- package/dist/agents/spec-auditor.md +297 -298
- package/dist/agents/specification-creator.md +333 -334
- package/dist/agents/task-classifier.md +449 -450
- package/dist/agents/task-group-implementer.md +283 -284
- package/dist/agents/test-suite-runner.md +194 -195
- package/dist/agents/user-docs-generator.md +508 -509
- package/dist/commands/reviews-code.md +90 -90
- package/dist/commands/reviews-pragmatic.md +99 -99
- package/dist/commands/reviews-production-readiness.md +113 -113
- package/dist/commands/reviews-reality-check.md +110 -110
- package/dist/commands/reviews-spec-audit.md +114 -114
- package/dist/commands/work.md +280 -280
- package/dist/configuration/agents-config.d.ts +2 -0
- package/dist/configuration/agents-config.js +8 -44
- package/dist/configuration/commands-config.d.ts +23 -0
- package/dist/configuration/commands-config.js +17 -17
- package/dist/configuration/skills-config.d.ts +2 -0
- package/dist/configuration/skills-config.js +3 -3
- package/dist/hooks/hooks-diagnostics.d.ts +3 -0
- package/dist/hooks/hooks-diagnostics.js +21 -0
- package/dist/hooks/hooks-persistence.d.ts +17 -0
- package/dist/hooks/hooks-persistence.js +207 -0
- package/dist/hooks/hooks-registry.d.ts +6 -0
- package/dist/hooks/hooks-registry.js +104 -0
- package/dist/hooks/hooks-wrapper.d.ts +25 -0
- package/dist/hooks/hooks-wrapper.js +318 -0
- package/dist/hooks/internal/before-tool.d.ts +6 -0
- package/dist/hooks/internal/before-tool.js +13 -0
- package/dist/hooks/internal/session-compaction.d.ts +9 -0
- package/dist/hooks/{session-compaction.js → internal/session-compaction.js} +9 -7
- package/dist/hooks/runtime/circuit-breaker.d.ts +23 -0
- package/dist/hooks/runtime/circuit-breaker.js +39 -0
- package/dist/hooks/runtime/failure-policy.d.ts +15 -0
- package/dist/hooks/runtime/failure-policy.js +49 -0
- package/dist/hooks/runtime/process-executor.d.ts +33 -0
- package/dist/hooks/runtime/process-executor.js +147 -0
- package/dist/hooks/runtime/status-recorder.d.ts +27 -0
- package/dist/hooks/runtime/status-recorder.js +111 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +111 -40
- package/dist/skills/agents-md-generator/SKILL.md +223 -223
- package/dist/skills/codebase-analyzer/SKILL.md +162 -162
- package/dist/skills/codebase-analyzer/references/code-analysis.md +63 -63
- package/dist/skills/codebase-analyzer/references/combined.md +31 -31
- package/dist/skills/codebase-analyzer/references/context-discovery.md +63 -63
- package/dist/skills/codebase-analyzer/references/file-discovery.md +51 -51
- package/dist/skills/codebase-analyzer/references/migration-target.md +23 -23
- package/dist/skills/codebase-analyzer/references/pattern-mining.md +22 -22
- package/dist/skills/dev-analyze/SKILL.md +115 -115
- package/dist/skills/dev-bugfix/SKILL.md +452 -452
- package/dist/skills/dev-finalize/SKILL.md +118 -118
- package/dist/skills/dev-implement/SKILL.md +167 -167
- package/dist/skills/dev-plan/SKILL.md +147 -147
- package/dist/skills/dev-spec/SKILL.md +182 -182
- package/dist/skills/dev-tdd-red/SKILL.md +94 -94
- package/dist/skills/dev-verify/SKILL.md +153 -153
- package/dist/skills/development/SKILL.md +260 -260
- package/dist/skills/diagrams-mermaid/SKILL.md +183 -159
- package/dist/skills/diagrams-mermaid/references/reference.md +220 -148
- package/dist/skills/docs-manager/SKILL.md +379 -379
- package/dist/skills/docs-manager/docs/INDEX.md +199 -199
- package/dist/skills/docs-manager/docs/standards/backend/api.md +25 -25
- package/dist/skills/docs-manager/docs/standards/backend/migrations.md +22 -22
- package/dist/skills/docs-manager/docs/standards/backend/models.md +25 -25
- package/dist/skills/docs-manager/docs/standards/backend/queries.md +22 -22
- package/dist/skills/docs-manager/docs/standards/frontend/accessibility.md +25 -25
- package/dist/skills/docs-manager/docs/standards/frontend/components.md +28 -28
- package/dist/skills/docs-manager/docs/standards/frontend/css.md +16 -16
- package/dist/skills/docs-manager/docs/standards/frontend/responsive.md +28 -28
- package/dist/skills/docs-manager/docs/standards/global/coding-style.md +25 -25
- package/dist/skills/docs-manager/docs/standards/global/commenting.md +10 -10
- package/dist/skills/docs-manager/docs/standards/global/conventions.md +31 -31
- package/dist/skills/docs-manager/docs/standards/global/error-handling.md +22 -22
- package/dist/skills/docs-manager/docs/standards/global/minimal-implementation.md +22 -22
- package/dist/skills/docs-manager/docs/standards/global/validation.md +28 -28
- package/dist/skills/docs-manager/docs/standards/testing/test-writing.md +25 -25
- package/dist/skills/docs-manager/references/agents-md-template.md +29 -29
- package/dist/skills/docs-manager/references/index-md-template.md +73 -73
- package/dist/skills/flow-init/SKILL.md +234 -234
- package/dist/skills/flow-init/references/architecture-template.md +45 -45
- package/dist/skills/flow-init/references/roadmap-templates.md +93 -93
- package/dist/skills/flow-init/references/tech-stack-template.md +70 -70
- package/dist/skills/flow-init/references/vision-templates.md +75 -75
- package/dist/skills/goal-development/SKILL.md +96 -96
- package/dist/skills/goal-migration/SKILL.md +114 -114
- package/dist/skills/goal-performance/SKILL.md +126 -126
- package/dist/skills/goal-research/SKILL.md +118 -118
- package/dist/skills/html-renderer/SKILL.md +173 -173
- package/dist/skills/html-renderer/references/index.html +318 -318
- package/dist/skills/html-renderer/references/styles.css +388 -388
- package/dist/skills/html-renderer/references/tokens.json +104 -104
- package/dist/skills/implementation-plan-executor/SKILL.md +378 -378
- package/dist/skills/implementation-verifier/SKILL.md +307 -307
- package/dist/skills/migration/SKILL.md +268 -268
- package/dist/skills/migration-analyze/SKILL.md +126 -126
- package/dist/skills/migration-finalize/SKILL.md +161 -161
- package/dist/skills/migration-fix/SKILL.md +155 -155
- package/dist/skills/migration-implement/SKILL.md +131 -131
- package/dist/skills/migration-plan/SKILL.md +131 -131
- package/dist/skills/migration-spec/SKILL.md +135 -135
- package/dist/skills/migration-spec/references/migration-strategies.md +430 -430
- package/dist/skills/migration-target/SKILL.md +134 -134
- package/dist/skills/migration-target/references/migration-types.md +489 -489
- package/dist/skills/migration-verify/SKILL.md +184 -184
- package/dist/skills/orchestrator-framework/SKILL.md +65 -65
- package/dist/skills/orchestrator-framework/references/command-namespacing.md +7 -7
- package/dist/skills/orchestrator-framework/references/confirm-or-revise-exception.md +20 -20
- package/dist/skills/orchestrator-framework/references/delegation-rules.md +54 -54
- package/dist/skills/orchestrator-framework/references/dispatcher-handoff.md +27 -27
- package/dist/skills/orchestrator-framework/references/fix-loop-contract.md +65 -65
- package/dist/skills/orchestrator-framework/references/gate-contract.md +122 -122
- package/dist/skills/orchestrator-framework/references/orchestrator-creation-checklist.md +51 -51
- package/dist/skills/orchestrator-framework/references/orchestrator-patterns.md +235 -235
- package/dist/skills/performance/SKILL.md +267 -267
- package/dist/skills/performance-analyze/SKILL.md +129 -129
- package/dist/skills/performance-analyze/references/performance-optimization-guide.md +271 -271
- package/dist/skills/performance-finalize/SKILL.md +117 -117
- package/dist/skills/performance-implement/SKILL.md +114 -114
- package/dist/skills/performance-plan/SKILL.md +112 -112
- package/dist/skills/performance-spec/SKILL.md +145 -145
- package/dist/skills/performance-verify/SKILL.md +164 -164
- package/dist/skills/research/SKILL.md +249 -249
- package/dist/skills/research-brainstorm/SKILL.md +120 -120
- package/dist/skills/research-brainstorm/references/brainstorming-techniques.md +84 -84
- package/dist/skills/research-converge/SKILL.md +130 -130
- package/dist/skills/research-design/SKILL.md +146 -146
- package/dist/skills/research-design/references/design-techniques.md +40 -40
- package/dist/skills/research-finalize/SKILL.md +125 -125
- package/dist/skills/research-fork/SKILL.md +190 -190
- package/dist/skills/research-gather/SKILL.md +133 -133
- package/dist/skills/research-plan/SKILL.md +141 -141
- package/dist/skills/research-plan/references/research-methodologies.md +710 -710
- package/dist/skills/research-quick/SKILL.md +139 -139
- package/dist/skills/research-synthesize/SKILL.md +127 -127
- package/dist/skills/rule-reviewer/SKILL.md +334 -334
- package/dist/skills/standards-discover/SKILL.md +260 -260
- package/dist/skills/standards-discover/references/aggregation-strategy.md +76 -76
- package/dist/skills/standards-discover/references/code-pattern-prompt.md +68 -68
- package/dist/skills/standards-discover/references/config-analyzer-prompt.md +67 -67
- package/dist/skills/standards-discover/references/docs-extractor-prompt.md +65 -65
- package/dist/skills/standards-discover/references/external-analyzer-prompt.md +75 -75
- package/dist/skills/standards-update/SKILL.md +207 -207
- package/dist/templates/orchestrator-state-base.yml +17 -17
- package/dist/templates/orchestrator-state-development.yml +95 -95
- package/dist/templates/orchestrator-state-migration.yml +95 -95
- package/dist/templates/orchestrator-state-performance.yml +64 -64
- package/dist/templates/orchestrator-state-research.yml +67 -67
- package/dist/tools/fork_task.d.ts +17 -0
- package/dist/tools/fork_task.js +21 -11
- package/dist/tools/verify_template.d.ts +11 -0
- package/dist/tools/verify_template.js +32 -17
- package/dist/tui/hooks-dialogs.d.ts +20 -0
- package/dist/tui/hooks-dialogs.js +181 -0
- package/dist/tui/hooks-presenter.d.ts +15 -0
- package/dist/tui/hooks-presenter.js +70 -0
- package/dist/tui/hooks-sidebar.d.ts +10 -0
- package/dist/tui/hooks-sidebar.js +104 -0
- package/dist/tui/primitives.d.ts +21 -0
- package/dist/tui/primitives.js +47 -0
- package/dist/tui.d.ts +12 -0
- package/dist/tui.js +129 -0
- package/dist/types/hook-types.d.ts +125 -0
- package/dist/types/hook-types.js +76 -0
- package/dist/types/opencode-types.d.ts +13 -0
- package/dist/utils/file-util.d.ts +2 -0
- package/dist/utils/file-util.js +6 -6
- package/dist/utils/fork-task.d.ts +27 -0
- package/dist/utils/fork-task.js +18 -23
- package/dist/utils/plugin-info.d.ts +3 -0
- package/dist/utils/plugin-info.js +8 -10
- package/dist/utils/workflow-paths.d.ts +17 -0
- package/dist/utils/workflow-paths.js +18 -0
- package/dist/utils/yaml-structure.d.ts +7 -0
- package/dist/utils/yaml-structure.js +7 -11
- package/package.json +68 -48
- package/dist/hooks/before-tool.js +0 -19
package/README.md
CHANGED
|
@@ -1,283 +1,448 @@
|
|
|
1
|
-

|
|
2
|
-
|
|
3
|
-
# Owflow
|
|
4
|
-
|
|
5
|
-
**Structured, standards-aware development workflows for OpenCode**
|
|
6
|
-
|
|
7
|
-
Describe what you want to build, and the plugin handles the rest - from specification through implementation to verification - while enforcing your project's coding standards at every step.
|
|
8
|
-
|
|
9
|
-
Started as a simple OpenCode fork of [Maister Claude Code plugin](https://github.com/SkillPanel/maister), Owflow aims to deliver production ready workflows using the full [Opencode](https://opencode.ai/) plugin support.
|
|
10
|
-
|
|
11
|
-
## What You Get
|
|
12
|
-
|
|
13
|
-
- **Guided workflows** for features, bug fixes, enhancements, performance, migrations and research
|
|
14
|
-
- **Auto-discovered standards** from your codebase - config files, source patterns, and documentation are analyzed and enforced throughout every workflow
|
|
15
|
-
- **Test-driven implementation** with automated planning, incremental verification, and full test suite runs before completion
|
|
16
|
-
- **Pause and resume** any workflow - state is preserved across sessions
|
|
17
|
-
- **Production readiness checks** including code review, reality assessment, and pragmatic over-engineering detection
|
|
18
|
-
|
|
19
|
-
## Getting Started
|
|
20
|
-
|
|
21
|
-
### Directory Structure
|
|
22
|
-
|
|
23
|
-
```
|
|
24
|
-
owflow/
|
|
25
|
-
├── docs/ # Plugin documentation (commands, workflows)
|
|
26
|
-
├── scripts/ # Build and utility scripts
|
|
27
|
-
└── src/ # Source code
|
|
28
|
-
├── __tests__/ # Test suites
|
|
29
|
-
├── agents/ # Agent definitions and prompts (.md)
|
|
30
|
-
├── commands/ # Maintained content commands (.md); the rest are generated from skill frontmatter
|
|
31
|
-
├── configuration/ # Handlers for agent, command, and skill configurations
|
|
32
|
-
├── hooks/ # OpenCode lifecycle hooks (tool execution, compaction)
|
|
33
|
-
├── skills/ # Workflows, orchestrators, and reusable skills
|
|
34
|
-
├── templates/ # Orchestrator state and task YAML templates
|
|
35
|
-
├── tools/ # Custom OpenCode tool implementations
|
|
36
|
-
├── types/ # TypeScript type definitions
|
|
37
|
-
├── utils/ # Internal utility functions
|
|
38
|
-
└── index.ts # Main plugin entry point
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### Prerequisites
|
|
42
|
-
|
|
43
|
-
- [Opencode](https://opencode.ai/) CLI installed and configured
|
|
44
|
-
- [
|
|
45
|
-
|
|
46
|
-
### Installation
|
|
47
|
-
|
|
48
|
-
#### Add owflow to the `plugin` array in your `opencode.json` ([global or project-level](https://opencode.ai/docs/plugins/#load-order)):
|
|
49
|
-
|
|
50
|
-
To use it across multiple repos it is advised to use the global level:
|
|
51
|
-
|
|
52
|
-
Linux/MacOS:
|
|
53
|
-
|
|
54
|
-
```sh
|
|
55
|
-
~/.config/opencode/opencode.json
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
Windows:
|
|
59
|
-
|
|
60
|
-
```powershell
|
|
61
|
-
\Users\YourUsername\.config\opencode\opencode.json
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
In `opencode.json`:
|
|
65
|
-
|
|
66
|
-
```json
|
|
67
|
-
{
|
|
68
|
-
...
|
|
69
|
-
"plugin": ["owflow@latest"]
|
|
70
|
-
...
|
|
71
|
-
}
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
### Initial project setup
|
|
75
|
-
|
|
76
|
-
Initialize your project to auto-detect coding standards and generate project documentation:
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
/owflow:flow-init
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
This scans your codebase and creates `.owflow/` with standards, docs, and task folders. May take a few minutes on larger projects.
|
|
83
|
-
|
|
84
|
-
If you have another project already using Owflow, you can reuse its standards as a starting point:
|
|
85
|
-
|
|
86
|
-
```bash
|
|
87
|
-
/owflow:flow-init --standards-from=/path/to/other-project
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
### First Workflow
|
|
91
|
-
|
|
92
|
-
```bash
|
|
93
|
-
/owflow:development Add user profile page with avatar upload
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
Or just discuss your task with Agent and then run:
|
|
97
|
-
|
|
98
|
-
```bash
|
|
99
|
-
/owflow:development
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
The plugin picks up context from your conversation - no arguments needed. Prefer everything in one session? Use `/owflow:goal-development` (autonomous mode) instead - it runs the same pipeline without handoffs between phases (subskills run back-to-back in one session).
|
|
103
|
-
|
|
104
|
-
## How It Works
|
|
105
|
-
|
|
106
|
-
1. You describe a task - either as an argument or just in conversation
|
|
107
|
-
2. The plugin classifies it (feature, bug, enhancement, etc.) and proposes a workflow
|
|
108
|
-
3. You confirm, and it guides you through the pipeline of development subskills: **analysis → spec → plan → implement → verify → finalize**
|
|
109
|
-
4. At each phase, it asks for your input and decisions
|
|
110
|
-
5. You get tested, verified code with a detailed work log
|
|
111
|
-
|
|
112
|
-
All artifacts are saved in `.owflow/tasks/` organized by type and date.
|
|
113
|
-
|
|
114
|
-
### Context-Aware Commands
|
|
115
|
-
|
|
116
|
-
Every workflow command works without arguments. The plugin reads your current conversation to extract the task description and auto-detect the task type:
|
|
117
|
-
|
|
118
|
-
```
|
|
119
|
-
You: "The login page throws a 500 error when the session expires"
|
|
120
|
-
You: /owflow:development
|
|
121
|
-
→ Auto-detects: bug fix, extracts description from conversation
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
```
|
|
125
|
-
You: /owflow:standards-update
|
|
126
|
-
→ Scans conversation for patterns like "we always use..." or "prefer X over Y"
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
You can always be explicit when you prefer - arguments and flags simply override the auto-detection.
|
|
130
|
-
|
|
131
|
-
## Supported Workflows
|
|
132
|
-
|
|
133
|
-
| Command | Use When |
|
|
134
|
-
| -------------------------- | ---------------------------------------------- |
|
|
135
|
-
| `/owflow:development` | Features, bug fixes, enhancements |
|
|
136
|
-
| `/owflow:research` | Research with synthesis and solution design |
|
|
137
|
-
| `/owflow:performance` | Optimizing speed or resource usage |
|
|
138
|
-
| `/owflow:migration` | Changing technologies or patterns |
|
|
139
|
-
|
|
140
|
-
Use `/owflow:work` as a single entry point — it classifies the task with the `task-classifier` subagent and routes to the right workflow.
|
|
141
|
-
|
|
142
|
-
### Autonomous Workflows
|
|
143
|
-
|
|
144
|
-
Each workflow has a `/owflow:goal-*` equivalent that runs the same pipeline back-to-back in one session, pausing at decision gates between steps. Both modes share one task state, so you can mix them freely on a single task.
|
|
145
|
-
|
|
146
|
-
| Command | Runs |
|
|
147
|
-
| -------------------------- | ----------------------------- |
|
|
148
|
-
| `/owflow:goal-development` | The full development pipeline |
|
|
149
|
-
| `/owflow:goal-research` | The full research pipeline |
|
|
150
|
-
| `/owflow:goal-performance` | The full performance pipeline |
|
|
151
|
-
| `/owflow:goal-migration` | The full migration pipeline |
|
|
152
|
-
|
|
153
|
-
### Research Utility
|
|
154
|
-
|
|
155
|
-
| Command | Use When |
|
|
156
|
-
| ----------------------------- | -------------------------------------------------------------------------------- |
|
|
157
|
-
| `/owflow:research-quick "<description>"` | Condensed research: brief → plan → gather → synthesis in one pass |
|
|
158
|
-
| `/owflow:research-fork <task-path> ["<what this fork should explore>"]` | Branch a research task and re-run from the fork point with different choices |
|
|
159
|
-
|
|
160
|
-
### Migration Subskills
|
|
161
|
-
|
|
162
|
-
Migration runs as a pipeline of eight standalone subskills — `/owflow:migration-analyze`, `/owflow:migration-target`, `/owflow:migration-spec`, `/owflow:migration-plan`, `/owflow:migration-implement`, `/owflow:migration-verify`, `/owflow:migration-fix`, `/owflow:migration-finalize` — with `/owflow:migration` as the dispatcher and `/owflow:goal-migration` running the whole pipeline in one session. Flags: `--from=<slug>`, `--type=code|data|architecture|general`, `--no-web-research`.
|
|
163
|
-
|
|
164
|
-
### Quick Commands
|
|
165
|
-
|
|
166
|
-
For smaller tasks that don't need a full workflow:
|
|
167
|
-
|
|
168
|
-
| Command | Use When | Artifacts |
|
|
169
|
-
| -------------------------------- | ----------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
|
|
170
|
-
| `/owflow:dev-spec --quick` | Standards-aware, resumable spec before any plan — spec only | `orchestrator-state.yml`, `analysis/quick-analysis.md`, `analysis/requirements.md`, `implementation/spec.md` |
|
|
171
|
-
| `/owflow:dev-plan --quick` | Standards-aware, resumable plan before coding — plan only | `orchestrator-state.yml`, `analysis/quick-analysis.md`, `implementation/spec.md`, `implementation/implementation-plan.md` |
|
|
172
|
-
| `/owflow:dev-implement --quick` | Task is clear, no architectural decisions needed | `orchestrator-state.yml`, `analysis/quick-analysis.md`, `implementation/spec.md`, `implementation/implementation-plan.md`, `work-log.md` |
|
|
173
|
-
| `/owflow:dev-bugfix` | Quick TDD-driven bug fix — write failing test, fix, verify | `orchestrator-state.yml`, `analysis/findings.md`, `summary.md` |
|
|
174
|
-
|
|
175
|
-
Every quick lane creates a standard development task under `.owflow/tasks/development/` (full `orchestrator-state.yml` with the lane as `orchestrator.entry_point`) and stops at that lane's exit gate — continuable later by any dev-* subskill (`/owflow:dev-verify`, `/owflow:development <task-path>`, …).
|
|
176
|
-
|
|
177
|
-
Quick development uses the standard pipeline instead: `/owflow:dev-implement --quick "<description>"` bootstraps a regular development task (`orchestrator-state.yml`, condensed spec + plan), implements it, and stops — continue later with `/owflow:dev-verify` or stop there if the results are enough. Plan-only tasks work the same way: `/owflow:dev-plan --quick "<description>"` bootstraps a regular development task and stops after the plan — continue with `/owflow:dev-implement` or stop there if the plan is enough. Spec-only tasks condense one step further: `/owflow:dev-spec --quick "<description>"` bootstraps a regular development task and stops after the condensed specification (written directly on the fly, no specification-creator subagent; audit skipped) — continue with `/owflow:dev-plan` or stop there if the spec is enough.
|
|
178
|
-
|
|
179
|
-
**The `--quick` flag is optional.** You can start from a bare prompt with any quick-lane command — the skill bootstraps the task and then asks whether to run the condensed quick lane or escalate to the full pipeline. Pass `--quick` to skip that question and go straight to the quick lane. Invoked with no argument at all, the skill prompts you for a task description, task path, or identifier. Bug-shaped descriptions route to `/owflow:dev-bugfix` instead (you can insist on proceeding if you prefer).
|
|
180
|
-
|
|
181
|
-
```bash
|
|
182
|
-
# Quick lane, no questions asked
|
|
183
|
-
/owflow:dev-spec --quick "Add server-side pagination to the users list"
|
|
184
|
-
/owflow:dev-plan --quick "Add rate limiting to the public API"
|
|
185
|
-
/owflow:dev-implement --quick "Add a logout button to the navbar"
|
|
186
|
-
|
|
187
|
-
# Bare prompt — the skill asks: quick lane or full pipeline?
|
|
188
|
-
/owflow:dev-spec "Design the CSV export for the invoices table"
|
|
189
|
-
/owflow:dev-plan "Add rate limiting to the public API"
|
|
190
|
-
/owflow:dev-implement "Add CSV export to the invoices table"
|
|
191
|
-
|
|
192
|
-
# No argument — prompts for a description, task path, or identifier
|
|
193
|
-
/owflow:dev-spec
|
|
194
|
-
/owflow:dev-plan
|
|
195
|
-
/owflow:dev-implement
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
### Fine-Grained Control: Development Subskills
|
|
199
|
-
|
|
200
|
-
The full `/owflow:development` workflow consists of standalone subskills — `/owflow:dev-analyze`, `/owflow:dev-tdd-red`, `/owflow:dev-spec`, `/owflow:dev-plan`, `/owflow:dev-implement`, `/owflow:dev-verify`, `/owflow:dev-finalize` — which you can also invoke individually. Each accepts a task path, or just a task-directory identifier:
|
|
201
|
-
|
|
202
|
-
```bash
|
|
203
|
-
/owflow:dev-spec 2026-01-12-my-feature
|
|
204
|
-
/owflow:dev-verify .owflow/tasks/development/2026-01-12-my-feature
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
If a subskill is invoked too early in the workflow (prerequisite phases not yet complete), it stops and tells you exactly which steps to run first, in order. If the workflow state doesn't exist yet, use `/owflow:development <description>` to start from scratch.
|
|
208
|
-
|
|
209
|
-
### Fine-Grained Control: Performance Subskills
|
|
210
|
-
|
|
211
|
-
The full `/owflow:performance` workflow consists of standalone subskills — `/owflow:performance-analyze`, `/owflow:performance-spec`, `/owflow:performance-plan`, `/owflow:performance-implement`, `/owflow:performance-verify`, `/owflow:performance-finalize` — which you can also invoke individually. Each accepts a task path, or just a task-directory identifier:
|
|
212
|
-
|
|
213
|
-
```bash
|
|
214
|
-
/owflow:performance-analyze 2026-01-12-dashboard-queries
|
|
215
|
-
/owflow:performance-verify .owflow/tasks/performance/2026-01-12-dashboard-queries
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
If a subskill is invoked too early in the workflow (prerequisite steps not yet complete), it stops and tells you exactly which steps to run first, in order. If the workflow state doesn't exist yet, use `/owflow:performance <description>` to start from scratch.
|
|
219
|
-
|
|
220
|
-
## Standards-Aware Development
|
|
221
|
-
|
|
222
|
-
This is the key differentiator. Owflow doesn't just run workflows - it learns your project's conventions and enforces them:
|
|
223
|
-
|
|
224
|
-
- **`/owflow:flow-init`** scans config files, source code, and documentation to auto-detect your coding standards
|
|
225
|
-
- **Continuous checking** - standards are consulted before specification, during planning, and while coding (not just at the start)
|
|
226
|
-
- **`/owflow:standards-discover`** refreshes standards from your evolving codebase
|
|
227
|
-
- **`/owflow:standards-update`** lets you add or refine standards manually, or sync from another project with `--from=PATH`
|
|
228
|
-
|
|
229
|
-
Standards live in `.owflow/docs/standards/` and are indexed in `.owflow/docs/INDEX.md`.
|
|
230
|
-
|
|
231
|
-
**Important**: Do not use plan mode with workflows (see [Best Practices](#best-practices) below).
|
|
232
|
-
|
|
233
|
-
##
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
-
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
# Owflow
|
|
4
|
+
|
|
5
|
+
**Structured, standards-aware development workflows for OpenCode**
|
|
6
|
+
|
|
7
|
+
Describe what you want to build, and the plugin handles the rest - from specification through implementation to verification - while enforcing your project's coding standards at every step.
|
|
8
|
+
|
|
9
|
+
Started as a simple OpenCode fork of [Maister Claude Code plugin](https://github.com/SkillPanel/maister), Owflow aims to deliver production ready workflows using the full [Opencode](https://opencode.ai/) plugin support.
|
|
10
|
+
|
|
11
|
+
## What You Get
|
|
12
|
+
|
|
13
|
+
- **Guided workflows** for features, bug fixes, enhancements, performance, migrations and research
|
|
14
|
+
- **Auto-discovered standards** from your codebase - config files, source patterns, and documentation are analyzed and enforced throughout every workflow
|
|
15
|
+
- **Test-driven implementation** with automated planning, incremental verification, and full test suite runs before completion
|
|
16
|
+
- **Pause and resume** any workflow - state is preserved across sessions
|
|
17
|
+
- **Production readiness checks** including code review, reality assessment, and pragmatic over-engineering detection
|
|
18
|
+
|
|
19
|
+
## Getting Started
|
|
20
|
+
|
|
21
|
+
### Directory Structure
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
owflow/
|
|
25
|
+
├── docs/ # Plugin documentation (commands, workflows)
|
|
26
|
+
├── scripts/ # Build and utility scripts
|
|
27
|
+
└── src/ # Source code
|
|
28
|
+
├── __tests__/ # Test suites
|
|
29
|
+
├── agents/ # Agent definitions and prompts (.md)
|
|
30
|
+
├── commands/ # Maintained content commands (.md); the rest are generated from skill frontmatter
|
|
31
|
+
├── configuration/ # Handlers for agent, command, and skill configurations
|
|
32
|
+
├── hooks/ # OpenCode lifecycle hooks (tool execution, compaction)
|
|
33
|
+
├── skills/ # Workflows, orchestrators, and reusable skills
|
|
34
|
+
├── templates/ # Orchestrator state and task YAML templates
|
|
35
|
+
├── tools/ # Custom OpenCode tool implementations
|
|
36
|
+
├── types/ # TypeScript type definitions
|
|
37
|
+
├── utils/ # Internal utility functions
|
|
38
|
+
└── index.ts # Main plugin entry point
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Prerequisites
|
|
42
|
+
|
|
43
|
+
- [Opencode](https://opencode.ai/) CLI installed and configured
|
|
44
|
+
- [Bun](https://bun.sh/) >= 1.3 (used by OpenCode)
|
|
45
|
+
|
|
46
|
+
### Installation
|
|
47
|
+
|
|
48
|
+
#### Add owflow to the `plugin` array in your `opencode.json` ([global or project-level](https://opencode.ai/docs/plugins/#load-order)):
|
|
49
|
+
|
|
50
|
+
To use it across multiple repos it is advised to use the global level:
|
|
51
|
+
|
|
52
|
+
Linux/MacOS:
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
~/.config/opencode/opencode.json
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Windows:
|
|
59
|
+
|
|
60
|
+
```powershell
|
|
61
|
+
\Users\YourUsername\.config\opencode\opencode.json
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
In `opencode.json`:
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
...
|
|
69
|
+
"plugin": ["owflow@latest"]
|
|
70
|
+
...
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Initial project setup
|
|
75
|
+
|
|
76
|
+
Initialize your project to auto-detect coding standards and generate project documentation:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
/owflow:flow-init
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
This scans your codebase and creates `.owflow/` with standards, docs, and task folders. May take a few minutes on larger projects.
|
|
83
|
+
|
|
84
|
+
If you have another project already using Owflow, you can reuse its standards as a starting point:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
/owflow:flow-init --standards-from=/path/to/other-project
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### First Workflow
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
/owflow:development Add user profile page with avatar upload
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Or just discuss your task with Agent and then run:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
/owflow:development
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
The plugin picks up context from your conversation - no arguments needed. Prefer everything in one session? Use `/owflow:goal-development` (autonomous mode) instead - it runs the same pipeline without handoffs between phases (subskills run back-to-back in one session).
|
|
103
|
+
|
|
104
|
+
## How It Works
|
|
105
|
+
|
|
106
|
+
1. You describe a task - either as an argument or just in conversation
|
|
107
|
+
2. The plugin classifies it (feature, bug, enhancement, etc.) and proposes a workflow
|
|
108
|
+
3. You confirm, and it guides you through the pipeline of development subskills: **analysis → spec → plan → implement → verify → finalize**
|
|
109
|
+
4. At each phase, it asks for your input and decisions
|
|
110
|
+
5. You get tested, verified code with a detailed work log
|
|
111
|
+
|
|
112
|
+
All artifacts are saved in `.owflow/tasks/` organized by type and date.
|
|
113
|
+
|
|
114
|
+
### Context-Aware Commands
|
|
115
|
+
|
|
116
|
+
Every workflow command works without arguments. The plugin reads your current conversation to extract the task description and auto-detect the task type:
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
You: "The login page throws a 500 error when the session expires"
|
|
120
|
+
You: /owflow:development
|
|
121
|
+
→ Auto-detects: bug fix, extracts description from conversation
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
You: /owflow:standards-update
|
|
126
|
+
→ Scans conversation for patterns like "we always use..." or "prefer X over Y"
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
You can always be explicit when you prefer - arguments and flags simply override the auto-detection.
|
|
130
|
+
|
|
131
|
+
## Supported Workflows
|
|
132
|
+
|
|
133
|
+
| Command | Use When |
|
|
134
|
+
| -------------------------- | ---------------------------------------------- |
|
|
135
|
+
| `/owflow:development` | Features, bug fixes, enhancements |
|
|
136
|
+
| `/owflow:research` | Research with synthesis and solution design |
|
|
137
|
+
| `/owflow:performance` | Optimizing speed or resource usage |
|
|
138
|
+
| `/owflow:migration` | Changing technologies or patterns |
|
|
139
|
+
|
|
140
|
+
Use `/owflow:work` as a single entry point — it classifies the task with the `task-classifier` subagent and routes to the right workflow.
|
|
141
|
+
|
|
142
|
+
### Autonomous Workflows
|
|
143
|
+
|
|
144
|
+
Each workflow has a `/owflow:goal-*` equivalent that runs the same pipeline back-to-back in one session, pausing at decision gates between steps. Both modes share one task state, so you can mix them freely on a single task.
|
|
145
|
+
|
|
146
|
+
| Command | Runs |
|
|
147
|
+
| -------------------------- | ----------------------------- |
|
|
148
|
+
| `/owflow:goal-development` | The full development pipeline |
|
|
149
|
+
| `/owflow:goal-research` | The full research pipeline |
|
|
150
|
+
| `/owflow:goal-performance` | The full performance pipeline |
|
|
151
|
+
| `/owflow:goal-migration` | The full migration pipeline |
|
|
152
|
+
|
|
153
|
+
### Research Utility
|
|
154
|
+
|
|
155
|
+
| Command | Use When |
|
|
156
|
+
| ----------------------------- | -------------------------------------------------------------------------------- |
|
|
157
|
+
| `/owflow:research-quick "<description>"` | Condensed research: brief → plan → gather → synthesis in one pass |
|
|
158
|
+
| `/owflow:research-fork <task-path> ["<what this fork should explore>"]` | Branch a research task and re-run from the fork point with different choices |
|
|
159
|
+
|
|
160
|
+
### Migration Subskills
|
|
161
|
+
|
|
162
|
+
Migration runs as a pipeline of eight standalone subskills — `/owflow:migration-analyze`, `/owflow:migration-target`, `/owflow:migration-spec`, `/owflow:migration-plan`, `/owflow:migration-implement`, `/owflow:migration-verify`, `/owflow:migration-fix`, `/owflow:migration-finalize` — with `/owflow:migration` as the dispatcher and `/owflow:goal-migration` running the whole pipeline in one session. Flags: `--from=<slug>`, `--type=code|data|architecture|general`, `--no-web-research`.
|
|
163
|
+
|
|
164
|
+
### Quick Commands
|
|
165
|
+
|
|
166
|
+
For smaller tasks that don't need a full workflow:
|
|
167
|
+
|
|
168
|
+
| Command | Use When | Artifacts |
|
|
169
|
+
| -------------------------------- | ----------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
|
|
170
|
+
| `/owflow:dev-spec --quick` | Standards-aware, resumable spec before any plan — spec only | `orchestrator-state.yml`, `analysis/quick-analysis.md`, `analysis/requirements.md`, `implementation/spec.md` |
|
|
171
|
+
| `/owflow:dev-plan --quick` | Standards-aware, resumable plan before coding — plan only | `orchestrator-state.yml`, `analysis/quick-analysis.md`, `implementation/spec.md`, `implementation/implementation-plan.md` |
|
|
172
|
+
| `/owflow:dev-implement --quick` | Task is clear, no architectural decisions needed | `orchestrator-state.yml`, `analysis/quick-analysis.md`, `implementation/spec.md`, `implementation/implementation-plan.md`, `work-log.md` |
|
|
173
|
+
| `/owflow:dev-bugfix` | Quick TDD-driven bug fix — write failing test, fix, verify | `orchestrator-state.yml`, `analysis/findings.md`, `summary.md` |
|
|
174
|
+
|
|
175
|
+
Every quick lane creates a standard development task under `.owflow/tasks/development/` (full `orchestrator-state.yml` with the lane as `orchestrator.entry_point`) and stops at that lane's exit gate — continuable later by any dev-* subskill (`/owflow:dev-verify`, `/owflow:development <task-path>`, …).
|
|
176
|
+
|
|
177
|
+
Quick development uses the standard pipeline instead: `/owflow:dev-implement --quick "<description>"` bootstraps a regular development task (`orchestrator-state.yml`, condensed spec + plan), implements it, and stops — continue later with `/owflow:dev-verify` or stop there if the results are enough. Plan-only tasks work the same way: `/owflow:dev-plan --quick "<description>"` bootstraps a regular development task and stops after the plan — continue with `/owflow:dev-implement` or stop there if the plan is enough. Spec-only tasks condense one step further: `/owflow:dev-spec --quick "<description>"` bootstraps a regular development task and stops after the condensed specification (written directly on the fly, no specification-creator subagent; audit skipped) — continue with `/owflow:dev-plan` or stop there if the spec is enough.
|
|
178
|
+
|
|
179
|
+
**The `--quick` flag is optional.** You can start from a bare prompt with any quick-lane command — the skill bootstraps the task and then asks whether to run the condensed quick lane or escalate to the full pipeline. Pass `--quick` to skip that question and go straight to the quick lane. Invoked with no argument at all, the skill prompts you for a task description, task path, or identifier. Bug-shaped descriptions route to `/owflow:dev-bugfix` instead (you can insist on proceeding if you prefer).
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
# Quick lane, no questions asked
|
|
183
|
+
/owflow:dev-spec --quick "Add server-side pagination to the users list"
|
|
184
|
+
/owflow:dev-plan --quick "Add rate limiting to the public API"
|
|
185
|
+
/owflow:dev-implement --quick "Add a logout button to the navbar"
|
|
186
|
+
|
|
187
|
+
# Bare prompt — the skill asks: quick lane or full pipeline?
|
|
188
|
+
/owflow:dev-spec "Design the CSV export for the invoices table"
|
|
189
|
+
/owflow:dev-plan "Add rate limiting to the public API"
|
|
190
|
+
/owflow:dev-implement "Add CSV export to the invoices table"
|
|
191
|
+
|
|
192
|
+
# No argument — prompts for a description, task path, or identifier
|
|
193
|
+
/owflow:dev-spec
|
|
194
|
+
/owflow:dev-plan
|
|
195
|
+
/owflow:dev-implement
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Fine-Grained Control: Development Subskills
|
|
199
|
+
|
|
200
|
+
The full `/owflow:development` workflow consists of standalone subskills — `/owflow:dev-analyze`, `/owflow:dev-tdd-red`, `/owflow:dev-spec`, `/owflow:dev-plan`, `/owflow:dev-implement`, `/owflow:dev-verify`, `/owflow:dev-finalize` — which you can also invoke individually. Each accepts a task path, or just a task-directory identifier:
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
/owflow:dev-spec 2026-01-12-my-feature
|
|
204
|
+
/owflow:dev-verify .owflow/tasks/development/2026-01-12-my-feature
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
If a subskill is invoked too early in the workflow (prerequisite phases not yet complete), it stops and tells you exactly which steps to run first, in order. If the workflow state doesn't exist yet, use `/owflow:development <description>` to start from scratch.
|
|
208
|
+
|
|
209
|
+
### Fine-Grained Control: Performance Subskills
|
|
210
|
+
|
|
211
|
+
The full `/owflow:performance` workflow consists of standalone subskills — `/owflow:performance-analyze`, `/owflow:performance-spec`, `/owflow:performance-plan`, `/owflow:performance-implement`, `/owflow:performance-verify`, `/owflow:performance-finalize` — which you can also invoke individually. Each accepts a task path, or just a task-directory identifier:
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
/owflow:performance-analyze 2026-01-12-dashboard-queries
|
|
215
|
+
/owflow:performance-verify .owflow/tasks/performance/2026-01-12-dashboard-queries
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
If a subskill is invoked too early in the workflow (prerequisite steps not yet complete), it stops and tells you exactly which steps to run first, in order. If the workflow state doesn't exist yet, use `/owflow:performance <description>` to start from scratch.
|
|
219
|
+
|
|
220
|
+
## Standards-Aware Development
|
|
221
|
+
|
|
222
|
+
This is the key differentiator. Owflow doesn't just run workflows - it learns your project's conventions and enforces them:
|
|
223
|
+
|
|
224
|
+
- **`/owflow:flow-init`** scans config files, source code, and documentation to auto-detect your coding standards
|
|
225
|
+
- **Continuous checking** - standards are consulted before specification, during planning, and while coding (not just at the start)
|
|
226
|
+
- **`/owflow:standards-discover`** refreshes standards from your evolving codebase
|
|
227
|
+
- **`/owflow:standards-update`** lets you add or refine standards manually, or sync from another project with `--from=PATH`
|
|
228
|
+
|
|
229
|
+
Standards live in `.owflow/docs/standards/` and are indexed in `.owflow/docs/INDEX.md`.
|
|
230
|
+
|
|
231
|
+
**Important**: Do not use plan mode with workflows (see [Best Practices](#best-practices) below).
|
|
232
|
+
|
|
233
|
+
## User Hooks
|
|
234
|
+
|
|
235
|
+
Extend OpenCode's lifecycle with your project's own scripts. Drop hook scripts into `.owflow/hooks/` and owflow dispatches them through its hook handlers - no plugin code required.
|
|
236
|
+
|
|
237
|
+
### TUI status and troubleshooting
|
|
238
|
+
|
|
239
|
+

|
|
240
|
+
|
|
241
|
+
Loaded hooks and their statuses are displayed in the top of sidebar menu. Each of the hook item in the list is the clickable button that will open the detail popup.
|
|
242
|
+
|
|
243
|
+

|
|
244
|
+
|
|
245
|
+
In the hook details popup there are hook run metadata available as well as a button to check errors and info logs for the given run.
|
|
246
|
+
|
|
247
|
+

|
|
248
|
+
|
|
249
|
+
Hook logs popup is scrollable and displays stderr and stdout logs in a separate blocks. Log file should be present on the disk for more detailed examination. Logs in popup serves as a quick way for human verification of problems during given session.
|
|
250
|
+
|
|
251
|
+
### File Placement and Naming Rules
|
|
252
|
+
|
|
253
|
+
- **Where to place files**: Place all hook scripts directly inside `.owflow/hooks/` at the root of your project (e.g., `<project-root>/.owflow/hooks/tool-execute-before.sh`). Discovery is flat (one directory level only, no subdirectories).
|
|
254
|
+
- **How to name files**: Name each file `<kebab-case-event>.<ext>`, where the lowercase kebab-case stem (`[a-z0-9]+(-[a-z0-9]+)*`) maps directly to the dotted hook or event name by replacing `-` with `.` (for example, `tool-execute-before.sh` → `tool.execute.before`, `session-idle.ps1` → `session.idle`).
|
|
255
|
+
- **Supported extensions**: Use `.sh` (executed via `bash`) or `.ps1` (executed via `pwsh` / `powershell.exe`).
|
|
256
|
+
- **One file per hook**: Each hook name may exist in **exactly one** format (`.sh` or `.ps1` - never both), and `.owflow/hooks/` must not contain any non-hook files (no READMEs, subdirectories, dotfiles, or log files).
|
|
257
|
+
|
|
258
|
+
| Extension | Interpreter | Transport |
|
|
259
|
+
| --------- | ----------- | --------- |
|
|
260
|
+
| `.sh` | subprocess via `bash` | JSON payload on stdin; exit 0 = ok, non-zero exit = block |
|
|
261
|
+
| `.ps1` | subprocess via `pwsh`/`powershell.exe` | JSON payload on stdin; exit 0 = ok, non-zero exit = block |
|
|
262
|
+
|
|
263
|
+
**All hooks are gate hooks** governed by universal fail-closed semantics (16 lifecycle events and 32 host events) using the standard **git-hooks contract**:
|
|
264
|
+
- **Input (`stdin`)**: JSON `{ event, session?: { sessionID }, context }`.
|
|
265
|
+
- **Output (`exit code` + `stdout`/`stderr`)**: Exit `0` succeeds; any non-zero exit rejects the operation with a `Blocked:` error (using `stderr` or `stdout` as the reason) and terminates the active session. Missing interpreters fail closed at fire time.
|
|
266
|
+
|
|
267
|
+
### Available Lifecycle Hooks (16)
|
|
268
|
+
|
|
269
|
+
Lifecycle hooks attach directly to OpenCode's plugin hook points:
|
|
270
|
+
|
|
271
|
+
| Event Name | Script File Name (`.sh` or `.ps1`) | Point of Execution |
|
|
272
|
+
| ---------- | ---------------------------------- | ------------------ |
|
|
273
|
+
| `config` | `config.<ext>` | Fires once during plugin initialization after owflow registers its skills, commands, and agents into the OpenCode configuration. |
|
|
274
|
+
| `chat.message` | `chat-message.<ext>` | Fires when a user submits a chat message in a session, before the model processes the turn. |
|
|
275
|
+
| `chat.params` | `chat-params.<ext>` | Fires when model generation parameters (such as temperature, topP, or provider options) are prepared for a chat request. |
|
|
276
|
+
| `chat.headers` | `chat-headers.<ext>` | Fires when HTTP headers are assembled for an outgoing model provider request. |
|
|
277
|
+
| `command.execute.before` | `command-execute-before.<ext>` | Fires immediately before a slash command is executed. |
|
|
278
|
+
| `tool.definition` | `tool-definition.<ext>` | Fires when a tool's schema and description are being resolved for presentation to the model. |
|
|
279
|
+
| `tool.execute.before` | `tool-execute-before.<ext>` | Fires immediately before a tool call executes, right after owflow's built-in destructive-command guard passes. |
|
|
280
|
+
| `tool.execute.after` | `tool-execute-after.<ext>` | Fires immediately after a tool call finishes executing and produces its result. |
|
|
281
|
+
| `shell.env` | `shell-env.<ext>` | Fires when environment variables are being constructed for a shell execution context. |
|
|
282
|
+
| `experimental.chat.messages.transform` | `experimental-chat-messages-transform.<ext>` | Fires before the conversation message history is sent to the model for a turn. |
|
|
283
|
+
| `experimental.chat.system.transform` | `experimental-chat-system-transform.<ext>` | Fires when the system prompt is being assembled before a model request. |
|
|
284
|
+
| `experimental.session.compacting` | `experimental-session-compacting.<ext>` | Fires when a session's context window is being compacted, right after owflow injects its orchestrator-state reminder. |
|
|
285
|
+
| `experimental.compaction.autocontinue` | `experimental-compaction-autocontinue.<ext>` | Fires during context compaction when determining whether the session should automatically continue its turn. |
|
|
286
|
+
| `experimental.text.complete` | `experimental-text-complete.<ext>` | Fires when the model finishes generating a text response segment. |
|
|
287
|
+
| `event` | `event.<ext>` | Catch-all hook that fires on every event emitted on the OpenCode event bus, after any matching host-event hook runs. |
|
|
288
|
+
| `dispose` | `dispose.<ext>` | Fires when the plugin instance is being shut down and disposed. |
|
|
289
|
+
|
|
290
|
+
### Available Host Events (32)
|
|
291
|
+
|
|
292
|
+
Host events are emitted on OpenCode's event bus and routed through the `event` hook handler when `event.type` matches:
|
|
293
|
+
|
|
294
|
+
| Event Name | Script File Name (`.sh` or `.ps1`) | Point of Execution |
|
|
295
|
+
| ---------- | ---------------------------------- | ------------------ |
|
|
296
|
+
| `command.executed` | `command-executed.<ext>` | Fires after a slash command has finished executing. |
|
|
297
|
+
| `file.edited` | `file-edited.<ext>` | Fires when a file in the workspace is modified by a tool or editor operation. |
|
|
298
|
+
| `file.watcher.updated` | `file-watcher-updated.<ext>` | Fires when the workspace filesystem watcher detects a file creation, change, or deletion. |
|
|
299
|
+
| `installation.update-available` | `installation-update-available.<ext>` | Listed in the host event table for when a newer OpenCode version is detected (note: because stem derivation maps all `-` to `.`, only the catch-all `event.<ext>` hook can observe this event). |
|
|
300
|
+
| `installation.updated` | `installation-updated.<ext>` | Fires after the OpenCode installation has been upgraded to a new version. |
|
|
301
|
+
| `lsp.client.diagnostics` | `lsp-client-diagnostics.<ext>` | Fires when a Language Server Protocol (LSP) client publishes updated diagnostics for workspace files. |
|
|
302
|
+
| `lsp.updated` | `lsp-updated.<ext>` | Fires when the status or configuration of connected LSP servers changes. |
|
|
303
|
+
| `message.part.removed` | `message-part-removed.<ext>` | Fires when a streaming or recorded content part is removed from a chat message. |
|
|
304
|
+
| `message.part.updated` | `message-part-updated.<ext>` | Fires when a content part of a chat message (such as text, reasoning, or a tool call) is created or updated. |
|
|
305
|
+
| `message.removed` | `message-removed.<ext>` | Fires when a message is deleted from a session's conversation history. |
|
|
306
|
+
| `message.updated` | `message-updated.<ext>` | Fires when a chat message's metadata or state is created or updated in a session. |
|
|
307
|
+
| `permission.replied` | `permission-replied.<ext>` | Fires when the user responds (approve or deny) to a runtime permission prompt. |
|
|
308
|
+
| `permission.updated` | `permission-updated.<ext>` | Fires when a permission request or rule state is created or updated. |
|
|
309
|
+
| `pty.created` | `pty-created.<ext>` | Fires when a new pseudo-terminal (PTY) session is spawned. |
|
|
310
|
+
| `pty.deleted` | `pty-deleted.<ext>` | Fires when a pseudo-terminal (PTY) session is removed and cleaned up. |
|
|
311
|
+
| `pty.exited` | `pty-exited.<ext>` | Fires when the underlying process inside a pseudo-terminal (PTY) session exits. |
|
|
312
|
+
| `pty.updated` | `pty-updated.<ext>` | Fires when a pseudo-terminal (PTY) session's state, title, or dimensions change. |
|
|
313
|
+
| `server.connected` | `server-connected.<ext>` | Fires when a client establishes a connection to the OpenCode server. |
|
|
314
|
+
| `server.instance.disposed` | `server-instance-disposed.<ext>` | Fires when an OpenCode server instance for a workspace is torn down and disposed. |
|
|
315
|
+
| `session.compacted` | `session-compacted.<ext>` | Fires after a session's conversation history has finished compacting. |
|
|
316
|
+
| `session.created` | `session-created.<ext>` | Fires when a new OpenCode chat session is created. |
|
|
317
|
+
| `session.deleted` | `session-deleted.<ext>` | Fires when an existing OpenCode chat session is deleted. |
|
|
318
|
+
| `session.diff` | `session-diff.<ext>` | Fires when the file diff summary for a session is computed or updated. |
|
|
319
|
+
| `session.error` | `session-error.<ext>` | Fires when an unhandled error occurs during session execution. |
|
|
320
|
+
| `session.idle` | `session-idle.<ext>` | Fires when a session finishes processing its current turn and transitions to the idle state. |
|
|
321
|
+
| `session.status` | `session-status.<ext>` | Fires whenever a session transitions between runtime states (such as busy, idle, or retrying). |
|
|
322
|
+
| `session.updated` | `session-updated.<ext>` | Fires when a session's metadata (such as title, sharing state, or timestamps) is updated. |
|
|
323
|
+
| `todo.updated` | `todo-updated.<ext>` | Fires when the session's todo list is created or modified via `todowrite`. |
|
|
324
|
+
| `tui.command.execute` | `tui-command-execute.<ext>` | Fires when a UI command is triggered inside the OpenCode TUI. |
|
|
325
|
+
| `tui.prompt.append` | `tui-prompt-append.<ext>` | Fires when text is programmatically appended to the TUI prompt input box. |
|
|
326
|
+
| `tui.toast.show` | `tui-toast-show.<ext>` | Fires when a toast notification is displayed in the OpenCode TUI. |
|
|
327
|
+
| `vcs.branch.updated` | `vcs-branch-updated.<ext>` | Fires when the active version-control (Git) branch changes in the workspace. |
|
|
328
|
+
|
|
329
|
+
**Excluded names**: `permission.ask`, `tool`, `auth`, `provider`, and `experimental.provider.small_model` are reserved OpenCode plugin surfaces and cannot be hooked via `.owflow/hooks/` (naming a script after them fails startup validation).
|
|
330
|
+
|
|
331
|
+
### Example hook in both formats
|
|
332
|
+
|
|
333
|
+
The same logging hook - it records the event, session, tool, and command from stdin - written in each supported format. Save **one** of these as `.owflow/hooks/tool-execute-before.<ext>`; the same hook name may not exist in two formats.
|
|
334
|
+
|
|
335
|
+
Scripts may log to stdout or stderr; both are captured automatically and shown in the TUI logs popup. Their working directory is the project root. Keep ad-hoc log files outside `.owflow/hooks/` - the strict digest allows only hook scripts there.
|
|
336
|
+
|
|
337
|
+
**Bash** (`.owflow/hooks/tool-execute-before.sh`, uses `jq`):
|
|
338
|
+
|
|
339
|
+
```bash
|
|
340
|
+
#!/usr/bin/env bash
|
|
341
|
+
set -euo pipefail
|
|
342
|
+
|
|
343
|
+
envelope="$(cat)"
|
|
344
|
+
event="$(jq -r '.event // "unknown"' <<<"$envelope")"
|
|
345
|
+
session="$(jq -r '.session.sessionID // "unknown"' <<<"$envelope")"
|
|
346
|
+
tool="$(jq -r '.context.tool // "?"' <<<"$envelope")"
|
|
347
|
+
command="$(jq -r '.context.args.command // ""' <<<"$envelope")"
|
|
348
|
+
|
|
349
|
+
printf '%s [example-hook] %s session=%s tool=%s command=%s\n' \
|
|
350
|
+
"$(date -u +"%Y-%m-%dT%H:%M:%SZ")" "$event" "$session" "$tool" "$command" >> .owflow/hook-events.log
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
**PowerShell** (`.owflow/hooks/tool-execute-before.ps1`):
|
|
354
|
+
|
|
355
|
+
```powershell
|
|
356
|
+
$ErrorActionPreference = "Stop"
|
|
357
|
+
|
|
358
|
+
$envelope = [Console]::In.ReadToEnd() | ConvertFrom-Json
|
|
359
|
+
$context = $envelope.context
|
|
360
|
+
$session = if ($envelope.session.sessionID) { $envelope.session.sessionID } else { "unknown" }
|
|
361
|
+
$stamp = Get-Date -Format o
|
|
362
|
+
|
|
363
|
+
$line = "$stamp [example-hook] $($envelope.event) session=$session tool=$($context.tool) command=$($context.args.command)"
|
|
364
|
+
Add-Content -Path .owflow/hook-events.log -Value $line
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
> **Strict digest - important**: `.owflow/hooks/` may contain **only** hook scripts, and each hook name may appear in **exactly one** format (`.sh` or `.ps1` - never two files with the same stem). Any other entry - a directory, a `.md` readme, a dotfile - is a validation error: user hooks are bypassed until you fix or remove the file, while the built-in destructive-command guard remains active. Keep notes and fixtures elsewhere.
|
|
368
|
+
|
|
369
|
+
Hooks are digested once at startup: **restart OpenCode to reload** after adding, editing, or removing a script (there is no watcher). Registration is fail-fast - a broken gate hook blocks the operation when it fires, it is never silently skipped; a `failed` gate also ends the current session. To start with user hooks disabled, set `OWFLOW_HOOKS_DISABLED=1`; the two built-in hooks (destructive-command guard and post-compaction reminder) remain active. To cap how long any single hook subprocess may run before being killed and treated as `failed`, set `OWFLOW_HOOK_TIMEOUT_MS=<milliseconds>` (default: untimed); in-flight hook subprocesses are also terminated automatically when the plugin disposes. To roll back to the previous release at any time, pin `"plugin": ["owflow@0.6.1"]` in `opencode.json` and restart OpenCode.
|
|
370
|
+
|
|
371
|
+
**Trust model**: scripts are the host project's own code, executed with the user's full privileges, with inherited environment, no name/path validation, no default timeout (`OWFLOW_HOOK_TIMEOUT_MS` is opt-in), and no output cap on the hook process itself — the git-hooks/husky convention; the bypass and timeout switches are the operator controls. Runtime logs (below) are a bounded local diagnostic record, not a tamper-evident audit trail, and never include the dispatch envelope, prompt text, or tool arguments.
|
|
372
|
+
|
|
373
|
+
**Visibility surfaces** (the loaded hook set is "effective after next restart"; TUI runtime colors are live):
|
|
374
|
+
|
|
375
|
+
- Startup: the `[owflow]` banner logs every registered hook (`path -> event interpreter - status`), invalid entries, and the bypass state
|
|
376
|
+
- TUI: an always-on **Active hooks** panel in the right-hand sidebar lists every loaded hook by name - no command, session, message, or model turn required. Each row uses a colored status orb (like the MCP status in OpenCode): grey before the hook has fired, yellow while a hook is running, green after a successful fire, and red after a failed, blocked, or unavailable-interpreter run; a settled outcome stays until that hook fires again. Every hook reports `In progress` while its code runs. Only a silent successful catch-all `event` run clears that pending state without recording an outcome, returning the row to its previous state (or `Idle`), so the high-frequency `event` hook does not leave a terminal trace; event-named hooks (`session-idle`, ...) and the one-shot `config`/`dispose` hooks record silent successes too. A fresh session starts with every row `Idle` and lights up on a real fire, while resuming an existing session loads the recorded state of the hook logs for that session. The current state follows the hook name in muted grey as `Idle`, `In progress`, `Success`, or `Error`. A trailing `›` marks each row as openable, and hovering a row highlights it and tints its name. The dispatcher writes a single overwritten JSON snapshot to OpenCode's tmp directory (`owflow-hooks-<workspace-hash>.json` inside `os.tmpdir()/opencode/`) - one file per workspace, no per-run files, last writer wins. The file is a diagnostic bridge for the TUI. Set `OWFLOW_HOOKS_STATUS_FILE` only to override the path for tests or manual debugging.
|
|
377
|
+
- TUI runtime logs: clicking a hook row opens a centered **run-detail popup** for that hook's latest settled run in the current session - status, duration, reason, exit code or signal, session, and total runs in the session (4,000-character budget; captured streams are omitted here). Its **View logs** button opens a second popup with the captured output across runs in the session: `--- stderr ---` first, then `--- stdout ---`. Session hook logs are not truncated; instead, large outputs are lazy-loaded in chunks as you scroll through the viewport. An empty capture shows `No output captured for this run.`. A successful event-named or `config`/`dispose` run is recorded even when it captured nothing (green `Success` row, `No output captured for this run.` in the logs popup); only a silent successful catch-all `event` run is a no-op. Runs that started before a fresh session's panel opened are ignored (showing an info toast instead of replaying a previous session's record), whereas resuming an existing session loads that session's recorded runs so details and captured logs remain viewable. The popup reads the log file at click time, so it works independently of the live status poll.
|
|
378
|
+
|
|
379
|
+
**Runtime logs**: each hook fire is considered for an append-only JSONL file in the same tmp directory (`owflow-hook-logs-<workspace-hash>-<hook-name>.jsonl`) - any hook run, or a catch-all `event` run that captured output or non-ok outcome. Only a silent successful catch-all `event` run is a no-op and appends nothing. Consecutive runs with identical event, hook, session, status, outcome, reason, exit code, signal, and captured output are coalesced into the first line, so a persistent failure or an unchanged repeated output cannot flood the file; a changed outcome or capture starts a new line. Hooks get their `stdout`, `stderr`, exit code, and signal captured automatically, and all stdout text is stored as the `stdout` field. Captured hook output is never forwarded to OpenCode's process output - the log file and the TUI popup are its only surfaces. Session hook logs are stored in full without truncation and lazy-loaded by scrolling in the TUI; non-session runs remain capped at 16 KB per stream. The file is capped at 4 MB with a single `.1` rotation. Set `OWFLOW_HOOK_LOGS_FILE` only to override the path for tests or manual debugging. Logs may contain sensitive hook output - owflow performs no redaction - so treat the file like any other local diagnostic artifact. Older records that still carry `runnerClass` or `errorStack` remain readable.
|
|
380
|
+
|
|
381
|
+
The TUI scan and startup banner are **digest-only** - they validate names, extensions, and event derivations. Discovery is structural for every script, so the TUI and startup banner report the same would-load set; no script is imported or executed.
|
|
382
|
+
|
|
383
|
+
PowerShell (`.ps1`) is verified against the same subprocess contract as `.sh` (fail-closed exit code mapping). The startup banner remains the unconditional visibility fallback outside the TUI.
|
|
384
|
+
|
|
385
|
+
## Environment Variables
|
|
386
|
+
|
|
387
|
+
You can configure owflow and its hook runtime behavior using the following environment variables:
|
|
388
|
+
|
|
389
|
+
| Variable | Values / Type | Default | Description |
|
|
390
|
+
| -------- | ------------- | ------- | ----------- |
|
|
391
|
+
| `OWFLOW_HOOKS_DISABLED` | `1` or unset | unset | **Bypass user hooks.** When set to `1`, disables loading, validating, and executing user hooks from `.owflow/hooks/`. Built-in hooks (destructive-command guard and post-compaction reminder) remain active. Disables active hooks status polling and log popups in the TUI. Useful as an emergency bypass if a hook script is broken or fails strict validation. |
|
|
392
|
+
| `OWFLOW_HOOK_TIMEOUT_MS` | Positive integer (ms) | unset (untimed) | **Per-hook execution timeout.** Maximum wall-clock time in milliseconds that a single user hook subprocess (`.sh` or `.ps1`) may run before being terminated and treated as failed. If a gate hook times out, the active session is aborted. |
|
|
393
|
+
| `OWFLOW_HOOKS_STATUS_FILE` | File path | `os.tmpdir()/opencode/owflow-hooks-<hash>.json` | **Hook status snapshot path override.** Overrides the location of the single-snapshot JSON file used by the dispatcher to communicate live hook states (`Idle`, `In progress`, `Success`, `Error`) to the TUI Active hooks sidebar panel. Intended for tests and manual debugging. |
|
|
394
|
+
| `OWFLOW_HOOK_LOGS_FILE` | File path | `os.tmpdir()/opencode/owflow-hook-logs-<hash>-<hook-name>.jsonl` | **Hook runtime log file path override.** Overrides the append-only JSONL log file where hook run records (exit code, signal, duration, captured `stdout`/`stderr`) are saved and read by the TUI log viewer popup. Intended for tests and manual debugging. |
|
|
395
|
+
|
|
396
|
+
> **Subprocess Environment**: User hook scripts run with inherited environment variables from OpenCode, meaning standard system variables (such as `PATH`, `TMPDIR`, and any credentials or project variables like `GH_TOKEN`) are available within your scripts.
|
|
397
|
+
|
|
398
|
+
## Beta Channel
|
|
399
|
+
|
|
400
|
+
Want to try experimental features before they hit stable? Install from the beta channel:
|
|
401
|
+
|
|
402
|
+
TBD
|
|
403
|
+
|
|
404
|
+
## Best Practices
|
|
405
|
+
|
|
406
|
+
**Don't use plan mode when starting a workflow.** Planning is a built-in part of every workflow — the orchestrator creates specs, plans, and other files as it goes. OpenCode's plan mode restricts file creation, which conflicts with this. Let the workflow handle planning on its own.
|
|
407
|
+
|
|
408
|
+
**Start workflows in a fresh session.** This is especially useful when chaining workflows (e.g., research → development). Research artifacts already contain all the context needed, so a clean session avoids noise from prior conversation.
|
|
409
|
+
|
|
410
|
+
**Chain workflows by passing a task folder.** If you've completed a research workflow and want to build on those results, pass the task folder directly — by path, or just by its directory identifier if the name is unique:
|
|
411
|
+
|
|
412
|
+
```bash
|
|
413
|
+
/owflow:development .owflow/tasks/research/2026-01-12-oauth-research
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
You can also append additional instructions to narrow scope or guide the workflow:
|
|
417
|
+
|
|
418
|
+
```bash
|
|
419
|
+
/owflow:development .owflow/tasks/research/2026-01-12-oauth-research Implement only phase 1
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
**Fork a research task to diverge from it.** If you want to re-run part of a completed research with different choices while keeping the original intact, fork it. Passing the task path is enough — the skill reads that research, then asks what the fork should explore, where it should diverge, and what to call it, with suggestions drawn from the research itself:
|
|
423
|
+
|
|
424
|
+
```bash
|
|
425
|
+
/owflow:research-fork .owflow/tasks/research/2026-01-12-oauth-research
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
Answer the three questions (or supply the answers up front — each one then gets skipped):
|
|
429
|
+
|
|
430
|
+
```bash
|
|
431
|
+
/owflow:research-fork .owflow/tasks/research/2026-01-12-oauth-research "compare scoping alternatives" \
|
|
432
|
+
--from=synthesis-complete --name="compare-scoping-alternatives"
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
The copy is verbatim (all artifacts, including those from after the fork point) and only the fork's `completed_phases` is trimmed at the fork point, so the fork resumes at the step after it. The source task is never modified.
|
|
436
|
+
|
|
437
|
+
## Known Issues
|
|
438
|
+
|
|
439
|
+
**Orchestrator may stall after long phases.** After context compaction (which typically happens after lengthy phases like implementation), the main agent may stop progressing automatically. If you notice it's idle, just type something like "continue" or "proceed" — it will pick up where it left off. You can also re-invoke the workflow in resume mode to reload the orchestrator state:
|
|
440
|
+
|
|
441
|
+
```bash
|
|
442
|
+
/owflow:development .owflow/tasks/development/2026-03-24-my-feature
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
## Learn More
|
|
446
|
+
|
|
447
|
+
- [Workflow Details](docs/workflows.md) - phases, examples, and task structure for each workflow type
|
|
448
|
+
- [Full Command Reference](docs/commands.md) - all workflow, review, utility, and quick commands
|