wogiflow 1.0.21 → 1.0.22
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.
- package/.claude/commands/wogi-bug.md +43 -0
- package/.claude/commands/wogi-bulk.md +144 -0
- package/.claude/commands/wogi-changelog.md +36 -0
- package/.claude/commands/wogi-compact.md +99 -0
- package/.claude/commands/wogi-config.md +50 -0
- package/.claude/commands/wogi-context.md +68 -0
- package/.claude/commands/wogi-correction.md +73 -0
- package/.claude/commands/wogi-debt.md +128 -0
- package/.claude/commands/wogi-deps.md +32 -0
- package/.claude/commands/wogi-epics.md +145 -0
- package/.claude/commands/wogi-export.md +100 -0
- package/.claude/commands/wogi-feature.md +149 -0
- package/.claude/commands/wogi-guided-edit.md +83 -0
- package/.claude/commands/wogi-health.md +43 -0
- package/.claude/commands/wogi-help.md +96 -0
- package/.claude/commands/wogi-hybrid-edit.md +36 -0
- package/.claude/commands/wogi-hybrid-off.md +24 -0
- package/.claude/commands/wogi-hybrid-setup.md +79 -0
- package/.claude/commands/wogi-hybrid-status.md +45 -0
- package/.claude/commands/wogi-hybrid.md +54 -0
- package/.claude/commands/wogi-import.md +44 -0
- package/.claude/commands/wogi-init.md +618 -0
- package/.claude/commands/wogi-log.md +38 -0
- package/.claude/commands/wogi-map-add.md +29 -0
- package/.claude/commands/wogi-map-check.md +35 -0
- package/.claude/commands/wogi-map-index.md +98 -0
- package/.claude/commands/wogi-map-scan.md +38 -0
- package/.claude/commands/wogi-map-sync.md +91 -0
- package/.claude/commands/wogi-map.md +33 -0
- package/.claude/commands/wogi-morning.md +65 -0
- package/.claude/commands/wogi-onboard.md +99 -0
- package/.claude/commands/wogi-plan.md +173 -0
- package/.claude/commands/wogi-ready.md +84 -0
- package/.claude/commands/wogi-resume.md +95 -0
- package/.claude/commands/wogi-review.md +636 -0
- package/.claude/commands/wogi-roadmap.md +241 -0
- package/.claude/commands/wogi-rules.md +104 -0
- package/.claude/commands/wogi-search.md +33 -0
- package/.claude/commands/wogi-session-end.md +49 -0
- package/.claude/commands/wogi-setup-stack.md +151 -0
- package/.claude/commands/wogi-skill-learn.md +66 -0
- package/.claude/commands/wogi-skills.md +87 -0
- package/.claude/commands/wogi-standup.md +28 -0
- package/.claude/commands/wogi-start.md +465 -0
- package/.claude/commands/wogi-status.md +41 -0
- package/.claude/commands/wogi-statusline-setup/skill.md +109 -0
- package/.claude/commands/wogi-story.md +98 -0
- package/.claude/commands/wogi-suspend.md +87 -0
- package/.claude/commands/wogi-test-browser.md +43 -0
- package/.claude/commands/wogi-trace.md +198 -0
- package/.claude/docs/architecture.md +37 -0
- package/.claude/docs/commands.md +343 -0
- package/.claude/docs/knowledge-base/01-setup-onboarding/README.md +177 -0
- package/.claude/docs/knowledge-base/01-setup-onboarding/component-indexing.md +341 -0
- package/.claude/docs/knowledge-base/01-setup-onboarding/framework-detection.md +269 -0
- package/.claude/docs/knowledge-base/01-setup-onboarding/installation.md +146 -0
- package/.claude/docs/knowledge-base/01-setup-onboarding/onboarding-existing.md +317 -0
- package/.claude/docs/knowledge-base/01-setup-onboarding/team-setup.md +346 -0
- package/.claude/docs/knowledge-base/02-task-execution/01-task-planning.md +259 -0
- package/.claude/docs/knowledge-base/02-task-execution/02-execution-loop.md +443 -0
- package/.claude/docs/knowledge-base/02-task-execution/03-verification.md +417 -0
- package/.claude/docs/knowledge-base/02-task-execution/04-completion.md +374 -0
- package/.claude/docs/knowledge-base/02-task-execution/05-session-review.md +170 -0
- package/.claude/docs/knowledge-base/02-task-execution/README.md +173 -0
- package/.claude/docs/knowledge-base/02-task-execution/external-integrations.md +133 -0
- package/.claude/docs/knowledge-base/02-task-execution/model-management.md +202 -0
- package/.claude/docs/knowledge-base/02-task-execution/specification-mode.md +292 -0
- package/.claude/docs/knowledge-base/02-task-execution/sync-daemon.md +96 -0
- package/.claude/docs/knowledge-base/02-task-execution/trade-offs.md +345 -0
- package/.claude/docs/knowledge-base/02-task-execution/workflow-steps.md +357 -0
- package/.claude/docs/knowledge-base/03-self-improvement/README.md +199 -0
- package/.claude/docs/knowledge-base/03-self-improvement/long-input-processing.md +160 -0
- package/.claude/docs/knowledge-base/03-self-improvement/model-learning.md +334 -0
- package/.claude/docs/knowledge-base/03-self-improvement/project-learning.md +301 -0
- package/.claude/docs/knowledge-base/03-self-improvement/skill-learning.md +372 -0
- package/.claude/docs/knowledge-base/03-self-improvement/skill-matching.md +304 -0
- package/.claude/docs/knowledge-base/03-self-improvement/team-learning.md +342 -0
- package/.claude/docs/knowledge-base/04-memory-context/README.md +189 -0
- package/.claude/docs/knowledge-base/04-memory-context/context-management.md +308 -0
- package/.claude/docs/knowledge-base/04-memory-context/memory-commands.md +176 -0
- package/.claude/docs/knowledge-base/04-memory-context/memory-systems.md +359 -0
- package/.claude/docs/knowledge-base/04-memory-context/prd-management.md +115 -0
- package/.claude/docs/knowledge-base/04-memory-context/session-persistence.md +359 -0
- package/.claude/docs/knowledge-base/04-memory-context/team-history.md +317 -0
- package/.claude/docs/knowledge-base/05-development-tools/README.md +84 -0
- package/.claude/docs/knowledge-base/05-development-tools/code-traces.md +278 -0
- package/.claude/docs/knowledge-base/05-development-tools/figma-analyzer.md +253 -0
- package/.claude/docs/knowledge-base/05-development-tools/guided-edit.md +173 -0
- package/.claude/docs/knowledge-base/05-development-tools/mcp-integrations.md +286 -0
- package/.claude/docs/knowledge-base/06-safety-guardrails/README.md +153 -0
- package/.claude/docs/knowledge-base/06-safety-guardrails/checkpoint-rollback.md +302 -0
- package/.claude/docs/knowledge-base/06-safety-guardrails/commit-gates.md +309 -0
- package/.claude/docs/knowledge-base/06-safety-guardrails/damage-control.md +292 -0
- package/.claude/docs/knowledge-base/06-safety-guardrails/security-scanning.md +291 -0
- package/.claude/docs/knowledge-base/README.md +92 -0
- package/.claude/docs/knowledge-base/configuration/README.md +228 -0
- package/.claude/docs/knowledge-base/configuration/all-options.md +1632 -0
- package/.claude/docs/knowledge-base/future-features.md +277 -0
- package/.claude/docs/stack.md +25 -0
- package/.claude/docs/testing.md +71 -0
- package/.claude/rules/README.md +60 -0
- package/.claude/rules/architecture/component-reuse.md +38 -0
- package/.claude/rules/architecture/document-structure.md +76 -0
- package/.claude/rules/architecture/feature-refactoring-cleanup.md +87 -0
- package/.claude/rules/architecture/model-management.md +35 -0
- package/.claude/rules/code-style/naming-conventions.md +55 -0
- package/.claude/rules/security/security-patterns.md +116 -0
- package/.claude/skills/.gitkeep +0 -0
- package/.claude/skills/README.md +131 -0
- package/.claude/skills/_template/commands/.gitkeep +0 -0
- package/.claude/skills/_template/knowledge/anti-patterns.md +49 -0
- package/.claude/skills/_template/knowledge/learnings.md +60 -0
- package/.claude/skills/_template/knowledge/patterns.md +45 -0
- package/.claude/skills/_template/rules/.gitkeep +0 -0
- package/.claude/skills/_template/skill.md +99 -0
- package/.claude/skills/_template/templates/.gitkeep +0 -0
- package/.claude/skills/figma-analyzer/knowledge/anti-patterns.md +216 -0
- package/.claude/skills/figma-analyzer/knowledge/patterns.md +144 -0
- package/.claude/skills/figma-analyzer/skill.md +236 -0
- package/lib/installer.js +59 -19
- package/package.json +5 -1
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# Task Execution Flow
|
|
2
|
+
|
|
3
|
+
The `/wogi-start` command initiates a structured execution pipeline that ensures thorough, high-quality task completion. This is the heart of WogiFlow.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## The Execution Pipeline
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
1. Task Selection → 2. Planning → 3. Execution Loop → 4. Verification → 5. Completion
|
|
11
|
+
───────────────── ───────────── ────────────────── ────────────── ────────────
|
|
12
|
+
• Task gating • Story creation • Self-completing • Auto-inference • Logging
|
|
13
|
+
• Size assessment • Acceptance • Durable sessions • Quality gates • Commits
|
|
14
|
+
• Dependency check criteria • Suspend/resume • Browser tests • Archival
|
|
15
|
+
• Decomposition • Hybrid mode • Cleanup
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Why This Matters
|
|
21
|
+
|
|
22
|
+
**The Problem**: Without structure, AI tends to:
|
|
23
|
+
- Start coding without understanding the full scope
|
|
24
|
+
- Miss edge cases and error handling
|
|
25
|
+
- Leave tasks incomplete when "good enough"
|
|
26
|
+
- Skip verification and break other features
|
|
27
|
+
|
|
28
|
+
**The Solution**: WogiFlow enforces a pipeline that:
|
|
29
|
+
- Gates implementation behind proper planning
|
|
30
|
+
- Loops until ALL acceptance criteria pass
|
|
31
|
+
- Verifies changes don't break existing functionality
|
|
32
|
+
- Documents everything for future context
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Quick Start
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# See available tasks
|
|
40
|
+
/wogi-ready
|
|
41
|
+
|
|
42
|
+
# Start a task (enters execution pipeline)
|
|
43
|
+
/wogi-start TASK-012
|
|
44
|
+
|
|
45
|
+
# Create a story with acceptance criteria first
|
|
46
|
+
/wogi-story "Add user authentication"
|
|
47
|
+
|
|
48
|
+
# Complete the task (runs quality gates)
|
|
49
|
+
/wogi-done TASK-012
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Pipeline Steps
|
|
55
|
+
|
|
56
|
+
### Step 1: Task Selection & Planning
|
|
57
|
+
Before any code is written, ensure the task is properly scoped.
|
|
58
|
+
|
|
59
|
+
**Key Features:**
|
|
60
|
+
- **Task Gating**: Implementation requires an existing task (no ad-hoc coding)
|
|
61
|
+
- **Size Assessment**: Small/Medium/Large determines planning depth
|
|
62
|
+
- **Story Creation**: Detailed acceptance criteria for non-trivial tasks
|
|
63
|
+
|
|
64
|
+
[Read more: Task Planning](./01-task-planning.md)
|
|
65
|
+
|
|
66
|
+
### Step 2: Execution Loop
|
|
67
|
+
The core loop that ensures thorough completion.
|
|
68
|
+
|
|
69
|
+
**Key Features:**
|
|
70
|
+
- **Self-Completing Loops**: Cannot exit until all criteria pass
|
|
71
|
+
- **Durable Sessions**: Crash recovery and progress tracking
|
|
72
|
+
- **Suspend/Resume**: Handle long-running or blocked tasks
|
|
73
|
+
- **Hybrid Mode**: Use local LLM for execution (85-95% token savings)
|
|
74
|
+
|
|
75
|
+
[Read more: Execution Loop](./02-execution-loop.md)
|
|
76
|
+
|
|
77
|
+
### Step 3: Verification
|
|
78
|
+
Automated checks that validate the implementation.
|
|
79
|
+
|
|
80
|
+
**Key Features:**
|
|
81
|
+
- **Auto-Inference**: Automatic verification of file existence, function exports, etc.
|
|
82
|
+
- **Quality Gates**: Lint, typecheck, test requirements per task type
|
|
83
|
+
- **Browser Testing**: Visual verification for UI changes
|
|
84
|
+
- **Pattern Enforcement**: Ensure code follows project decisions
|
|
85
|
+
|
|
86
|
+
[Read more: Verification](./03-verification.md)
|
|
87
|
+
|
|
88
|
+
### Step 4: Completion
|
|
89
|
+
Proper wrap-up and documentation.
|
|
90
|
+
|
|
91
|
+
**Key Features:**
|
|
92
|
+
- **Request Logging**: Every change documented with tags
|
|
93
|
+
- **App-Map Updates**: New components registered
|
|
94
|
+
- **Commit Handling**: Approval workflow based on task type
|
|
95
|
+
- **Session Archival**: Preserve context for learning
|
|
96
|
+
|
|
97
|
+
[Read more: Completion](./04-completion.md)
|
|
98
|
+
|
|
99
|
+
### Step 5: Session Review (Optional)
|
|
100
|
+
Comprehensive code review before finalizing changes.
|
|
101
|
+
|
|
102
|
+
**Key Features:**
|
|
103
|
+
- **3 Parallel Agents**: Code/Logic, Security, Architecture
|
|
104
|
+
- **Natural Triggers**: Say "please review" to run
|
|
105
|
+
- **Consolidated Report**: Issues ranked by severity
|
|
106
|
+
|
|
107
|
+
[Read more: Session Review](./05-session-review.md)
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Essential Configuration
|
|
112
|
+
|
|
113
|
+
```json
|
|
114
|
+
{
|
|
115
|
+
"enforcement": {
|
|
116
|
+
"strictMode": true, // Require tasks for implementation
|
|
117
|
+
"requireTaskForImplementation": true, // Block ad-hoc coding
|
|
118
|
+
"requireStoryForMediumTasks": true // Medium+ tasks need stories
|
|
119
|
+
},
|
|
120
|
+
"loops": {
|
|
121
|
+
"enforced": true, // Cannot exit until complete
|
|
122
|
+
"maxRetries": 5, // Failed verification retries
|
|
123
|
+
"maxIterations": 20 // Total loop cycles
|
|
124
|
+
},
|
|
125
|
+
"qualityGates": {
|
|
126
|
+
"feature": {
|
|
127
|
+
"require": ["tests", "appMapUpdate", "requestLogEntry"]
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Trade-offs
|
|
136
|
+
|
|
137
|
+
Understanding the trade-offs helps you configure WogiFlow for your needs:
|
|
138
|
+
|
|
139
|
+
| Setting | Higher Value | Lower Value |
|
|
140
|
+
|---------|-------------|-------------|
|
|
141
|
+
| `loops.maxRetries` | More thorough, more tokens | Faster, might miss issues |
|
|
142
|
+
| `loops.enforced` | Guaranteed completion | Manual control |
|
|
143
|
+
| `qualityGates` | Fewer bugs in production | Faster development |
|
|
144
|
+
| `hybrid.enabled` | 85-95% token savings | Full Claude quality |
|
|
145
|
+
|
|
146
|
+
[Read more: Trade-offs](./trade-offs.md)
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Additional Features
|
|
151
|
+
|
|
152
|
+
### External Integrations
|
|
153
|
+
Import tasks from Jira and Linear for seamless project management integration.
|
|
154
|
+
|
|
155
|
+
[Read more: External Integrations](./external-integrations.md)
|
|
156
|
+
|
|
157
|
+
### Background Sync
|
|
158
|
+
Keep workflow state synchronized across multiple sessions.
|
|
159
|
+
|
|
160
|
+
[Read more: Sync Daemon](./sync-daemon.md)
|
|
161
|
+
|
|
162
|
+
### Model Management
|
|
163
|
+
Registry, routing, and statistics for multiple LLM providers.
|
|
164
|
+
|
|
165
|
+
[Read more: Model Management](./model-management.md)
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Related
|
|
170
|
+
|
|
171
|
+
- [Commands Reference](../../commands.md) - All slash commands
|
|
172
|
+
- [Configuration Reference](../configuration/all-options.md) - All config options
|
|
173
|
+
- [Safety & Guardrails](../06-safety-guardrails/) - Damage control, checkpoints
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# External Integrations
|
|
2
|
+
|
|
3
|
+
Import and sync tasks from external project management tools.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Supported Integrations
|
|
8
|
+
|
|
9
|
+
| Platform | Script | Commands |
|
|
10
|
+
|----------|--------|----------|
|
|
11
|
+
| Jira | `flow-jira-integration.js` | `flow jira list/sync/push/config` |
|
|
12
|
+
| Linear | `flow-linear-integration.js` | `flow linear list/sync/push/config` |
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Jira Integration
|
|
17
|
+
|
|
18
|
+
### Configuration
|
|
19
|
+
|
|
20
|
+
Add to `.workflow/config.json`:
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"integrations": {
|
|
25
|
+
"jira": {
|
|
26
|
+
"enabled": true,
|
|
27
|
+
"baseUrl": "https://yourcompany.atlassian.net",
|
|
28
|
+
"projectKey": "PROJ",
|
|
29
|
+
"apiToken": "$JIRA_API_TOKEN",
|
|
30
|
+
"email": "your@email.com"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Commands
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# List assigned issues
|
|
40
|
+
flow jira list
|
|
41
|
+
|
|
42
|
+
# Import issues to ready.json
|
|
43
|
+
flow jira sync
|
|
44
|
+
|
|
45
|
+
# Push completed tasks back to Jira
|
|
46
|
+
flow jira push
|
|
47
|
+
|
|
48
|
+
# Show configuration
|
|
49
|
+
flow jira config
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Environment Variables
|
|
53
|
+
|
|
54
|
+
- `JIRA_API_TOKEN` - Your Jira API token
|
|
55
|
+
- `JIRA_EMAIL` - Your Jira email (optional, can be in config)
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Linear Integration
|
|
60
|
+
|
|
61
|
+
### Configuration
|
|
62
|
+
|
|
63
|
+
Add to `.workflow/config.json`:
|
|
64
|
+
|
|
65
|
+
```json
|
|
66
|
+
{
|
|
67
|
+
"integrations": {
|
|
68
|
+
"linear": {
|
|
69
|
+
"enabled": true,
|
|
70
|
+
"apiKey": "$LINEAR_API_KEY",
|
|
71
|
+
"teamId": "TEAM-123"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Commands
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# List assigned issues
|
|
81
|
+
flow linear list
|
|
82
|
+
|
|
83
|
+
# Import issues to ready.json
|
|
84
|
+
flow linear sync
|
|
85
|
+
|
|
86
|
+
# Push completed tasks back to Linear
|
|
87
|
+
flow linear push
|
|
88
|
+
|
|
89
|
+
# Show configuration
|
|
90
|
+
flow linear config
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Environment Variables
|
|
94
|
+
|
|
95
|
+
- `LINEAR_API_KEY` - Your Linear API key
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Combined View
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
# List tasks from all integrations
|
|
103
|
+
flow external-tasks
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Task Mapping
|
|
109
|
+
|
|
110
|
+
When importing, external tasks are mapped to WogiFlow tasks:
|
|
111
|
+
|
|
112
|
+
| External Field | WogiFlow Field |
|
|
113
|
+
|----------------|----------------|
|
|
114
|
+
| Title/Summary | `title` |
|
|
115
|
+
| Description | `description` |
|
|
116
|
+
| Priority | `priority` |
|
|
117
|
+
| Labels/Tags | `tags` |
|
|
118
|
+
| Issue Key | `externalId` |
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Sync Behavior
|
|
123
|
+
|
|
124
|
+
- **Import**: Creates new tasks in `ready.json` with `source: "jira"` or `source: "linear"`
|
|
125
|
+
- **Push**: Updates external issue status when task is completed via `/wogi-done`
|
|
126
|
+
- **Duplicates**: Checks `externalId` to avoid re-importing same issue
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Related
|
|
131
|
+
|
|
132
|
+
- [Task Planning](./01-task-planning.md) - How tasks are structured
|
|
133
|
+
- [Background Sync](./sync-daemon.md) - Automated sync
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# Model Management
|
|
2
|
+
|
|
3
|
+
Registry, routing, and statistics for LLM models.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
WogiFlow supports multiple LLM providers and tracks performance to optimize model selection.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Model Registry
|
|
14
|
+
|
|
15
|
+
**Script**: `flow-models.js`
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# List all registered models
|
|
19
|
+
flow models list
|
|
20
|
+
|
|
21
|
+
# Show detailed model info
|
|
22
|
+
flow models info <model>
|
|
23
|
+
|
|
24
|
+
# Get routing recommendation for task type
|
|
25
|
+
flow models route <task-type>
|
|
26
|
+
|
|
27
|
+
# Show performance statistics
|
|
28
|
+
flow models stats
|
|
29
|
+
|
|
30
|
+
# Show cost analysis
|
|
31
|
+
flow models cost
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Model List Output
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
Registered Models
|
|
38
|
+
════════════════════════════════════════
|
|
39
|
+
claude-sonnet-4 Anthropic 200K context $$
|
|
40
|
+
claude-opus-4 Anthropic 200K context $$$
|
|
41
|
+
gpt-4o OpenAI 128K context $$
|
|
42
|
+
gemini-2.0-flash Google 1M context $
|
|
43
|
+
ollama-qwen Local 32K context Free
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Intelligent Routing
|
|
49
|
+
|
|
50
|
+
**Script**: `flow-model-router.js`
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# Get routing recommendation
|
|
54
|
+
flow route "<task description>"
|
|
55
|
+
|
|
56
|
+
# Use specific strategy
|
|
57
|
+
flow route --strategy quality-first "<task>"
|
|
58
|
+
flow route --strategy cost-optimized "<task>"
|
|
59
|
+
flow route --strategy learned "<task>"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Routing Strategies
|
|
63
|
+
|
|
64
|
+
| Strategy | Description |
|
|
65
|
+
|----------|-------------|
|
|
66
|
+
| `quality-first` | Prefer most capable model |
|
|
67
|
+
| `cost-optimized` | Minimize cost while meeting requirements |
|
|
68
|
+
| `learned` | Use historical success rates |
|
|
69
|
+
|
|
70
|
+
### Routing Factors
|
|
71
|
+
|
|
72
|
+
- Task complexity (estimated tokens)
|
|
73
|
+
- Required capabilities (code, reasoning, context)
|
|
74
|
+
- Historical success rate per model
|
|
75
|
+
- Cost constraints
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Cascade Fallback
|
|
80
|
+
|
|
81
|
+
**Script**: `flow-cascade.js`
|
|
82
|
+
|
|
83
|
+
Automatically try alternate models on repeated failures.
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# Show cascade state
|
|
87
|
+
flow cascade status
|
|
88
|
+
|
|
89
|
+
# Reset failure tracking
|
|
90
|
+
flow cascade reset
|
|
91
|
+
|
|
92
|
+
# Show configuration
|
|
93
|
+
flow cascade config
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Configuration
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"cascade": {
|
|
101
|
+
"enabled": true,
|
|
102
|
+
"fallbackModel": "claude-sonnet-4",
|
|
103
|
+
"maxFailuresBeforeEscalate": 3,
|
|
104
|
+
"escalateOnCategories": ["capability_mismatch", "context_overflow"]
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### How Cascade Works
|
|
110
|
+
|
|
111
|
+
1. Primary model fails 3x on same error category
|
|
112
|
+
2. System escalates to fallback model
|
|
113
|
+
3. Success rate tracked for future routing
|
|
114
|
+
4. Failure count resets after successful completion
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Model Adapter
|
|
119
|
+
|
|
120
|
+
**Script**: `flow-model-adapter.js`
|
|
121
|
+
|
|
122
|
+
Per-model prompt adaptations and learned corrections.
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
# Show current adapter info
|
|
126
|
+
flow model-adapter
|
|
127
|
+
|
|
128
|
+
# Show per-model statistics
|
|
129
|
+
flow model-adapter --stats
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Adapter Files
|
|
133
|
+
|
|
134
|
+
Located in `.workflow/model-adapters/`:
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
├── claude-default.md # Claude family defaults
|
|
138
|
+
├── claude-sonnet-4.md # Sonnet-specific
|
|
139
|
+
├── ollama-qwen.md # Local model adapter
|
|
140
|
+
└── _template.md # New adapter template
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Adapter Contents
|
|
144
|
+
|
|
145
|
+
- Prompt style preferences
|
|
146
|
+
- Known limitations
|
|
147
|
+
- Learned corrections
|
|
148
|
+
- Success patterns
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Performance Stats
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
flow models stats
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Output Example
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
Model Performance Statistics
|
|
162
|
+
════════════════════════════════════════
|
|
163
|
+
Model Success Avg Time Tasks
|
|
164
|
+
────────────────────────────────────────
|
|
165
|
+
claude-sonnet-4 94% 12.3s 234
|
|
166
|
+
claude-opus-4 98% 45.2s 45
|
|
167
|
+
ollama-qwen 78% 8.5s 156
|
|
168
|
+
gpt-4o 91% 15.1s 89
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## Tiered Learning
|
|
174
|
+
|
|
175
|
+
**Script**: `flow-tiered-learning.js`
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
# Show patterns by confidence tier
|
|
179
|
+
flow learning tiers
|
|
180
|
+
|
|
181
|
+
# Show learning statistics
|
|
182
|
+
flow learning stats
|
|
183
|
+
|
|
184
|
+
# Manually apply a pattern
|
|
185
|
+
flow learning apply <pattern-id>
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Learning Tiers
|
|
189
|
+
|
|
190
|
+
| Tier | Confidence | Behavior |
|
|
191
|
+
|------|------------|----------|
|
|
192
|
+
| Auto-Apply | 90%+ | Applied without prompt |
|
|
193
|
+
| Apply with Log | 70-90% | Applied, logged for review |
|
|
194
|
+
| Queue for Review | <70% | Held for manual approval |
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## Related
|
|
199
|
+
|
|
200
|
+
- [Execution Loop](./02-execution-loop.md) - How models are invoked
|
|
201
|
+
- [Hybrid Mode](./02-execution-loop.md#hybrid-mode) - Multi-model orchestration
|
|
202
|
+
- [Memory Commands](../04-memory-context/memory-commands.md) - Learning storage
|