owflow 0.3.0 → 0.4.2
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/README.md +22 -0
- package/dist/agents/information-gatherer.md +691 -691
- package/dist/agents/research-planner.md +450 -447
- package/dist/agents/research-synthesizer.md +403 -401
- package/dist/agents/solution-brainstormer.md +257 -257
- package/dist/agents/solution-designer.md +372 -372
- package/dist/commands/goal-research.md +33 -0
- package/dist/commands/research-brainstorm.md +33 -0
- package/dist/commands/research-converge.md +33 -0
- package/dist/commands/research-design.md +33 -0
- package/dist/commands/research-finalize.md +33 -0
- package/dist/commands/research-fork.md +40 -0
- package/dist/commands/research-gather.md +33 -0
- package/dist/commands/research-plan.md +37 -0
- package/dist/commands/research-quick.md +37 -0
- package/dist/commands/research-synthesize.md +33 -0
- package/dist/commands/research.md +55 -36
- package/dist/commands/work.md +3 -3
- package/dist/configuration/skills-config.js +1 -1
- package/dist/index.js +5 -2
- package/dist/skills/goal-research/SKILL.md +118 -0
- package/dist/skills/orchestrator-framework/references/dispatcher-handoff.md +8 -1
- package/dist/skills/orchestrator-framework/references/gate-contract.md +112 -104
- package/dist/skills/research/SKILL.md +249 -495
- package/dist/skills/research-brainstorm/SKILL.md +120 -0
- package/dist/skills/{research → research-brainstorm}/references/brainstorming-techniques.md +1 -1
- package/dist/skills/research-converge/SKILL.md +130 -0
- package/dist/skills/research-design/SKILL.md +146 -0
- package/dist/skills/{research → research-design}/references/design-techniques.md +1 -1
- package/dist/skills/research-finalize/SKILL.md +125 -0
- package/dist/skills/research-fork/SKILL.md +190 -0
- package/dist/skills/research-gather/SKILL.md +133 -0
- package/dist/skills/research-plan/SKILL.md +141 -0
- package/dist/skills/research-quick/SKILL.md +139 -0
- package/dist/skills/research-synthesize/SKILL.md +127 -0
- package/dist/templates/orchestrator-state-research.yml +19 -13
- package/dist/tools/fork_task.js +36 -0
- package/dist/tools/verify_template.js +10 -31
- package/dist/utils/file-util.js +1 -1
- package/dist/utils/fork-task.js +74 -0
- package/dist/utils/plugin-info.js +20 -0
- package/dist/utils/yaml-structure.js +32 -0
- package/package.json +1 -1
- package/dist/constants.js +0 -4
- /package/dist/skills/{research → research-plan}/references/research-methodologies.md +0 -0
|
@@ -12,7 +12,14 @@ Orchestrators MAY delegate phase bodies to user-invocable **subskills** instead
|
|
|
12
12
|
## Rules
|
|
13
13
|
|
|
14
14
|
1. **State file is canonical.** `orchestrator-state.yml` remains the single source of truth. Subskills read it on entry and write step results on exit. `completed_phases` values MUST stay stable so both modes intermix freely on the same task.
|
|
15
|
-
- **Value convention**: `completed_phases` / `failed_phases` / `auto_fix_attempts` keys are **descriptive step slugs**, not `phase-N` numbers.
|
|
15
|
+
- **Value convention**: `completed_phases` / `failed_phases` / `auto_fix_attempts` keys are **descriptive step slugs**, not `phase-N` numbers. Canonical slugs per workflow:
|
|
16
|
+
|
|
17
|
+
| Workflow | Slugs | Routing table | Template |
|
|
18
|
+
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | ---------------------------------------------- |
|
|
19
|
+
| development | `codebase-analysed`, `gap-analysed`, `tdd-red-proven`, `spec-written`, `spec-audited`, `plan-created`, `implementation-done`, `tdd-green-proven`, `options-chosen`, `verification-done`, `e2e-run`, `docs-generated`, `task-completed` | `skills/development/SKILL.md` | `templates/orchestrator-state-development.yml` |
|
|
20
|
+
| research | `brief-written`, `plan-created`, `findings-gathered`, `synthesis-complete`, `alternatives-generated`, `approaches-chosen`, `design-generated`, `research-completed` | `skills/research/SKILL.md` | `templates/orchestrator-state-research.yml` |
|
|
21
|
+
| performance | `phase-N` (legacy holdout — kept internally consistent) | `skills/performance/SKILL.md` | `templates/orchestrator-state-performance.yml` |
|
|
22
|
+
| migration | `phase-N` (legacy holdout — kept internally consistent) | `skills/migration/SKILL.md` | `templates/orchestrator-state-migration.yml` |
|
|
16
23
|
2. **Subskills are self-contained.** Each has: an entry check (validate state + prerequisite artifacts), an execute section (delegation via Skill/Task tools per the [Delegation Rules](delegation-rules.md)), and an exit (state update + closing ritual). **State updates are per-step**: a subskill writes `orchestrator-state.yml` immediately after each of its steps completes — appending only the step slug actually performed, bumping `orchestrator.updated`, recording failures in `failed_phases`/`auto_fix_attempts`, and validating with `verify_template` — never as a single end-of-skill write.
|
|
17
24
|
3. **Closing ritual (handoff) → Exit Gate.** Every subskill ends with the **Exit Gate** contract, see [Gate Contract](gate-contract.md) (results box → results-acceptance question → next-step hint on accept → STOP).
|
|
18
25
|
4. **Entry checks replace phase gates in assisted mode.** A subskill invoked directly must validate the same prerequisites a phase gate would (e.g., spec exists before audit) and route to the prerequisite's command if missing — via its **Entry Gate** ([Gate Contract](gate-contract.md)).
|
|
@@ -1,104 +1,112 @@
|
|
|
1
|
-
# Gate Contract — Entry Gate & Exit Gate (Skill Contract)
|
|
2
|
-
|
|
3
|
-
Shared contract for how every user-invocable skill opens and closes. Extracted from `orchestrator-patterns.md` (Section 9) so skills can link to it directly.
|
|
4
|
-
|
|
5
|
-
Every **user-invocable** skill (orchestrators, subskills, dispatchers, utility commands) opens with an **Entry Gate** and closes with an **Exit Gate**. Internal skills (subagent-invoked, `user-invocable: false`) use lightweight input/structured-output contracts instead and never call `question`.
|
|
6
|
-
|
|
7
|
-
## Entry Gate
|
|
8
|
-
|
|
9
|
-
The Entry Gate runs BEFORE any phase work. It validates that this skill is allowed to run and routes to what is missing instead of guessing.
|
|
10
|
-
|
|
11
|
-
1. **Argument resolution** — resolve the argument in priority order: full path → identifier (directory name under the workflow's task type) → fresh description. If missing, ambiguous, or unmatched:
|
|
12
|
-
- Print a structured ask: the exact inputs accepted, with format examples, then WAIT.
|
|
13
|
-
- NEVER guess, auto-pick a task, or proceed with a resolved-by-hope path.
|
|
14
|
-
2. **Prerequisite check** — verify each required upstream artifact, expressed as a table the skill keeps at the top of its body:
|
|
15
|
-
|
|
16
|
-
| Required for this skill | Where verified | Produced by |
|
|
17
|
-
| ----------------------- | ------------------------------------------------------------------- | ---------------------------- |
|
|
18
|
-
| State file exists | `<task-path>/orchestrator-state.yml` | `/owflow:development <desc>` |
|
|
19
|
-
| Analysis done | `gap-analysed` in `completed_phases` + `analysis/gap-analysis.md` exists | `/owflow:dev-analyze` |
|
|
20
|
-
| Spec approved | `implementation/spec.md` exists | `/owflow:dev-spec` |
|
|
21
|
-
|
|
22
|
-
Verify **presence and, where cheap, content** (state field values like `has_reproducible_defect`, marker artifacts like `implementation/tdd-red-gate.md`), not just file existence.
|
|
23
|
-
|
|
24
|
-
3. **Blocked output** — when a prerequisite is unmet, print the blocked block and STOP:
|
|
25
|
-
1. Numbered "Steps that must be completed first (in order)", each with its exact prefixed command (`/owflow:dev-analyze <task-path>`).
|
|
26
|
-
2. List of resumable task identifiers (directories under the workflow's task type), if any exist.
|
|
27
|
-
3. Fresh-start hint: `Run /owflow:<entry-command> <description> to start a task from scratch.`
|
|
28
|
-
4. **Skip/resume semantics** — when the skill's steps are already in `completed_phases` (validate artifacts before trusting state): report the existing results briefly and route to the Exit Gate instead of re-executing.
|
|
29
|
-
5. **Conditional activation** — skills that only apply under a state condition (e.g., TDD red gate requires `has_reproducible_defect: true`) check it as part of the Entry Gate and route to the correct alternative command when inactive.
|
|
30
|
-
|
|
31
|
-
### Missing-state bootstrap (mid-pipeline entry)
|
|
32
|
-
|
|
33
|
-
When a
|
|
34
|
-
|
|
35
|
-
1. **Ask** via `question`: "No
|
|
36
|
-
2. **On confirm (bootstrap)**:
|
|
37
|
-
- Create the task directory `.owflow/tasks
|
|
38
|
-
- Create `orchestrator-state.yml` from
|
|
39
|
-
- Run `verify_template` against
|
|
40
|
-
- Then continue into Execute. Because bootstrapping creates **state only — never upstream artifacts**, later artifact prerequisites (e.g., `implementation/spec.md` before planning) still block with the normal precondition loop, so an incorrectly early bootstrap cannot silently skip work.
|
|
41
|
-
3. **On decline** — print the blocked block with the fresh-start hint
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
- **
|
|
84
|
-
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
1
|
+
# Gate Contract — Entry Gate & Exit Gate (Skill Contract)
|
|
2
|
+
|
|
3
|
+
Shared contract for how every user-invocable skill opens and closes. Extracted from `orchestrator-patterns.md` (Section 9) so skills can link to it directly.
|
|
4
|
+
|
|
5
|
+
Every **user-invocable** skill (orchestrators, subskills, dispatchers, utility commands) opens with an **Entry Gate** and closes with an **Exit Gate**. Internal skills (subagent-invoked, `user-invocable: false`) use lightweight input/structured-output contracts instead and never call `question`.
|
|
6
|
+
|
|
7
|
+
## Entry Gate
|
|
8
|
+
|
|
9
|
+
The Entry Gate runs BEFORE any phase work. It validates that this skill is allowed to run and routes to what is missing instead of guessing.
|
|
10
|
+
|
|
11
|
+
1. **Argument resolution** — resolve the argument in priority order: full path → identifier (directory name under the workflow's task type) → fresh description. If missing, ambiguous, or unmatched:
|
|
12
|
+
- Print a structured ask: the exact inputs accepted, with format examples, then WAIT.
|
|
13
|
+
- NEVER guess, auto-pick a task, or proceed with a resolved-by-hope path.
|
|
14
|
+
2. **Prerequisite check** — verify each required upstream artifact, expressed as a table the skill keeps at the top of its body:
|
|
15
|
+
|
|
16
|
+
| Required for this skill | Where verified | Produced by |
|
|
17
|
+
| ----------------------- | ------------------------------------------------------------------- | ---------------------------- |
|
|
18
|
+
| State file exists | `<task-path>/orchestrator-state.yml` | `/owflow:development <desc>` |
|
|
19
|
+
| Analysis done | `gap-analysed` in `completed_phases` + `analysis/gap-analysis.md` exists | `/owflow:dev-analyze` |
|
|
20
|
+
| Spec approved | `implementation/spec.md` exists | `/owflow:dev-spec` |
|
|
21
|
+
|
|
22
|
+
Verify **presence and, where cheap, content** (state field values like `has_reproducible_defect`, marker artifacts like `implementation/tdd-red-gate.md`), not just file existence.
|
|
23
|
+
|
|
24
|
+
3. **Blocked output** — when a prerequisite is unmet, print the blocked block and STOP:
|
|
25
|
+
1. Numbered "Steps that must be completed first (in order)", each with its exact prefixed command (`/owflow:dev-analyze <task-path>`).
|
|
26
|
+
2. List of resumable task identifiers (directories under the workflow's task type), if any exist.
|
|
27
|
+
3. Fresh-start hint: `Run /owflow:<entry-command> <description> to start a task from scratch.`
|
|
28
|
+
4. **Skip/resume semantics** — when the skill's steps are already in `completed_phases` (validate artifacts before trusting state): report the existing results briefly and route to the Exit Gate instead of re-executing.
|
|
29
|
+
5. **Conditional activation** — skills that only apply under a state condition (e.g., TDD red gate requires `has_reproducible_defect: true`) check it as part of the Entry Gate and route to the correct alternative command when inactive.
|
|
30
|
+
|
|
31
|
+
### Missing-state bootstrap (mid-pipeline entry)
|
|
32
|
+
|
|
33
|
+
When a subskill is invoked with a task path/identifier whose `orchestrator-state.yml` exists nowhere (no task, no state file) and the ONLY unmet prerequisite is the state file itself, the skill does not blindly send the user back to the full pipeline — the user chose to enter mid-pipeline. Instead:
|
|
34
|
+
|
|
35
|
+
1. **Ask** via `question`: "No task exists at this path. Create a fresh standard task and start at `<this skill's first step slug>`?"
|
|
36
|
+
2. **On confirm (bootstrap)**:
|
|
37
|
+
- Create the task directory `.owflow/tasks/<workflow-type>/YYYY-MM-DD-task-name/` (name derived from the argument or the user's input) — mark `orchestrator.entry_point: "<skill> (mid-pipeline bootstrap)"` and `started_phase` with this skill's starting step slug.
|
|
38
|
+
- Create `orchestrator-state.yml` from the workflow's template, honoring any of the skill's command flags into their state fields; leave `completed_phases` empty (upstream steps stay unrecorded).
|
|
39
|
+
- Run `verify_template` against the workflow's template.
|
|
40
|
+
- Then continue into Execute. Because bootstrapping creates **state only — never upstream artifacts**, later artifact prerequisites (e.g., `implementation/spec.md` before planning) still block with the normal precondition loop, so an incorrectly early bootstrap cannot silently skip work.
|
|
41
|
+
3. **On decline** — print the blocked block with the fresh-start hint and STOP.
|
|
42
|
+
|
|
43
|
+
#### dev-* bootstrap
|
|
44
|
+
|
|
45
|
+
- Task directory under `.owflow/tasks/development/`; template `orchestrator-state-development.yml`; fresh-start hint: `Run /owflow:development <description> to start a task from scratch.`
|
|
46
|
+
- Skill starting points (used for the bootstrap question and `started_phase`): dev-analyze → `codebase-analysed`; dev-tdd-red → `tdd-red-proven`; dev-spec → `spec-written`; dev-plan → `plan-created`; dev-implement → `implementation-done`; dev-verify → `options-chosen`; dev-finalize → `e2e-run`.
|
|
47
|
+
|
|
48
|
+
#### research-* bootstrap
|
|
49
|
+
|
|
50
|
+
- Task directory under `.owflow/tasks/research/`; template `orchestrator-state-research.yml`; fresh-start hint: `Run /owflow:research <question> to start a task from scratch.`
|
|
51
|
+
- Skill starting points (used for the bootstrap question and `started_phase`): research-plan → `brief-written`; research-gather → `findings-gathered`; research-synthesize → `synthesis-complete`; research-brainstorm → `alternatives-generated`; research-converge → `approaches-chosen`; research-design → `design-generated`; research-finalize → `research-completed`.
|
|
52
|
+
|
|
53
|
+
### Deterministic entry checks (future)
|
|
54
|
+
|
|
55
|
+
Entry-gate checks above are currently executed by the agent reading state. For more deterministic routing, future work considers (a) a small script that checks whether `orchestrator-state.yml` exists, parses it, and answers slug/next-step queries, and (b) an OpenCode lifecycle hook that automates these entry-gate checks for dev-* skills before they run. Until then, follow the rules above exactly as written.
|
|
56
|
+
|
|
57
|
+
## Exit Gate
|
|
58
|
+
|
|
59
|
+
The Exit Gate runs after all phase work and state updates are final. It presents results, asks the user to confirm them, and only then hands off.
|
|
60
|
+
|
|
61
|
+
1. **Results box** — one-screen markdown summary (no ASCII borders, markdown headings/bold carry the emphasis):
|
|
62
|
+
|
|
63
|
+
```markdown
|
|
64
|
+
## ✅ <SKILL> COMPLETE — <task name>
|
|
65
|
+
|
|
66
|
+
**<Field 1>** — [key outcome]
|
|
67
|
+
**<Field 2>** — [key outcome]
|
|
68
|
+
|
|
69
|
+
**Artifacts**
|
|
70
|
+
|
|
71
|
+
- `relative/path/to/artifact.md`
|
|
72
|
+
|
|
73
|
+
**Next ▸** `/owflow:<next-skill> <task-path>`
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Conventions:
|
|
77
|
+
- Status glyphs follow the outcome: ✅ pass/success, ⚠ pass-with-concerns/partial, ❌ fail.
|
|
78
|
+
- Set the **Next ▸** line to the suggested next command for this skill; omit it when the next-step hint depends on the Accept response (the handoff block is printed after Accept anyway).
|
|
79
|
+
|
|
80
|
+
2. **Results-acceptance question** (MANDATORY, fires before any handoff hint):
|
|
81
|
+
|
|
82
|
+
Use `question` — "Are these results correct?" with options:
|
|
83
|
+
- **Accept** — results are good; proceed to the next-step hint.
|
|
84
|
+
- **Adjust** — user specifies what to change; re-work ONLY the affected parts, update artifacts/state, then re-present the results box and re-ask.
|
|
85
|
+
- **Discuss** — walk through a specific result in more depth (evidence, reasoning, alternatives); after the discussion, re-ask.
|
|
86
|
+
- **Stop here** — artifacts persist; print the resume command (`/owflow:<this-skill> <task-path>` or the next phase command) and end.
|
|
87
|
+
|
|
88
|
+
3. **Next-step hint** — only after Accept: print the suggested next command derived from state, plus an "Other options" block of alternative valid commands. Every suggested command is a **compact annotated entry**:
|
|
89
|
+
- **Purpose** — one line stating what the proposed skill does.
|
|
90
|
+
- **Requirement tag** — `required` (mandatory next phase) or `optional` (shortcut, standalone utility, or conditional step) with its activation condition, e.g. `optional — only when has_reproducible_defect: true`.
|
|
91
|
+
- **Remaining plan** (for optional/alternative paths) — one compact line listing the phases still ahead in execution order, marking which are optional.
|
|
92
|
+
- Standalone review/utility commands are annotated `optional — does not advance phases`.
|
|
93
|
+
|
|
94
|
+
Example shape (~5 lines):
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
→ /owflow:dev-verify <task-path>
|
|
98
|
+
What: runs the verification pipeline (completeness, code review, fixes) — required before commit. Remaining after: /owflow:dev-finalize (required).
|
|
99
|
+
Other options:
|
|
100
|
+
/owflow:reviews-code <task-path> — optional, does not advance phases (standalone re-run of code review)
|
|
101
|
+
/owflow:goal-development <task-path> — optional shortcut: runs all remaining phases in one loop (… → verify → finalize)
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Then STOP. Never auto-invoke the next skill.
|
|
105
|
+
|
|
106
|
+
4. **Gate ordering** — per the Phase Gate Behavior state ordering rule in `orchestrator-patterns.md`: finish phase work → present results box → acceptance question → user responds → THEN the state is already consistent (per-step writes happened during Execute); the Exit Gate never mutates phase state on its own except recording the user's acceptance decision where the state schema has a field for it.
|
|
107
|
+
|
|
108
|
+
## Exceptions
|
|
109
|
+
|
|
110
|
+
- **Dispatchers** (`development`, `research`): the Exit Gate's acceptance question is adapted — the results box is the handoff block, and the question asks how to proceed (hand off to the suggested subskill / switch to autonomous mode / adjust / stop).
|
|
111
|
+
- **Utility skills with explicit no-follow-up contracts** (`agents-md-generator`, `rule-reviewer`): the acceptance question is confirm-or-revise only; follow-up suggestions stay prohibited unless the user asks. See [confirm-or-revise exception](confirm-or-revise-exception.md).
|
|
112
|
+
- **Orchestrated mode** (`goal-development`, `goal-research`): the subskill's own Exit Gate acceptance question IS the loop gate — Accept means "continue to the next subskill". The wrapper MUST NOT add a second consecutive `question`.
|