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.
Files changed (121) hide show
  1. package/.claude/commands/wogi-bug.md +43 -0
  2. package/.claude/commands/wogi-bulk.md +144 -0
  3. package/.claude/commands/wogi-changelog.md +36 -0
  4. package/.claude/commands/wogi-compact.md +99 -0
  5. package/.claude/commands/wogi-config.md +50 -0
  6. package/.claude/commands/wogi-context.md +68 -0
  7. package/.claude/commands/wogi-correction.md +73 -0
  8. package/.claude/commands/wogi-debt.md +128 -0
  9. package/.claude/commands/wogi-deps.md +32 -0
  10. package/.claude/commands/wogi-epics.md +145 -0
  11. package/.claude/commands/wogi-export.md +100 -0
  12. package/.claude/commands/wogi-feature.md +149 -0
  13. package/.claude/commands/wogi-guided-edit.md +83 -0
  14. package/.claude/commands/wogi-health.md +43 -0
  15. package/.claude/commands/wogi-help.md +96 -0
  16. package/.claude/commands/wogi-hybrid-edit.md +36 -0
  17. package/.claude/commands/wogi-hybrid-off.md +24 -0
  18. package/.claude/commands/wogi-hybrid-setup.md +79 -0
  19. package/.claude/commands/wogi-hybrid-status.md +45 -0
  20. package/.claude/commands/wogi-hybrid.md +54 -0
  21. package/.claude/commands/wogi-import.md +44 -0
  22. package/.claude/commands/wogi-init.md +618 -0
  23. package/.claude/commands/wogi-log.md +38 -0
  24. package/.claude/commands/wogi-map-add.md +29 -0
  25. package/.claude/commands/wogi-map-check.md +35 -0
  26. package/.claude/commands/wogi-map-index.md +98 -0
  27. package/.claude/commands/wogi-map-scan.md +38 -0
  28. package/.claude/commands/wogi-map-sync.md +91 -0
  29. package/.claude/commands/wogi-map.md +33 -0
  30. package/.claude/commands/wogi-morning.md +65 -0
  31. package/.claude/commands/wogi-onboard.md +99 -0
  32. package/.claude/commands/wogi-plan.md +173 -0
  33. package/.claude/commands/wogi-ready.md +84 -0
  34. package/.claude/commands/wogi-resume.md +95 -0
  35. package/.claude/commands/wogi-review.md +636 -0
  36. package/.claude/commands/wogi-roadmap.md +241 -0
  37. package/.claude/commands/wogi-rules.md +104 -0
  38. package/.claude/commands/wogi-search.md +33 -0
  39. package/.claude/commands/wogi-session-end.md +49 -0
  40. package/.claude/commands/wogi-setup-stack.md +151 -0
  41. package/.claude/commands/wogi-skill-learn.md +66 -0
  42. package/.claude/commands/wogi-skills.md +87 -0
  43. package/.claude/commands/wogi-standup.md +28 -0
  44. package/.claude/commands/wogi-start.md +465 -0
  45. package/.claude/commands/wogi-status.md +41 -0
  46. package/.claude/commands/wogi-statusline-setup/skill.md +109 -0
  47. package/.claude/commands/wogi-story.md +98 -0
  48. package/.claude/commands/wogi-suspend.md +87 -0
  49. package/.claude/commands/wogi-test-browser.md +43 -0
  50. package/.claude/commands/wogi-trace.md +198 -0
  51. package/.claude/docs/architecture.md +37 -0
  52. package/.claude/docs/commands.md +343 -0
  53. package/.claude/docs/knowledge-base/01-setup-onboarding/README.md +177 -0
  54. package/.claude/docs/knowledge-base/01-setup-onboarding/component-indexing.md +341 -0
  55. package/.claude/docs/knowledge-base/01-setup-onboarding/framework-detection.md +269 -0
  56. package/.claude/docs/knowledge-base/01-setup-onboarding/installation.md +146 -0
  57. package/.claude/docs/knowledge-base/01-setup-onboarding/onboarding-existing.md +317 -0
  58. package/.claude/docs/knowledge-base/01-setup-onboarding/team-setup.md +346 -0
  59. package/.claude/docs/knowledge-base/02-task-execution/01-task-planning.md +259 -0
  60. package/.claude/docs/knowledge-base/02-task-execution/02-execution-loop.md +443 -0
  61. package/.claude/docs/knowledge-base/02-task-execution/03-verification.md +417 -0
  62. package/.claude/docs/knowledge-base/02-task-execution/04-completion.md +374 -0
  63. package/.claude/docs/knowledge-base/02-task-execution/05-session-review.md +170 -0
  64. package/.claude/docs/knowledge-base/02-task-execution/README.md +173 -0
  65. package/.claude/docs/knowledge-base/02-task-execution/external-integrations.md +133 -0
  66. package/.claude/docs/knowledge-base/02-task-execution/model-management.md +202 -0
  67. package/.claude/docs/knowledge-base/02-task-execution/specification-mode.md +292 -0
  68. package/.claude/docs/knowledge-base/02-task-execution/sync-daemon.md +96 -0
  69. package/.claude/docs/knowledge-base/02-task-execution/trade-offs.md +345 -0
  70. package/.claude/docs/knowledge-base/02-task-execution/workflow-steps.md +357 -0
  71. package/.claude/docs/knowledge-base/03-self-improvement/README.md +199 -0
  72. package/.claude/docs/knowledge-base/03-self-improvement/long-input-processing.md +160 -0
  73. package/.claude/docs/knowledge-base/03-self-improvement/model-learning.md +334 -0
  74. package/.claude/docs/knowledge-base/03-self-improvement/project-learning.md +301 -0
  75. package/.claude/docs/knowledge-base/03-self-improvement/skill-learning.md +372 -0
  76. package/.claude/docs/knowledge-base/03-self-improvement/skill-matching.md +304 -0
  77. package/.claude/docs/knowledge-base/03-self-improvement/team-learning.md +342 -0
  78. package/.claude/docs/knowledge-base/04-memory-context/README.md +189 -0
  79. package/.claude/docs/knowledge-base/04-memory-context/context-management.md +308 -0
  80. package/.claude/docs/knowledge-base/04-memory-context/memory-commands.md +176 -0
  81. package/.claude/docs/knowledge-base/04-memory-context/memory-systems.md +359 -0
  82. package/.claude/docs/knowledge-base/04-memory-context/prd-management.md +115 -0
  83. package/.claude/docs/knowledge-base/04-memory-context/session-persistence.md +359 -0
  84. package/.claude/docs/knowledge-base/04-memory-context/team-history.md +317 -0
  85. package/.claude/docs/knowledge-base/05-development-tools/README.md +84 -0
  86. package/.claude/docs/knowledge-base/05-development-tools/code-traces.md +278 -0
  87. package/.claude/docs/knowledge-base/05-development-tools/figma-analyzer.md +253 -0
  88. package/.claude/docs/knowledge-base/05-development-tools/guided-edit.md +173 -0
  89. package/.claude/docs/knowledge-base/05-development-tools/mcp-integrations.md +286 -0
  90. package/.claude/docs/knowledge-base/06-safety-guardrails/README.md +153 -0
  91. package/.claude/docs/knowledge-base/06-safety-guardrails/checkpoint-rollback.md +302 -0
  92. package/.claude/docs/knowledge-base/06-safety-guardrails/commit-gates.md +309 -0
  93. package/.claude/docs/knowledge-base/06-safety-guardrails/damage-control.md +292 -0
  94. package/.claude/docs/knowledge-base/06-safety-guardrails/security-scanning.md +291 -0
  95. package/.claude/docs/knowledge-base/README.md +92 -0
  96. package/.claude/docs/knowledge-base/configuration/README.md +228 -0
  97. package/.claude/docs/knowledge-base/configuration/all-options.md +1632 -0
  98. package/.claude/docs/knowledge-base/future-features.md +277 -0
  99. package/.claude/docs/stack.md +25 -0
  100. package/.claude/docs/testing.md +71 -0
  101. package/.claude/rules/README.md +60 -0
  102. package/.claude/rules/architecture/component-reuse.md +38 -0
  103. package/.claude/rules/architecture/document-structure.md +76 -0
  104. package/.claude/rules/architecture/feature-refactoring-cleanup.md +87 -0
  105. package/.claude/rules/architecture/model-management.md +35 -0
  106. package/.claude/rules/code-style/naming-conventions.md +55 -0
  107. package/.claude/rules/security/security-patterns.md +116 -0
  108. package/.claude/skills/.gitkeep +0 -0
  109. package/.claude/skills/README.md +131 -0
  110. package/.claude/skills/_template/commands/.gitkeep +0 -0
  111. package/.claude/skills/_template/knowledge/anti-patterns.md +49 -0
  112. package/.claude/skills/_template/knowledge/learnings.md +60 -0
  113. package/.claude/skills/_template/knowledge/patterns.md +45 -0
  114. package/.claude/skills/_template/rules/.gitkeep +0 -0
  115. package/.claude/skills/_template/skill.md +99 -0
  116. package/.claude/skills/_template/templates/.gitkeep +0 -0
  117. package/.claude/skills/figma-analyzer/knowledge/anti-patterns.md +216 -0
  118. package/.claude/skills/figma-analyzer/knowledge/patterns.md +144 -0
  119. package/.claude/skills/figma-analyzer/skill.md +236 -0
  120. package/lib/installer.js +59 -19
  121. package/package.json +5 -1
@@ -0,0 +1,277 @@
1
+ # Future Features
2
+
3
+ Planned and considered features for WogiFlow.
4
+
5
+ ---
6
+
7
+ ## Status Legend
8
+
9
+ | Status | Meaning |
10
+ |--------|---------|
11
+ | **Planned** | Will be implemented |
12
+ | **Backlog** | On request or when needed |
13
+ | **Considering** | Under evaluation |
14
+ | **Skipped** | Not planning to implement |
15
+
16
+ ---
17
+
18
+ ## Planned Features
19
+
20
+ ### Team Observability Dashboard
21
+
22
+ **Status**: Planned (with team tier launch)
23
+
24
+ Web UI for team-wide visibility:
25
+ - All runs with status
26
+ - Per-step spans with inputs/outputs
27
+ - Retry history and failure context
28
+ - Team-wide task dashboard
29
+ - Role-based access (admin, lead, member)
30
+
31
+ **Trigger**: Team tier launch with hosted database
32
+
33
+ ---
34
+
35
+ ### Enhanced Model Stats
36
+
37
+ **Status**: Planned
38
+
39
+ Track detailed success metrics per model:
40
+
41
+ ```json
42
+ {
43
+ "ollama-qwen": {
44
+ "successRate": 0.87,
45
+ "avgLatencyMs": 4500,
46
+ "failuresByCategory": {
47
+ "import_error": 12,
48
+ "type_error": 5
49
+ },
50
+ "byTaskType": {
51
+ "create-component": { "success": 45, "fail": 3 },
52
+ "fix-bug": { "success": 22, "fail": 8 }
53
+ }
54
+ }
55
+ }
56
+ ```
57
+
58
+ **Trigger**: Users asking "which model is best for X?"
59
+
60
+ ---
61
+
62
+ ### Tiered Learning Thresholds
63
+
64
+ **Status**: Planned
65
+
66
+ Smarter auto-application of learned patterns:
67
+
68
+ ```javascript
69
+ const LEARNING_TIERS = {
70
+ AUTO_APPLY: { minSuccessRate: 0.9, minSamples: 5 },
71
+ APPLY_WITH_LOG: { minSuccessRate: 0.7, minSamples: 3 },
72
+ QUEUE_FOR_REVIEW: { minSuccessRate: 0, minSamples: 0 }
73
+ };
74
+ ```
75
+
76
+ **Trigger**: Model adapter needs smarter auto-apply logic
77
+
78
+ ---
79
+
80
+ ## Backlog Features
81
+
82
+ ### Quality Gate Confidence
83
+
84
+ **Status**: Backlog
85
+
86
+ Don't apply low-confidence changes automatically:
87
+
88
+ ```javascript
89
+ const confidenceMarkers = {
90
+ high: ["I'm confident", "This will work", "Straightforward"],
91
+ low: ["I think", "might work", "not entirely sure"]
92
+ };
93
+ ```
94
+
95
+ **Trigger**: When bad outputs are frequently applied
96
+
97
+ ---
98
+
99
+ ### Context Priority Scoring
100
+
101
+ **Status**: Backlog
102
+
103
+ Smarter context selection than "include everything":
104
+
105
+ ```javascript
106
+ const CONTEXT_PRIORITIES = {
107
+ required_types: 1.0, // Always include
108
+ target_file: 0.95, // Almost always
109
+ related_imports: 0.8, // Usually helpful
110
+ patterns: 0.7, // Good to have
111
+ examples: 0.5, // Nice to have
112
+ full_files: 0.3 // Only if space
113
+ };
114
+ ```
115
+
116
+ **Trigger**: If context overflow becomes common
117
+
118
+ ---
119
+
120
+ ### Formalized Model Registry
121
+
122
+ **Status**: Backlog
123
+
124
+ Structured capability definitions per model:
125
+
126
+ ```json
127
+ {
128
+ "models": {
129
+ "gpt-4o-mini": {
130
+ "provider": "openai",
131
+ "contextWindow": 128000,
132
+ "costTier": "cheap",
133
+ "capabilities": ["code-generation", "structured-output"],
134
+ "structuredOutputReliability": "high"
135
+ }
136
+ }
137
+ }
138
+ ```
139
+
140
+ **Trigger**: When supporting 5+ executor models
141
+
142
+ ---
143
+
144
+ ## Multi-Model Features
145
+
146
+ Only implement if users have 3+ models configured.
147
+
148
+ ### Multi-Model Orchestration
149
+
150
+ **Status**: Considering
151
+
152
+ Route different tasks to optimal models:
153
+
154
+ ```json
155
+ {
156
+ "modelRouting": {
157
+ "orchestration": "claude-opus",
158
+ "exploration": "claude-haiku",
159
+ "frontend": "gemini-pro",
160
+ "debugging": "gpt-5",
161
+ "documentation": "claude-sonnet"
162
+ }
163
+ }
164
+ ```
165
+
166
+ **Trigger**: Users want to optimize cost/quality tradeoffs
167
+ **Risk**: Complexity, API key management, cost tracking
168
+
169
+ ---
170
+
171
+ ### Task Router
172
+
173
+ **Status**: Backlog
174
+
175
+ Automatically route task types to best models.
176
+
177
+ **Trigger**: Users with 3+ models asking for routing
178
+ **Risk**: Over-engineering for single-model users
179
+
180
+ ---
181
+
182
+ ### Parallel Dispatch
183
+
184
+ **Status**: Backlog
185
+
186
+ Execute independent subtasks on multiple models simultaneously.
187
+
188
+ **Trigger**: Users request parallel execution for speed
189
+ **Risk**: Complexity for unclear gain
190
+
191
+ ---
192
+
193
+ ## Skipped Features
194
+
195
+ We're skeptical these add value without strong evidence.
196
+
197
+ ### Structured JSON Contract
198
+
199
+ **Why Skipped**: Local LLMs can't reliably produce JSON
200
+ **Would Reconsider If**: New models achieve 95%+ JSON reliability
201
+ **Current Solution**: `flow-response-parser.js` handles messy output
202
+
203
+ ---
204
+
205
+ ### SQLite Telemetry
206
+
207
+ **Why Skipped**: JSON files work fine for 50 runs/day
208
+ **Would Reconsider If**: Users need complex queries across runs
209
+ **Concerns**: Native dependency, not human-readable, overkill
210
+
211
+ ---
212
+
213
+ ### Prompt Fragment System
214
+
215
+ **Why Skipped**: Current Handlebars templates work fine
216
+ **Would Reconsider If**: Templates become unmanageable (20+)
217
+
218
+ ---
219
+
220
+ ## Recently Implemented
221
+
222
+ These were on the backlog but have been completed:
223
+
224
+ | Feature | Implementation |
225
+ |---------|---------------|
226
+ | Jira Integration | flow-jira-integration.js - `flow jira list/sync/push` |
227
+ | Linear Integration | flow-linear-integration.js - `flow linear list/sync/push` |
228
+ | Cascade Fallback | flow-cascade.js - `flow cascade status/reset/config` |
229
+ | Background Sync Daemon | flow-sync-daemon.js - `flow sync-daemon start/stop/status` |
230
+ | PRD Management | flow-prd-manager.js - `flow prd load/context/list/clear` |
231
+ | Memory Sync | flow-memory-sync.js - `flow memory-sync --auto` |
232
+ | Entropy Monitor | flow-entropy-monitor.js - `flow entropy --auto` |
233
+ | Model Registry & Stats | flow-models.js - `flow models list/info/route/stats` |
234
+ | Model Router | flow-model-router.js - `flow route "<task>"` |
235
+ | Multi-Approach | flow-multi-approach.js - `flow multi-approach` |
236
+ | Complexity Assessment | flow-complexity.js - `flow complexity "<task>"` |
237
+ | Metrics & Analysis | flow-metrics.js - `flow metrics --problems` |
238
+ | Release Channels | lib/release-channel.js - `flow channel show/set/list` |
239
+ | Tiered Learning | flow-tiered-learning.js - `flow learning tiers/stats` |
240
+ | Failure Category Enum | `ERROR_CATEGORIES` in flow-adaptive-learning.js |
241
+ | Strategy Effectiveness | `flow hybrid learning effectiveness` |
242
+ | Learning Deduplication | 7-day window in flow-adaptive-learning.js |
243
+ | Community Contribution | `flow hybrid learning contribute --auto-pr` |
244
+ | Damage Control System | flow-damage-control.js |
245
+ | Auto-Inference Verification | flow-task-enforcer.js |
246
+ | Durable Sessions | flow-durable-session.js |
247
+ | Suspend/Resume | flow-suspend.js, flow-resume.js |
248
+ | agent_requested Rules | Rules have `alwaysApply` frontmatter for smart loading |
249
+ | Component Index Freshness | Post-task triggers, stale checks, git hooks |
250
+ | Guided Edit Mode | `/wogi-guided-edit` for step-by-step multi-file changes |
251
+ | Git Hooks Setup | `flow-setup-hooks.js` for pre-commit automation |
252
+
253
+ ---
254
+
255
+ ## How This Backlog Works
256
+
257
+ 1. **Review Quarterly**: Are users asking for any of these?
258
+ 2. **Promote on Demand**: Move items up when users request them
259
+ 3. **Delete if Stale**: Remove items no one asks about in 6 months
260
+ 4. **Track Triggers**: Note what would make each feature valuable
261
+
262
+ ---
263
+
264
+ ## Requesting Features
265
+
266
+ To request a feature from this backlog:
267
+ 1. Open an issue with use case
268
+ 2. Describe the pain point
269
+ 3. If compelling, feature gets promoted
270
+
271
+ ---
272
+
273
+ ## Related
274
+
275
+ - [Task Execution](./02-task-execution/) - Core execution features
276
+ - [Self-Improvement](./03-self-improvement/) - Learning system
277
+ - [Hybrid Mode](./02-task-execution/02-execution-loop.md#hybrid-mode) - Multi-model basics
@@ -0,0 +1,25 @@
1
+ # Tech Stack
2
+
3
+ ## Runtime
4
+ - Node.js 18+
5
+
6
+ ## Package Manager
7
+ - npm
8
+
9
+ ## Languages
10
+ - JavaScript (CommonJS)
11
+ - Shell scripts (Bash)
12
+
13
+ ## Key Dependencies
14
+ - fs, path (Node built-ins)
15
+ - crypto (for hash-based IDs)
16
+ - child_process (for git operations)
17
+
18
+ ## Development Tools
19
+ - Git for version control
20
+ - No build system (direct Node.js execution)
21
+
22
+ ---
23
+
24
+ Generated: 2026-01-11
25
+ Last synced: 2026-01-11
@@ -0,0 +1,71 @@
1
+ # Testing Strategy
2
+
3
+ <!-- PINS: test-commands, verification-gates, windows-testing -->
4
+
5
+ ## Current State
6
+ <!-- PIN: test-commands -->
7
+
8
+ - No formal test framework configured
9
+ - Manual testing via CLI commands
10
+
11
+ ## Test Commands
12
+ ```bash
13
+ # Health check
14
+ ./scripts/flow health
15
+
16
+ # Verify workflow files
17
+ ./scripts/flow verify
18
+
19
+ # Check knowledge sync
20
+ ./scripts/flow knowledge-sync status
21
+ ```
22
+
23
+ ## Verification Gates
24
+ <!-- PIN: verification-gates -->
25
+
26
+ Configured in `config.json → qualityGates`:
27
+ - Lint check
28
+ - TypeScript type check
29
+ - Test execution (when configured)
30
+
31
+ ## Future Considerations
32
+ - Add Jest or Vitest for unit tests
33
+ - Add integration tests for CLI commands
34
+ - Add E2E tests for full workflow scenarios
35
+
36
+ ## Windows Testing Checklist
37
+ <!-- PIN: windows-testing -->
38
+
39
+ When testing WogiFlow on Windows with Claude Code 2.1.7+:
40
+
41
+ ### Path Handling
42
+ - [ ] Verify temp directory paths work correctly
43
+ - Windows paths may contain backslash sequences like `C:\temp` or `C:\new` where `\t` and `\n` could be misinterpreted as tab and newline escape sequences if not handled properly
44
+ - [ ] Confirm `path.join()` creates valid Windows paths
45
+ - [ ] Test file operations in OneDrive/Dropbox-synced directories
46
+
47
+ ### File System
48
+ - [ ] Check no false "file modified" errors with cloud sync tools
49
+ - [ ] Verify antivirus scanner compatibility (Windows Defender)
50
+ - [ ] Test file watching doesn't trigger spurious updates
51
+
52
+ ### Bash Commands
53
+ - [ ] Confirm bash commands execute correctly via Claude Code
54
+ - [ ] Verify escape sequences in paths are handled properly
55
+ - [ ] Test commands with spaces in directory names
56
+
57
+ ### Quick Smoke Test
58
+ ```powershell
59
+ # In PowerShell
60
+ npm install wogiflow
61
+ npx flow health
62
+ npx flow status
63
+ npx flow ready
64
+ ```
65
+
66
+ **Note**: Claude Code 2.1.7 fixed several Windows-specific issues including path escape sequence handling and false "file modified" errors with cloud sync tools. If you encounter problems, ensure Claude Code is updated.
67
+
68
+ ---
69
+
70
+ Generated: 2026-01-11
71
+ Last synced: 2026-01-14
@@ -0,0 +1,60 @@
1
+ # Project Rules
2
+
3
+ This directory contains coding rules and patterns for this project, organized by category.
4
+
5
+ ## Structure
6
+
7
+ ```
8
+ .claude/rules/
9
+ ├── code-style/ # Naming conventions, formatting
10
+ │ └── naming-conventions.md
11
+ ├── security/ # Security patterns and practices
12
+ │ └── security-patterns.md
13
+ ├── architecture/ # Design decisions and patterns
14
+ │ ├── component-reuse.md
15
+ │ └── model-management.md
16
+ └── README.md
17
+ ```
18
+
19
+ ## How Rules Work
20
+
21
+ Rules are automatically loaded by Claude Code based on:
22
+ - **alwaysApply: true** - Rule is always loaded
23
+ - **alwaysApply: false** - Rule is loaded based on `globs` or `description` relevance
24
+ - **globs** - File patterns that trigger rule loading
25
+
26
+ ## Adding New Rules
27
+
28
+ 1. Choose the appropriate category subdirectory
29
+ 2. Create a `.md` file with frontmatter:
30
+
31
+ ```yaml
32
+ ---
33
+ alwaysApply: false
34
+ description: "Brief description for relevance matching"
35
+ globs: src/**/*.ts # Optional: only load for these files
36
+ ---
37
+ ```
38
+
39
+ 3. Write the rule content in markdown
40
+
41
+ ## Categories
42
+
43
+ | Category | Purpose |
44
+ |----------|---------|
45
+ | code-style | Naming conventions, formatting, file structure |
46
+ | security | Security patterns, input validation, safe practices |
47
+ | architecture | Design decisions, component patterns, system organization |
48
+
49
+ ## Auto-Generation
50
+
51
+ Some rules can be auto-generated from `.workflow/state/decisions.md`:
52
+
53
+ ```bash
54
+ node scripts/flow-rules-sync.js
55
+ ```
56
+
57
+ The sync script will route rules to appropriate category subdirectories.
58
+
59
+ ---
60
+ Last updated: 2026-01-12
@@ -0,0 +1,38 @@
1
+ ---
2
+ globs: src/components/**/*
3
+ alwaysApply: false
4
+ description: "Component reuse policy - always check app-map.md before creating components"
5
+ ---
6
+
7
+ # Component Reuse Policy
8
+
9
+ **Rule**: Always check `app-map.md` before creating any component.
10
+
11
+ ## Priority Order
12
+
13
+ 1. **Use existing** - Check if component already exists in app-map
14
+ 2. **Add variant** - Extend existing component with a new variant
15
+ 3. **Extend** - Create a wrapper/HOC around existing component
16
+ 4. **Create new** - Only as last resort
17
+
18
+ ## Before Creating Components
19
+
20
+ ```bash
21
+ # Check app-map first
22
+ cat .workflow/state/app-map.md | grep -i "button"
23
+
24
+ # Or search codebase
25
+ grep -r "Button" src/components/
26
+ ```
27
+
28
+ ## Variant vs New Component
29
+
30
+ Prefer variants when:
31
+ - Same base functionality, different appearance
32
+ - Same HTML structure, different styling
33
+ - Same component, different size/color/state
34
+
35
+ Create new component when:
36
+ - Fundamentally different functionality
37
+ - Different DOM structure
38
+ - Different state management
@@ -0,0 +1,76 @@
1
+ ---
2
+ alwaysApply: true
3
+ description: "All AI-context documents must use PIN markers for targeted context loading"
4
+ ---
5
+
6
+ # Document Structure for AI Context
7
+
8
+ All documents in `.workflow/` that are used as AI context MUST follow the PIN standard.
9
+
10
+ ## Required Structure
11
+
12
+ ### 1. Header with PIN List
13
+ Every document starts with a comment listing all pins in the document:
14
+ ```markdown
15
+ <!-- PINS: pin1, pin2, pin3 -->
16
+ ```
17
+
18
+ ### 2. Section PIN Markers
19
+ Each major section has a PIN marker comment:
20
+ ```markdown
21
+ ### Section Title
22
+ <!-- PIN: section-specific-pin -->
23
+ [Content]
24
+ ```
25
+
26
+ ### 3. PIN Naming Convention
27
+ - Use kebab-case: `user-authentication`, not `userAuthentication`
28
+ - Use semantic names: `error-handling`, not `eh`
29
+ - Use compound names for specificity: `json-parse-safety`
30
+
31
+ ## Why PINs Matter
32
+
33
+ The PIN system enables:
34
+ 1. **Targeted context loading**: Only load sections relevant to current task
35
+ 2. **Cheaper model routing**: Haiku can fetch only relevant sections for Opus
36
+ 3. **Change detection**: Hash sections independently for smart invalidation
37
+ 4. **Cross-reference**: Link sections by PIN across documents
38
+
39
+ ## Example Document
40
+
41
+ ```markdown
42
+ # Config Reference
43
+
44
+ <!-- PINS: database, authentication, api-keys, environment -->
45
+
46
+ ## Database Settings
47
+ <!-- PIN: database -->
48
+ | Setting | Default | Description |
49
+ |---------|---------|-------------|
50
+
51
+ ## Authentication
52
+ <!-- PIN: authentication -->
53
+ | Setting | Default | Description |
54
+ |---------|---------|-------------|
55
+ ```
56
+
57
+ ## Parsing
58
+
59
+ The PIN system automatically parses documents with:
60
+ - `flow-section-index.js` - Generates section index with pins
61
+ - `flow-section-resolver.js` - Resolves sections by PIN lookup
62
+ - `getSectionsByPins(['auth', 'security'])` - Fetch only relevant sections
63
+
64
+ ## Files That Must Have PINs
65
+
66
+ | File | Required PINs |
67
+ |------|---------------|
68
+ | `decisions.md` | Per coding rule/pattern |
69
+ | `app-map.md` | Per component/screen |
70
+ | `product.md` | Per product section |
71
+ | `stack.md` | Per technology |
72
+
73
+ ## Validation
74
+
75
+ Run `node scripts/flow-section-index.js --force` to regenerate the index.
76
+ Check `.workflow/state/section-index.json` for indexed sections and their pins.
@@ -0,0 +1,87 @@
1
+ ---
2
+ alwaysApply: false
3
+ description: "Cleanup checklist when refactoring or renaming features"
4
+ globs:
5
+ - "scripts/*.js"
6
+ - ".claude/skills/**/*"
7
+ ---
8
+
9
+ # Feature Refactoring Cleanup
10
+
11
+ When refactoring, renaming, or replacing a feature, ensure complete cleanup of the old implementation.
12
+
13
+ ## Mandatory Cleanup Checklist
14
+
15
+ When a feature is refactored or renamed, you MUST:
16
+
17
+ ### 1. Remove Old Code
18
+ - [ ] Delete old script files (e.g., `flow-old-feature.js`)
19
+ - [ ] Remove old skill directories (e.g., `.claude/skills/old-feature/`)
20
+ - [ ] Remove old hook files if applicable
21
+
22
+ ### 2. Update Configuration
23
+ - [ ] Rename config keys (e.g., `oldFeature` → `newFeature`)
24
+ - [ ] Remove from `skills.installed` array if skill was removed
25
+ - [ ] Update any feature flags
26
+
27
+ ### 3. Update Documentation
28
+ - [ ] Rename/update doc files in `.claude/docs/`
29
+ - [ ] Update command references in `commands.md`
30
+ - [ ] Update skill-matching.md if skill changed
31
+ - [ ] Search for old name in all `.md` files
32
+
33
+ ### 4. Clean References
34
+ - [ ] Search codebase: `grep -r "old-feature-name" .`
35
+ - [ ] Update imports in dependent scripts
36
+ - [ ] Update any hardcoded references
37
+
38
+ ### 5. Update State Files
39
+ - [ ] Clean `.workflow/state/` of old state files
40
+ - [ ] Update `ready.json` if tasks reference old feature
41
+ - [ ] Archive old change specs
42
+
43
+ ## Search Commands
44
+
45
+ Run these to find lingering references:
46
+
47
+ ```bash
48
+ # Find all references to old feature
49
+ grep -r "old-feature-name" --include="*.js" --include="*.md" --include="*.json" .
50
+
51
+ # Find in config
52
+ grep "oldFeatureName" .workflow/config.json
53
+
54
+ # Find skill references
55
+ grep -r "old-feature" .claude/
56
+ ```
57
+
58
+ ## Why This Matters
59
+
60
+ Incomplete cleanup causes:
61
+ - **Confusion**: Old commands/skills appear to work but don't
62
+ - **Bloat**: Dead code accumulates
63
+ - **Errors**: Old references cause runtime failures
64
+ - **Documentation drift**: Docs describe non-existent features
65
+
66
+ ## Example: transcript-digestion → long-input-gate
67
+
68
+ When this refactoring happened without proper cleanup:
69
+
70
+ | Artifact | Status | Should Have Been |
71
+ |----------|--------|------------------|
72
+ | `.claude/skills/transcript-digestion/` | Left behind | Deleted |
73
+ | `config.transcriptDigestion` | Left as-is | Renamed to `longInputGate` |
74
+ | `skills.installed` array | Still listed | Removed |
75
+ | `skill-matching.md` | Old references | Updated |
76
+ | `transcript-digestion.md` doc | Still existed | Renamed/rewritten |
77
+
78
+ ## Automation Opportunity
79
+
80
+ Consider adding a `flow refactor-cleanup <old-name> <new-name>` command that:
81
+ 1. Searches for all references
82
+ 2. Shows what needs updating
83
+ 3. Optionally auto-updates simple cases
84
+
85
+ ---
86
+
87
+ Last updated: 2026-01-14
@@ -0,0 +1,35 @@
1
+ ---
2
+ globs: scripts/flow-model*.js
3
+ alwaysApply: false
4
+ description: "Model management architecture - two separate systems for different purposes"
5
+ ---
6
+
7
+ # Model Management Architecture
8
+
9
+ **Context**: Phase 1 introduced model registry and stats system alongside existing model-adapter.
10
+
11
+ ## Two Model Systems
12
+
13
+ ### 1. flow-model-adapter.js - Prompt Adaptation
14
+
15
+ - `getCurrentModel()` returns normalized model name (string)
16
+ - Focus: Per-model prompt adjustments, learning, and corrections
17
+ - Imports: Used by flow-knowledge-router.js
18
+
19
+ ### 2. flow-models.js - Registry and Stats
20
+
21
+ - `getCurrentModel()` returns `{name, info, source}` object
22
+ - Focus: Model listing, routing recommendations, cost tracking
23
+ - Standalone CLI commands: `flow models [subcommand]`
24
+
25
+ ## Design Decision
26
+
27
+ **Keep them separate** because:
28
+ - Different return types serve different consumers
29
+ - Adapter system needs just the name for pattern matching
30
+ - Registry system needs full model metadata for display/routing
31
+ - Merging would create unnecessary coupling
32
+
33
+ ## Future Consideration
34
+
35
+ Could extract shared model detection logic into a common utility if they drift apart, but avoid premature abstraction.