owflow 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +448 -261
  3. package/dist/agents/bottleneck-analyzer.md +332 -329
  4. package/dist/agents/code-quality-pragmatist.md +353 -354
  5. package/dist/agents/code-reviewer.md +238 -239
  6. package/dist/agents/codebase-analysis-reporter.md +245 -246
  7. package/dist/agents/docs-operator.md +22 -23
  8. package/dist/agents/e2e-test-verifier.md +447 -448
  9. package/dist/agents/gap-analyzer.md +501 -502
  10. package/dist/agents/implementation-completeness-checker.md +219 -220
  11. package/dist/agents/implementation-planner.md +308 -309
  12. package/dist/agents/information-gatherer.md +690 -691
  13. package/dist/agents/production-readiness-checker.md +278 -279
  14. package/dist/agents/project-analyzer.md +403 -403
  15. package/dist/agents/reality-assessor.md +365 -366
  16. package/dist/agents/research-planner.md +449 -450
  17. package/dist/agents/research-synthesizer.md +402 -403
  18. package/dist/agents/solution-brainstormer.md +256 -257
  19. package/dist/agents/solution-designer.md +371 -372
  20. package/dist/agents/spec-auditor.md +297 -298
  21. package/dist/agents/specification-creator.md +333 -334
  22. package/dist/agents/task-classifier.md +449 -450
  23. package/dist/agents/task-group-implementer.md +283 -284
  24. package/dist/agents/test-suite-runner.md +194 -195
  25. package/dist/agents/user-docs-generator.md +508 -509
  26. package/dist/commands/reviews-code.md +90 -90
  27. package/dist/commands/reviews-pragmatic.md +99 -99
  28. package/dist/commands/reviews-production-readiness.md +113 -113
  29. package/dist/commands/reviews-reality-check.md +110 -110
  30. package/dist/commands/reviews-spec-audit.md +114 -114
  31. package/dist/commands/work.md +280 -280
  32. package/dist/configuration/agents-config.d.ts +2 -0
  33. package/dist/configuration/agents-config.js +8 -44
  34. package/dist/configuration/commands-config.d.ts +23 -0
  35. package/dist/configuration/commands-config.js +17 -17
  36. package/dist/configuration/skills-config.d.ts +2 -0
  37. package/dist/configuration/skills-config.js +3 -3
  38. package/dist/hooks/hooks-diagnostics.d.ts +3 -0
  39. package/dist/hooks/hooks-diagnostics.js +21 -0
  40. package/dist/hooks/hooks-persistence.d.ts +17 -0
  41. package/dist/hooks/hooks-persistence.js +207 -0
  42. package/dist/hooks/hooks-registry.d.ts +6 -0
  43. package/dist/hooks/hooks-registry.js +104 -0
  44. package/dist/hooks/hooks-wrapper.d.ts +25 -0
  45. package/dist/hooks/hooks-wrapper.js +318 -0
  46. package/dist/hooks/internal/before-tool.d.ts +6 -0
  47. package/dist/hooks/internal/before-tool.js +13 -0
  48. package/dist/hooks/internal/session-compaction.d.ts +9 -0
  49. package/dist/hooks/{session-compaction.js → internal/session-compaction.js} +9 -7
  50. package/dist/hooks/runtime/circuit-breaker.d.ts +23 -0
  51. package/dist/hooks/runtime/circuit-breaker.js +39 -0
  52. package/dist/hooks/runtime/failure-policy.d.ts +15 -0
  53. package/dist/hooks/runtime/failure-policy.js +49 -0
  54. package/dist/hooks/runtime/process-executor.d.ts +33 -0
  55. package/dist/hooks/runtime/process-executor.js +147 -0
  56. package/dist/hooks/runtime/status-recorder.d.ts +27 -0
  57. package/dist/hooks/runtime/status-recorder.js +111 -0
  58. package/dist/index.d.ts +7 -0
  59. package/dist/index.js +111 -40
  60. package/dist/skills/agents-md-generator/SKILL.md +223 -223
  61. package/dist/skills/codebase-analyzer/SKILL.md +162 -162
  62. package/dist/skills/codebase-analyzer/references/code-analysis.md +63 -63
  63. package/dist/skills/codebase-analyzer/references/combined.md +31 -31
  64. package/dist/skills/codebase-analyzer/references/context-discovery.md +63 -63
  65. package/dist/skills/codebase-analyzer/references/file-discovery.md +51 -51
  66. package/dist/skills/codebase-analyzer/references/migration-target.md +23 -23
  67. package/dist/skills/codebase-analyzer/references/pattern-mining.md +22 -22
  68. package/dist/skills/dev-analyze/SKILL.md +115 -115
  69. package/dist/skills/dev-bugfix/SKILL.md +452 -452
  70. package/dist/skills/dev-finalize/SKILL.md +118 -118
  71. package/dist/skills/dev-implement/SKILL.md +167 -167
  72. package/dist/skills/dev-plan/SKILL.md +147 -147
  73. package/dist/skills/dev-spec/SKILL.md +182 -182
  74. package/dist/skills/dev-tdd-red/SKILL.md +94 -94
  75. package/dist/skills/dev-verify/SKILL.md +153 -153
  76. package/dist/skills/development/SKILL.md +260 -260
  77. package/dist/skills/diagrams-mermaid/SKILL.md +183 -159
  78. package/dist/skills/diagrams-mermaid/references/reference.md +220 -148
  79. package/dist/skills/docs-manager/SKILL.md +379 -379
  80. package/dist/skills/docs-manager/docs/INDEX.md +199 -199
  81. package/dist/skills/docs-manager/docs/standards/backend/api.md +25 -25
  82. package/dist/skills/docs-manager/docs/standards/backend/migrations.md +22 -22
  83. package/dist/skills/docs-manager/docs/standards/backend/models.md +25 -25
  84. package/dist/skills/docs-manager/docs/standards/backend/queries.md +22 -22
  85. package/dist/skills/docs-manager/docs/standards/frontend/accessibility.md +25 -25
  86. package/dist/skills/docs-manager/docs/standards/frontend/components.md +28 -28
  87. package/dist/skills/docs-manager/docs/standards/frontend/css.md +16 -16
  88. package/dist/skills/docs-manager/docs/standards/frontend/responsive.md +28 -28
  89. package/dist/skills/docs-manager/docs/standards/global/coding-style.md +25 -25
  90. package/dist/skills/docs-manager/docs/standards/global/commenting.md +10 -10
  91. package/dist/skills/docs-manager/docs/standards/global/conventions.md +31 -31
  92. package/dist/skills/docs-manager/docs/standards/global/error-handling.md +22 -22
  93. package/dist/skills/docs-manager/docs/standards/global/minimal-implementation.md +22 -22
  94. package/dist/skills/docs-manager/docs/standards/global/validation.md +28 -28
  95. package/dist/skills/docs-manager/docs/standards/testing/test-writing.md +25 -25
  96. package/dist/skills/docs-manager/references/agents-md-template.md +29 -29
  97. package/dist/skills/docs-manager/references/index-md-template.md +73 -73
  98. package/dist/skills/flow-init/SKILL.md +234 -234
  99. package/dist/skills/flow-init/references/architecture-template.md +45 -45
  100. package/dist/skills/flow-init/references/roadmap-templates.md +93 -93
  101. package/dist/skills/flow-init/references/tech-stack-template.md +70 -70
  102. package/dist/skills/flow-init/references/vision-templates.md +75 -75
  103. package/dist/skills/goal-development/SKILL.md +96 -96
  104. package/dist/skills/goal-migration/SKILL.md +114 -114
  105. package/dist/skills/goal-performance/SKILL.md +126 -0
  106. package/dist/skills/goal-research/SKILL.md +118 -118
  107. package/dist/skills/html-renderer/SKILL.md +173 -173
  108. package/dist/skills/html-renderer/references/index.html +318 -318
  109. package/dist/skills/html-renderer/references/styles.css +388 -388
  110. package/dist/skills/html-renderer/references/tokens.json +104 -104
  111. package/dist/skills/implementation-plan-executor/SKILL.md +378 -378
  112. package/dist/skills/implementation-verifier/SKILL.md +307 -307
  113. package/dist/skills/migration/SKILL.md +268 -268
  114. package/dist/skills/migration-analyze/SKILL.md +126 -126
  115. package/dist/skills/migration-finalize/SKILL.md +161 -161
  116. package/dist/skills/migration-fix/SKILL.md +155 -155
  117. package/dist/skills/migration-implement/SKILL.md +131 -131
  118. package/dist/skills/migration-plan/SKILL.md +131 -131
  119. package/dist/skills/migration-spec/SKILL.md +135 -135
  120. package/dist/skills/migration-spec/references/migration-strategies.md +430 -430
  121. package/dist/skills/migration-target/SKILL.md +134 -134
  122. package/dist/skills/migration-target/references/migration-types.md +489 -489
  123. package/dist/skills/migration-verify/SKILL.md +184 -184
  124. package/dist/skills/orchestrator-framework/SKILL.md +65 -65
  125. package/dist/skills/orchestrator-framework/references/command-namespacing.md +7 -7
  126. package/dist/skills/orchestrator-framework/references/confirm-or-revise-exception.md +20 -20
  127. package/dist/skills/orchestrator-framework/references/delegation-rules.md +54 -54
  128. package/dist/skills/orchestrator-framework/references/dispatcher-handoff.md +27 -27
  129. package/dist/skills/orchestrator-framework/references/fix-loop-contract.md +65 -65
  130. package/dist/skills/orchestrator-framework/references/gate-contract.md +122 -117
  131. package/dist/skills/orchestrator-framework/references/orchestrator-creation-checklist.md +51 -51
  132. package/dist/skills/orchestrator-framework/references/orchestrator-patterns.md +235 -235
  133. package/dist/skills/performance/SKILL.md +267 -437
  134. package/dist/skills/performance-analyze/SKILL.md +129 -0
  135. package/dist/skills/{performance → performance-analyze}/references/performance-optimization-guide.md +271 -365
  136. package/dist/skills/performance-finalize/SKILL.md +117 -0
  137. package/dist/skills/performance-implement/SKILL.md +114 -0
  138. package/dist/skills/performance-plan/SKILL.md +112 -0
  139. package/dist/skills/performance-spec/SKILL.md +145 -0
  140. package/dist/skills/performance-verify/SKILL.md +164 -0
  141. package/dist/skills/research/SKILL.md +249 -249
  142. package/dist/skills/research-brainstorm/SKILL.md +120 -120
  143. package/dist/skills/research-brainstorm/references/brainstorming-techniques.md +84 -84
  144. package/dist/skills/research-converge/SKILL.md +130 -130
  145. package/dist/skills/research-design/SKILL.md +146 -146
  146. package/dist/skills/research-design/references/design-techniques.md +40 -40
  147. package/dist/skills/research-finalize/SKILL.md +125 -125
  148. package/dist/skills/research-fork/SKILL.md +190 -190
  149. package/dist/skills/research-gather/SKILL.md +133 -133
  150. package/dist/skills/research-plan/SKILL.md +141 -141
  151. package/dist/skills/research-plan/references/research-methodologies.md +710 -710
  152. package/dist/skills/research-quick/SKILL.md +139 -139
  153. package/dist/skills/research-synthesize/SKILL.md +127 -127
  154. package/dist/skills/rule-reviewer/SKILL.md +334 -334
  155. package/dist/skills/standards-discover/SKILL.md +260 -260
  156. package/dist/skills/standards-discover/references/aggregation-strategy.md +76 -76
  157. package/dist/skills/standards-discover/references/code-pattern-prompt.md +68 -68
  158. package/dist/skills/standards-discover/references/config-analyzer-prompt.md +67 -67
  159. package/dist/skills/standards-discover/references/docs-extractor-prompt.md +65 -65
  160. package/dist/skills/standards-discover/references/external-analyzer-prompt.md +75 -75
  161. package/dist/skills/standards-update/SKILL.md +207 -207
  162. package/dist/templates/orchestrator-state-base.yml +17 -17
  163. package/dist/templates/orchestrator-state-development.yml +95 -95
  164. package/dist/templates/orchestrator-state-migration.yml +95 -95
  165. package/dist/templates/orchestrator-state-performance.yml +64 -53
  166. package/dist/templates/orchestrator-state-research.yml +67 -67
  167. package/dist/tools/fork_task.d.ts +17 -0
  168. package/dist/tools/fork_task.js +21 -11
  169. package/dist/tools/verify_template.d.ts +11 -0
  170. package/dist/tools/verify_template.js +32 -17
  171. package/dist/tui/hooks-dialogs.d.ts +20 -0
  172. package/dist/tui/hooks-dialogs.js +181 -0
  173. package/dist/tui/hooks-presenter.d.ts +15 -0
  174. package/dist/tui/hooks-presenter.js +70 -0
  175. package/dist/tui/hooks-sidebar.d.ts +10 -0
  176. package/dist/tui/hooks-sidebar.js +104 -0
  177. package/dist/tui/primitives.d.ts +21 -0
  178. package/dist/tui/primitives.js +47 -0
  179. package/dist/tui.d.ts +12 -0
  180. package/dist/tui.js +129 -0
  181. package/dist/types/hook-types.d.ts +125 -0
  182. package/dist/types/hook-types.js +76 -0
  183. package/dist/types/opencode-types.d.ts +13 -0
  184. package/dist/utils/file-util.d.ts +2 -0
  185. package/dist/utils/file-util.js +6 -6
  186. package/dist/utils/fork-task.d.ts +27 -0
  187. package/dist/utils/fork-task.js +18 -23
  188. package/dist/utils/plugin-info.d.ts +3 -0
  189. package/dist/utils/plugin-info.js +8 -10
  190. package/dist/utils/workflow-paths.d.ts +17 -0
  191. package/dist/utils/workflow-paths.js +18 -0
  192. package/dist/utils/yaml-structure.d.ts +7 -0
  193. package/dist/utils/yaml-structure.js +7 -11
  194. package/package.json +68 -48
  195. package/dist/hooks/before-tool.js +0 -19
@@ -1,73 +1,73 @@
1
- # INDEX.md Template
2
-
3
- Use this structure when generating or updating `.owflow/docs/INDEX.md`. Scan the actual `.owflow/docs/` directory to populate sections dynamically — do not hardcode file lists.
4
-
5
- For technical standards, the description MUST enumerate specific practices/conventions documented in the file, not just a generic category description.
6
-
7
- ```markdown
8
- # Documentation Index
9
-
10
- **IMPORTANT**: Read this file at the beginning of any development task to understand available documentation and standards.
11
-
12
- ## Quick Reference
13
-
14
- ### Project Documentation
15
-
16
- Project-level documentation covering vision, goals, architecture, and technology choices.
17
-
18
- ### Technical Standards
19
-
20
- Coding standards, conventions, and best practices organized by domain.
21
-
22
- ---
23
-
24
- ## Project Documentation
25
-
26
- Located in `.owflow/docs/project/`
27
-
28
- ### Vision (`project/vision.md`)
29
-
30
- [Brief description of what this file contains]
31
-
32
- ### Roadmap (`project/roadmap.md`)
33
-
34
- [Brief description of what this file contains]
35
-
36
- ### Tech Stack (`project/tech-stack.md`)
37
-
38
- [Brief description of what this file contains]
39
-
40
- ### Architecture (`project/architecture.md`)
41
-
42
- [Brief description of what this file contains - if exists]
43
-
44
- ---
45
-
46
- ## Technical Standards
47
-
48
- ### [Category Name] Standards
49
-
50
- Located in `.owflow/docs/standards/[category]/`
51
-
52
- #### [Standard Name] (`standards/[category]/[name].md`)
53
-
54
- [Practice-specific description — enumerate actual conventions, not generic text]
55
-
56
- [... repeat for all categories and standards discovered in the directory ...]
57
-
58
- ---
59
-
60
- ## How to Use This Documentation
61
-
62
- 1. **Start Here**: Always read this INDEX.md first to understand what documentation exists
63
- 2. **Project Context**: Read relevant project documentation before starting work
64
- 3. **Standards**: Reference appropriate standards when writing code
65
- 4. **Keep Updated**: Update documentation when making significant changes
66
- 5. **Customize**: Adapt all documentation to your project's specific needs
67
-
68
- ## Updating Documentation
69
-
70
- - Project documentation should be updated when goals, tech stack, or architecture changes
71
- - Technical standards should be updated when team conventions evolve
72
- - Always update INDEX.md when adding, removing, or significantly changing documentation
73
- ```
1
+ # INDEX.md Template
2
+
3
+ Use this structure when generating or updating `.owflow/docs/INDEX.md`. Scan the actual `.owflow/docs/` directory to populate sections dynamically — do not hardcode file lists.
4
+
5
+ For technical standards, the description MUST enumerate specific practices/conventions documented in the file, not just a generic category description.
6
+
7
+ ```markdown
8
+ # Documentation Index
9
+
10
+ **IMPORTANT**: Read this file at the beginning of any development task to understand available documentation and standards.
11
+
12
+ ## Quick Reference
13
+
14
+ ### Project Documentation
15
+
16
+ Project-level documentation covering vision, goals, architecture, and technology choices.
17
+
18
+ ### Technical Standards
19
+
20
+ Coding standards, conventions, and best practices organized by domain.
21
+
22
+ ---
23
+
24
+ ## Project Documentation
25
+
26
+ Located in `.owflow/docs/project/`
27
+
28
+ ### Vision (`project/vision.md`)
29
+
30
+ [Brief description of what this file contains]
31
+
32
+ ### Roadmap (`project/roadmap.md`)
33
+
34
+ [Brief description of what this file contains]
35
+
36
+ ### Tech Stack (`project/tech-stack.md`)
37
+
38
+ [Brief description of what this file contains]
39
+
40
+ ### Architecture (`project/architecture.md`)
41
+
42
+ [Brief description of what this file contains - if exists]
43
+
44
+ ---
45
+
46
+ ## Technical Standards
47
+
48
+ ### [Category Name] Standards
49
+
50
+ Located in `.owflow/docs/standards/[category]/`
51
+
52
+ #### [Standard Name] (`standards/[category]/[name].md`)
53
+
54
+ [Practice-specific description — enumerate actual conventions, not generic text]
55
+
56
+ [... repeat for all categories and standards discovered in the directory ...]
57
+
58
+ ---
59
+
60
+ ## How to Use This Documentation
61
+
62
+ 1. **Start Here**: Always read this INDEX.md first to understand what documentation exists
63
+ 2. **Project Context**: Read relevant project documentation before starting work
64
+ 3. **Standards**: Reference appropriate standards when writing code
65
+ 4. **Keep Updated**: Update documentation when making significant changes
66
+ 5. **Customize**: Adapt all documentation to your project's specific needs
67
+
68
+ ## Updating Documentation
69
+
70
+ - Project documentation should be updated when goals, tech stack, or architecture changes
71
+ - Technical standards should be updated when team conventions evolve
72
+ - Always update INDEX.md when adding, removing, or significantly changing documentation
73
+ ```
@@ -1,234 +1,234 @@
1
- ---
2
- name: owflow:flow-init
3
- description: Initialize AI SDLC framework with intelligent project analysis and documentation generation
4
- argument-hint: "[--standards-from=PATH]"
5
- user-invocable: true
6
- ---
7
-
8
- # Initialize AI SDLC Framework
9
-
10
- Initialize `.owflow/docs/` with intelligent project analysis and meaningful documentation generation based on actual codebase inspection.
11
-
12
- Gates follow the shared contract in [Gate Contract](../orchestrator-framework/references/gate-contract.md).
13
-
14
- **NOTE**: This skill invokes other skills and subagents at specific phases. Use the **Task tool with `docs-operator` subagent** (subagent_type: `docs-operator`) for all docs-manager operations, and **Task tool** for project-analyzer. Use the **Skill tool** only for standards-discover (Phase 8, last phase). The Task tool returns control to this skill after completion; the Skill tool does not.
15
-
16
- ## Entry Gate
17
-
18
- PHASE 1 (Pre-flight Checks) below IS the entry gate of this skill. It validates the `--standards-from=PATH` argument (resolve it; abort with an informative message if the referenced project lacks `.owflow/docs/standards/`) and detects the pre-existing state of `.owflow/` — routing to backup, update, or cancel accordingly. Complete it before any other phase.
19
-
20
- ## Phase Configuration
21
-
22
- | Phase | Subject | activeForm |
23
- | ----- | ---------------------------------- | -------------------------------- |
24
- | 1 | Pre-flight checks | Running pre-flight checks |
25
- | 2 | Analyze project codebase | Analyzing project codebase |
26
- | 3 | Present findings & gather context | Gathering project context |
27
- | 4 | Select standards to initialize | Selecting standards |
28
- | 5 | Initialize documentation structure | Initializing documentation |
29
- | 6 | Generate project documentation | Generating project documentation |
30
- | 7 | Validate | Validating initialization |
31
- | 8 | Discover coding standards | Discovering coding standards |
32
-
33
- **Task Tracking**: Before Phase 1, use `TaskCreate` for all phases (pending), then set sequential dependencies with `TaskUpdate addBlockedBy`. At each phase: `TaskUpdate` to `in_progress` → execute → `TaskUpdate` to `completed`. If skipped (e.g., user selects "Update existing"), mark skipped phases as `completed` with `metadata: {skipped: true}`.
34
-
35
- ---
36
-
37
- ## PHASE 1: Pre-flight Checks
38
-
39
- **If `--standards-from=PATH` is provided:**
40
-
41
- 1. Resolve the path (absolute or relative to current working directory)
42
- 2. Check if `PATH/.owflow/docs/standards/` exists. If not, inform the user and stop — the specified project doesn't have owflow standards initialized.
43
- 3. Store the resolved standards source path for use in Phases 4 and 5.
44
-
45
- Check if `.owflow/` directory already exists.
46
-
47
- **If exists**, use question:
48
-
49
- - Options: "Backup and reinitialize", "Update existing documentation", "Cancel"
50
- - If "Backup": Create `.owflow.backup-$(date +%Y%m%d-%H%M%S)/` using Bash tool
51
- - If "Update": Skip to PHASE 6 (documentation generation only)
52
- - If "Cancel": Stop execution
53
-
54
- ---
55
-
56
- ## PHASE 2: Project Analysis
57
-
58
- Invoke `project-analyzer` subagent via the Task tool.
59
-
60
- Wait for completion. Store analysis results for use in Phases 3 and 6.
61
-
62
- ---
63
-
64
- ## PHASE 3: Present Findings & Gather Context
65
-
66
- **Step 1**: Present analysis results to the user (project type, primary language/framework, architecture, tech stack, conventions, strengths/opportunities).
67
-
68
- **Step 2**: Use question to confirm analysis accuracy. If corrections needed, collect them.
69
-
70
- **Step 3**: Gather additional context via question (adapt to project type):
71
-
72
- 1. Project name (if not obvious)
73
- 2. Project description (1-2 sentences)
74
- 3. Primary goals (adapt question to new/existing/legacy project)
75
- 4. Team context (optional)
76
- 5. Special requirements (optional)
77
-
78
- **Step 4**: Ask which project documentation to generate using question (multi-select):
79
-
80
- - "Vision" — Project vision, goals, and purpose
81
- - "Roadmap" — Development roadmap and planned features
82
- - "Tech Stack" — Technology choices and rationale (ALWAYS selected, required)
83
- - "Architecture" — System architecture and design patterns (optional)
84
-
85
- Smart defaults based on `projectArchitectureType`:
86
-
87
- - Standard/Frontend-only/Backend-only: All selected
88
- - Monorepo/Umbrella: Only "Tech Stack" selected
89
-
90
- Store selections for Phase 6.
91
-
92
- ---
93
-
94
- ## PHASE 4: Select Standards to Initialize
95
-
96
- Before presenting options, explain to the user:
97
-
98
- - **What standards are**: Coding standards are documented conventions and best practices (naming, error handling, testing patterns, etc.) that guide consistent development across the project.
99
- - **Starting point**: If `--standards-from` was provided, standards come from the referenced project. Otherwise, the plugin includes generic built-in standards. Either way, they serve as a starting point and can be fully customized or extended later.
100
-
101
- **Determine available categories:**
102
-
103
- - **If `--standards-from` was provided**: Scan `PATH/.owflow/docs/standards/*/` to discover all available categories from the external project (may include custom categories beyond the baseline global/frontend/backend/testing).
104
- - **Otherwise**: Use built-in baseline categories (global, frontend, backend, testing).
105
-
106
- Calculate smart defaults based on analysis:
107
-
108
- - **Global**: Always recommended (if available)
109
- - **Frontend**: If frontend framework detected or projectArchitectureType includes frontend (if available)
110
- - **Backend**: If backend framework detected or projectArchitectureType includes backend (if available)
111
- - **Testing**: Always recommended (if available)
112
-
113
- Also scan `.owflow/docs/standards/*/` for any existing custom categories to include.
114
-
115
- Show smart defaults summary (noting the source: external project or built-in), then use question:
116
-
117
- - "Use smart defaults" → proceed with calculated defaults
118
- - "Customize selection" → show multi-select with all discovered categories + "Add custom category" option
119
-
120
- Custom categories: if user adds a new category, create the directory and include it in the selection.
121
-
122
- Store selection for Phase 5.
123
-
124
- ---
125
-
126
- ## PHASE 5: Initialize Documentation Structure
127
-
128
- **Invoke `docs-operator` subagent** via Task tool (subagent_type: `docs-operator`) with prompt:
129
-
130
- > "Initialize documentation structure. Standards selection: [array from Phase 4]. [If --standards-from was provided: Standards source path: [resolved path]/.owflow/docs/standards/. Copy standards from this external path instead of built-in defaults.] Only copy selected standard categories. Do NOT copy project templates — only create the project/ directory. Project documentation will be generated in Phase 6 with real content from project analysis. Create placeholder sections in INDEX.md for skipped categories."
131
-
132
- Wait for docs-operator to complete, then immediately proceed to Phase 6.
133
-
134
- ---
135
-
136
- ## PHASE 6: Generate Project Documentation
137
-
138
- **IMPORTANT**: Only generate docs selected in Phase 3.
139
-
140
- For each selected doc type, read the corresponding reference template:
141
-
142
- - Vision selected → Read `references/vision-templates.md`, select template by project type (new/existing/legacy)
143
- - Roadmap selected → Read `references/roadmap-templates.md`, select template by project type
144
- - Tech Stack (always) → Read `references/tech-stack-template.md`
145
- - Architecture selected → Read `references/architecture-template.md`
146
-
147
- Fill templates using:
148
-
149
- - Analysis report data (tech stack, age, structure)
150
- - User-provided context from Phase 3 (goals, users, requirements)
151
- - Auto-detected project characteristics
152
-
153
- Write each file to `.owflow/docs/project/`.
154
-
155
- **Diagram refinement (content-preserving, do NOT replace prose):**
156
-
157
- - If Architecture doc is selected and `.owflow/docs/project/architecture.md` exists:
158
- 1. Invoke Skill tool: `diagrams-mermaid`
159
- 2. Pass context from analysis + generated architecture content
160
- 3. Add Mermaid sections that **refine** the document:
161
- - `## Visual Architecture Context` (prefer `C4Context` or `C4Container`)
162
- - `## Component Communication Flow` (prefer `sequenceDiagram` or `flowchart`)
163
- 4. Keep existing architecture narrative intact; diagrams must supplement, not replace sections.
164
-
165
- - If Tech Stack doc is selected and `.owflow/docs/project/tech-stack.md` exists:
166
- 1. Invoke Skill tool: `diagrams-mermaid`
167
- 2. Add one lightweight visual section (e.g., runtime/build dependency flow) only if context is sufficient
168
- 3. If context is insufficient, keep text-only output and list missing details (no invented dependencies).
169
-
170
- ---
171
-
172
- ## PHASE 7: Validate → Exit Gate
173
-
174
- **Step 1**: Invoke `docs-operator` subagent via Task tool (subagent_type: `docs-operator`) with prompt:
175
-
176
- > "Regenerate INDEX.md to include all newly created project documentation. Then verify AGENTS.md is properly integrated with .owflow/docs/ documentation."
177
-
178
- Wait for docs-operator to complete, then immediately continue with Step 2.
179
-
180
- **Step 2**: Run validation checks:
181
-
182
- - Verify INDEX.md exists
183
- - Verify tech-stack.md exists (required)
184
- - Verify selected docs exist
185
- - Verify selected standards directories exist
186
- - Verify AGENTS.md integration
187
-
188
- **Step 3: Results box** — present the summary as:
189
-
190
- ```markdown
191
- ## ✅ FLOW INIT COMPLETE — <project name>
192
-
193
- **Project type** — [type, language, framework, architecture]
194
- **Structure** — [tree with check marks for created items]
195
- **Docs** — [which docs generated, which standards initialized]
196
- **Standards** — [discovered count, applied]
197
- **Key findings** — [strengths, opportunities]
198
-
199
- **Created** — `.owflow/docs/INDEX.md`
200
- ```
201
-
202
- **Step 4: Results-acceptance question** — use `question` — "Are these results correct?" with options:
203
-
204
- - **Accept** — initialization is complete; print next steps below.
205
- - **Adjust** — regenerate the affected artifact (analysis, doc, standards) with the user's corrections, then re-present the results box.
206
- - **Discuss** — walk through the generated structure and findings in more depth; then re-ask.
207
- - **Stop here** — end; everything is already written to `.owflow/docs/`.
208
-
209
- **Next steps (after Accept)**:
210
-
211
- 1. Review and customize the generated documentation and standards for your team
212
- 2. Start development with `/owflow:development "<task description>"` (or project work)
213
- 3. Keep documentation current via `/owflow:standards-update "<convention>"`
214
-
215
- ---
216
-
217
- ## PHASE 8: Discover Coding Standards
218
-
219
- Invoke the `standards-discover` skill via Skill tool with `--scope=full` to automatically discover coding standards from the project's config files, source code patterns, documentation, and external sources.
220
-
221
- > "Run standards discovery with --scope=full. This is being invoked as part of project initialization."
222
-
223
- The standards-discover skill handles its own user interaction (presenting findings by confidence tier, asking for approval). Let it run its full workflow — this is the last phase of init, so context handoff is fine here.
224
-
225
- After completion, display a brief summary of how many standards were discovered and applied.
226
-
227
- ---
228
-
229
- ## Error Handling Principles
230
-
231
- - If `.owflow/docs/` creation fails: check permissions, suggest manual creation
232
- - If project-analyzer fails: offer to proceed with manual input only
233
- - If docs-manager fails: offer retry (max 2 attempts), then manual instructions
234
- - Never auto-rollback — always ask user before destructive actions
1
+ ---
2
+ name: owflow:flow-init
3
+ description: Initialize AI SDLC framework with intelligent project analysis and documentation generation
4
+ argument-hint: "[--standards-from=PATH]"
5
+ user-invocable: true
6
+ ---
7
+
8
+ # Initialize AI SDLC Framework
9
+
10
+ Initialize `.owflow/docs/` with intelligent project analysis and meaningful documentation generation based on actual codebase inspection.
11
+
12
+ Gates follow the shared contract in [Gate Contract](../orchestrator-framework/references/gate-contract.md).
13
+
14
+ **NOTE**: This skill invokes other skills and subagents at specific phases. Use the **Task tool with `docs-operator` subagent** (subagent_type: `docs-operator`) for all docs-manager operations, and **Task tool** for project-analyzer. Use the **Skill tool** only for standards-discover (Phase 8, last phase). The Task tool returns control to this skill after completion; the Skill tool does not.
15
+
16
+ ## Entry Gate
17
+
18
+ PHASE 1 (Pre-flight Checks) below IS the entry gate of this skill. It validates the `--standards-from=PATH` argument (resolve it; abort with an informative message if the referenced project lacks `.owflow/docs/standards/`) and detects the pre-existing state of `.owflow/` — routing to backup, update, or cancel accordingly. Complete it before any other phase.
19
+
20
+ ## Phase Configuration
21
+
22
+ | Phase | Subject | activeForm |
23
+ | ----- | ---------------------------------- | -------------------------------- |
24
+ | 1 | Pre-flight checks | Running pre-flight checks |
25
+ | 2 | Analyze project codebase | Analyzing project codebase |
26
+ | 3 | Present findings & gather context | Gathering project context |
27
+ | 4 | Select standards to initialize | Selecting standards |
28
+ | 5 | Initialize documentation structure | Initializing documentation |
29
+ | 6 | Generate project documentation | Generating project documentation |
30
+ | 7 | Validate | Validating initialization |
31
+ | 8 | Discover coding standards | Discovering coding standards |
32
+
33
+ **Task Tracking**: Before Phase 1, use `TaskCreate` for all phases (pending), then set sequential dependencies with `TaskUpdate addBlockedBy`. At each phase: `TaskUpdate` to `in_progress` → execute → `TaskUpdate` to `completed`. If skipped (e.g., user selects "Update existing"), mark skipped phases as `completed` with `metadata: {skipped: true}`.
34
+
35
+ ---
36
+
37
+ ## PHASE 1: Pre-flight Checks
38
+
39
+ **If `--standards-from=PATH` is provided:**
40
+
41
+ 1. Resolve the path (absolute or relative to current working directory)
42
+ 2. Check if `PATH/.owflow/docs/standards/` exists. If not, inform the user and stop — the specified project doesn't have owflow standards initialized.
43
+ 3. Store the resolved standards source path for use in Phases 4 and 5.
44
+
45
+ Check if `.owflow/` directory already exists.
46
+
47
+ **If exists**, use question:
48
+
49
+ - Options: "Backup and reinitialize", "Update existing documentation", "Cancel"
50
+ - If "Backup": Create `.owflow.backup-$(date +%Y%m%d-%H%M%S)/` using Bash tool
51
+ - If "Update": Skip to PHASE 6 (documentation generation only)
52
+ - If "Cancel": Stop execution
53
+
54
+ ---
55
+
56
+ ## PHASE 2: Project Analysis
57
+
58
+ Invoke `project-analyzer` subagent via the Task tool.
59
+
60
+ Wait for completion. Store analysis results for use in Phases 3 and 6.
61
+
62
+ ---
63
+
64
+ ## PHASE 3: Present Findings & Gather Context
65
+
66
+ **Step 1**: Present analysis results to the user (project type, primary language/framework, architecture, tech stack, conventions, strengths/opportunities).
67
+
68
+ **Step 2**: Use question to confirm analysis accuracy. If corrections needed, collect them.
69
+
70
+ **Step 3**: Gather additional context via question (adapt to project type):
71
+
72
+ 1. Project name (if not obvious)
73
+ 2. Project description (1-2 sentences)
74
+ 3. Primary goals (adapt question to new/existing/legacy project)
75
+ 4. Team context (optional)
76
+ 5. Special requirements (optional)
77
+
78
+ **Step 4**: Ask which project documentation to generate using question (multi-select):
79
+
80
+ - "Vision" — Project vision, goals, and purpose
81
+ - "Roadmap" — Development roadmap and planned features
82
+ - "Tech Stack" — Technology choices and rationale (ALWAYS selected, required)
83
+ - "Architecture" — System architecture and design patterns (optional)
84
+
85
+ Smart defaults based on `projectArchitectureType`:
86
+
87
+ - Standard/Frontend-only/Backend-only: All selected
88
+ - Monorepo/Umbrella: Only "Tech Stack" selected
89
+
90
+ Store selections for Phase 6.
91
+
92
+ ---
93
+
94
+ ## PHASE 4: Select Standards to Initialize
95
+
96
+ Before presenting options, explain to the user:
97
+
98
+ - **What standards are**: Coding standards are documented conventions and best practices (naming, error handling, testing patterns, etc.) that guide consistent development across the project.
99
+ - **Starting point**: If `--standards-from` was provided, standards come from the referenced project. Otherwise, the plugin includes generic built-in standards. Either way, they serve as a starting point and can be fully customized or extended later.
100
+
101
+ **Determine available categories:**
102
+
103
+ - **If `--standards-from` was provided**: Scan `PATH/.owflow/docs/standards/*/` to discover all available categories from the external project (may include custom categories beyond the baseline global/frontend/backend/testing).
104
+ - **Otherwise**: Use built-in baseline categories (global, frontend, backend, testing).
105
+
106
+ Calculate smart defaults based on analysis:
107
+
108
+ - **Global**: Always recommended (if available)
109
+ - **Frontend**: If frontend framework detected or projectArchitectureType includes frontend (if available)
110
+ - **Backend**: If backend framework detected or projectArchitectureType includes backend (if available)
111
+ - **Testing**: Always recommended (if available)
112
+
113
+ Also scan `.owflow/docs/standards/*/` for any existing custom categories to include.
114
+
115
+ Show smart defaults summary (noting the source: external project or built-in), then use question:
116
+
117
+ - "Use smart defaults" → proceed with calculated defaults
118
+ - "Customize selection" → show multi-select with all discovered categories + "Add custom category" option
119
+
120
+ Custom categories: if user adds a new category, create the directory and include it in the selection.
121
+
122
+ Store selection for Phase 5.
123
+
124
+ ---
125
+
126
+ ## PHASE 5: Initialize Documentation Structure
127
+
128
+ **Invoke `docs-operator` subagent** via Task tool (subagent_type: `docs-operator`) with prompt:
129
+
130
+ > "Initialize documentation structure. Standards selection: [array from Phase 4]. [If --standards-from was provided: Standards source path: [resolved path]/.owflow/docs/standards/. Copy standards from this external path instead of built-in defaults.] Only copy selected standard categories. Do NOT copy project templates — only create the project/ directory. Project documentation will be generated in Phase 6 with real content from project analysis. Create placeholder sections in INDEX.md for skipped categories."
131
+
132
+ Wait for docs-operator to complete, then immediately proceed to Phase 6.
133
+
134
+ ---
135
+
136
+ ## PHASE 6: Generate Project Documentation
137
+
138
+ **IMPORTANT**: Only generate docs selected in Phase 3.
139
+
140
+ For each selected doc type, read the corresponding reference template:
141
+
142
+ - Vision selected → Read `references/vision-templates.md`, select template by project type (new/existing/legacy)
143
+ - Roadmap selected → Read `references/roadmap-templates.md`, select template by project type
144
+ - Tech Stack (always) → Read `references/tech-stack-template.md`
145
+ - Architecture selected → Read `references/architecture-template.md`
146
+
147
+ Fill templates using:
148
+
149
+ - Analysis report data (tech stack, age, structure)
150
+ - User-provided context from Phase 3 (goals, users, requirements)
151
+ - Auto-detected project characteristics
152
+
153
+ Write each file to `.owflow/docs/project/`.
154
+
155
+ **Diagram refinement (content-preserving, do NOT replace prose):**
156
+
157
+ - If Architecture doc is selected and `.owflow/docs/project/architecture.md` exists:
158
+ 1. Invoke Skill tool: `diagrams-mermaid` with target file `.owflow/docs/project/architecture.md` (the skill writes the diagrams into the file and themes them github-dark by default)
159
+ 2. Pass context from analysis + generated architecture content
160
+ 3. Add Mermaid sections that **refine** the document:
161
+ - `## Visual Architecture Context` (architecture view: `flowchart` with subgraphs)
162
+ - `## Component Communication Flow` (prefer `sequenceDiagram` or `flowchart`)
163
+ 4. Keep existing architecture narrative intact; diagrams must supplement, not replace sections.
164
+
165
+ - If Tech Stack doc is selected and `.owflow/docs/project/tech-stack.md` exists:
166
+ 1. Invoke Skill tool: `diagrams-mermaid` with target file `.owflow/docs/project/tech-stack.md`
167
+ 2. Add one lightweight visual section (e.g., runtime/build dependency flow) only if context is sufficient
168
+ 3. If context is insufficient, keep text-only output and list missing details (no invented dependencies).
169
+
170
+ ---
171
+
172
+ ## PHASE 7: Validate → Exit Gate
173
+
174
+ **Step 1**: Invoke `docs-operator` subagent via Task tool (subagent_type: `docs-operator`) with prompt:
175
+
176
+ > "Regenerate INDEX.md to include all newly created project documentation. Then verify AGENTS.md is properly integrated with .owflow/docs/ documentation."
177
+
178
+ Wait for docs-operator to complete, then immediately continue with Step 2.
179
+
180
+ **Step 2**: Run validation checks:
181
+
182
+ - Verify INDEX.md exists
183
+ - Verify tech-stack.md exists (required)
184
+ - Verify selected docs exist
185
+ - Verify selected standards directories exist
186
+ - Verify AGENTS.md integration
187
+
188
+ **Step 3: Results box** — present the summary as:
189
+
190
+ ```markdown
191
+ ## ✅ FLOW INIT COMPLETE — <project name>
192
+
193
+ **Project type** — [type, language, framework, architecture]
194
+ **Structure** — [tree with check marks for created items]
195
+ **Docs** — [which docs generated, which standards initialized]
196
+ **Standards** — [discovered count, applied]
197
+ **Key findings** — [strengths, opportunities]
198
+
199
+ **Created** — `.owflow/docs/INDEX.md`
200
+ ```
201
+
202
+ **Step 4: Results-acceptance question** — use `question` — "Are these results correct?" with options:
203
+
204
+ - **Accept** — initialization is complete; print next steps below.
205
+ - **Adjust** — regenerate the affected artifact (analysis, doc, standards) with the user's corrections, then re-present the results box.
206
+ - **Discuss** — walk through the generated structure and findings in more depth; then re-ask.
207
+ - **Stop here** — end; everything is already written to `.owflow/docs/`.
208
+
209
+ **Next steps (after Accept)**:
210
+
211
+ 1. Review and customize the generated documentation and standards for your team
212
+ 2. Start development with `/owflow:development "<task description>"` (or project work)
213
+ 3. Keep documentation current via `/owflow:standards-update "<convention>"`
214
+
215
+ ---
216
+
217
+ ## PHASE 8: Discover Coding Standards
218
+
219
+ Invoke the `standards-discover` skill via Skill tool with `--scope=full` to automatically discover coding standards from the project's config files, source code patterns, documentation, and external sources.
220
+
221
+ > "Run standards discovery with --scope=full. This is being invoked as part of project initialization."
222
+
223
+ The standards-discover skill handles its own user interaction (presenting findings by confidence tier, asking for approval). Let it run its full workflow — this is the last phase of init, so context handoff is fine here.
224
+
225
+ After completion, display a brief summary of how many standards were discovered and applied.
226
+
227
+ ---
228
+
229
+ ## Error Handling Principles
230
+
231
+ - If `.owflow/docs/` creation fails: check permissions, suggest manual creation
232
+ - If project-analyzer fails: offer to proceed with manual input only
233
+ - If docs-manager fails: offer retry (max 2 attempts), then manual instructions
234
+ - Never auto-rollback — always ask user before destructive actions