wogiflow 1.0.17 → 1.0.18

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 (60) hide show
  1. package/.workflow/specs/architecture.md.template +24 -0
  2. package/.workflow/specs/stack.md.template +33 -0
  3. package/.workflow/specs/testing.md.template +36 -0
  4. package/.workflow/templates/api-map.md.template +37 -0
  5. package/.workflow/templates/claude-md.hbs +57 -7
  6. package/.workflow/templates/function-map.md.template +33 -0
  7. package/lib/installer.js +3 -1
  8. package/package.json +1 -1
  9. package/scripts/flow +52 -3
  10. package/scripts/flow-api-index.js +803 -0
  11. package/scripts/flow-context-compact/expander.js +430 -0
  12. package/scripts/flow-context-compact/index.js +295 -0
  13. package/scripts/flow-context-compact/section-extractor.js +345 -0
  14. package/scripts/flow-context-compact/summary-tree.js +464 -0
  15. package/scripts/flow-done.js +903 -11
  16. package/scripts/flow-durable-session.js +1 -1
  17. package/scripts/flow-epics.js +978 -0
  18. package/scripts/flow-error-recovery.js +788 -0
  19. package/scripts/flow-feature.js +797 -0
  20. package/scripts/flow-function-index.js +607 -0
  21. package/scripts/flow-hooks-install.js +291 -0
  22. package/scripts/flow-hooks.js +1 -0
  23. package/scripts/flow-hybrid-interactive.js +243 -33
  24. package/scripts/flow-hypothesis-generator.js +651 -0
  25. package/scripts/flow-item-link.js +272 -0
  26. package/scripts/flow-knowledge-sync.js +13 -9
  27. package/scripts/flow-morning.js +20 -7
  28. package/scripts/flow-orchestrate.js +48 -10
  29. package/scripts/flow-parallel.js +39 -0
  30. package/scripts/flow-phased-task.js +548 -0
  31. package/scripts/flow-plan.js +798 -0
  32. package/scripts/flow-ready.js +52 -1
  33. package/scripts/flow-review-passes/index.js +447 -0
  34. package/scripts/flow-review-passes/integration.js +637 -0
  35. package/scripts/flow-review-passes/logic.js +419 -0
  36. package/scripts/flow-review-passes/security.js +463 -0
  37. package/scripts/flow-review-passes/structure.js +378 -0
  38. package/scripts/flow-review.js +458 -0
  39. package/scripts/flow-scanner-base.js +302 -0
  40. package/scripts/flow-semantic-match.js +460 -0
  41. package/scripts/flow-session-end.js +157 -0
  42. package/scripts/flow-session-learning.js +770 -0
  43. package/scripts/flow-session-state.js +150 -1
  44. package/scripts/flow-setup-hooks +63 -8
  45. package/scripts/flow-spec-verifier.js +819 -0
  46. package/scripts/flow-start.js +251 -4
  47. package/scripts/flow-story.js +102 -74
  48. package/scripts/{flow-loop-enforcer.js → flow-task-enforcer.js} +101 -85
  49. package/scripts/flow-utils.js +684 -22
  50. package/scripts/hooks/adapters/claude-code.js +78 -7
  51. package/scripts/hooks/core/component-check.js +123 -90
  52. package/scripts/hooks/core/index.js +6 -1
  53. package/scripts/hooks/core/session-context.js +51 -8
  54. package/scripts/hooks/core/setup-check.js +6 -8
  55. package/scripts/hooks/core/setup-handler.js +216 -0
  56. package/scripts/hooks/core/task-gate.js +26 -16
  57. package/scripts/hooks/entry/claude-code/session-start.js +25 -0
  58. package/scripts/hooks/entry/claude-code/setup.js +68 -0
  59. package/scripts/hooks/git/post-commit.js +153 -0
  60. package/scripts/flow-new-feature +0 -86
@@ -0,0 +1,24 @@
1
+ # Architecture
2
+
3
+ ## Pattern
4
+
5
+ <!-- Detected during onboarding -->
6
+ <!-- Examples: MVC, Clean Architecture, DDD, Microservices, Monolith -->
7
+
8
+ ## Structure
9
+
10
+ <!-- Project structure overview -->
11
+ <!-- Key directories and their purposes -->
12
+
13
+ ## Key Decisions
14
+
15
+ <!-- Architecture decisions made for this project -->
16
+ <!-- Trade-offs and rationale -->
17
+
18
+ ## Dependencies
19
+
20
+ <!-- Major dependencies and their purposes -->
21
+
22
+ ---
23
+
24
+ *This file is auto-populated during `flow onboard`. Update manually as architecture evolves.*
@@ -0,0 +1,33 @@
1
+ # Tech Stack
2
+
3
+ ## Framework
4
+
5
+ <!-- Primary framework (e.g., Next.js, NestJS, FastAPI) -->
6
+
7
+ ## Language
8
+
9
+ <!-- Primary language (e.g., TypeScript, Python, Go) -->
10
+
11
+ ## Database
12
+
13
+ <!-- Database system if applicable (e.g., PostgreSQL, MongoDB) -->
14
+
15
+ ## Package Manager
16
+
17
+ <!-- npm, yarn, pnpm, pip, etc. -->
18
+
19
+ ## Build Tools
20
+
21
+ <!-- Build and bundling tools (e.g., Vite, Webpack, esbuild) -->
22
+
23
+ ## Testing
24
+
25
+ <!-- Test frameworks (e.g., Jest, Vitest, pytest) -->
26
+
27
+ ## Other Tools
28
+
29
+ <!-- Linters, formatters, CI/CD tools -->
30
+
31
+ ---
32
+
33
+ *This file is auto-populated during `flow onboard`. Update manually as stack evolves.*
@@ -0,0 +1,36 @@
1
+ # Testing
2
+
3
+ ## Test Framework
4
+
5
+ <!-- Primary test framework (e.g., Jest, Vitest, pytest) -->
6
+
7
+ ## Test Commands
8
+
9
+ ```bash
10
+ # Run all tests
11
+ npm test
12
+
13
+ # Run tests in watch mode
14
+ npm run test:watch
15
+
16
+ # Run specific test file
17
+ npm test -- path/to/test.ts
18
+ ```
19
+
20
+ ## Test Structure
21
+
22
+ <!-- Where tests are located -->
23
+ <!-- Naming conventions -->
24
+
25
+ ## Coverage
26
+
27
+ <!-- Coverage requirements if any -->
28
+ <!-- Coverage commands -->
29
+
30
+ ## E2E Testing
31
+
32
+ <!-- E2E framework if used (e.g., Playwright, Cypress) -->
33
+
34
+ ---
35
+
36
+ *This file is auto-populated during `flow onboard`. Update manually as testing strategy evolves.*
@@ -0,0 +1,37 @@
1
+ # API Registry
2
+
3
+ Quick reference of API calls and endpoints. **Check before creating anything new.**
4
+
5
+ > Run `flow api-index scan` to populate this file.
6
+
7
+ ---
8
+
9
+ ## User Endpoints
10
+
11
+ | Endpoint | Method | Purpose | File |
12
+ |----------|--------|---------|------|
13
+ | `/api/users` | GET | Fetch all users | `src/api/users.ts` |
14
+ | `/api/users/:id` | GET | Fetch single user | `src/api/users.ts` |
15
+
16
+ ---
17
+
18
+ ## API Client Functions
19
+
20
+ ### Users
21
+
22
+ | Function | Method | Endpoint | File |
23
+ |----------|--------|----------|------|
24
+ | `fetchUsers` | GET | /api/users | `src/api/users.ts` |
25
+ | `createUser` | POST | /api/users | `src/api/users.ts` |
26
+
27
+ ---
28
+
29
+ ## Rules
30
+
31
+ 1. **Before creating** → Search this file for existing API calls
32
+ 2. **If similar exists** → Extend with parameter or options
33
+ 3. **After creating** → Run `flow api-index scan` to update
34
+
35
+ ---
36
+
37
+ Last scanned: _Not yet scanned_
@@ -37,16 +37,25 @@ Check `.workflow/state/ready.json` for existing tasks.
37
37
 
38
38
  ### Step 3: Assess task size
39
39
 
40
- | Size | Criteria | Action |
41
- |------|----------|--------|
42
- | **Small** | < {{config.enforcement.taskSizeThresholds.small.maxFiles}} files, < {{config.enforcement.taskSizeThresholds.small.maxHours}} hour, obvious scope | Create task inline, proceed with `/wogi-start` |
43
- | **Medium** | {{config.enforcement.taskSizeThresholds.small.maxFiles}}-{{config.enforcement.taskSizeThresholds.medium.maxFiles}} files, {{config.enforcement.taskSizeThresholds.small.maxHours}}-{{config.enforcement.taskSizeThresholds.medium.maxHours}} hours, some complexity | **STOP** - Create story first |
44
- | **Large** | > {{config.enforcement.taskSizeThresholds.medium.maxFiles}} files, > {{config.enforcement.taskSizeThresholds.medium.maxHours}} hours, new feature | **STOP** - Create story first |
40
+ | Level | Type | Files | Criteria | Action |
41
+ |-------|------|-------|----------|--------|
42
+ | L3 | **Subtask** | 1 | Atomic operation, trivial | Execute inline |
43
+ | L2 | **Task** | 1-5 | Single concern, 1-3 AC | Create task, proceed with `/wogi-start` |
44
+ | L1 | **Story** | 5-15 | Multi-component, 3-10 AC | **STOP** - Create story first |
45
+ | L0 | **Epic** | 15+ | New subsystem, 3+ stories | **STOP** - Create epic, decompose to stories |
45
46
 
46
- ### For Medium/Large Tasks:
47
+ **Classification Keywords:**
48
+ - Epic indicators: system, architecture, migration, redesign, platform
49
+ - Story indicators: feature, flow, integration, module, workflow
50
+ - Task indicators: add, fix, update, change, remove
47
51
 
52
+ Note: WogiFlow can auto-classify requests. If unsure, default to creating a story for medium+ requests.
53
+
54
+ ### For Story/Epic Requests:
55
+
56
+ **For Stories (L1):**
48
57
  ```
49
- This looks like a medium/large task.
58
+ This looks like a story-level feature (5-15 files).
50
59
 
51
60
  Before I start implementing, I need to create a story with acceptance criteria.
52
61
 
@@ -60,6 +69,22 @@ Then:
60
69
  2. **WAIT for user approval** on the story
61
70
  3. Only then proceed with `/wogi-start`
62
71
 
72
+ **For Epics (L0):**
73
+ ```
74
+ This is a large feature that qualifies as an Epic (15+ files, multiple stories).
75
+
76
+ I'll need to decompose this into stories first.
77
+
78
+ **Proposed epic:** "[title based on request]"
79
+
80
+ Should I create this epic and decompose it into stories for your approval?
81
+ ```
82
+
83
+ Then:
84
+ 1. Run `/wogi-epic "[title]"` to create the epic with story breakdown
85
+ 2. **WAIT for user approval** on the epic structure
86
+ 3. Start with the first story using `/wogi-start`
87
+
63
88
  **This is NON-NEGOTIABLE when strict mode is enabled.**
64
89
 
65
90
  ---
@@ -175,6 +200,29 @@ After EVERY request that changes files:
175
200
  2. Search codebase for existing
176
201
  3. Priority: Use existing → Add variant → Extend → Create new (last resort)
177
202
 
203
+ ## Function & API Reuse
204
+
205
+ **Before creating ANY new utility function or API call:**
206
+
207
+ 1. **Check `function-map.md`** for existing utilities
208
+ - Search by purpose (date formatting, validation, parsing)
209
+ - Check if extending an existing function makes sense
210
+
211
+ 2. **Check `api-map.md`** for existing API endpoints
212
+ - Search by entity type (users, products, orders)
213
+ - Check if existing endpoint can be parameterized
214
+
215
+ 3. **Evaluate**: Can you extend an existing item instead of creating new?
216
+ - Same intent? → Extend with variant/parameter
217
+ - Similar but different? → Create new, reference existing
218
+ - Completely new? → Create and register
219
+
220
+ **Decision criteria**: Does extending require LESS effort AND make logical sense?
221
+
222
+ **After creating new functions/APIs:**
223
+ - Run `flow function-index scan` to update the function registry
224
+ - Run `flow api-index scan` to update the API registry
225
+
178
226
  {{#if skills}}
179
227
  ## Installed Skills
180
228
 
@@ -193,6 +241,8 @@ Check `.claude/skills/[name]/skill.md` for skill-specific guidance.
193
241
  | Tasks | `.workflow/state/ready.json` |
194
242
  | Logs | `.workflow/state/request-log.md` |
195
243
  | Components | `.workflow/state/app-map.md` |
244
+ | Functions | `.workflow/state/function-map.md` |
245
+ | APIs | `.workflow/state/api-map.md` |
196
246
  | Rules | `.workflow/state/decisions.md` |
197
247
  | Progress | `.workflow/state/progress.md` |
198
248
  | Roadmap | `.workflow/roadmap.md` |
@@ -0,0 +1,33 @@
1
+ # Function Registry
2
+
3
+ Quick reference of utility functions. **Check before creating anything new.**
4
+
5
+ > Run `flow function-index scan` to populate this file.
6
+
7
+ ---
8
+
9
+ ## Utilities
10
+
11
+ | Function | Purpose | File | Parameters |
12
+ |----------|---------|------|------------|
13
+ | _Example_ | Format dates for display | `src/utils/date.ts` | date: Date, format?: string |
14
+
15
+ ---
16
+
17
+ ## Helpers
18
+
19
+ | Function | Purpose | File | Parameters |
20
+ |----------|---------|------|------------|
21
+ | _Example_ | Validate email format | `src/helpers/validation.ts` | email: string |
22
+
23
+ ---
24
+
25
+ ## Rules
26
+
27
+ 1. **Before creating** → Search this file
28
+ 2. **If similar exists** → Extend with parameter, don't create new
29
+ 3. **After creating** → Run `flow function-index scan` to update
30
+
31
+ ---
32
+
33
+ Last scanned: _Not yet scanned_
package/lib/installer.js CHANGED
@@ -254,7 +254,9 @@ function createWorkflowStructure(projectRoot, config) {
254
254
  { name: 'request-log.md', content: '# Request Log\n\nAutomatic log of all requests that changed files.\n\n---\n' },
255
255
  { name: 'decisions.md', content: '# Project Decisions\n\nKey decisions and patterns for this project.\n\n---\n' },
256
256
  { name: 'app-map.md', content: '# Application Map\n\nComponent registry for this project.\n\n---\n' },
257
- { name: 'progress.md', content: '# Progress Notes\n\nSession handoff notes.\n\n---\n' }
257
+ { name: 'progress.md', content: '# Progress Notes\n\nSession handoff notes.\n\n---\n' },
258
+ { name: 'function-map.md', content: '# Function Registry\n\nUtility function registry. Run `flow function-index scan` to populate.\n\n---\n' },
259
+ { name: 'api-map.md', content: '# API Registry\n\nAPI calls registry. Run `flow api-index scan` to populate.\n\n---\n' }
258
260
  ];
259
261
 
260
262
  for (const file of stateFiles) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wogiflow",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "description": "AI-powered development workflow management system with multi-model support",
5
5
  "main": "lib/index.js",
6
6
  "bin": {
package/scripts/flow CHANGED
@@ -92,8 +92,17 @@ show_help() {
92
92
  echo " map-index scan Rescan codebase"
93
93
  echo " map-sync Compare index with app-map"
94
94
  echo ""
95
+ echo "Functions & APIs:"
96
+ echo " function-index scan Scan for utility functions"
97
+ echo " function-index show Show function details"
98
+ echo " function-index map Regenerate function-map.md"
99
+ echo " api-index scan Scan for API calls"
100
+ echo " api-index show Show API function or endpoint"
101
+ echo " api-index map Regenerate api-map.md"
102
+ echo ""
95
103
  echo "Skills & Learning:"
96
104
  echo " skill-learn Extract learnings from recent changes"
105
+ echo " auto-learn Auto-learn from session reviews and bug fixes"
97
106
  echo " skill-create <name> Create a new skill"
98
107
  echo " skill-create --list List existing skills"
99
108
  echo " skill detect Detect frameworks in project"
@@ -108,6 +117,22 @@ show_help() {
108
117
  echo " correct list List recent corrections"
109
118
  echo " aggregate Aggregate learnings across skills"
110
119
  echo " aggregate --promote Interactive promotion wizard"
120
+ echo " pattern-enforce Enforce patterns from decisions/app-map"
121
+ echo ""
122
+ echo "Code Analysis:"
123
+ echo " code-intel analyze Analyze imports/exports in codebase"
124
+ echo " code-intel deps Show dependency graph"
125
+ echo " review Code review with auto multi-pass detection"
126
+ echo " review --multipass Force multi-pass review mode"
127
+ echo ""
128
+ echo "Error Recovery:"
129
+ echo " error-recovery analyze Analyze error output hierarchically"
130
+ echo " error-recovery status Show recovery session status"
131
+ echo ""
132
+ echo "Epics:"
133
+ echo " epic list List all epics"
134
+ echo " epic show <id> Show epic details and progress"
135
+ echo " epic create Create a new epic"
111
136
  echo ""
112
137
  echo "Code Traces:"
113
138
  echo " trace \"<prompt>\" Generate task-focused code trace"
@@ -419,9 +444,33 @@ case "${1:-}" in
419
444
  map-sync)
420
445
  "$SCRIPT_DIR/flow-map-sync" "${@:2}"
421
446
  ;;
447
+ function-index)
448
+ node "$SCRIPT_DIR/flow-function-index.js" "${@:2}"
449
+ ;;
450
+ api-index)
451
+ node "$SCRIPT_DIR/flow-api-index.js" "${@:2}"
452
+ ;;
422
453
  skill-learn)
423
454
  node "$SCRIPT_DIR/flow-skill-learn.js" "${@:2}"
424
455
  ;;
456
+ auto-learn)
457
+ node "$SCRIPT_DIR/flow-auto-learn.js" "${@:2}"
458
+ ;;
459
+ code-intel|code-intelligence)
460
+ node "$SCRIPT_DIR/flow-code-intelligence.js" "${@:2}"
461
+ ;;
462
+ error-recovery)
463
+ node "$SCRIPT_DIR/flow-error-recovery.js" "${@:2}"
464
+ ;;
465
+ epic|epics)
466
+ node "$SCRIPT_DIR/flow-epics.js" "${@:2}"
467
+ ;;
468
+ pattern-enforce)
469
+ node "$SCRIPT_DIR/flow-pattern-enforcer.js" "${@:2}"
470
+ ;;
471
+ review)
472
+ node "$SCRIPT_DIR/flow-review.js" "${@:2}"
473
+ ;;
425
474
  correct)
426
475
  node "$SCRIPT_DIR/flow-correct.js" "${@:2}"
427
476
  ;;
@@ -486,13 +535,13 @@ case "${1:-}" in
486
535
  loop)
487
536
  case "${2:-status}" in
488
537
  status)
489
- node "$SCRIPT_DIR/flow-loop-enforcer.js" status
538
+ node "$SCRIPT_DIR/flow-task-enforcer.js" status
490
539
  ;;
491
540
  stats)
492
- node "$SCRIPT_DIR/flow-loop-enforcer.js" stats
541
+ node "$SCRIPT_DIR/flow-task-enforcer.js" stats
493
542
  ;;
494
543
  can-exit)
495
- node "$SCRIPT_DIR/flow-loop-enforcer.js" can-exit
544
+ node "$SCRIPT_DIR/flow-task-enforcer.js" can-exit
496
545
  ;;
497
546
  enable)
498
547
  node "$SCRIPT_DIR/flow-config-set.js" loops.enforced true