owflow 0.1.1 → 0.1.3

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 (104) hide show
  1. package/README.md +8 -1
  2. package/dist/agents/bottleneck-analyzer.md +329 -0
  3. package/dist/agents/code-quality-pragmatist.md +354 -0
  4. package/dist/agents/code-reviewer.md +239 -0
  5. package/dist/agents/codebase-analysis-reporter.md +246 -0
  6. package/dist/agents/docs-operator.md +23 -0
  7. package/dist/agents/e2e-test-verifier.md +448 -0
  8. package/dist/agents/gap-analyzer.md +502 -0
  9. package/dist/agents/implementation-completeness-checker.md +220 -0
  10. package/dist/agents/implementation-planner.md +309 -0
  11. package/dist/agents/information-gatherer.md +691 -0
  12. package/dist/agents/production-readiness-checker.md +279 -0
  13. package/dist/agents/project-analyzer.md +404 -0
  14. package/dist/agents/reality-assessor.md +366 -0
  15. package/dist/agents/research-planner.md +447 -0
  16. package/dist/agents/research-synthesizer.md +401 -0
  17. package/dist/agents/solution-brainstormer.md +257 -0
  18. package/dist/agents/solution-designer.md +372 -0
  19. package/dist/agents/spec-auditor.md +298 -0
  20. package/dist/agents/specification-creator.md +334 -0
  21. package/dist/agents/task-classifier.md +462 -0
  22. package/dist/agents/task-group-implementer.md +284 -0
  23. package/dist/agents/test-suite-runner.md +195 -0
  24. package/dist/agents/ui-mockup-generator.md +369 -0
  25. package/dist/agents/user-docs-generator.md +509 -0
  26. package/dist/commands/development.md +37 -0
  27. package/dist/commands/flow-init.md +37 -0
  28. package/dist/commands/migration.md +37 -0
  29. package/dist/commands/performance.md +37 -0
  30. package/dist/commands/product-design.md +37 -0
  31. package/dist/commands/quick-bugfix.md +37 -0
  32. package/dist/commands/quick-dev.md +140 -0
  33. package/dist/commands/quick-plan.md +132 -0
  34. package/dist/commands/research.md +37 -0
  35. package/dist/commands/reviews-code.md +90 -0
  36. package/dist/commands/reviews-pragmatic.md +99 -0
  37. package/dist/commands/reviews-production-readiness.md +113 -0
  38. package/dist/commands/reviews-reality-check.md +110 -0
  39. package/dist/commands/reviews-spec-audit.md +114 -0
  40. package/dist/commands/standards-discover.md +37 -0
  41. package/dist/commands/standards-update.md +37 -0
  42. package/dist/commands/work.md +284 -0
  43. package/dist/index.js +3 -2
  44. package/dist/skills/codebase-analyzer/SKILL.md +162 -0
  45. package/dist/skills/codebase-analyzer/references/code-analysis.md +63 -0
  46. package/dist/skills/codebase-analyzer/references/combined.md +31 -0
  47. package/dist/skills/codebase-analyzer/references/context-discovery.md +63 -0
  48. package/dist/skills/codebase-analyzer/references/file-discovery.md +51 -0
  49. package/dist/skills/codebase-analyzer/references/migration-target.md +23 -0
  50. package/dist/skills/codebase-analyzer/references/pattern-mining.md +22 -0
  51. package/dist/skills/development/SKILL.md +669 -0
  52. package/dist/skills/docs-manager/SKILL.md +379 -0
  53. package/dist/skills/docs-manager/docs/INDEX.md +199 -0
  54. package/dist/skills/docs-manager/docs/standards/backend/api.md +25 -0
  55. package/dist/skills/docs-manager/docs/standards/backend/migrations.md +22 -0
  56. package/dist/skills/docs-manager/docs/standards/backend/models.md +25 -0
  57. package/dist/skills/docs-manager/docs/standards/backend/queries.md +22 -0
  58. package/dist/skills/docs-manager/docs/standards/frontend/accessibility.md +25 -0
  59. package/dist/skills/docs-manager/docs/standards/frontend/components.md +28 -0
  60. package/dist/skills/docs-manager/docs/standards/frontend/css.md +16 -0
  61. package/dist/skills/docs-manager/docs/standards/frontend/responsive.md +28 -0
  62. package/dist/skills/docs-manager/docs/standards/global/coding-style.md +25 -0
  63. package/dist/skills/docs-manager/docs/standards/global/commenting.md +10 -0
  64. package/dist/skills/docs-manager/docs/standards/global/conventions.md +31 -0
  65. package/dist/skills/docs-manager/docs/standards/global/error-handling.md +22 -0
  66. package/dist/skills/docs-manager/docs/standards/global/minimal-implementation.md +22 -0
  67. package/dist/skills/docs-manager/docs/standards/global/validation.md +28 -0
  68. package/dist/skills/docs-manager/docs/standards/testing/test-writing.md +25 -0
  69. package/dist/skills/docs-manager/references/claude-md-template.md +29 -0
  70. package/dist/skills/docs-manager/references/index-md-template.md +73 -0
  71. package/dist/skills/flow-init/SKILL.md +198 -0
  72. package/dist/skills/flow-init/references/architecture-template.md +45 -0
  73. package/dist/skills/flow-init/references/roadmap-templates.md +93 -0
  74. package/dist/skills/flow-init/references/tech-stack-template.md +70 -0
  75. package/dist/skills/flow-init/references/vision-templates.md +75 -0
  76. package/dist/skills/implementation-plan-executor/SKILL.md +378 -0
  77. package/dist/skills/implementation-verifier/SKILL.md +307 -0
  78. package/dist/skills/migration/SKILL.md +380 -0
  79. package/dist/skills/migration/references/migration-strategies.md +397 -0
  80. package/dist/skills/migration/references/migration-types.md +437 -0
  81. package/dist/skills/orchestrator-framework/SKILL.md +65 -0
  82. package/dist/skills/orchestrator-framework/references/orchestrator-creation-checklist.md +47 -0
  83. package/dist/skills/orchestrator-framework/references/orchestrator-patterns.md +329 -0
  84. package/dist/skills/performance/SKILL.md +418 -0
  85. package/dist/skills/performance/references/performance-optimization-guide.md +365 -0
  86. package/dist/skills/product-design/SKILL.md +843 -0
  87. package/dist/skills/product-design/references/characteristic-detection.md +92 -0
  88. package/dist/skills/product-design/references/interaction-patterns.md +206 -0
  89. package/dist/skills/product-design/references/visual-companion.md +190 -0
  90. package/dist/skills/product-design/server/index.ts +359 -0
  91. package/dist/skills/product-design/server/template.html +256 -0
  92. package/dist/skills/quick-bugfix/SKILL.md +241 -0
  93. package/dist/skills/research/SKILL.md +493 -0
  94. package/dist/skills/research/references/brainstorming-techniques.md +84 -0
  95. package/dist/skills/research/references/design-techniques.md +40 -0
  96. package/dist/skills/research/references/research-methodologies.md +710 -0
  97. package/dist/skills/standards-discover/SKILL.md +236 -0
  98. package/dist/skills/standards-discover/references/aggregation-strategy.md +76 -0
  99. package/dist/skills/standards-discover/references/code-pattern-prompt.md +68 -0
  100. package/dist/skills/standards-discover/references/config-analyzer-prompt.md +67 -0
  101. package/dist/skills/standards-discover/references/docs-extractor-prompt.md +65 -0
  102. package/dist/skills/standards-discover/references/external-analyzer-prompt.md +75 -0
  103. package/dist/skills/standards-update/SKILL.md +159 -0
  104. package/package.json +44 -43
@@ -0,0 +1,236 @@
1
+ ---
2
+ name: standards-discover
3
+ description: Discover coding standards from project configuration files, code patterns, documentation, and external sources (PRs, CI/CD)
4
+ user-invocable: true
5
+ ---
6
+
7
+ # Standards Discovery Skill
8
+
9
+ Analyzes multiple project sources in parallel to discover coding standards, conventions, and best practices. Aggregates findings with confidence scoring, presents for user approval, and applies approved standards via `docs-manager` skill.
10
+
11
+ ## Core Principles
12
+
13
+ 1. **Parallel Execution**: Launch discovery subagents concurrently for speed (~45-60s vs ~2-4min sequential)
14
+ 2. **Evidence-Based**: Every finding must cite specific files, line counts, or config rules as evidence
15
+ 3. **Confidence Scoring**: Multi-factor confidence based on source count, consistency, and explicitness
16
+ 4. **Deduplication**: Same standard found across sources merges into single finding with combined evidence
17
+ 5. **Graceful Degradation**: Skip unavailable sources (no gh CLI, no docs) without failing entire workflow
18
+
19
+ ---
20
+
21
+ ## Input Parameters
22
+
23
+ | Parameter | Default | Description |
24
+ | ----------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
25
+ | `--scope` | `full` | Discovery scope: `full`, `quick`, or any category name (baseline: `global`, `frontend`, `backend`, `testing`; custom categories also supported) |
26
+ | `--confidence` | `60` | Minimum confidence threshold (0-100) for displaying findings |
27
+ | `--auto-apply` | `false` | Auto-apply standards with confidence >= 90% without asking |
28
+ | `--skip-external` | `false` | Skip GitHub PR analysis and CI/CD sources |
29
+ | `--pr-count` | `20` | Number of recent merged PRs to analyze |
30
+
31
+ **Scope determines which phases run:**
32
+
33
+ | Scope | Config (P1) | Code (P2) | Docs (P3) | External (P4) |
34
+ | ---------- | ---------------- | -------------- | --------- | ------------- |
35
+ | `full` | Yes | Yes | Yes | Yes |
36
+ | `global` | Yes | Yes (limited) | Yes | Yes |
37
+ | `frontend` | FE configs | FE files | Yes | Yes |
38
+ | `backend` | BE configs | BE files | Yes | Yes |
39
+ | `testing` | Test configs | Test files | Yes | Yes |
40
+ | `quick` | Yes | No | No | No |
41
+ | `[custom]` | Relevant configs | Filtered files | Yes | Yes |
42
+
43
+ Custom scope values are matched against existing `.owflow/docs/standards/*/` directories and filter analysis to relevant files.
44
+
45
+ ---
46
+
47
+ ## Phase Configuration
48
+
49
+ | Phase | Subject | activeForm |
50
+ | ----- | -------------------------------- | ---------------------------------- |
51
+ | 1 | Plan discovery scope | Planning discovery scope |
52
+ | 2 | Analyze configuration files | Analyzing configuration files |
53
+ | 3 | Mine code patterns | Mining code patterns |
54
+ | 4 | Extract documentation standards | Extracting documentation standards |
55
+ | 5 | Analyze external sources | Analyzing external sources |
56
+ | 6 | Aggregate & deduplicate findings | Aggregating findings |
57
+ | 7 | Review findings with user | Reviewing findings |
58
+ | 8 | Apply approved standards | Applying standards |
59
+ | 9 | Generate summary report | Generating summary |
60
+
61
+ **Task Tracking**: At start of Phase 1, use `TaskCreate` for all phases above (pending). Set dependencies: Phases 2-5 blocked by Phase 1 (they run in parallel after planning). Phase 6 blocked by Phases 2-5. Phases 7-9 sequential. At each phase start: `TaskUpdate` to `in_progress`. At each phase end: `TaskUpdate` to `completed`. For phases skipped due to scope (e.g., Phases 3-4 when `--scope=quick`), mark `completed` with `metadata: {skipped: true, reason: "scope=quick"}`.
62
+
63
+ ---
64
+
65
+ ## Execution Workflow
66
+
67
+ ### Phase 1: Planning & Initialization
68
+
69
+ 1. **Parse options** from command arguments
70
+ 2. **Check prerequisites**: Verify `.owflow/docs/` exists. If not, offer to run `/flow-init` first
71
+ 3. **Read existing standards** from `.owflow/docs/INDEX.md` to identify updates vs creates and avoid duplicates
72
+ 4. **Display discovery plan** showing scope, sources, and estimated time
73
+ 5. **Get user confirmation** via question before proceeding
74
+
75
+ ---
76
+
77
+ ### Phase 2-5: Parallel Discovery
78
+
79
+ > **CRITICAL: Launch all applicable subagents in ONE message for parallel execution.**
80
+
81
+ **Step 1: Determine which phases to run** based on scope and flags.
82
+
83
+ **Step 1.5: Create temp output directory** — Run `mktemp -d` via Bash to create a unique temp directory for this invocation. Store the path (e.g., `/tmp/abc123`). Each subagent will write its results to a dedicated file in this directory: `{tmpdir}/config.yml`, `{tmpdir}/code.yml`, `{tmpdir}/docs.yml`, `{tmpdir}/external.yml`.
84
+
85
+ **Step 2: Read prompt templates**
86
+
87
+ > **STOP — Do NOT skip this step. Do NOT write prompts from memory.**
88
+
89
+ Use the Read tool to load ONLY the reference files for phases you will execute:
90
+
91
+ | Phase | Condition | Read This File |
92
+ | ------------------- | ------------------------- | ---------------------------------------- |
93
+ | 2: Config Analysis | Always | `references/config-analyzer-prompt.md` |
94
+ | 3: Code Patterns | scope != `quick` | `references/code-pattern-prompt.md` |
95
+ | 4: Documentation | scope != `quick` | `references/docs-extractor-prompt.md` |
96
+ | 5: External Sources | `--skip-external` not set | `references/external-analyzer-prompt.md` |
97
+
98
+ **SELF-CHECK**: Did you read the template files with the Read tool? If not, go back and read them now.
99
+
100
+ **Step 3: Adapt templates** — Replace `[scope]`, `[confidence]`, and other placeholders with actual values. Replace the `[output_file]` placeholder in each template with the actual temp file path for that phase (e.g., `{tmpdir}/config.yml`).
101
+
102
+ **Step 4: Launch subagents in parallel** — Use the Task tool with `subagent_type: general-purpose` for each phase.
103
+
104
+ > ❌ **WRONG** — launching one agent per message, waiting for result, then launching the next.
105
+ > ✅ **CORRECT** — launching ALL applicable agents (2–4 Task calls) in a SINGLE message.
106
+
107
+ **Step 5: Wait** for ALL subagents to complete, then read each temp file using the Read tool to collect findings.
108
+
109
+ **Step 6: Display progress** — Show count of findings per phase.
110
+
111
+ ---
112
+
113
+ ### Phase 6: Aggregation & Deduplication
114
+
115
+ **Read** `references/aggregation-strategy.md` for confidence scoring methodology.
116
+
117
+ 1. **Combine** all findings from Phases 2-5
118
+ 2. **Deduplicate** by grouping on `category + standard_name` — merge evidence and sources
119
+ 3. **Calculate final confidence** using multi-factor scoring from the reference
120
+ 4. **Detect conflicts** — flag contradictory standards (e.g., ESLint says semicolons, Prettier says no)
121
+ 5. **Categorize** into High (>= 80%), Medium (60-79%), Low (< 60%)
122
+ 6. **Filter** by `--confidence` threshold
123
+
124
+ Display aggregation summary: total raw findings, unique standards, conflicts detected.
125
+
126
+ ---
127
+
128
+ ### Phase 7: User Review & Approval
129
+
130
+ **Step 1: Present full summary table** — Before any approval prompts, output ALL findings in a table grouped by confidence level. Each group has a header with count:
131
+
132
+ ```
133
+ ### High Confidence (>=80%) — 5 standards
134
+
135
+ | # | Standard | Category | Score | Sources | Description |
136
+ |---|----------|----------|-------|---------|-------------|
137
+ | 1 | no-semicolons | global | 92 | config, code, docs | Omit semicolons in all JS/TS files |
138
+ | 2 | ... | ... | ... | ... | ... |
139
+
140
+ ### Medium Confidence (60-79%) — 3 standards
141
+ ...
142
+
143
+ ### Low Confidence (<60%) — 2 standards
144
+ ...
145
+
146
+ ### Conflicts — 1 detected
147
+ | # | Standard | Conflict | Sources A | Sources B |
148
+ ```
149
+
150
+ The **Sources** column lists all contributing sources for each finding (config, code, docs, PRs, CI, pre-commit). This gives users full visibility before making decisions.
151
+
152
+ **Step 2: Approval flow** — After the summary table:
153
+
154
+ - **High confidence (>= 80%)**: Use question offering batch approval ("Apply all N high-confidence standards") or individual drill-down review. For drill-down, show full detail per finding: all evidence items with source attribution, examples (preferred/avoid), and confidence score breakdown (which factors contributed how many points).
155
+
156
+ - **Medium confidence (60-79%)**: Present each individually with full detail (evidence, examples, confidence breakdown). Use question with Accept/Modify/Skip options per finding.
157
+
158
+ - **Low confidence (< threshold)**: Show the summary table rows only. Offer to expand details or skip all.
159
+
160
+ - **Conflicts**: Present each conflict showing both sides with their evidence and sources. Use question to resolve (pick side A, pick side B, skip, or custom).
161
+
162
+ If `--auto-apply` is set, automatically approve findings with confidence >= 90% and only prompt for the rest.
163
+
164
+ ---
165
+
166
+ ### Phase 8: Application
167
+
168
+ > **DELEGATION REQUIRED**: Do NOT write standard files directly using Write/Edit tools. ALL file operations MUST go through the `docs-operator` subagent (Task tool).
169
+ >
170
+ > **SELF-CHECK before each file operation**: "Am I about to write a file directly? STOP — invoke docs-operator via Task tool instead."
171
+
172
+ For each approved standard:
173
+
174
+ 1. **Prepare content** — Standard name, description, examples (preferred/avoid), rationale from evidence, source citations. Format each standard as a `###` heading with 1-10 lines description (excluding code snippets). Group related standards into the same topic file. Add brief code examples only when they clarify the practice.
175
+ 2. **Check if file exists** — Determine create vs update action
176
+ 3. **Invoke `docs-operator` subagent** via Task tool (subagent_type: `docs-operator`) — Pass prepared content. For creates: new file. For updates: merge new findings with existing. Wait for completion, then continue with the next standard.
177
+ 4. **After all standards applied, invoke `docs-operator` subagent** via Task tool to regenerate INDEX.md. Wait for completion, then continue with step 5.
178
+ 5. **Invoke `docs-operator` subagent** via Task tool to verify AGENTS.md integration — ensure standards directory is referenced. Wait for completion, then display the application summary.
179
+
180
+ Display application summary: created count, updated count, total active.
181
+
182
+ ---
183
+
184
+ ### Phase 9: Summary Report
185
+
186
+ Display final results:
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)
192
+
193
+ ---
194
+
195
+ ## Error Handling
196
+
197
+ | Situation | Strategy |
198
+ | ----------------------- | ----------------------------------------------------- |
199
+ | `.owflow/docs/` missing | Offer `/flow-init`, abort if declined |
200
+ | gh CLI unavailable | Skip PR analysis, continue with other sources |
201
+ | GitHub API rate limit | Skip PR analysis, note in report |
202
+ | Config file parse error | Skip that file, log warning, continue |
203
+ | No standards found | Suggest lowering threshold or checking specific scope |
204
+ | docs-manager fails | Offer retry/skip/cancel per standard |
205
+ | Subagent returns empty | Note in report, proceed with available findings |
206
+
207
+ ---
208
+
209
+ ## Integration
210
+
211
+ | Integrates With | How |
212
+ | ------------------------------------ | ---------------------------------------------------------------- |
213
+ | `docs-manager` skill | Creates/updates standard files, regenerates INDEX.md |
214
+ | `implementation-plan-executor` skill | Discovered standards immediately available via INDEX.md |
215
+ | `standards-update` command | Complementary: discover = automated bulk, update = manual single |
216
+
217
+ ---
218
+
219
+ ## Examples
220
+
221
+ ```bash
222
+ # Full discovery (default)
223
+ /standards-discover
224
+
225
+ # Quick scan (config files only, ~30-60s)
226
+ /standards-discover --scope=quick
227
+
228
+ # Frontend standards only
229
+ /standards-discover --scope=frontend
230
+
231
+ # High confidence, auto-apply
232
+ /standards-discover --confidence=80 --auto-apply
233
+
234
+ # Skip external analysis (offline/no GitHub)
235
+ /standards-discover --skip-external
236
+ ```
@@ -0,0 +1,76 @@
1
+ # Aggregation Strategy — Confidence Scoring & Deduplication
2
+
3
+ ## Deduplication Rules
4
+
5
+ Group findings by `category + standard_name`. When multiple findings match:
6
+
7
+ 1. **Merge evidence** — Combine all evidence items from all sources
8
+ 2. **Track sources** — Note which phases contributed (config, code, docs, external)
9
+ 3. **Take strongest description** — Prefer documented > config > code-inferred
10
+ 4. **Preserve examples** — Combine unique examples
11
+
12
+ ## Confidence Scoring
13
+
14
+ Calculate final confidence using these factors:
15
+
16
+ ### Source Count (max 45 points)
17
+ - Each unique source: +15 points (config, code-patterns, documentation, pr-reviews, ci-config, pre-commit)
18
+ - Cap at 45 points (3+ sources)
19
+
20
+ ### Consistency (max 20 points)
21
+ - >= 90% consistency across sampled files: +20
22
+ - 70-89% consistency: +10
23
+ - < 70% consistency: +0
24
+
25
+ ### Explicitness (max 15 points)
26
+ - Found in config file (explicit rule): +15
27
+ - Found in documentation (explicitly stated): +10
28
+ - Inferred from code patterns only: +5
29
+
30
+ ### Evidence Strength (max 20 points)
31
+ - Per evidence item: +5 points, cap at 20 (4+ evidence items)
32
+
33
+ ### PR Feedback Boost (max 10 points)
34
+ - 5+ PR reviews mention this: +10
35
+ - 3-4 PR reviews: +5
36
+
37
+ **Final score**: Sum of factors, capped at 100.
38
+
39
+ ## Conflict Detection
40
+
41
+ Flag conflicts when two findings for the same aspect give contradictory guidance:
42
+
43
+ - Same tool, different settings (e.g., ESLint vs Prettier disagreeing on semicolons)
44
+ - Documentation says one thing, config enforces another
45
+ - Code patterns don't match documented standards
46
+
47
+ Present each conflict to user with both sides and evidence.
48
+
49
+ ## Confidence Categories
50
+
51
+ | Level | Range | Guidance |
52
+ |-------|-------|----------|
53
+ | High | >= 80% | Strong evidence, multiple sources. Safe to apply. |
54
+ | Medium | 60-79% | Some evidence, may need clarification. Review recommended. |
55
+ | Low | < 60% | Weak or inconsistent patterns. May indicate area needing standardization. |
56
+
57
+ ## Presentation Order
58
+
59
+ 1. High confidence findings (batch approval option)
60
+ 2. Medium confidence findings (individual review)
61
+ 3. Conflicts (resolution required)
62
+ 4. Low confidence findings (informational, skip option)
63
+
64
+ ## Presentation Format
65
+
66
+ Before approval prompts, present a **full summary table** grouped by confidence level. Each finding row shows:
67
+
68
+ - **Standard name** and **category**
69
+ - **Confidence score** (numeric, 0-100)
70
+ - **Sources** — all contributing sources listed (e.g., "config, code, docs"). This is key for user trust and decision-making.
71
+ - **Brief description** (one line, truncated if needed)
72
+
73
+ When drilling into individual findings (medium confidence, or user-requested drill-down), show:
74
+ - Full description and examples (preferred/avoid patterns)
75
+ - Evidence items with source attribution (which source provided each piece of evidence)
76
+ - Confidence score breakdown: show points from each factor (source count, consistency, explicitness, evidence strength, PR boost) so user understands why the score is what it is
@@ -0,0 +1,68 @@
1
+ # Code Pattern Analyzer — Subagent Prompt Template
2
+
3
+ Analyze source code patterns to discover coding conventions and standards used in the project.
4
+
5
+ ## Task
6
+
7
+ Sample code files, detect consistent patterns in naming/imports/structure, return findings as YAML.
8
+
9
+ ## Sampling Strategy
10
+
11
+ For performance, sample rather than exhaustive analysis:
12
+
13
+ - **Frontend files**: Sample up to 50 files (`*.ts`, `*.tsx`, `*.js`, `*.jsx`, `*.vue`, `*.svelte`)
14
+ - **Backend files**: Sample up to 50 files (`*.py`, `*.rb`, `*.java`, `*.go`, `*.rs`)
15
+ - **Test files**: Sample up to 30 files (`*.test.*`, `*.spec.*`, `*_test.*`)
16
+
17
+ Use Glob to find files, then Read a representative sample from different directories.
18
+
19
+ ## Patterns to Detect
20
+
21
+ 1. **File Naming**: PascalCase, kebab-case, snake_case, camelCase — calculate consistency %
22
+ 2. **Import Patterns**: Absolute vs relative, path aliases (`@/`), import grouping/sorting
23
+ 3. **Error Handling**: try/catch usage, custom error classes, error wrapping, logging patterns
24
+ 4. **Component Structure** (frontend): Functional vs class components, hooks usage, props patterns
25
+ 5. **API Patterns** (backend): Endpoint naming, resource naming (plural/singular), versioning
26
+ 6. **Function Style**: Arrow functions vs declarations, async/await vs promises
27
+ 7. **Type Patterns**: TypeScript strictness, type vs interface usage, generics patterns
28
+
29
+ ## Consistency Threshold
30
+
31
+ Only report patterns with **>= 60% consistency** across sampled files.
32
+
33
+ Calculate: `(files following pattern / total files sampled) * 100`
34
+
35
+ ## Categorization
36
+
37
+ Discover existing categories from `.owflow/docs/standards/*/`. Baseline categories: `global/`, `frontend/`, `backend/`, `testing/`. Propose new categories if patterns don't fit existing ones.
38
+
39
+ ## Confidence Range
40
+
41
+ Code pattern findings: **60-88%** confidence. Higher when consistency is >= 90%.
42
+
43
+ ## Output Format
44
+
45
+ Return YAML:
46
+
47
+ ```yaml
48
+ findings:
49
+ - category: "[category/subcategory]"
50
+ standard_name: "[Short Name]"
51
+ description: "[What the convention is]"
52
+ confidence: [60-88]
53
+ evidence:
54
+ - "[X] of [Y] files follow this pattern"
55
+ - "Examples: [file1], [file2], [file3]"
56
+ source: "code-patterns"
57
+ examples:
58
+ - "[Correct pattern example]"
59
+ ```
60
+
61
+ ## Rules
62
+
63
+ - Sample files randomly across directories for representative results
64
+ - Report file counts in evidence (e.g., "247 of 250 .tsx files use PascalCase")
65
+ - Only report patterns with >= 60% consistency
66
+ - Return empty findings list if no clear patterns emerge
67
+ - Focus on actionable, consistent patterns — not one-off occurrences
68
+ - Do NOT write any files to the project directory. Write your YAML results to: `[output_file]` (the orchestrator replaces this placeholder with an actual temp file path when invoking you).
@@ -0,0 +1,67 @@
1
+ # Config Standards Analyzer — Subagent Prompt Template
2
+
3
+ Analyze project configuration files to discover coding standards and conventions.
4
+
5
+ ## Task
6
+
7
+ Find and analyze configuration files, extract standards, return structured findings as YAML.
8
+
9
+ ## Configuration Files to Analyze
10
+
11
+ 1. **Linter configs**: `.eslintrc.*`, `.prettierrc*`, `pylintrc`, `.pylintrc`, `.rubocop.yml`, `biome.json`
12
+ 2. **Compiler configs**: `tsconfig.json`, `jsconfig.json`
13
+ 3. **Package managers**: `package.json` (scripts, conventions), `requirements.txt`, `Gemfile`, `pom.xml`, `go.mod`
14
+ 4. **Editor configs**: `.editorconfig` (indentation, line endings, charset)
15
+ 5. **Container configs**: `Dockerfile`, `docker-compose.yml`
16
+
17
+ ## What to Extract
18
+
19
+ For each config file found, extract rules/settings that indicate coding standards:
20
+
21
+ - **ESLint**: Naming conventions, code style (quotes, semicolons, indentation), framework patterns, import rules
22
+ - **Prettier**: Formatting rules (semi, singleQuote, trailingComma, tabWidth, printWidth)
23
+ - **TypeScript**: Compiler strictness (strict, noImplicitAny), module resolution, path aliases
24
+ - **Package.json**: Script patterns, testing conventions, pre-commit hooks (husky/lint-staged)
25
+ - **EditorConfig**: Indentation style/size, charset, line endings, trailing whitespace
26
+ - **Biome**: Combined lint + format rules
27
+
28
+ ## Categorization
29
+
30
+ Discover existing categories from `.owflow/docs/standards/*/`. Baseline categories:
31
+
32
+ - `global/` — Language-agnostic (indentation, line endings, general error handling)
33
+ - `frontend/` — UI-specific (React rules, CSS conventions, component patterns)
34
+ - `backend/` — Server-specific (API rules, database conventions)
35
+ - `testing/` — Test-related (test frameworks, coverage requirements)
36
+
37
+ Propose new categories if findings don't fit existing ones.
38
+
39
+ ## Confidence Range
40
+
41
+ Config-based findings: **70-85%** confidence (explicit configuration = strong evidence).
42
+
43
+ ## Output Format
44
+
45
+ Return YAML:
46
+
47
+ ```yaml
48
+ findings:
49
+ - category: "[category/subcategory]"
50
+ standard_name: "[Short Name]"
51
+ description: "[What the standard requires]"
52
+ confidence: [70-85]
53
+ evidence:
54
+ - "[config-file]: [specific rule or setting]"
55
+ source: "config"
56
+ examples:
57
+ - "[Brief correct example if applicable]"
58
+ ```
59
+
60
+ ## Rules
61
+
62
+ - Only include findings with clear evidence from actual config files
63
+ - Be specific in descriptions (not "follow ESLint rules" but "use single quotes for strings")
64
+ - Include exact file paths in evidence
65
+ - Return empty findings list if no config files found
66
+ - Focus on actionable, verifiable standards
67
+ - Do NOT write any files to the project directory. Write your YAML results to: `[output_file]` (the orchestrator replaces this placeholder with an actual temp file path when invoking you).
@@ -0,0 +1,65 @@
1
+ # Documentation Standards Extractor — Subagent Prompt Template
2
+
3
+ Extract coding standards and conventions explicitly documented in project files.
4
+
5
+ ## Task
6
+
7
+ Find and parse documentation files, extract explicitly stated standards, return findings as YAML.
8
+
9
+ ## Documentation Files to Analyze
10
+
11
+ 1. **README.md** — Look for: Code Style, Contributing Guidelines, Conventions, Best Practices sections
12
+ 2. **CONTRIBUTING.md** — PR requirements, commit conventions, testing requirements, code review standards
13
+ 3. **ARCHITECTURE.md** / `docs/architecture/` — Design patterns, architectural decisions
14
+ 4. **ADRs** (Architecture Decision Records) — `adr/`, `decisions/`, `docs/decisions/` directories
15
+ 5. **AGENTS.md** / `.claude/AGENTS.md` — AI-specific coding instructions and project conventions
16
+ 6. **Code of Conduct**, **STYLEGUIDE.md** — If present
17
+
18
+ ## What to Extract
19
+
20
+ Look for explicit standard statements:
21
+
22
+ - "We use..." / "This project uses..."
23
+ - "Always..." / "Never..."
24
+ - "Prefer X over Y"
25
+ - "Required: ..." / "Must..."
26
+ - Code examples showing correct/incorrect patterns
27
+ - Numbered rules or guidelines lists
28
+
29
+ **Only extract explicitly stated standards** — do not infer from code examples alone.
30
+
31
+ ## Categorization
32
+
33
+ Discover existing categories from `.owflow/docs/standards/*/`. Baseline categories: `global/`, `frontend/`, `backend/`, `testing/`. Propose new categories if patterns don't fit existing ones.
34
+
35
+ ## Confidence Range
36
+
37
+ Documentation findings: **80-92%** confidence (explicitly documented = strong evidence).
38
+
39
+ Higher end (90+) when multiple docs agree or when stated as mandatory rules.
40
+
41
+ ## Output Format
42
+
43
+ Return YAML:
44
+
45
+ ```yaml
46
+ findings:
47
+ - category: "[category/subcategory]"
48
+ standard_name: "[Short Name]"
49
+ description: "[What the standard requires]"
50
+ confidence: [80-92]
51
+ evidence:
52
+ - '[filename]: "[exact quote or paraphrase]"'
53
+ source: "documentation"
54
+ examples:
55
+ - "[Example from docs if provided]"
56
+ ```
57
+
58
+ ## Rules
59
+
60
+ - Include exact quotes or close paraphrases in evidence
61
+ - Note which file each standard comes from
62
+ - Return empty findings list if no documentation files found
63
+ - Prioritize actionable, clear standards over vague guidance
64
+ - Do not duplicate what config files already enforce — focus on human-written guidelines
65
+ - Do NOT write any files to the project directory. Write your YAML results to: `[output_file]` (the orchestrator replaces this placeholder with an actual temp file path when invoking you).
@@ -0,0 +1,75 @@
1
+ # External Standards Analyzer — Subagent Prompt Template
2
+
3
+ Analyze pull requests, CI/CD configurations, and pre-commit hooks to discover enforced standards.
4
+
5
+ ## Task
6
+
7
+ Mine external sources for standards evidence, return findings as YAML.
8
+
9
+ ## Sources to Analyze
10
+
11
+ ### 1. Pull Requests (via gh CLI)
12
+
13
+ **First check availability:**
14
+ ```bash
15
+ which gh && gh auth status
16
+ ```
17
+
18
+ If gh CLI available:
19
+ - Get last `[pr_count]` merged PRs: `gh pr list --state merged --limit [pr_count] --json number,title`
20
+ - For each PR, check review comments for repeated feedback patterns
21
+ - Look for: "Please use...", "Always...", "Avoid...", "Per our convention...", "Style:", "Nit:"
22
+ - Only report patterns that appear in **3+ different PRs** (significant feedback, not one-off)
23
+
24
+ If gh CLI unavailable: skip PR analysis, note in output, not an error.
25
+
26
+ ### 2. CI/CD Workflows
27
+
28
+ - **GitHub Actions**: `.github/workflows/*.yml`
29
+ - **GitLab CI**: `.gitlab-ci.yml`
30
+ - **Other**: `Jenkinsfile`, `.circleci/config.yml`, `.travis.yml`
31
+
32
+ Extract: lint steps, test requirements, coverage thresholds, build quality gates, pre-deployment checks.
33
+
34
+ ### 3. Pre-commit Hooks
35
+
36
+ - **Husky**: `.husky/` directory (pre-commit, pre-push scripts)
37
+ - **pre-commit framework**: `.pre-commit-config.yaml`
38
+ - **lint-staged**: `lint-staged` config in `package.json` or `.lintstagedrc`
39
+
40
+ Extract: mandatory checks, formatting enforcement, commit message validation.
41
+
42
+ ## Confidence Ranges
43
+
44
+ | Source | Confidence Range | Rationale |
45
+ |--------|-----------------|-----------|
46
+ | CI/CD enforced standards | 85-95% | Enforced by automation — very reliable |
47
+ | Pre-commit hooks | 80-90% | Actively enforced on every commit |
48
+ | PR review patterns (5+ PRs) | 70-80% | Strong team consensus |
49
+ | PR review patterns (3-4 PRs) | 60-70% | Emerging pattern |
50
+
51
+ ## Output Format
52
+
53
+ Return YAML:
54
+
55
+ ```yaml
56
+ github_available: true # or false
57
+ findings:
58
+ - category: "[category/subcategory]"
59
+ standard_name: "[Short Name]"
60
+ description: "[What the standard requires]"
61
+ confidence: [60-95]
62
+ evidence:
63
+ - "[source]: [specific evidence]"
64
+ source: "[pr-reviews|ci-config|pre-commit]"
65
+ examples: []
66
+ ```
67
+
68
+ ## Rules
69
+
70
+ - Handle gh CLI gracefully — return `github_available: false` and empty PR findings, not error
71
+ - Only report PR patterns appearing in 3+ different PRs
72
+ - For CI/CD: extract specific thresholds and rules, not just "runs tests"
73
+ - Return empty findings list if no external sources available
74
+ - Be specific: "80% coverage required" not "has coverage check"
75
+ - Do NOT write any files to the project directory. Write your YAML results to: `[output_file]` (the orchestrator replaces this placeholder with an actual temp file path when invoking you).