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
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: work
2
+ name: owflow:work
3
3
  description: Unified entry point — auto-classifies tasks and routes to appropriate workflow. ALWAYS execute when invoked via slash command.
4
4
  ---
5
5
 
@@ -12,7 +12,7 @@ Auto-classifies tasks and routes to the appropriate workflow orchestrator. Suppo
12
12
  ## Usage
13
13
 
14
14
  ```bash
15
- /work [task description | task folder path | issue identifier]
15
+ /owflow:work [task description | task folder path | issue identifier]
16
16
  ```
17
17
 
18
18
  ### Input Types
@@ -31,18 +31,18 @@ Auto-classifies tasks and routes to the appropriate workflow orchestrator. Suppo
31
31
 
32
32
  ```bash
33
33
  # Resume existing task
34
- /work ".owflow/tasks/development/2025-10-23-login-timeout"
35
- /work "2025-10-26-user-auth"
34
+ /owflow:work ".owflow/tasks/development/2025-10-23-login-timeout"
35
+ /owflow:work "2025-10-26-user-auth"
36
36
 
37
37
  # New task (auto-classifies)
38
- /work "Fix login timeout error on mobile devices"
39
- /work "Add user authentication with email/password"
40
- /work "Improve dashboard loading performance"
38
+ /owflow:work "Fix login timeout error on mobile devices"
39
+ /owflow:work "Add user authentication with email/password"
40
+ /owflow:work "Improve dashboard loading performance"
41
41
 
42
42
  # From issue tracker
43
- /work "#456"
44
- /work "PROJ-123"
45
- /work "AB#789"
43
+ /owflow:work "#456"
44
+ /owflow:work "PROJ-123"
45
+ /owflow:work "AB#789"
46
46
  ```
47
47
 
48
48
  ## How It Works
@@ -145,9 +145,9 @@ Use Skill tool:
145
145
 
146
146
  Examples:
147
147
 
148
- - Resume development: `skill: "development"` with `args: "--resume .owflow/tasks/development/2025-10-23-fix"`
149
- - Restart from phase: `skill: "development"` with `args: "--resume .owflow/tasks/development/2025-10-26-auth --from=verify"`
150
- - Fresh attempts: `skill: "migration"` with `args: "--resume .owflow/tasks/migrations/2025-10-20-redux --reset-attempts"`
148
+ - Resume development: `skill: "owflow:development"` with `args: "--resume .owflow/tasks/development/2025-10-23-fix"`
149
+ - Restart from step: `skill: "owflow:development"` with `args: "--resume .owflow/tasks/development/2025-10-26-auth --from=verification-done"` (dev tasks use descriptive step slugs in `completed_phases`; performance and migration are the remaining `phase-N` holdouts — research uses the descriptive slugs in `templates/orchestrator-state-research.yml`)
150
+ - Fresh attempts: `skill: "owflow:migration"` with `args: "--resume .owflow/tasks/migrations/2025-10-20-redux --reset-attempts"`
151
151
 
152
152
  ### Step 3: Classify & Route New Task
153
153
 
@@ -194,9 +194,9 @@ Use Skill tool:
194
194
 
195
195
  **Routing examples:**
196
196
 
197
- - development (92%): `skill: "development"` with `args: "Fix login timeout error"`
198
- - development (88%): `skill: "development"` with `args: "Add filtering to user table"`
199
- - performance (95%): `skill: "performance"` with `args: "Optimize slow dashboard queries"`
197
+ - development (92%): `skill: "owflow:development"` with `args: "Fix login timeout error"`
198
+ - development (88%): `skill: "owflow:development"` with `args: "Add filtering to user table"`
199
+ - performance (95%): `skill: "owflow:performance"` with `args: "Optimize slow dashboard queries"`
200
200
 
201
201
  ---
202
202
 
@@ -224,9 +224,9 @@ Then route to selected workflow using Skill tool.
224
224
  ```
225
225
  Display:
226
226
  "Task cancelled. You can:
227
- - Run /work again when ready
227
+ - Run /owflow:work again when ready
228
228
  - Use specific workflow commands directly:
229
- /development, /performance, etc."
229
+ /owflow:development, /owflow:performance, etc."
230
230
  ```
231
231
 
232
232
  ---
@@ -235,10 +235,10 @@ Display:
235
235
 
236
236
  | Workflow Type | Skill | Args |
237
237
  | ------------- | ------------- | --------------------------------------------------- |
238
- | development | `development` | `--resume [path] [--from=PHASE] [--reset-attempts]` |
238
+ | development | `development` | `--resume [path] [--from=<slug>] [--reset-attempts]` |
239
239
  | performance | `performance` | `--resume [path] [--from=PHASE]` |
240
240
  | migration | `migration` | `--resume [path] [--from=PHASE]` |
241
- | research | `research` | `--resume [path] [--from=PHASE]` |
241
+ | research | `research` | `--resume [path] [--from=<slug>]` |
242
242
 
243
243
  ---
244
244
 
@@ -246,7 +246,7 @@ Display:
246
246
 
247
247
  ### With Task Classifier
248
248
 
249
- The `/work` command delegates classification to the task-classifier subagent via Task tool, which:
249
+ The `/owflow:work` command delegates classification to the task-classifier subagent via Task tool, which:
250
250
 
251
251
  - Fetches issue details from GitHub/Jira/Azure DevOps (via MCP, CLI tools, or WebFetch)
252
252
  - Analyzes codebase context for better classification
@@ -1,5 +1,5 @@
1
1
  import path from "node:path";
2
- import { PLUGIN_ROOT } from "../constants.js";
2
+ import { PLUGIN_ROOT } from "../utils/plugin-info.js";
3
3
  export const configureSkills = (config) => {
4
4
  config.skills = config.skills || {};
5
5
  config.skills.paths = config.skills.paths || [];
package/dist/index.js CHANGED
@@ -4,7 +4,9 @@
4
4
  */
5
5
  import path from "node:path";
6
6
  import fs from "node:fs";
7
+ import { PLUGIN_VERSION } from "./utils/plugin-info.js";
7
8
  import { verify_template } from "./tools/verify_template.js";
9
+ import { fork_task } from "./tools/fork_task.js";
8
10
  import { rereadOrchestratorState } from "./hooks/session-compaction.js";
9
11
  import { guardAgainstDestructiveActions } from "./hooks/before-tool.js";
10
12
  import { configureSkills } from "./configuration/skills-config.js";
@@ -16,13 +18,14 @@ const OwflowPlugin = async ({ $, directory }) => {
16
18
  return {
17
19
  tool: {
18
20
  verify_template,
21
+ fork_task,
19
22
  },
20
23
  /**
21
24
  * Register owflow's skills, commands, and agents so OpenCode discovers
22
25
  * them without requiring manual config file edits.
23
26
  */
24
27
  config: async (config) => {
25
- console.log("[owflow] Starting plugin installation...");
28
+ console.log(`[owflow] Starting plugin installation (v${PLUGIN_VERSION})...`);
26
29
  let typedConfig = config;
27
30
  // Get small_model config for alias resolution
28
31
  // Try from config parameter first, fallback to reading opencode.json
@@ -45,7 +48,7 @@ const OwflowPlugin = async ({ $, directory }) => {
45
48
  configureCommands(typedConfig);
46
49
  configureAgents(typedConfig, smallModel);
47
50
  config = typedConfig;
48
- console.log("[owflow] Plugin installation completed successfully.");
51
+ console.log(`[owflow] Plugin installation completed successfully (v${PLUGIN_VERSION}).`);
49
52
  },
50
53
  "experimental.session.compacting": async (input, output) => {
51
54
  await rereadOrchestratorState(directory, output);
@@ -0,0 +1,223 @@
1
+ ---
2
+ name: owflow:agents-md-generator
3
+ description: >
4
+ Generate an AGENTS.md onboarding document for AI coding agents working in
5
+ this repository. Inspects the repo (package manifest, README, scripts,
6
+ lint/test config, layout, commit history) and writes a concise contributor
7
+ guide titled "Repository Guidelines". Use when the user invokes
8
+ /owflow:agents-md-generator, asks to "create AGENTS.md", "write an agent onboarding
9
+ doc", "generate contributor guide for agents", or similar. The output is
10
+ optimized to be small, precise, reference-heavy, and ordered with critical
11
+ rules at the top — so a future agent reads it once and stays unblocked.
12
+ argument-hint: "[directory or file path]"
13
+ user-invocable: true
14
+ ---
15
+
16
+ # AGENTS.md generator
17
+
18
+ Produce an `AGENTS.md` that serves as an onboarding document for AI coding agents in this repository. The file is short, specific to the repo, and structured so the most important rules appear first.
19
+
20
+ 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)).
21
+
22
+ ## Entry Gate
23
+
24
+ The input resolution below IS this skill's entry gate:
25
+
26
+ ## Input resolution
27
+
28
+ `$ARGUMENTS` is optional. It may be:
29
+
30
+ - empty → write to `AGENTS.md` at the repo root.
31
+ - a directory path → write `AGENTS.md` inside that directory (useful for nested per-area guides, e.g. `src/api/AGENTS.md`).
32
+ - a full file path ending in `.md` → write there verbatim.
33
+
34
+ If the target file already exists, do **not** silently overwrite. Switch to the update flow under "Procedure → Update path". The default behavior is a surgical edit that preserves still-valid content, not a rewrite.
35
+
36
+ ## Scope detection — repo-level vs. directory-level
37
+
38
+ The same skill can produce two materially different documents depending on **where** it's invoked from. Detect the scope before discovery so the draft targets the right altitude.
39
+
40
+ 1. **Resolve the target directory.** If `$ARGUMENTS` names a path, that's the target. Otherwise it's the current working directory (`pwd`).
41
+ 2. **Compare against the repo root.** Run `git rev-parse --show-toplevel`. If the target directory equals the repo root → **repo-level scope**. If it's a subdirectory (e.g. `src/components/`, `packages/api/src/routes/`, `app/api/`) → **directory-level scope**.
42
+
43
+ **Repo-level scope.** Follow the procedure and "Output structure" below as written — the document is a high-level onboarding guide (project structure, build commands, CI gate, commit conventions, etc.).
44
+
45
+ **Directory-level scope.** Drop the repository-onboarding framing entirely. The reader already knows the repo; they need the rules of _this_ directory. Reorient discovery and output:
46
+
47
+ - **Discover locally first.** Inspect the files actually living next to the target: sibling source files, the nearest `index.ts`/`Application.java`, co-located tests, the parent directory's README if any, and any nested config (e.g. `tsconfig.json`, `.eslintrc`, `application.yml`, route manifests) that overrides repo-level defaults. Only consult repo-root docs (`README.md`, `AGENTS.md`) to **resolve conflicts** or pull a single canonical `@`-reference — not as the primary source.
48
+ - **Infer the local pattern by reading siblings.** What shape do existing files in this directory take? Component file layout, naming (`PascalCase.tsx`, `camelCase.ts`, `*.handler.ts` for Node.js; `PascalCase.java`, `*Controller.java`, `*Service.java` for Spring), default vs. named exports (Node.js) or package-private vs. public visibility (Java), prop/argument conventions, where types/styles/tests live relative to the unit, error-handling idioms, what gets imported from where. The AGENTS.md captures the convention you observed, not generic advice.
49
+ - **Reframe sections around the local unit.** Replace repo-level sections with directory-relevant ones. Useful defaults (adapt to what's there):
50
+ - _Adding a new \<unit\>_ — concrete steps for the dominant artifact in this directory (component, route handler, migration, hook, worker, etc.), citing one existing sibling as the reference shape via `@./<sibling-file>`.
51
+ - _File layout & naming_ — naming pattern, co-location rules (test next to source? styles inline? types in a sibling file?), barrel-export policy if one exists.
52
+ - _Local conventions_ — props/args shape, state/data-flow rules, allowed imports (and forbidden ones — e.g. "components in this directory must not import from `src/server/`"), accessibility or i18n rules visible in siblings.
53
+ - _Testing this unit_ — the test pattern used by neighbors, how to run just this directory's tests.
54
+ - _Tripwires_ — directory-specific "never do X" rules visible in siblings or a nearby AGENTS.md fragment.
55
+ - **Skip the repo-level sections.** No top-level project structure map, no monorepo package list, no global build/CI overview, no commit-convention recap — those belong in the root `AGENTS.md`. If the reader needs them, link once: `See @AGENTS.md at the repo root for repo-wide rules.`
56
+ - **Length budget shrinks.** Aim for **120–250 words** of body for directory-level guides; the surface area is smaller, and padding here is worse than at the root.
57
+
58
+ The Quality guards still apply, with one substitution: guard 5 ("Critical rules first") becomes "Local rules first" — the highest-leverage line is the one that prevents a wrong-shaped sibling from landing in this directory.
59
+
60
+ ## Interactive prompts
61
+
62
+ Whenever the procedure says _"ask the user"_, use the `question` tool with labeled options. If a step requires free-form input, ask via a plain conversational message instead.
63
+
64
+ ## Parallel research via subagents (optional)
65
+
66
+ If the repo is large enough to benefit (roughly >20 top-level files), use the `Task` tool to fan out independent reads in **one batched call** (multiple subagents in a single invocation, not sequentially):
67
+
68
+ - one subagent reads `README.md`, existing `AGENTS.md`, top-level `docs/` index
69
+ - one inspects the manifest + lint/format/type configs
70
+ - one inspects test config + CI workflows
71
+ - one runs the git-history queries via `Bash` (commit conventions, last-touch on AGENTS.md, diff range since `LAST_TOUCH`)
72
+
73
+ Each subagent should return a **short structured report** (≤200 words: facts only, with `path:line` citations) — not a full file dump. The main agent then synthesizes the AGENTS.md from those reports.
74
+
75
+ **Skip the fan-out if** the repo is small (under ~20 top-level files), or you've already loaded most of the relevant files in the current context.
76
+
77
+ **Do not delegate** the synthesis step (drafting and Quality-guard checks). Drafting requires holding the full picture in one context to enforce the 200–400 word budget, ordering, and `@`-reference policy.
78
+
79
+ ## What this skill does NOT do
80
+
81
+ - Does not invent project facts. Every claim in the output must trace back to a file, command, or commit you actually inspected.
82
+ - Does not embed multi-line code or config snippets. Use `@`-references to canonical files instead (e.g. `@package.json`, `@tsconfig.json`, `@docs/architecture.md`).
83
+ - Does not write generic engineering advice ("write clean code", "follow best practices", "handle errors properly"). If a rule cannot be checked against a diff, drop it or rewrite it concretely.
84
+ - Does not restate framework defaults, language tutorials, or anything the AI assistant already knows from training. Only project-specific knowledge earns a line.
85
+ - Does not edit unrelated files. The skill writes one markdown file and stops.
86
+
87
+ ## Procedure
88
+
89
+ **First, branch on existence.** Before discovering anything else, check whether the resolved target path already exists (use `Read` or `Glob`). If it does, follow the **Update path** below. If not, follow the **Create path**.
90
+
91
+ ### Create path
92
+
93
+ 1. **Discover.** Read in this order, skipping what doesn't exist:
94
+ - `README.md`, existing `AGENTS.md`, top-level `docs/` index.
95
+ - Manifest: `package.json` (scripts, workspaces, engines) for Node.js, or `pom.xml` / `build.gradle` (plugins, dependencies, profiles) for Spring Java.
96
+ - Lint/format/type configs: `.eslintrc*`, `oxlint*`, `biome.json`, `tsconfig.json`, `.editorconfig` for Node.js; `checkstyle.xml`, `spotbugs-exclude.xml`, `.editorconfig` for Spring Java.
97
+ - Test config: `vitest.config.*`, `jest.config.*`, `playwright.config.*`, `*.test.*` locations for Node.js; `src/test/`, `*Test.java`, `*IT.java`, Surefire/Failsafe plugin config in `pom.xml` for Spring Java.
98
+ - CI: `.github/workflows/*` (one or two files; just enough to know the gate).
99
+ - Layout: top two levels of the tree (use `Glob` or `Bash`), workspace package list if monorepo.
100
+ - History: `git log --oneline -n 30` to learn commit-message conventions; `git config remote.origin.url` for PR target.
101
+ 2. **Extract.** From discovery, write down for yourself:
102
+ - The 1–3 commands an agent runs most often (build, test, lint, dev server).
103
+ - The handful of conventions a reviewer would actually flag in PR review (naming patterns, file layout, commit prefix style).
104
+ - Any hard "never do X" rule visible in `AGENTS.md`, README, or CI validators.
105
+ - Where deeper docs live, so the AGENTS.md can point to them instead of duplicating.
106
+ 3. **Draft.** Write the file per "Output structure" below.
107
+ 4. **Self-check before writing.** Run the five guards in "Quality guards". If any fail, revise the draft, do not write yet.
108
+ 5. **Write.** Use the `Write` tool to create the file at the resolved path. Confirm the path and word count back to the user.
109
+
110
+ ### Update path
111
+
112
+ Triggered when the target file already exists. The default is a **surgical edit**: keep what's still true, fix what's stale, fill what's missing, and remove what's been deleted from the repo. Do not rewrite from scratch unless the user asks.
113
+
114
+ 1. **Inventory the existing file.**
115
+ - Read the full file.
116
+ - List its current sections (H1/H2/H3 headings) and the rules/commands under each.
117
+ - Extract every `@`-reference and every relative path or filename it cites.
118
+
119
+ 2. **Date the file via git.**
120
+ - `git log --follow --format="%h %ad %s" --date=short -- <path>` — full edit history of the file.
121
+ - Note the **last-touched commit hash** and date. Call this `LAST_TOUCH`.
122
+ - If the file is untracked (`git ls-files --error-unmatch <path>` fails), treat it as freshly authored: skip git-diff steps and run the full Create path discovery, but still preserve any obviously project-specific content the user wrote.
123
+
124
+ 3. **Diff repo state since `LAST_TOUCH`.** Use these checks (skip any whose target the file doesn't reference):
125
+ - `git diff --stat LAST_TOUCH..HEAD -- README.md AGENTS.md docs/` — has top-level documentation moved or changed?
126
+ - `git diff LAST_TOUCH..HEAD -- package.json pom.xml build.gradle` (whichever exists) — for **scripts**, **dependencies**, **engines**, **workspaces**. Pay closest attention to the `scripts` block (Node.js) or plugin/dependency changes (Maven/Gradle): renamed/added/removed scripts or build targets are the most common source of stale AGENTS.md content.
127
+ - `git diff LAST_TOUCH..HEAD -- .eslintrc* oxlint* biome.json tsconfig.json .editorconfig checkstyle.xml spotbugs-exclude.xml` — has the lint/format/type toolchain changed?
128
+ - `git diff LAST_TOUCH..HEAD -- vitest.config.* jest.config.* playwright.config.*` (Node.js) or `pom.xml` Surefire/Failsafe sections (Spring Java) — has the test stack or layout changed?
129
+ - `git diff --stat LAST_TOUCH..HEAD -- .github/workflows/` — has the CI gate changed?
130
+ - `git log --oneline LAST_TOUCH..HEAD -- <commit-conventions-relevant-area>` and `git log --oneline -n 30` — does the commit-style observation in the file still match recent history?
131
+ - For each `@`-reference and path the file mentions: use `Read` or `Glob` to check whether the path still exists. If it no longer exists or has been renamed, that line is stale.
132
+
133
+ 4. **Classify each line of the existing file** into one of four buckets:
134
+ - **KEEP** — still accurate; cited file/command/path still exists with the same shape.
135
+ - **UPDATE** — directionally right but a detail is stale (renamed script, moved path, changed tool, version bump). Note the exact replacement.
136
+ - **REMOVE** — the underlying file/command/convention no longer exists, or the rule has been contradicted by a newer source (`AGENTS.md`, README) that you trust more.
137
+ - **MISSING** — not currently in the file but should be (new top-level package, new required script, new "never do X" rule landed via CI validator, new commit convention visible in `git log`).
138
+ Keep this classification as a short table you can show the user. Cite `path:line` (in the existing AGENTS.md) for every UPDATE/REMOVE entry, and cite the source-of-truth path (e.g. `package.json:42`) for every UPDATE/MISSING entry.
139
+
140
+ 5. **Confirm scope before editing.** Use the `question` tool with these options:
141
+ - **Apply the proposed updates** — execute the UPDATE/REMOVE/MISSING list as targeted edit operations; KEEP lines are not touched.
142
+ - **Show me the change list first** — print the classification table to chat, no edits, then ask again.
143
+ - **Full regenerate** — discard the existing file and run the Create path. Use only when the existing file is mostly stale or the user explicitly wants a clean slate.
144
+ - **Cancel** — no changes.
145
+
146
+ 6. **Edit surgically.** For the "Apply" choice, prefer multiple targeted `Write` calls (one per UPDATE/REMOVE/MISSING entry) over a single full-file rewrite. This preserves authorial voice in KEEP sections and produces a reviewable diff. If section ordering violates the "critical rules first" guard from the Quality guards and the user approved updates, you may move whole sections — but only sections, never re-author rule wording silently.
147
+
148
+ 7. **Re-run the Quality guards** on the updated file. The same five gates apply. If a guard now fails because of the update (e.g. body grew past 400 words after MISSING additions), trim KEEP content that has become low-leverage rather than dropping the new MISSING content.
149
+
150
+ 8. **Report.** Confirm path, new word count, and a one-line summary of what changed in each bucket (e.g. _"3 updated, 1 removed, 2 added; section order unchanged"_).
151
+
152
+ ## Output structure
153
+
154
+ The document title is `# Repository Guidelines`. Target length is **200–400 words** of body content. Use Markdown headings for structure. Adapt sections to what the repo actually has — omit any section that would be empty or speculative.
155
+
156
+ Order sections by **leverage to a fresh agent**, not by tradition. Critical rules and the most-used commands go first; nice-to-know context goes last. A useful default ordering, when in doubt:
157
+
158
+ 1. **Hard rules / Agent-specific instructions** — the "never do X" list and any tripwires (only include if the repo actually has them; otherwise skip and let conventions carry the weight).
159
+ 2. **Project Structure & Module Organization** — top-level directory map, where source/tests/assets live, monorepo package list if relevant. Reference deeper docs with `@path/to/doc.md` instead of inlining them.
160
+ 3. **Build, Test, and Development Commands** — the 3–6 commands an agent will actually run, each with a one-line purpose. Prefer `pnpm <script>` (Node.js) or `./mvnw <goal>` / `./gradlew <task>` (Spring Java) over raw tool invocations when the project wraps them.
161
+ 4. **Coding Style & Naming Conventions** — indentation, language version, naming patterns (with one short example pattern, not a code block), and the lint/format tools that enforce them.
162
+ 5. **Testing Guidelines** — framework, where tests live, naming pattern, how to run a single test, any coverage threshold the repo actually checks.
163
+ 6. **Commit & Pull Request Guidelines** — the convention observed in `git log` (e.g. Conventional Commits prefixes seen), PR description expectations, required CI checks.
164
+ 7. **Security & Configuration Tips** _(optional)_ — secrets handling, env-file location, validator scripts that fail CI.
165
+ 8. **Architecture Overview** _(optional, only if not already covered by a `@`-reference)_ — 3–6 bullets max; otherwise link out.
166
+
167
+ Open the file with one short paragraph (1–2 sentences) naming what the project is and the primary stack — enough that an agent landing in the repo for the first time has a frame. No mission statements, team intros, or values.
168
+
169
+ ## Quality guards (run before performing a file write operation)
170
+
171
+ Each guard is a hard gate. If any fails, revise the draft.
172
+
173
+ 1. **Length.** Body is 200–400 words. Under 200 means you skipped specifics; over 400 means you padded or inlined what should be a reference.
174
+ 2. **No multi-line snippets.** No fenced code blocks longer than a single command line. Replace example components / configs / migrations with `@path/to/file`. Short single-line command examples (`pnpm test`, `git rebase main`) are fine.
175
+ 3. **Every rule is checkable.** Re-read each sentence and ask: _could a reviewer flag a diff against this?_ If not, rewrite it with a concrete pattern, threshold, or named tool. Strike phrases like "clean code", "best practices", "modern patterns", "be consistent", "handle errors properly", "keep it simple".
176
+ 4. **No redundant knowledge.** Strike any line you could have written without opening the repo. Framework defaults, language tutorials, and definitions of common terms do not earn a slot. If a rule duplicates `README.md` / `package.json` / lint config, replace it with `@README.md` / `@package.json` / `@.eslintrc.json`.
177
+ 5. **Critical rules first.** The first third of the file must contain the highest-stakes rules and the most-used commands. If the only "never do X" rule is at the bottom, move it up. If the top is welcome/mission/values, cut it.
178
+
179
+ ## Tone
180
+
181
+ Professional, instructional, terse. Second person ("Run `npm test` before pushing" or "Run `./mvnw verify` before pushing") or imperative ("Place new handlers in `src/api/<feature>/`" or "Place new controllers in `src/main/java/<package>/controller/`"). No marketing voice, no emojis, no decorative dividers.
182
+
183
+ ## After writing (Exit Gate — confirm-or-revise form)
184
+
185
+ Per the shared contract's exception for no-follow-up skills, present the results box, then ask only a confirm-or-revise question (no unsolicited follow-up suggestions):
186
+
187
+ **Results box**:
188
+
189
+ ```markdown
190
+ ## ✅ AGENTS.MD COMPLETE — <path>
191
+
192
+ **Scope** — [repo-level / directory-level]
193
+ **Words** — [<word count> body words]
194
+ **Sections** — [<1-line section order summary>]
195
+
196
+ **Written** — `<path>`
197
+ ```
198
+
199
+ Report to the user:
200
+
201
+ - the file path written,
202
+ - the body word count,
203
+ - a one-line summary of the section order chosen.
204
+
205
+ **Results-acceptance question** — use `question` — "Is the document correct?" with options:
206
+
207
+ - **Accept** — keep it. Reminder (always print with or without acceptance): _test the file by running a real task with a fresh agent session — onboarding docs only prove themselves on the next run._
208
+ - **Adjust** — user specifies changes (trim, reorder, re-shape a section); apply them surgically, re-run the Quality guards, re-present the results box.
209
+ - **Discuss** — justify a specific rule or citation (its file source); then re-ask.
210
+ - **Stop here** — keep the file as written; nothing further at this time.
211
+
212
+ After the user's response, stop. Do not propose further follow-ups unless the user asks.
213
+
214
+ ## Edge cases
215
+
216
+ - **No `README.md` and no manifest detected.** Stop and tell the user the repo looks empty or unfamiliar; ask for a one-paragraph project description before drafting.
217
+ - **Monorepo with per-package READMEs.** Write a root `AGENTS.md` that lists packages and `@`-references each package's README, rather than duplicating per-package detail. Suggest nested `packages/<name>/AGENTS.md` for any package with rules that materially differ.
218
+ - **Existing rich `AGENTS.md` in the repo.** Treat it as authoritative source material. The new `AGENTS.md` should be a tighter distillation that points back to `@AGENTS.md` for depth, not a verbatim copy.
219
+ - **Existing `AGENTS.md` was edited by hand after its last commit.** `git diff HEAD -- <path>` will show uncommitted changes. Read those changes first and treat them as KEEP unless they directly contradict a CI-enforced rule — the user is mid-edit and you must not clobber in-flight work.
220
+ - **`LAST_TOUCH` is the initial commit of the repo.** Diff range becomes `LAST_TOUCH..HEAD` with no useful signal. Fall back to inspecting current repo state vs. the file's claims, line by line, without the git-diff shortcut.
221
+ - **File exists but is empty or a stub.** Skip the Update path — run the Create path and overwrite, since there is no authorial content to preserve.
222
+ - **Repo with no commit history (`git log` empty).** Skip the commit-conventions section rather than guessing; note in the PR section that the convention is to be defined.
223
+ - **Polyglot repo (e.g. Node.js frontend + Spring Java backend).** Pick the dominant stack by file count for the "Build/Test/Dev" section; mention the secondary stack only if it has its own commands an agent will need. For a typical full-stack repo, cover both `package.json` scripts and Maven/Gradle goals.
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: codebase-analyzer
2
+ name: owflow:codebase-analyzer
3
3
  description: Analyzes codebase using adaptive parallel Explore subagents based on task complexity. Selects agent roles from a pool, launches Explore agents, then delegates report generation to codebase-analysis-reporter subagent.
4
4
  user-invocable: false
5
5
  ---
@@ -0,0 +1,115 @@
1
+ ---
2
+ name: owflow:dev-analyze
3
+ description: Development — codebase analysis with clarifications, then gap analysis with scope decisions. First work phase of the development workflow.
4
+ argument-hint: "[task-path-or-identifier]"
5
+ user-invocable: true
6
+ ---
7
+
8
+ # Dev Analyze — Codebase & Gap Analysis (codebase-analysed, gap-analysed)
9
+
10
+ Work phase of the development workflow. Runs codebase exploration, requirements clarification, gap analysis, and scope decisions for an existing development task. State lives in `orchestrator-state.yml` — this skill reads it on entry and writes results on exit.
11
+
12
+ Related entry points: `/owflow:development` (assisted mode), `/owflow:goal-development` (autonomous mode). Both produce the same state; you may mix them freely.
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/development/` (e.g., `2026-01-12-my-task`); 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. Prerequisites: none — this is the first work phase. Everything else requires it.
22
+ 2. List available dev-task identifiers (directories under `.owflow/tasks/development/`) to resume from, if any.
23
+ 3. Hint: `Run /owflow:development <description> to start a task from scratch, or pass a task path/identifier to resume.`
24
+
25
+ ### Prerequisites
26
+
27
+ | Required for this skill | Where verified | Produced by |
28
+ | ----------------------- | ------------------------------------ | ---------------------------- |
29
+ | State file exists | `<task-path>/orchestrator-state.yml` | `/owflow:development <desc>` |
30
+
31
+ 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 `codebase-analysed`): `question` — create a fresh standard development task starting at this step, or decline → print `No development task found at <path>. Run /owflow:development <description> to start a task from scratch.` and STOP.
32
+ 2. **Skip/resume**: if `codebase-analysed` is in `completed_phases`, skip that part. If `gap-analysed` is in `completed_phases`, the whole skill is done — report existing results and route to the Exit Gate.
33
+
34
+ ## Execute
35
+
36
+ **Read first**: the [Delegation Rules](../orchestrator-framework/references/delegation-rules.md) and the [Dispatcher & Handoff Pattern](../orchestrator-framework/references/dispatcher-handoff.md).
37
+
38
+ ### Codebase Analysis (`codebase-analysed`)
39
+
40
+ 1. Skill tool - `codebase-analyzer`. Pass: task description (`task.description`), task_path, risk-relevant state, `project_doc_paths` from state, research/quick-reference context if present in state.
41
+ 2. Direct - use `question` for max 5 critical clarifying questions. Save to `analysis/clarifications.md`; set `task_context.clarifications_resolved`.
42
+ 3. **State write**: append `codebase-analysed` to `completed_phases`; update `task_context.risk_level`, `task_context.clarifications_resolved`, `phase_summaries.codebase_analysis`; bump `orchestrator.updated`. On failure: append `codebase-analysed` to `failed_phases`, increment `auto_fix_attempts["codebase-analysed"]`. Then re-read state + run `verify_template` (see State Update Convention).
43
+
44
+ ### Gap Analysis & Scope (`gap-analysed`)
45
+
46
+ 1. Task tool - `gap-analyzer` subagent. Pass: task_path, risk level, codebase summary, key files, clarifications, `project_doc_paths`.
47
+ 2. **Extract structured data from the result** (this gates later phases — do not summarize only):
48
+ - Read `task_characteristics` (5 fields: `has_reproducible_defect`, `modifies_existing_code`, `creates_new_entities`, `involves_data_operations`, `ui_heavy`) → write to `task_context.task_characteristics`
49
+ - Read `risk_level` → `task_context.risk_level`
50
+ - Write 1-2 sentence summary to `phase_summaries.gap_analysis`
51
+ - **SELF-CHECK**: re-read `orchestrator-state.yml` and verify the 5 characteristic values match the gap-analyzer output.
52
+ 3. **Decision gate** (mandatory): if `decisions_needed.critical` or `decisions_needed.important` is non-empty → `question` (one per critical; batch important into multi-select). If empty, note "No scope decisions needed" in state.
53
+ 4. Save scope clarifications to `analysis/scope-clarifications.md` (conditional).
54
+ 5. **Optional phase defaults**: `ui_heavy: true` → `options.e2e_enabled: true` + `options.user_docs_enabled: true`; `creates_new_entities: true` → `options.user_docs_enabled: true`. Command flags in state (`options`) already set override these.
55
+ 6. **State write**: append `gap-analysed` to `completed_phases`; update `task_context.task_characteristics`, `task_context.risk_level`, `phase_summaries.gap_analysis`; record decision-gate outcome (or "No scope decisions needed") in `task_context.gaps`; apply option defaults to `options.*`; bump `orchestrator.updated`. On failure: append `gap-analysed` to `failed_phases`, increment `auto_fix_attempts["gap-analysed"]`. Then re-read state + run `verify_template`.
56
+
57
+ **ANTI-PATTERN**: Do NOT override `ui_heavy` with your own complexity judgment ("no new screens needed, just..."). It is a gap-analyzer signal.
58
+
59
+ ## State Update Convention (per step)
60
+
61
+ Apply after EVERY phase/step above:
62
+
63
+ 1. **Write immediately** — update `orchestrator-state.yml` as soon as the step completes, appending ONLY the step slug actually performed (e.g. `codebase-analysed`, `gap-analysed`) plus that step's fields. Never batch multiple steps into one end-of-skill write.
64
+ 2. **Timestamp** — set `orchestrator.updated` to the current UTC timestamp on every write.
65
+ 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["<slug>"]`.
66
+ 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-development.yml`. Fix any reported issue immediately before proceeding.
67
+ 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.
68
+
69
+ ## Exit Gate
70
+
71
+ Present results, get user confirmation, then hand off (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)). Never auto-invoke the next skill.
72
+
73
+ ### Results box
74
+
75
+ ```markdown
76
+ ## ✅ DEV ANALYZE COMPLETE — <task name>
77
+
78
+ **Task type** — [detected type]
79
+ **Risk level** — [risk_level from state]
80
+ **Characteristics** — [key characteristics — TDD gate, E2E, user docs]
81
+ **Scope decisions** — [decisions made / "none needed"]
82
+
83
+ **Artifacts**
84
+
85
+ - `analysis/codebase-analysis.md`
86
+ - `analysis/clarifications.md`
87
+ - `analysis/gap-analysis.md`
88
+ - `analysis/scope-clarifications.md` [conditional]
89
+ ```
90
+
91
+ ### Results-acceptance question
92
+
93
+ Use `question` — "Are these results correct?" with options:
94
+
95
+ - **Accept** — analysis is good; continue.
96
+ - **Adjust** — re-run only the affected part (clarifications, gap analysis, or scope decisions), update state and artifacts, re-present the results box.
97
+ - **Discuss** — walk through a specific result (risk level rationale, characteristics, scope decisions) in more depth; then re-ask.
98
+ - **Stop here** — print the resume command (`/owflow:dev-analyze <task-path>`) and end.
99
+
100
+ ### Next steps (after Accept)
101
+
102
+ Read `task_context.task_characteristics` from state and print the suggested command with annotations (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)):
103
+
104
+ - `has_reproducible_defect: true` → `→ /owflow:dev-tdd-red <task-path>`
105
+ What: writes a failing test that reproduces the defect — `required` before the spec when a reproducible defect exists; the test becomes the spec's acceptance criterion.
106
+ - otherwise → `→ /owflow:dev-spec <task-path>`
107
+ What: turns the analysis into a user-approved specification — `required` next phase. There is no shorter alternative path: spec → plan → implement → verify → finalize.
108
+
109
+ **Other options**:
110
+
111
+ - `/owflow:dev-spec --quick <task-path>` — `optional` condensed alternative: writes the condensed spec directly on the fly (no specification-creator subagent; audit skipped) instead of the full requirements/spec flow
112
+ - `/owflow:goal-development <task-path>` — `optional` shortcut: runs all remaining phases in one loop (red gate if flagged → spec → plan → implement → verify → finalize)
113
+ - `/owflow:dev-spec <task-path>` — `optional` — skips the TDD gate manually (not recommended for reproducible defects; remaining plan unchanged: plan → implement → verify → finalize)
114
+
115
+ Then STOP.