owflow 0.2.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.
Files changed (111) hide show
  1. package/README.md +83 -28
  2. package/dist/agents/code-reviewer.md +1 -1
  3. package/dist/agents/information-gatherer.md +691 -691
  4. package/dist/agents/production-readiness-checker.md +1 -1
  5. package/dist/agents/project-analyzer.md +0 -1
  6. package/dist/agents/research-planner.md +450 -447
  7. package/dist/agents/research-synthesizer.md +403 -401
  8. package/dist/agents/solution-brainstormer.md +257 -257
  9. package/dist/agents/solution-designer.md +372 -372
  10. package/dist/agents/task-classifier.md +3 -3
  11. package/dist/commands/agents-md-generator.md +36 -0
  12. package/dist/commands/dev-analyze.md +33 -0
  13. package/dist/commands/dev-bugfix.md +37 -0
  14. package/dist/commands/dev-finalize.md +33 -0
  15. package/dist/commands/dev-implement.md +34 -0
  16. package/dist/commands/dev-plan.md +37 -0
  17. package/dist/commands/dev-spec.md +37 -0
  18. package/dist/commands/dev-tdd-red.md +33 -0
  19. package/dist/commands/dev-verify.md +33 -0
  20. package/dist/commands/development.md +11 -12
  21. package/dist/commands/diagrams-mermaid.md +3 -4
  22. package/dist/commands/flow-init.md +3 -4
  23. package/dist/commands/goal-development.md +32 -0
  24. package/dist/commands/goal-research.md +33 -0
  25. package/dist/commands/html-renderer.md +3 -4
  26. package/dist/commands/migration.md +3 -4
  27. package/dist/commands/performance.md +3 -4
  28. package/dist/commands/research-brainstorm.md +33 -0
  29. package/dist/commands/research-converge.md +33 -0
  30. package/dist/commands/research-design.md +33 -0
  31. package/dist/commands/research-finalize.md +33 -0
  32. package/dist/commands/research-fork.md +40 -0
  33. package/dist/commands/research-gather.md +33 -0
  34. package/dist/commands/research-plan.md +37 -0
  35. package/dist/commands/research-quick.md +37 -0
  36. package/dist/commands/research-synthesize.md +33 -0
  37. package/dist/commands/research.md +55 -37
  38. package/dist/commands/reviews-code.md +4 -4
  39. package/dist/commands/reviews-pragmatic.md +4 -4
  40. package/dist/commands/reviews-production-readiness.md +4 -4
  41. package/dist/commands/reviews-reality-check.md +4 -4
  42. package/dist/commands/reviews-spec-audit.md +4 -4
  43. package/dist/commands/rule-reviewer.md +38 -0
  44. package/dist/commands/standards-discover.md +3 -4
  45. package/dist/commands/standards-update.md +3 -4
  46. package/dist/commands/work.md +21 -21
  47. package/dist/configuration/skills-config.js +1 -1
  48. package/dist/index.js +5 -2
  49. package/dist/skills/agents-md-generator/SKILL.md +223 -0
  50. package/dist/skills/codebase-analyzer/SKILL.md +1 -1
  51. package/dist/skills/dev-analyze/SKILL.md +115 -0
  52. package/dist/skills/dev-bugfix/SKILL.md +452 -0
  53. package/dist/skills/dev-finalize/SKILL.md +118 -0
  54. package/dist/skills/dev-implement/SKILL.md +167 -0
  55. package/dist/skills/dev-plan/SKILL.md +147 -0
  56. package/dist/skills/dev-spec/SKILL.md +182 -0
  57. package/dist/skills/dev-tdd-red/SKILL.md +94 -0
  58. package/dist/skills/dev-verify/SKILL.md +160 -0
  59. package/dist/skills/development/SKILL.md +130 -522
  60. package/dist/skills/diagrams-mermaid/SKILL.md +3 -1
  61. package/dist/skills/docs-manager/SKILL.md +4 -4
  62. package/dist/skills/docs-manager/references/agents-md-template.md +1 -1
  63. package/dist/skills/flow-init/SKILL.md +34 -13
  64. package/dist/skills/goal-development/SKILL.md +96 -0
  65. package/dist/skills/goal-research/SKILL.md +118 -0
  66. package/dist/skills/html-renderer/SKILL.md +14 -1
  67. package/dist/skills/implementation-plan-executor/SKILL.md +1 -1
  68. package/dist/skills/implementation-verifier/SKILL.md +1 -1
  69. package/dist/skills/migration/SKILL.md +63 -18
  70. package/dist/skills/orchestrator-framework/SKILL.md +1 -1
  71. package/dist/skills/orchestrator-framework/references/command-namespacing.md +7 -0
  72. package/dist/skills/orchestrator-framework/references/confirm-or-revise-exception.md +20 -0
  73. package/dist/skills/orchestrator-framework/references/delegation-rules.md +54 -0
  74. package/dist/skills/orchestrator-framework/references/dispatcher-handoff.md +27 -0
  75. package/dist/skills/orchestrator-framework/references/gate-contract.md +112 -0
  76. package/dist/skills/orchestrator-framework/references/orchestrator-creation-checklist.md +3 -0
  77. package/dist/skills/orchestrator-framework/references/orchestrator-patterns.md +8 -50
  78. package/dist/skills/performance/SKILL.md +52 -18
  79. package/dist/skills/research/SKILL.md +249 -462
  80. package/dist/skills/research-brainstorm/SKILL.md +120 -0
  81. package/dist/skills/{research → research-brainstorm}/references/brainstorming-techniques.md +1 -1
  82. package/dist/skills/research-converge/SKILL.md +130 -0
  83. package/dist/skills/research-design/SKILL.md +146 -0
  84. package/dist/skills/{research → research-design}/references/design-techniques.md +1 -1
  85. package/dist/skills/research-finalize/SKILL.md +125 -0
  86. package/dist/skills/research-fork/SKILL.md +190 -0
  87. package/dist/skills/research-gather/SKILL.md +133 -0
  88. package/dist/skills/research-plan/SKILL.md +141 -0
  89. package/dist/skills/research-quick/SKILL.md +139 -0
  90. package/dist/skills/research-synthesize/SKILL.md +127 -0
  91. package/dist/skills/rule-reviewer/SKILL.md +334 -0
  92. package/dist/skills/standards-discover/SKILL.md +37 -14
  93. package/dist/skills/standards-update/SKILL.md +58 -10
  94. package/dist/templates/orchestrator-state-development.yml +14 -13
  95. package/dist/templates/orchestrator-state-research.yml +19 -13
  96. package/dist/tools/fork_task.js +36 -0
  97. package/dist/tools/verify_template.js +10 -31
  98. package/dist/utils/file-util.js +14 -8
  99. package/dist/utils/fork-task.js +74 -0
  100. package/dist/utils/plugin-info.js +20 -0
  101. package/dist/utils/yaml-structure.js +32 -0
  102. package/package.json +1 -1
  103. package/dist/commands/quick-bugfix.md +0 -37
  104. package/dist/commands/quick-dev.md +0 -182
  105. package/dist/commands/quick-plan.md +0 -167
  106. package/dist/constants.js +0 -4
  107. package/dist/skills/quick-bugfix/SKILL.md +0 -311
  108. package/dist/templates/quick-bugfix-task.yml +0 -10
  109. package/dist/templates/quick-dev-task.yml +0 -10
  110. package/dist/templates/quick-plan-task.yml +0 -11
  111. /package/dist/skills/{research → research-plan}/references/research-methodologies.md +0 -0
@@ -0,0 +1,127 @@
1
+ ---
2
+ name: owflow:research-synthesize
3
+ description: Research skill — delegates synthesis and evidence-based reporting to the research-synthesizer agent, producing the synthesis document and the comprehensive research report with per-finding confidence. Closes the research foundation (synthesis-complete) at the boundary with the optional chain (user choice).
4
+ argument-hint: "[task-path-or-identifier]"
5
+ user-invocable: true
6
+ ---
7
+
8
+ # Research Synthesize — Synthesis & Research Report (synthesis-complete)
9
+
10
+ Work phase of the research workflow. Delegates pattern synthesis and evidence-based reporting to the research-synthesizer agent (`analysis/synthesis.md` + `outputs/research-report.md`). This is the research-foundation boundary: the Exit Gate is the pause between the foundation and the optional-phase decision. State lives in `orchestrator-state.yml` — this skill reads it on entry and writes results on exit.
11
+
12
+ Related phases: `/owflow:research-gather` (produces the merged findings); the optional chain (`research-brainstorm` / `research-design`) and `/owflow:research-finalize` follow, per the user's choice.
13
+
14
+ ## Entry Gate
15
+
16
+ Resolve the `task-path-or-identifier` argument BEFORE anything else (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)):
17
+
18
+ - **Path** (absolute or project-relative) to the task directory — use as-is.
19
+ - **Identifier** — exact directory name inside `.owflow/tasks/research/` (e.g., `2026-09-26-my-research`); resolve to its path.
20
+ - If the argument is **missing**, the path does **not exist**, or matches **no identifier** → print the blocked block, then STOP (never guess or auto-pick a task):
21
+ 1. Steps that must be completed first (in order), each with its command:
22
+ - Research brief & plan (`brief-written`, `plan-created`) → `/owflow:research-plan <task-path>`
23
+ - Parallel findings fan (`findings-gathered`) → `/owflow:research-gather <task-path>`
24
+ 2. List available research-task identifiers (directories under `.owflow/tasks/research/`) to resume from, if any.
25
+ 3. Hint: `Run /owflow:research <question> to start a task from scratch, or pass a task path/identifier to resume.`
26
+
27
+ ### Prerequisites
28
+
29
+ | Required for this skill | Where verified | Produced by |
30
+ | ------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------ |
31
+ | State file exists | `<task-path>/orchestrator-state.yml` | `/owflow:research <question>` or `/owflow:research-quick` |
32
+ | Findings exist | `findings-gathered` in `completed_phases` + `analysis/findings/` has per-category files | `/owflow:research-gather <task-path>` (or the quick lane's condensed gather) |
33
+ | Research question recorded | `research_context.research_question` non-null in state | `/owflow:research-plan <task-path>` |
34
+
35
+ 1. **Read `orchestrator-state.yml`** from the task path. If missing → mid-pipeline bootstrap ([Missing-state Bootstrap](../orchestrator-framework/references/gate-contract.md), starting slug `synthesis-complete`): `question` — create a fresh standard research task starting at this step, or decline → print `No research task found at <path>. Run /owflow:research <question> to start a task from scratch.` and STOP.
36
+ 2. **Content check — findings present**: the per-category files under `analysis/findings/` must exist (artifacts before state — drop the `findings-gathered` entry and route back to `/owflow:research-gather <task-path>` when they do not).
37
+ 3. **Skip/resume**: if `analysis/synthesis.md` AND `outputs/research-report.md` both exist, adopt them — append `synthesis-complete` if it is missing, backfill `research_outputs.synthesis` and `research_outputs.research_report` when those fields are still null, report the existing summaries, and route to the Exit Gate. Either file missing → re-run below (drop a stale `synthesis-complete` entry first).
38
+
39
+ ## Input / Output Artifacts
40
+
41
+ | Artifact | Normal mode (full lane) | Quick mode (`research-quick`) |
42
+ | ---------------------------------------------- | ----------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
43
+ | Consumed: `analysis/findings/*.md` | all per-category files (the gather contract) | same — quick-lane findings feed the inline synthesis |
44
+ | Consumed: `research-synthesizer` agent (Task tool) | 1 delegated call | n/a — synthesis is ALWAYS inline in the quick lane (the ONLY exception to this delegation) |
45
+ | Produced: `analysis/synthesis.md` | delegated (patterns, cross-references, gaps) | written directly inline |
46
+ | Produced: `outputs/research-report.md` | delegated (report + per-finding confidence) | written directly inline |
47
+ | State write | `synthesis-complete`; `confidence_level`, `phase_summaries.synthesize`, `research_outputs.synthesis` + `.research_report` | same slug and fields, condensation-noted |
48
+
49
+ ## Execute (delegated synthesis)
50
+
51
+ **Read first**: the [Delegation Rules](../orchestrator-framework/references/delegation-rules.md).
52
+
53
+ > **ANTI-PATTERN — never write synthesis.md or research-report.md yourself. "The findings are few" is NOT a reason to skip delegation. (The quick lane is the ONLY exception — research-quick synthesizes inline and skips this section.)**
54
+
55
+ 1. **INVOKE NOW**: Task tool - `research-synthesizer` subagent (never the Skill tool — this is an agent). Pass (Pattern 7 — accumulated context): task_path, findings_directory_path, research_question, research_type, methodology (from state).
56
+
57
+ **Synthesizer produces**:
58
+
59
+ - Pattern analysis and cross-references → `analysis/synthesis.md`
60
+ - Comprehensive research report answering research question → `outputs/research-report.md`
61
+ - Confidence levels for each finding
62
+ - Documented gaps and uncertainties
63
+
64
+ > **SELF-CHECK on both artifacts**: after the Task tool returns, verify `analysis/synthesis.md` AND `outputs/research-report.md` exist (synthesis documents gaps; report carries confidence per finding). If missing: **STOP. Re-invoke the research-synthesizer with corrected context.** If the second attempt also fails, use `question` to report the failure and ask whether to retry (after targeted re-gathering if the gaps require it) or stop. There is no continue-without-synthesis path — every later step reads these artifacts. On stop, record the failure per the State Update Convention and print the resume command.
65
+
66
+ ### Post-synthesis decision re-cap (direct, condensable)
67
+
68
+ The synthesizer's key outcomes are surfaced to the user here before the Exit Gate (decisions from subagents must go to the user — never silently skipped): overall `confidence_level`, top patterns, documented gaps. Extract a 1-2 sentence summary into `phase_summaries.synthesize`.
69
+
70
+ ### Close (`synthesis-complete`)
71
+
72
+ 1. **State write**: append `synthesis-complete` to `completed_phases`; update `research_context.confidence_level`, `phase_summaries.synthesize`; set `research_outputs.synthesis` and `research_outputs.research_report`; bump `orchestrator.updated`. On failure: append `synthesis-complete` to `failed_phases`, increment `auto_fix_attempts["synthesis-complete"]`. Then re-read state + run `verify_template` (see State Update Convention).
73
+
74
+ ## State Update Convention (per step)
75
+
76
+ Apply after EVERY step above:
77
+
78
+ 1. **Write immediately** — update `orchestrator-state.yml` as soon as the step completes, appending ONLY the step slug actually performed (`synthesis-complete`) plus that step's fields. Never batch multiple steps into one end-of-skill write.
79
+ 2. **Timestamp** — set `orchestrator.updated` to the current UTC timestamp on every write.
80
+ 3. **Failures** — if the step fails or its retries are abandoned, do NOT append to `completed_phases`; instead append the step's slug to `orchestrator.failed_phases` and increment `auto_fix_attempts["synthesis-complete"]`.
81
+ 4. **Validate** — after every write, re-read the file to confirm values, then run the `verify_template` tool with `filePath: <task-path>/orchestrator-state.yml`, `templateName: orchestrator-state-research.yml`. Fix any reported issue immediately before proceeding.
82
+ 5. **Final check** — before the Exit Gate, one consolidated re-read + `verify_template` run to confirm the full state matches everything performed in this session.
83
+
84
+ ## Recovery
85
+
86
+ | Step | Max Attempts | Strategy |
87
+ | --------------------------------- | ------------ | ------------------------------------- |
88
+ | Synthesize (`synthesis-complete`) | 2 | Request targeted re-gathering for gaps |
89
+
90
+ ## Exit Gate
91
+
92
+ Present results, get user confirmation, then hand off (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)). Never auto-invoke the next skill.
93
+
94
+ ### Results box
95
+
96
+ ```markdown
97
+ ## ✅ RESEARCH SYNTHESIZE COMPLETE — <research question>
98
+
99
+ **Type** — [research type]
100
+ **Confidence** — [confidence level from state]
101
+ **Key patterns** — [2-3 one-line pattern highlights from synthesis]
102
+ **Gaps** — [documented gaps and uncertainties, 1 line]
103
+
104
+ **Artifacts**
105
+
106
+ - `analysis/synthesis.md`
107
+ - `outputs/research-report.md`
108
+ ```
109
+
110
+ ### Results-acceptance question
111
+
112
+ Use `question` — "Are these results correct?" with options:
113
+
114
+ - **Accept** — synthesis and report are good; continue.
115
+ - **Adjust** — re-run the affected part with the user's corrections (targeted re-gathering for gaps, then re-synthesize), update state and artifacts, re-present the results box.
116
+ - **Discuss** — walk through specific findings or confidence levels in more depth; then re-ask.
117
+ - **Stop here** — print the resume command (`/owflow:research-synthesize <task-path>`) and end.
118
+
119
+ ### Next steps (after Accept)
120
+
121
+ Research foundation complete (initialized, planned, gathered, synthesized). Continue to optional-phase evaluation?
122
+
123
+ - `→ /owflow:research-brainstorm <task-path>` — when the user wants solution alternatives brainstormed. Remaining after: converge → design (when wanted) → finalize.
124
+ - `→ /owflow:research-design <task-path>` — design-only branch (no brainstorming), seeded from the research report. Remaining after: finalize.
125
+ - `→ /owflow:research-finalize <task-path>` — when neither is wanted: inventories the outputs and completes the task. If the foundation alone was the goal, this is the route — the task stays resumable.
126
+
127
+ Then STOP.
@@ -0,0 +1,334 @@
1
+ ---
2
+ name: owflow:rule-reviewer
3
+ description: Score an AI rules file on 5 axes and return concrete actionable fixes
4
+ argument-hint: "[path/to/rules.md]"
5
+ user-invocable: true
6
+ ---
7
+
8
+ # Rule reviewer
9
+
10
+ Score an AI rules file on five axes and return concrete fixes. The file under review is whatever rule-for-AI markdown the user passes in — this skill does not assume CLAUDE.md, AGENTS.md, or any specific tool.
11
+
12
+ The skill never edits the file. It produces a scorecard. The user decides what to act on.
13
+
14
+ Gates follow the shared contract in [Gate Contract](../orchestrator-framework/references/gate-contract.md) (confirm-or-revise exception — see the [Confirm-or-Revise Exception](../orchestrator-framework/references/confirm-or-revise-exception.md)).
15
+
16
+ ## Entry Gate
17
+
18
+ The input resolution below IS this skill's entry gate.
19
+
20
+ ## Input resolution
21
+
22
+ **Get the path to the rules file:**
23
+
24
+ 1. If a path is provided as the skill argument, use it directly
25
+ 2. If no path is provided, use question:
26
+ ```
27
+ "Which rules file should I review? Provide the path."
28
+ ```
29
+ 3. Do not guess
30
+
31
+ Supported path formats — absolute, repo-relative, or `@`-prefixed:
32
+
33
+ - `AGENTS.md`
34
+ - `.cursor/rules/api.mdc`
35
+ - `src/api/AGENTS.md`
36
+ - `.github/copilot-instructions.md`
37
+ - `~/.claude/CLAUDE.md`
38
+
39
+ If the path resolves to a directory, use question to ask which file to review. If it resolves to multiple files (e.g. `**/AGENTS.md`), score them one at a time and report each scorecard separately — do not merge.
40
+
41
+ If the file does not exist, stop and report the path. Do not invent content.
42
+
43
+ ## What this skill does NOT do
44
+
45
+ - Does not edit the rules file _unless the user explicitly approves the reorder proposed by Check 5_. The default output is read-only.
46
+ - Does not generate a full "fixed version" of the file. At most, Check 5 may move/regroup sections; it never rewrites rule content.
47
+ - Does not assume the file's tool target. CLAUDE.md, AGENTS.md, `.mdc`, `.windsurfrules`, custom names — all treated as "a rules-for-AI file".
48
+ - Does not score _project content_ (architecture, tech choices, conventions). It scores the _rule artifact's condition_ — the same way a code review scores code, not the product.
49
+
50
+ ## Procedure
51
+
52
+ 1. Read the file in full using the Read tool (if it's > 2000 lines, read in chunks until complete).
53
+ 2. Compute Checks 1–4.
54
+ 3. Run Check 5 in its own multi-step flow (5a list → 5b comment → 5c propose → 5d ask via question → 5e atomic-change reminder). The reorder edit, if any, happens here and only with explicit user approval.
55
+ 4. Print the scorecard in the exact format under "Output format". Include the reorder-proposal summary and the user's decision in the Check 5 findings.
56
+ 5. Run the Exit Gate (end of "Output format"): results-acceptance question, then stop. Do not propose further follow-up actions unless the user asks.
57
+
58
+ ---
59
+
60
+ ## The 5 checks
61
+
62
+ ### Check 1 — Length
63
+
64
+ Count non-empty lines (ignore blank lines and pure separator lines like `---`).
65
+
66
+ | Lines | Verdict | Symbol |
67
+ | ------- | --------- | ------ |
68
+ | 0–200 | fine | OK |
69
+ | 201–500 | watch out | WARN |
70
+ | 501+ | warn | FAIL |
71
+
72
+ Why it matters: long rule files crowd out the user's prompt in the context window, and middle-of-file rules get the weakest attention from the model. Length is a proxy for "you're paying context for things the agent doesn't need every session."
73
+
74
+ For WARN/FAIL, suggest:
75
+
76
+ - Split per-area rules into nested files closer to their code (e.g. `src/api/AGENTS.md`).
77
+ - Replace duplicated docs with `@`-references to the canonical file.
78
+ - Drop rules that aren't tied to a recurring agent failure mode.
79
+
80
+ ### Check 2 — Direct code/config snippets
81
+
82
+ Scan for fenced code blocks (` ``` `) and inline code blocks longer than ~3 lines.
83
+
84
+ Flag any block that looks like:
85
+
86
+ - An example component, endpoint, migration, schema, query, bash script or test.
87
+ - A configuration file (`tsconfig.json`, `eslintrc`, `package.json`, `wrangler.toml`).
88
+ - A migration template or boilerplate that lives elsewhere in the repo.
89
+
90
+ Do **not** flag:
91
+
92
+ - Short structural snippets used to define a _format_ the agent must produce (e.g. a 2–4 line error-shape template).
93
+ - Command examples (`npm run dev`, `git rebase`, etc.).
94
+ - Mermaid/diagram blocks.
95
+
96
+ For each flagged block, suggest:
97
+
98
+ - Move the snippet to a real file in the repo.
99
+ - Replace the block with a one-line `@`-reference, e.g. `@src/features/users/user.service.ts`, `@docs/api-errors.md`.
100
+ - Reason: the example will be wrong in two places at the next refactor; a reference can't drift.
101
+
102
+ Verdict: OK if 0 flagged blocks · WARN if 1–2 · FAIL if 3+.
103
+
104
+ ### Check 3 — Precise language
105
+
106
+ Scan for vague intent that cannot be checked against a diff. Common offenders:
107
+
108
+ - "Write clean code"
109
+ - "Follow best practices"
110
+ - "Care about quality"
111
+ - "Be consistent"
112
+ - "Use modern patterns"
113
+ - "Make it readable / maintainable / robust"
114
+ - "Handle errors properly"
115
+ - "Keep things simple"
116
+
117
+ For every match, **always propose at least one concrete, testable alternative grounded in this project's context**. Never suggest "just delete it" — the author put the line there for a reason; your job is to translate the intent into something a reviewer can check against a diff.
118
+
119
+ To ground the suggestion, pull signal from:
120
+
121
+ - the file under review (stack mentioned, naming conventions stated elsewhere, hard rules in other sections),
122
+ - nearby paragraphs around the vague phrase (what was the author about to say?),
123
+ - visible repo context if available (`package.json`, `tsconfig.json`, framework choice, lint config, sibling rule files).
124
+
125
+ If the project context truly doesn't suggest anything specific, propose a sensible default for the detected stack and label it **(assumed)** so the author knows to confirm.
126
+
127
+ Examples (note how each replacement borrows project-specific names/conventions, not generic advice):
128
+
129
+ | Vague phrase in file | Project context signal | Grounded testable replacement |
130
+ | --------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
131
+ | "Write clean code" | TypeScript + ESLint mentioned in same file | "Avoid `any`. Functions over 40 lines must be split. Run `pnpm lint` before committing." |
132
+ | "Handle errors properly" | Hard rule earlier: API returns `{ error: {...} }` shape | "API handlers must return `{ error: { code, message, context } }` per the shape defined above. Never throw raw." |
133
+ | "Be consistent with naming" | File mentions `feature.handler.ts` elsewhere | "Use `<feature>.handler.ts` (matching the existing handlers in `src/api/`), not `featureHandler.ts`." |
134
+ | "Use modern patterns" | Project uses native JS, no lodash in `package.json` | "Use native `Array`/`Object` methods. Do not add `lodash` — it's not in `package.json` and we keep it that way." |
135
+ | "Make components readable" | React + Tailwind project | "Components over 150 lines must be split. Tailwind classes go through `cn()` for conditionals (assumed — confirm if a different helper is used)." |
136
+ | "Keep things simple" | Python FastAPI service | "Prefer one Pydantic model per request/response. No nested decorators beyond `@router.post` + `@requires_auth`." |
137
+
138
+ Verdict: OK if 0 vague phrases · WARN if 1–3 · FAIL if 4+.
139
+
140
+ Verdict: OK if 0 vague phrases · WARN if 1–3 · FAIL if 4+.
141
+
142
+ ### Check 4 — Redundant knowledge
143
+
144
+ You are the actor agent reviewing this file. Read it the way you'd read it at the start of a session and ask one question after each paragraph:
145
+
146
+ > **"Did I already know this before I opened the file?"**
147
+
148
+ If the answer is "yes, this is in my training data" or "yes, this is the framework's documented default" or "yes, the README/lint config already says this" — flag it. The author paid context for something you didn't need explained.
149
+
150
+ Use these self-checks while scanning:
151
+
152
+ - **The "no surprise" test.** Could you have produced this paragraph yourself if asked, with no project access? If yes — redundant.
153
+ - **The "framework default" test.** Is the rule restating something the framework, the lint config, the type checker, or the test runner already enforces (e.g. "use TypeScript strict mode", "use `useEffect` cleanup", "FastAPI uses Pydantic for validation", "PostgreSQL supports JSONB")? If yes — redundant. The tool will catch the violation; the prose won't add anything.
154
+ - **The "definition" test.** Does the paragraph define a generic engineering term ("what is a service layer", "what REST is", "what hooks are", "what JSX is", "what is `Decimal`")? You know these. Flag and delete.
155
+ - **The "could be a link" test.** Does it duplicate `README.md`, `package.json` scripts, the project layout, or `.eslintrc` settings? If yes — replace with `@README.md` / `@package.json` / `@.eslintrc.json`. A reference doesn't drift; copied prose does.
156
+ - **The "tutorial smell" test.** If the paragraph reads like a section from the framework's "Getting Started" page or a Medium article — it's tutorial content, not project knowledge. You read those during training.
157
+
158
+ What is **not** redundant (don't flag):
159
+
160
+ - Project-specific conventions that contradict the framework default ("we use `useEffect` only for non-data side effects").
161
+ - Local pitfalls and historical workarounds you couldn't infer from the code ("the `events` table is partitioned by month — bulk inserts to the wrong partition fail silently").
162
+ - Internal naming, layout, or workflow rules ("postings live in `<verb>_<noun>.posting.ts`").
163
+ - Rules that look generic but are tied to a real incident (the file should mention the incident or link to a failure-modes register).
164
+
165
+ For each flagged paragraph, suggest one of:
166
+
167
+ - **Delete it** — you already knew it.
168
+ - **Replace with `@`-reference** — `@README.md`, `@tsconfig.json`, `@docs/...`.
169
+ - **Keep only if backed by an incident** — and if so, ask the author to add the incident note inline so the rule survives future audits.
170
+
171
+ Verdict: OK if 0 redundant paragraphs · WARN if 1–3 · FAIL if 4+.
172
+
173
+ ### Check 5 — Rule ordering
174
+
175
+ Models pay more attention to the start and end of long contexts ("U-shaped attention"). Critical rules buried in the middle of a long file are statistically less likely to be followed. This check has its own multi-step flow because reordering a file is a meaningful edit, not a one-line fix.
176
+
177
+ Run the steps in order. The result of this check goes into the scorecard _and_ may trigger an interactive reorder.
178
+
179
+ #### Step 5a — List the current high-level order
180
+
181
+ Walk the file and print the current top-level structure as a numbered list. Use H1/H2 headings (and H3s only if there are no H2s). Include the line number of each heading. Do **not** comment yet — just lay out what's there.
182
+
183
+ Example:
184
+
185
+ ```
186
+ Current order:
187
+ 1. # Welcome to OrderFlow (line 1)
188
+ 2. ## About the team (line 5)
189
+ 3. ## Project mission (line 9)
190
+ 4. ## Our values (line 13)
191
+ 5. ## Tech stack (line 22)
192
+ 6. ## Setup (line 36)
193
+ 7. ## TypeScript (line 78)
194
+ ...
195
+ N. ## Project conventions (line 312)
196
+ ```
197
+
198
+ If the file has no headings, say so explicitly: _"No section headings — file is one undifferentiated block."_
199
+
200
+ #### Step 5b — Comment on the order
201
+
202
+ Now annotate the list. For each section, give it a short tag and a one-line note. Use these tags:
203
+
204
+ - **CRITICAL** — load-bearing rule (security, money, irreversibility, project-specific "never do X").
205
+ - **USEFUL** — real project knowledge that helps but isn't a tripwire.
206
+ - **INTRO** — welcome/mission/team — lowers signal density at the top.
207
+ - **REDUNDANT** — already flagged in Check 4 (framework defaults, definitions, tutorial content).
208
+ - **VAGUE** — already flagged in Check 3.
209
+ - **REFERENCE** — points to other files via `@`-syntax (cheap, fine anywhere).
210
+
211
+ Then state the structural problem in one paragraph. Examples:
212
+
213
+ > "Critical security and tenancy rules are at the bottom (line 312). The first 35 lines are INTRO/values/marketing, which the model will weight heavily but which contain no actionable rules. Risk: the agent reads the bloat fully and skims past the rules that actually matter."
214
+
215
+ > "Order is roughly correct — hard rules at top, conventions in the middle, references at the bottom. One INTRO paragraph at line 1 could be tightened, but no structural reshuffle needed."
216
+
217
+ #### Step 5c — Propose a better order (only if needed)
218
+
219
+ If the comment in 5b identified a real problem, propose a target order. Frame it as _"sections moved to top / kept / moved to bottom / removed"_, not as a full rewrite of every line.
220
+
221
+ Example:
222
+
223
+ ```
224
+ Proposed order:
225
+ 1. ## Hard rules (was: line 312) ← moved to top
226
+ 2. ## Project conventions (was: line 312, split) ← moved up
227
+ 3. ## Tech stack (was: line 22) ← kept
228
+ 4. ## Setup (was: line 36) ← kept, replace with @README.md if possible
229
+ 5. ## Failure modes (new section) ← collect incident-driven rules here
230
+ — ## About the team / Mission / Values ← remove (Check 3/4 already flagged these)
231
+ ```
232
+
233
+ If 5b found no problem, skip 5c entirely — say _"Order is sound; no reshuffle needed."_
234
+
235
+ #### Step 5d — Ask before reordering
236
+
237
+ If 5c produced a proposal, use question before touching the file:
238
+
239
+ - Question: "Check 5 proposes reordering sections. How would you like to proceed?"
240
+ - Options:
241
+ 1. "Yes, reorder the file now" — apply the proposed structure, preserve all rule content, only move/regroup sections.
242
+ 2. "Only move the critical rules to the top" — minimal change: lift hard rules to the top, leave the rest alone.
243
+ 3. "Show me the diff first" — produce the reordered file as a preview block in chat, no write.
244
+ 4. "No, just leave the suggestion in the report" — don't edit the file; the scorecard stands.
245
+
246
+ If the user picks an editing option, apply it with care: preserve every byte of rule content (only headings and section blocks move), and write a single edit. If the user picks "leave the suggestion", do nothing.
247
+
248
+ #### Step 5e — Atomic-change reminder
249
+
250
+ Always end Check 5 with this reminder, regardless of whether a reorder happened:
251
+
252
+ > **Test each change in your next agent session.** Reordering a rules file is a context-shape change — its effect on agent behavior only shows up the next time you run a real task. Apply changes one at a time (atomic): reorder, then run a representative task, then move on to the next change (split, dedupe, rewrite). Bundling multiple structural changes makes it impossible to attribute a behavior shift to a specific edit.
253
+
254
+ #### Verdict
255
+
256
+ Score the file before any reorder happens, based on the original order:
257
+
258
+ - **OK** — top of file is dense with CRITICAL/USEFUL rules, clear headings, no INTRO bloat at the start.
259
+ - **WARN** — structure is mixed: some critical rules at top, others buried; or non-trivial INTRO at the start.
260
+ - **FAIL** — critical rules appear after line 200, or the file has no headings at all, or the top 30+ lines are pure INTRO/marketing.
261
+
262
+ ---
263
+
264
+ ## Output format
265
+
266
+ Print exactly this, in this order. Use Polish or English matching the user's prompt language. Reference `path:line` for every concrete finding so the user can jump straight to it.
267
+
268
+ ```
269
+ # Rule Review — <path>
270
+
271
+ **Overall:** <one-line summary, e.g. "Healthy file with two redundancy hotspots" or "Long, vague, and bottom-heavy — needs a split">
272
+
273
+ ## Scorecard
274
+
275
+ | # | Check | Verdict | Score |
276
+ |---|---|---|---|
277
+ | 1 | Length | OK/WARN/FAIL | <n> non-blank lines |
278
+ | 2 | Direct snippets | OK/WARN/FAIL | <n> flagged blocks |
279
+ | 3 | Precise language | OK/WARN/FAIL | <n> vague phrases |
280
+ | 4 | Redundant knowledge | OK/WARN/FAIL | <n> redundant rules |
281
+ | 5 | Rule ordering | OK/WARN/FAIL | <one-line reason> |
282
+
283
+ ## Findings
284
+
285
+ ### 1. Length — <verdict>
286
+ - <n> non-blank lines.
287
+ - <suggestion if WARN/FAIL, otherwise omit>
288
+
289
+ ### 2. Direct snippets — <verdict>
290
+ - `path:line-range` — <what kind of snippet> → suggest `@<file>` reference.
291
+ - ...
292
+
293
+ ### 3. Precise language — <verdict>
294
+ - `path:line` — "<vague phrase>" → "<testable rewrite>"
295
+ - ...
296
+
297
+ ### 4. Redundant knowledge — <verdict>
298
+ - `path:line` — <what's redundant> → <delete | replace with @reference | keep only if backed by an incident>
299
+ - ...
300
+
301
+ ### 5. Rule ordering — <verdict>
302
+ - <structural observation, e.g. "Critical security rule at line 287, intro fluff lines 1–42">
303
+ - <suggestion>
304
+
305
+ ## Top 3 actions
306
+ 1. <highest-leverage fix>
307
+ 2. <second>
308
+ 3. <third>
309
+ ```
310
+
311
+ If a check is OK, still list it in the table but skip the "Findings" subsection (write `### N. <name> — OK` and one short line, nothing more).
312
+
313
+ The "Top 3 actions" must be ordered by leverage, not by check number. Pick from across all five checks.
314
+
315
+ ### Exit Gate (confirm-or-revise form)
316
+
317
+ Per the shared contract's exception for no-follow-up skills, after printing the scorecard use `question` — "Is the scorecard correct?" with options:
318
+
319
+ - **Accept** — keep it. Stop here; act on "Top 3 actions" whenever you like.
320
+ - **Adjust** — re-run a specific check with different criteria or (Check 5) redo the reorder after re-deciding.
321
+ - **Discuss** — justify a specific verdict or finding (evidence cited, why it matters); then re-ask.
322
+ - **Stop here** — nothing further.
323
+
324
+ If Check 5 produced a reorder proposal the user has not yet decided on, include a "Run Check 5 now" option in the question. After the user's response, stop. Do not propose further follow-ups unless the user asks.
325
+
326
+ ---
327
+
328
+ ## Edge cases
329
+
330
+ - **File under 50 lines:** still run all five checks. Short files often fail Check 3 (vague) and Check 4 (redundant) the most.
331
+ - **File is mostly references (`@…`) and few inline rules:** that's a good sign for Checks 2 and 4. Don't penalize it.
332
+ - **File is a `.mdc` with frontmatter (`globs:`, `alwaysApply:`):** count rule lines from after the frontmatter. The frontmatter itself is configuration, not rule content.
333
+ - **File is a generated stub from `/init` and untouched:** still review it. Often Check 4 (redundant) will dominate — that's the signal to clean it.
334
+ - **Multiple rule files in the project:** review the one passed in. Mention sibling files in "Top 3 actions" only if relevant (e.g. duplication between root `AGENTS.md` and a nested one).
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: standards-discover
2
+ name: owflow:standards-discover
3
3
  description: Discover coding standards from project configuration files, code patterns, documentation, and external sources (PRs, CI/CD)
4
4
  user-invocable: true
5
5
  ---
@@ -67,7 +67,7 @@ Custom scope values are matched against existing `.owflow/docs/standards/*/` dir
67
67
  ### Phase 1: Planning & Initialization
68
68
 
69
69
  1. **Parse options** from command arguments
70
- 2. **Check prerequisites**: Verify `.owflow/docs/` exists. If not, offer to run `/flow-init` first
70
+ 2. **Check prerequisites**: Verify `.owflow/docs/` exists. If not, offer to run `/owflow:flow-init` first
71
71
  3. **Read existing standards** from `.owflow/docs/INDEX.md` to identify updates vs creates and avoid duplicates
72
72
  4. **Display discovery plan** showing scope, sources, and estimated time
73
73
  5. **Get user confirmation** via question before proceeding
@@ -181,14 +181,37 @@ Display application summary: created count, updated count, total active.
181
181
 
182
182
  ---
183
183
 
184
- ### Phase 9: Summary Report
184
+ ### Phase 9: Summary Report → Exit Gate
185
185
 
186
- Display final results:
186
+ Present final results and close (Exit Gate contract, [Gate Contract](../orchestrator-framework/references/gate-contract.md)):
187
187
 
188
- - Sources analyzed (config files, code files sampled, docs parsed, PRs reviewed)
189
- - Standards applied (created/updated counts by category)
190
- - Standards skipped (low confidence, user declined)
191
- - Next steps (review, commit, re-run schedule)
188
+ **Results box**:
189
+
190
+ ```markdown
191
+ ## ✅ STANDARDS DISCOVER COMPLETE
192
+
193
+ **Sources analyzed** — [config files, code samples, docs, PRs]
194
+ **Applied** — [created] created / [updated] updated ([total] active)
195
+ **Skipped** — [count — low confidence / declined]
196
+
197
+ **Artifacts**
198
+ - `.owflow/docs/INDEX.md`
199
+ - `.owflow/docs/standards/<category>/<topic>.md` [per applied standard]
200
+ ```
201
+
202
+ **Results-acceptance question** — use `question` — "Are these results correct?" with options:
203
+
204
+ - **Accept** — discovery and application are complete; print next steps below.
205
+ - **Adjust** — re-review skipping findings (e.g., "show low-confidence items", "re-run a source"), apply the additional standards, then re-present the results box.
206
+ - **Discuss** — walk through specific applied standards (evidence, confidence breakdown, sources) in more depth; then re-ask.
207
+ - **Stop here** — end.
208
+
209
+ **Next steps (after Accept)**:
210
+
211
+ - Review the applied standards files in `.owflow/docs/standards/`
212
+ - Commit the changes
213
+ - `/owflow:standards-update "<convention>"` — document any conventions discovery missed
214
+ - Re-run periodically: `/owflow:standards-discover --scope=quick`
192
215
 
193
216
  ---
194
217
 
@@ -196,7 +219,7 @@ Display final results:
196
219
 
197
220
  | Situation | Strategy |
198
221
  | ----------------------- | ----------------------------------------------------- |
199
- | `.owflow/docs/` missing | Offer `/flow-init`, abort if declined |
222
+ | `.owflow/docs/` missing | Offer `/owflow:flow-init`, abort if declined |
200
223
  | gh CLI unavailable | Skip PR analysis, continue with other sources |
201
224
  | GitHub API rate limit | Skip PR analysis, note in report |
202
225
  | Config file parse error | Skip that file, log warning, continue |
@@ -220,17 +243,17 @@ Display final results:
220
243
 
221
244
  ```bash
222
245
  # Full discovery (default)
223
- /standards-discover
246
+ /owflow:standards-discover
224
247
 
225
248
  # Quick scan (config files only, ~30-60s)
226
- /standards-discover --scope=quick
249
+ /owflow:standards-discover --scope=quick
227
250
 
228
251
  # Frontend standards only
229
- /standards-discover --scope=frontend
252
+ /owflow:standards-discover --scope=frontend
230
253
 
231
254
  # High confidence, auto-apply
232
- /standards-discover --confidence=80 --auto-apply
255
+ /owflow:standards-discover --confidence=80 --auto-apply
233
256
 
234
257
  # Skip external analysis (offline/no GitHub)
235
- /standards-discover --skip-external
258
+ /owflow:standards-discover --skip-external
236
259
  ```
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: standards-update
2
+ name: owflow:standards-update
3
3
  description: Update or create project standards from conversation context or explicit description
4
4
  argument-hint: "[description of standard/convention] [--from=PATH]"
5
5
  user-invocable: true
@@ -12,9 +12,9 @@ Update or create standards in `.owflow/docs/standards/` based on conversation co
12
12
  ## Usage
13
13
 
14
14
  ```bash
15
- /standards-update # Detect from conversation
16
- /standards-update "always use React.memo for lists" # From description
17
- /standards-update --from=/path/to/other-project # Sync from another project
15
+ /owflow:standards-update # Detect from conversation
16
+ /owflow:standards-update "always use React.memo for lists" # From description
17
+ /owflow:standards-update --from=/path/to/other-project # Sync from another project
18
18
  ```
19
19
 
20
20
  ---
@@ -27,7 +27,7 @@ When `--from=PATH` is provided, the skill switches to **sync mode** — importin
27
27
 
28
28
  1. Resolve the path (absolute or relative to cwd)
29
29
  2. Check `PATH/.owflow/docs/standards/` exists. If not, inform the user and stop.
30
- 3. Check `.owflow/docs/standards/` exists in the current project. If not, offer to run `/flow-init` first.
30
+ 3. Check `.owflow/docs/standards/` exists in the current project. If not, offer to run `/owflow:flow-init` first.
31
31
 
32
32
  ### SYNC STEP 2: Analyze Differences
33
33
 
@@ -61,9 +61,31 @@ Invoke `docs-operator` subagent via Task tool (subagent_type: `docs-operator`):
61
61
 
62
62
  Wait for docs-operator to complete, then immediately proceed to SYNC STEP 5.
63
63
 
64
- ### SYNC STEP 5: Summarize
64
+ ### SYNC STEP 5: Exit Gate
65
65
 
66
- Display: standards added, standards updated, standards skipped, and total count. Suggest reviewing the imported standards and committing.
66
+ Present results and close (Exit Gate contract, [Gate Contract](../orchestrator-framework/references/gate-contract.md)):
67
+
68
+ ```markdown
69
+ ## ✅ STANDARDS SYNC COMPLETE
70
+
71
+ **Added** — [added count]
72
+ **Updated** — [updated count]
73
+ **Skipped** — [skipped count]
74
+ **Total** — [total]
75
+
76
+ **Artifacts**
77
+ - `.owflow/docs/standards/<category>/<file>.md` [per synced standard]
78
+ - `.owflow/docs/INDEX.md`
79
+ ```
80
+
81
+ Use `question` — "Are these results correct?" with options:
82
+
83
+ - **Accept** — sync is complete; print next steps below.
84
+ - **Adjust** — re-run selected imports with different merge choices, then re-present the results box.
85
+ - **Discuss** — walk through merged/differing standards in more depth; then re-ask.
86
+ - **Stop here** — end.
87
+
88
+ Next steps (after Accept): review the imported standards, then commit.
67
89
 
68
90
  ---
69
91
 
@@ -145,15 +167,41 @@ Wait for docs-operator to complete, then immediately proceed to Phase 5.
145
167
 
146
168
  ---
147
169
 
148
- ## PHASE 5: Validate & Summarize
170
+ ## PHASE 5: Validate & Exit Gate
149
171
 
150
172
  1. Verify standard file exists and has content
151
173
  2. Verify INDEX.md references the standard with practice-specific description (not generic)
152
174
  3. Verify AGENTS.md integration
153
- 4. Display summary: what was updated/created, practices added, next steps (review, commit, share with team)
175
+ 4. Present results (Exit Gate contract, [Gate Contract](../orchestrator-framework/references/gate-contract.md)):
176
+
177
+ **Results box**:
178
+
179
+ ```markdown
180
+ ## ✅ STANDARDS UPDATE COMPLETE
181
+
182
+ **Action** — [created / updated] `standards/<category>/<name>.md`
183
+ **Practices** — [count added/changed]
184
+ **INDEX/AGENTS** — [integration status]
185
+
186
+ **Artifacts**
187
+ - `.owflow/docs/standards/<category>/<name>.md`
188
+ - `.owflow/docs/INDEX.md`
189
+ ```
190
+
191
+ **Results-acceptance question** — use `question` — "Are these results correct?" with options:
192
+
193
+ - **Accept** — standard is good; print next steps below.
194
+ - **Adjust** — revise the standard (wording, more practices, better examples), via docs-operator, then re-present the results box.
195
+ - **Discuss** — walk through what was written and why in more depth; then re-ask.
196
+ - **Stop here** — end.
197
+
198
+ **Next steps (after Accept)**:
199
+
200
+ - Review the applied standard file
201
+ - Commit the changes and share with the team
154
202
 
155
203
  ---
156
204
 
157
205
  ## Prerequisites
158
206
 
159
- If `.owflow/docs/` doesn't exist, offer to run `/flow-init` first.
207
+ If `.owflow/docs/` doesn't exist, offer to run `/owflow:flow-init` first.