wogiflow 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/.workflow/agents/reviewer.md +81 -0
  2. package/.workflow/agents/security.md +94 -0
  3. package/.workflow/agents/story-writer.md +58 -0
  4. package/.workflow/bridges/base-bridge.js +395 -0
  5. package/.workflow/bridges/claude-bridge.js +434 -0
  6. package/.workflow/bridges/index.js +130 -0
  7. package/.workflow/lib/assumption-detector.js +481 -0
  8. package/.workflow/lib/config-substitution.js +371 -0
  9. package/.workflow/lib/failure-categories.js +478 -0
  10. package/.workflow/state/app-map.md.template +15 -0
  11. package/.workflow/state/architecture.md.template +24 -0
  12. package/.workflow/state/component-index.json.template +5 -0
  13. package/.workflow/state/decisions.md.template +15 -0
  14. package/.workflow/state/feedback-patterns.md.template +9 -0
  15. package/.workflow/state/knowledge-sync.json.template +6 -0
  16. package/.workflow/state/progress.md.template +14 -0
  17. package/.workflow/state/ready.json.template +7 -0
  18. package/.workflow/state/request-log.md.template +14 -0
  19. package/.workflow/state/session-state.json.template +11 -0
  20. package/.workflow/state/stack.md.template +33 -0
  21. package/.workflow/state/testing.md.template +36 -0
  22. package/.workflow/templates/claude-md.hbs +257 -0
  23. package/.workflow/templates/correction-report.md +67 -0
  24. package/.workflow/templates/gemini-md.hbs +52 -0
  25. package/README.md +1802 -0
  26. package/bin/flow +205 -0
  27. package/lib/index.js +33 -0
  28. package/lib/installer.js +467 -0
  29. package/lib/release-channel.js +269 -0
  30. package/lib/skill-registry.js +526 -0
  31. package/lib/upgrader.js +401 -0
  32. package/lib/utils.js +305 -0
  33. package/package.json +64 -0
  34. package/scripts/flow +985 -0
  35. package/scripts/flow-adaptive-learning.js +1259 -0
  36. package/scripts/flow-aggregate.js +488 -0
  37. package/scripts/flow-archive +133 -0
  38. package/scripts/flow-auto-context.js +1015 -0
  39. package/scripts/flow-auto-learn.js +615 -0
  40. package/scripts/flow-bridge.js +223 -0
  41. package/scripts/flow-browser-suggest.js +316 -0
  42. package/scripts/flow-bug.js +247 -0
  43. package/scripts/flow-cascade.js +711 -0
  44. package/scripts/flow-changelog +85 -0
  45. package/scripts/flow-checkpoint.js +483 -0
  46. package/scripts/flow-cli.js +403 -0
  47. package/scripts/flow-code-intelligence.js +760 -0
  48. package/scripts/flow-complexity.js +502 -0
  49. package/scripts/flow-config-set.js +152 -0
  50. package/scripts/flow-constants.js +157 -0
  51. package/scripts/flow-context +152 -0
  52. package/scripts/flow-context-init.js +482 -0
  53. package/scripts/flow-context-monitor.js +384 -0
  54. package/scripts/flow-context-scoring.js +886 -0
  55. package/scripts/flow-correct.js +458 -0
  56. package/scripts/flow-damage-control.js +985 -0
  57. package/scripts/flow-deps +101 -0
  58. package/scripts/flow-diff.js +700 -0
  59. package/scripts/flow-done +151 -0
  60. package/scripts/flow-done.js +489 -0
  61. package/scripts/flow-durable-session.js +1541 -0
  62. package/scripts/flow-entropy-monitor.js +345 -0
  63. package/scripts/flow-export-profile +349 -0
  64. package/scripts/flow-export-scanner.js +1046 -0
  65. package/scripts/flow-figma-confirm.js +400 -0
  66. package/scripts/flow-figma-extract.js +496 -0
  67. package/scripts/flow-figma-generate.js +683 -0
  68. package/scripts/flow-figma-index.js +909 -0
  69. package/scripts/flow-figma-match.js +617 -0
  70. package/scripts/flow-figma-mcp-server.js +518 -0
  71. package/scripts/flow-figma-pipeline.js +414 -0
  72. package/scripts/flow-file-ops.js +301 -0
  73. package/scripts/flow-gate-confidence.js +825 -0
  74. package/scripts/flow-guided-edit.js +659 -0
  75. package/scripts/flow-health +185 -0
  76. package/scripts/flow-health.js +413 -0
  77. package/scripts/flow-hooks.js +556 -0
  78. package/scripts/flow-http-client.js +249 -0
  79. package/scripts/flow-hybrid-detect.js +167 -0
  80. package/scripts/flow-hybrid-interactive.js +591 -0
  81. package/scripts/flow-hybrid-test.js +152 -0
  82. package/scripts/flow-import-profile +439 -0
  83. package/scripts/flow-init +253 -0
  84. package/scripts/flow-instruction-richness.js +827 -0
  85. package/scripts/flow-jira-integration.js +579 -0
  86. package/scripts/flow-knowledge-router.js +522 -0
  87. package/scripts/flow-knowledge-sync.js +589 -0
  88. package/scripts/flow-linear-integration.js +631 -0
  89. package/scripts/flow-links.js +774 -0
  90. package/scripts/flow-log-manager.js +559 -0
  91. package/scripts/flow-loop-enforcer.js +1246 -0
  92. package/scripts/flow-loop-retry-learning.js +630 -0
  93. package/scripts/flow-lsp.js +923 -0
  94. package/scripts/flow-map-index +348 -0
  95. package/scripts/flow-map-sync +201 -0
  96. package/scripts/flow-memory-blocks.js +668 -0
  97. package/scripts/flow-memory-compactor.js +350 -0
  98. package/scripts/flow-memory-db.js +1110 -0
  99. package/scripts/flow-memory-sync.js +484 -0
  100. package/scripts/flow-metrics.js +353 -0
  101. package/scripts/flow-migrate-ids.js +370 -0
  102. package/scripts/flow-model-adapter.js +802 -0
  103. package/scripts/flow-model-router.js +884 -0
  104. package/scripts/flow-models.js +1231 -0
  105. package/scripts/flow-morning.js +517 -0
  106. package/scripts/flow-multi-approach.js +660 -0
  107. package/scripts/flow-new-feature +86 -0
  108. package/scripts/flow-onboard +1042 -0
  109. package/scripts/flow-orchestrate-llm.js +459 -0
  110. package/scripts/flow-orchestrate.js +3592 -0
  111. package/scripts/flow-output.js +123 -0
  112. package/scripts/flow-parallel-detector.js +399 -0
  113. package/scripts/flow-parallel-dispatch.js +987 -0
  114. package/scripts/flow-parallel.js +428 -0
  115. package/scripts/flow-pattern-enforcer.js +600 -0
  116. package/scripts/flow-prd-manager.js +282 -0
  117. package/scripts/flow-progress.js +323 -0
  118. package/scripts/flow-project-analyzer.js +975 -0
  119. package/scripts/flow-prompt-composer.js +487 -0
  120. package/scripts/flow-providers.js +1381 -0
  121. package/scripts/flow-queue.js +308 -0
  122. package/scripts/flow-ready +82 -0
  123. package/scripts/flow-ready.js +189 -0
  124. package/scripts/flow-regression.js +396 -0
  125. package/scripts/flow-response-parser.js +450 -0
  126. package/scripts/flow-resume.js +284 -0
  127. package/scripts/flow-rules-sync.js +439 -0
  128. package/scripts/flow-run-trace.js +718 -0
  129. package/scripts/flow-safety.js +587 -0
  130. package/scripts/flow-search +104 -0
  131. package/scripts/flow-security.js +481 -0
  132. package/scripts/flow-session-end +106 -0
  133. package/scripts/flow-session-end.js +437 -0
  134. package/scripts/flow-session-state.js +671 -0
  135. package/scripts/flow-setup-hooks +216 -0
  136. package/scripts/flow-setup-hooks.js +377 -0
  137. package/scripts/flow-skill-create.js +329 -0
  138. package/scripts/flow-skill-creator.js +572 -0
  139. package/scripts/flow-skill-generator.js +1046 -0
  140. package/scripts/flow-skill-learn.js +880 -0
  141. package/scripts/flow-skill-matcher.js +578 -0
  142. package/scripts/flow-spec-generator.js +820 -0
  143. package/scripts/flow-stack-wizard.js +895 -0
  144. package/scripts/flow-standup +162 -0
  145. package/scripts/flow-start +74 -0
  146. package/scripts/flow-start.js +235 -0
  147. package/scripts/flow-status +110 -0
  148. package/scripts/flow-status.js +301 -0
  149. package/scripts/flow-step-browser.js +83 -0
  150. package/scripts/flow-step-changelog.js +217 -0
  151. package/scripts/flow-step-comments.js +306 -0
  152. package/scripts/flow-step-complexity.js +234 -0
  153. package/scripts/flow-step-coverage.js +218 -0
  154. package/scripts/flow-step-knowledge.js +193 -0
  155. package/scripts/flow-step-pr-tests.js +364 -0
  156. package/scripts/flow-step-regression.js +89 -0
  157. package/scripts/flow-step-review.js +516 -0
  158. package/scripts/flow-step-security.js +162 -0
  159. package/scripts/flow-step-silent-failures.js +290 -0
  160. package/scripts/flow-step-simplifier.js +346 -0
  161. package/scripts/flow-story +105 -0
  162. package/scripts/flow-story.js +500 -0
  163. package/scripts/flow-suspend.js +252 -0
  164. package/scripts/flow-sync-daemon.js +654 -0
  165. package/scripts/flow-task-analyzer.js +606 -0
  166. package/scripts/flow-team-dashboard.js +748 -0
  167. package/scripts/flow-team-sync.js +752 -0
  168. package/scripts/flow-team.js +977 -0
  169. package/scripts/flow-tech-options.js +528 -0
  170. package/scripts/flow-templates.js +812 -0
  171. package/scripts/flow-tiered-learning.js +728 -0
  172. package/scripts/flow-trace +204 -0
  173. package/scripts/flow-transcript-chunking.js +1106 -0
  174. package/scripts/flow-transcript-digest.js +7918 -0
  175. package/scripts/flow-transcript-language.js +465 -0
  176. package/scripts/flow-transcript-parsing.js +1085 -0
  177. package/scripts/flow-transcript-stories.js +2194 -0
  178. package/scripts/flow-update-map +224 -0
  179. package/scripts/flow-utils.js +2242 -0
  180. package/scripts/flow-verification.js +644 -0
  181. package/scripts/flow-verify.js +1177 -0
  182. package/scripts/flow-voice-input.js +638 -0
  183. package/scripts/flow-watch +168 -0
  184. package/scripts/flow-workflow-steps.js +521 -0
  185. package/scripts/flow-workflow.js +1029 -0
  186. package/scripts/flow-worktree.js +489 -0
  187. package/scripts/hooks/adapters/base-adapter.js +102 -0
  188. package/scripts/hooks/adapters/claude-code.js +359 -0
  189. package/scripts/hooks/adapters/index.js +79 -0
  190. package/scripts/hooks/core/component-check.js +341 -0
  191. package/scripts/hooks/core/index.js +35 -0
  192. package/scripts/hooks/core/loop-check.js +241 -0
  193. package/scripts/hooks/core/session-context.js +294 -0
  194. package/scripts/hooks/core/task-gate.js +177 -0
  195. package/scripts/hooks/core/validation.js +230 -0
  196. package/scripts/hooks/entry/claude-code/post-tool-use.js +65 -0
  197. package/scripts/hooks/entry/claude-code/pre-tool-use.js +89 -0
  198. package/scripts/hooks/entry/claude-code/session-end.js +87 -0
  199. package/scripts/hooks/entry/claude-code/session-start.js +46 -0
  200. package/scripts/hooks/entry/claude-code/stop.js +43 -0
  201. package/scripts/postinstall.js +139 -0
  202. package/templates/browser-test-flow.json +56 -0
  203. package/templates/bug-report.md +43 -0
  204. package/templates/component-detail.md +42 -0
  205. package/templates/component.stories.tsx +49 -0
  206. package/templates/context/constraints.md +83 -0
  207. package/templates/context/conventions.md +177 -0
  208. package/templates/context/stack.md +60 -0
  209. package/templates/correction-report.md +90 -0
  210. package/templates/feature-proposal.md +35 -0
  211. package/templates/hybrid/_base.md +254 -0
  212. package/templates/hybrid/_patterns.md +45 -0
  213. package/templates/hybrid/create-component.md +127 -0
  214. package/templates/hybrid/create-file.md +56 -0
  215. package/templates/hybrid/create-hook.md +145 -0
  216. package/templates/hybrid/create-service.md +70 -0
  217. package/templates/hybrid/fix-bug.md +33 -0
  218. package/templates/hybrid/modify-file.md +55 -0
  219. package/templates/story.md +68 -0
  220. package/templates/task.json +56 -0
  221. package/templates/trace.md +69 -0
@@ -0,0 +1,83 @@
1
+ # Project Constraints
2
+
3
+ **IMMUTABLE** - These rules cannot be changed without explicit human approval.
4
+ AI assistants must follow these constraints absolutely.
5
+
6
+ ---
7
+
8
+ ## Architecture Constraints
9
+
10
+ ### AC-001: Template Constraint
11
+ **Added**: {{date}}
12
+ **Reason**: [why this constraint exists]
13
+ **Rule**: [the specific constraint]
14
+
15
+ <!-- Add more architecture constraints as needed -->
16
+
17
+ ---
18
+
19
+ ## Security Constraints
20
+
21
+ ### SC-001: No Secrets in Code
22
+ **Added**: {{date}}
23
+ **Reason**: Security best practice
24
+ **Rule**: Never hardcode API keys, passwords, tokens, or secrets. Use environment variables.
25
+
26
+ ### SC-002: Input Validation Required
27
+ **Added**: {{date}}
28
+ **Reason**: Prevent injection attacks
29
+ **Rule**: All user input must be validated and sanitized before use.
30
+
31
+ <!-- Add more security constraints as needed -->
32
+
33
+ ---
34
+
35
+ ## Performance Constraints
36
+
37
+ <!-- Add performance constraints here -->
38
+ <!-- Example:
39
+ ### PC-001: Bundle Size Limit
40
+ **Added**: {{date}}
41
+ **Reason**: Performance budget
42
+ **Rule**: Main bundle must not exceed 200KB gzipped.
43
+ -->
44
+
45
+ ---
46
+
47
+ ## Compatibility Constraints
48
+
49
+ <!-- Add compatibility constraints here -->
50
+ <!-- Example:
51
+ ### CC-001: Browser Support
52
+ **Added**: {{date}}
53
+ **Reason**: User base requirements
54
+ **Rule**: Must support last 2 versions of Chrome, Firefox, Safari, Edge.
55
+ -->
56
+
57
+ ---
58
+
59
+ ## Process Constraints
60
+
61
+ ### PR-001: No Direct Main Commits
62
+ **Added**: {{date}}
63
+ **Reason**: Code review requirement
64
+ **Rule**: All changes must go through pull requests. No direct commits to main/master.
65
+
66
+ <!-- Add more process constraints as needed -->
67
+
68
+ ---
69
+
70
+ ## Data Constraints
71
+
72
+ <!-- Add data constraints here -->
73
+ <!-- Example:
74
+ ### DC-001: PII Handling
75
+ **Added**: {{date}}
76
+ **Reason**: Privacy compliance
77
+ **Rule**: Personal identifiable information must be encrypted at rest and in transit.
78
+ -->
79
+
80
+ ---
81
+
82
+ *This file is append-only. To modify existing constraints, request explicit human review.*
83
+ *Constraints can only be removed or modified by a human, never by AI.*
@@ -0,0 +1,177 @@
1
+ # Coding Conventions
2
+
3
+ Patterns and conventions for this project. AI can propose updates via diff.
4
+
5
+ ---
6
+
7
+ ## Naming Conventions
8
+
9
+ ### Files & Directories
10
+ | Type | Convention | Example |
11
+ |------|------------|---------|
12
+ | Components | PascalCase | `UserProfile.tsx` |
13
+ | Hooks | camelCase with `use` prefix | `useAuth.ts` |
14
+ | Utilities | camelCase | `formatDate.ts` |
15
+ | Constants | SCREAMING_SNAKE_CASE file | `API_ENDPOINTS.ts` |
16
+ | Types | PascalCase with `.types.ts` | `User.types.ts` |
17
+ | Tests | Same name with `.test.ts` | `UserProfile.test.tsx` |
18
+
19
+ ### Variables & Functions
20
+ | Type | Convention | Example |
21
+ |------|------------|---------|
22
+ | Variables | camelCase | `userName` |
23
+ | Constants | SCREAMING_SNAKE_CASE | `MAX_RETRIES` |
24
+ | Booleans | `is/has/should/can` prefix | `isLoading`, `hasError` |
25
+ | Event handlers | `handle` prefix | `handleSubmit` |
26
+ | Async functions | verb-noun pattern | `fetchUser`, `createPost` |
27
+ | Private | underscore prefix (optional) | `_internalHelper` |
28
+
29
+ ### Components & Classes
30
+ | Type | Convention | Example |
31
+ |------|------------|---------|
32
+ | React Components | PascalCase | `UserProfile` |
33
+ | Classes | PascalCase | `ApiClient` |
34
+ | Interfaces | PascalCase, no `I` prefix | `User`, `Config` |
35
+ | Type aliases | PascalCase | `UserId`, `ApiResponse` |
36
+ | Enums | PascalCase, UPPER members | `Status.ACTIVE` |
37
+
38
+ ---
39
+
40
+ ## Code Structure
41
+
42
+ ### File Organization
43
+ ```
44
+ // 1. External imports (React, libraries)
45
+ // 2. Internal imports (absolute paths)
46
+ // 3. Relative imports
47
+ // 4. Type imports
48
+ // 5. Asset imports (styles, images)
49
+
50
+ // Component/Module code
51
+
52
+ // Exports
53
+ ```
54
+
55
+ ### Component Structure (React)
56
+ ```typescript
57
+ // 1. Imports
58
+ // 2. Types/Interfaces
59
+ // 3. Constants
60
+ // 4. Helper functions
61
+ // 5. Component definition
62
+ // 6. Styles (if CSS-in-JS)
63
+ // 7. Export
64
+ ```
65
+
66
+ ---
67
+
68
+ ## Import Order
69
+
70
+ 1. React/framework core imports
71
+ 2. Third-party library imports
72
+ 3. Internal modules (absolute paths like `@/`)
73
+ 4. Relative imports (`./`, `../`)
74
+ 5. Type-only imports
75
+ 6. Style imports
76
+
77
+ ---
78
+
79
+ ## Code Patterns
80
+
81
+ ### Error Handling
82
+ ```typescript
83
+ // Prefer try-catch with specific error handling
84
+ try {
85
+ await riskyOperation();
86
+ } catch (error) {
87
+ if (error instanceof SpecificError) {
88
+ // Handle specific case
89
+ }
90
+ throw error; // Re-throw if unhandled
91
+ }
92
+ ```
93
+
94
+ ### Async/Await
95
+ ```typescript
96
+ // Prefer async/await over .then() chains
97
+ const data = await fetchData();
98
+
99
+ // Use Promise.all for parallel operations
100
+ const [users, posts] = await Promise.all([
101
+ fetchUsers(),
102
+ fetchPosts()
103
+ ]);
104
+ ```
105
+
106
+ ### Null Handling
107
+ ```typescript
108
+ // Use optional chaining
109
+ const name = user?.profile?.name;
110
+
111
+ // Use nullish coalescing for defaults
112
+ const value = input ?? defaultValue;
113
+ ```
114
+
115
+ ---
116
+
117
+ ## Documentation
118
+
119
+ ### Comments
120
+ - Use JSDoc for public APIs
121
+ - Explain "why" not "what"
122
+ - Remove commented-out code
123
+ - Keep comments up to date
124
+
125
+ ### Code Comments Example
126
+ ```typescript
127
+ // BAD: Increments counter
128
+ counter++;
129
+
130
+ // GOOD: Track retry attempts for rate limit backoff
131
+ retryCount++;
132
+ ```
133
+
134
+ ---
135
+
136
+ ## Testing Conventions
137
+
138
+ ### Test File Location
139
+ - Co-located with source: `Component.test.tsx`
140
+ - Or in `__tests__` directory
141
+
142
+ ### Test Structure
143
+ ```typescript
144
+ describe('ComponentName', () => {
145
+ describe('methodName', () => {
146
+ it('should do expected behavior', () => {
147
+ // Arrange
148
+ // Act
149
+ // Assert
150
+ });
151
+ });
152
+ });
153
+ ```
154
+
155
+ ---
156
+
157
+ ## Git Conventions
158
+
159
+ ### Commit Messages
160
+ ```
161
+ <type>(<scope>): <subject>
162
+
163
+ <body>
164
+
165
+ <footer>
166
+ ```
167
+
168
+ Types: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore`
169
+
170
+ ### Branch Naming
171
+ - Feature: `feature/description`
172
+ - Bugfix: `fix/description`
173
+ - Hotfix: `hotfix/description`
174
+
175
+ ---
176
+
177
+ *AI can propose updates to this file via diff. Human approval required for changes.*
@@ -0,0 +1,60 @@
1
+ # Technology Stack
2
+
3
+ Auto-detected and human-verified technology stack for this project.
4
+
5
+ ---
6
+
7
+ ## Runtime
8
+ - **Language**: [auto-detect or specify]
9
+ - **Runtime**: [e.g., Node.js 20.x, Bun, Deno, Python 3.11]
10
+ - **Package Manager**: [npm, yarn, pnpm, pip, cargo]
11
+
12
+ ## Frameworks
13
+ - **Frontend**: [e.g., React 18, Vue 3, Svelte, Angular, None]
14
+ - **Backend**: [e.g., Express, Fastify, NestJS, Django, None]
15
+ - **Full-Stack**: [e.g., Next.js 14, Nuxt, SvelteKit, None]
16
+
17
+ ## Key Dependencies
18
+ <!-- List important dependencies and their purposes -->
19
+ | Dependency | Purpose |
20
+ |------------|---------|
21
+ | example | description |
22
+
23
+ ## Build & Tooling
24
+ - **Bundler**: [e.g., Vite, Webpack, esbuild, Rollup]
25
+ - **Testing**: [e.g., Jest, Vitest, Playwright, pytest]
26
+ - **Linting**: [e.g., ESLint, Biome, Ruff]
27
+ - **Formatting**: [e.g., Prettier, Biome, Black]
28
+ - **Type Checking**: [e.g., TypeScript, mypy, None]
29
+
30
+ ## Infrastructure
31
+ - **Database**: [e.g., PostgreSQL, MongoDB, SQLite, None]
32
+ - **ORM/ODM**: [e.g., Prisma, Drizzle, TypeORM, SQLAlchemy]
33
+ - **Cache**: [e.g., Redis, Memcached, None]
34
+ - **Queue**: [e.g., BullMQ, Celery, None]
35
+ - **Hosting**: [e.g., Vercel, AWS, GCP, Self-hosted]
36
+
37
+ ---
38
+
39
+ ## Version Requirements
40
+
41
+ ```json
42
+ {
43
+ "node": ">=20.0.0",
44
+ "npm": ">=10.0.0"
45
+ }
46
+ ```
47
+
48
+ ---
49
+
50
+ ## Environment Variables
51
+
52
+ | Variable | Required | Description |
53
+ |----------|----------|-------------|
54
+ | DATABASE_URL | Yes | Database connection string |
55
+ | API_KEY | No | External API key |
56
+
57
+ ---
58
+
59
+ *Last updated: {{timestamp}}*
60
+ *Updated by: {{author}}*
@@ -0,0 +1,90 @@
1
+ # Correction Report: [wf-XXXXXXXX]-Correction-[N]
2
+
3
+ ## Meta
4
+
5
+ | Field | Value |
6
+ |-------|-------|
7
+ | Task ID | [wf-XXXXXXXX] |
8
+ | Correction # | [N] |
9
+ | Date | [YYYY-MM-DD] |
10
+ | Severity | [minor/moderate/critical] |
11
+
12
+ ---
13
+
14
+ ## Problem Description
15
+
16
+ ### What Was Expected
17
+
18
+ [Describe the expected behavior]
19
+
20
+ ### What Actually Happened
21
+
22
+ [Describe the actual behavior]
23
+
24
+ ### Error Message (if any)
25
+
26
+ ```
27
+ [paste error message]
28
+ ```
29
+
30
+ ---
31
+
32
+ ## Root Cause Analysis
33
+
34
+ ### Investigation Steps
35
+
36
+ 1. [Step taken to investigate]
37
+ 2. [Step taken to investigate]
38
+
39
+ ### Identified Cause
40
+
41
+ [Why did this happen - the actual root cause]
42
+
43
+ ---
44
+
45
+ ## Solution Applied
46
+
47
+ ### Changes Made
48
+
49
+ | File | Change Description |
50
+ |------|-------------------|
51
+ | [path/to/file.ts] | [What was changed] |
52
+
53
+ ### Code Summary
54
+
55
+ ```diff
56
+ - [old code]
57
+ + [new code]
58
+ ```
59
+
60
+ ---
61
+
62
+ ## Verification
63
+
64
+ ### Test Result After Fix
65
+
66
+ | Test | Before | After |
67
+ |------|--------|-------|
68
+ | [Test name] | FAIL | PASS |
69
+
70
+ ---
71
+
72
+ ## Prevention Measures
73
+
74
+ ### How to Avoid in Future
75
+
76
+ 1. [Preventive measure 1]
77
+ 2. [Preventive measure 2]
78
+
79
+ ### Documentation Updates
80
+
81
+ - [ ] Update decisions.md with pattern
82
+ - [ ] Update relevant agent instructions
83
+ - [ ] Add test case to prevent regression
84
+
85
+ ---
86
+
87
+ ## Linked
88
+
89
+ - **Request Log**: R-[XXX]
90
+ - **Task**: [wf-XXXXXXXX]
@@ -0,0 +1,35 @@
1
+ # Feature: [Name]
2
+
3
+ ## Summary
4
+ [Brief description of the feature]
5
+
6
+ ## Problem
7
+ [What problem does this solve?]
8
+
9
+ ## Solution
10
+ [How will this feature solve the problem?]
11
+
12
+ ## User Stories
13
+ - As a [user type], I want to [action] so that [benefit]
14
+
15
+ ## Acceptance Criteria
16
+ - [ ] [Criterion 1]
17
+ - [ ] [Criterion 2]
18
+ - [ ] [Criterion 3]
19
+
20
+ ## Dependencies
21
+ - [List any dependencies on other features or components]
22
+
23
+ ## Technical Notes
24
+ [Any technical considerations, constraints, or decisions]
25
+
26
+ ## Components Needed
27
+ Check app-map.md before listing:
28
+ - [ ] [Component 1] - exists / needs variant / needs creation
29
+ - [ ] [Component 2]
30
+
31
+ ## Estimated Effort
32
+ [Small / Medium / Large]
33
+
34
+ ## Risks
35
+ - [Potential risks or blockers]
@@ -0,0 +1,254 @@
1
+ ## ⚠️ CRITICAL OUTPUT RULES (READ FIRST)
2
+
3
+ **Your output will be written directly to a file. Follow these rules EXACTLY:**
4
+
5
+ 1. Output ONLY valid code - no explanations, no markdown
6
+ 2. Do NOT wrap code in ``` code blocks
7
+ 3. Do NOT include any text before the code
8
+ 4. Do NOT include any text after the code
9
+ 5. Start with imports (or 'use client' directive if needed)
10
+ 6. Do NOT include thinking or reasoning text in your output
11
+
12
+ **WRONG OUTPUT:**
13
+ ```
14
+ Here's the code you need:
15
+ import React from 'react'
16
+ ```
17
+
18
+ **CORRECT OUTPUT:**
19
+ import { useState } from 'react';
20
+
21
+ **You MAY use `<thinking>...</thinking>` tags to reason through complex problems.**
22
+ Only the code OUTSIDE these tags will be extracted and written to the file.
23
+
24
+ ═══════════════════════════════════════════════════════════════════════════════
25
+
26
+ # Project Context
27
+
28
+ You are generating code for this project.
29
+
30
+ {{#if uiFramework}}
31
+ ## Framework: {{uiFramework}}
32
+ {{/if}}
33
+
34
+ {{#if stylingApproach}}
35
+ ## Styling: {{stylingApproach}}
36
+ {{/if}}
37
+
38
+ ## Import Rules
39
+
40
+ {{#if doNotImport}}
41
+ ### Forbidden Imports (DO NOT USE)
42
+ DO NOT import these: {{doNotImport}}
43
+ {{/if}}
44
+
45
+ ### Available Project Imports
46
+
47
+ **Use ONLY imports listed below for project code. Other paths are FORBIDDEN.**
48
+
49
+ {{#if availableComponents}}
50
+ #### Components
51
+ ```typescript
52
+ {{availableComponents}}
53
+ ```
54
+ {{/if}}
55
+
56
+ {{#if availableHooks}}
57
+ #### Hooks
58
+ ```typescript
59
+ {{availableHooks}}
60
+ ```
61
+ {{/if}}
62
+
63
+ {{#if availableServices}}
64
+ #### Services
65
+ ```typescript
66
+ {{availableServices}}
67
+ ```
68
+ {{/if}}
69
+
70
+ {{#if availableTypes}}
71
+ #### Types
72
+ ```typescript
73
+ {{availableTypes}}
74
+ ```
75
+ {{/if}}
76
+
77
+ {{#if availableUtils}}
78
+ #### Utilities
79
+ ```typescript
80
+ {{availableUtils}}
81
+ ```
82
+ {{/if}}
83
+
84
+ {{#if typeLocations}}
85
+ ### Type Import Paths
86
+ {{typeLocations}}
87
+ {{/if}}
88
+
89
+ ### Standard Library Imports (Always Allowed)
90
+
91
+ These imports are always safe to use without being listed above:
92
+
93
+ **React:**
94
+ - `useState`, `useEffect`, `useCallback`, `useMemo`, `useRef`, `useContext`
95
+ - `useReducer`, `useLayoutEffect`, `useImperativeHandle`, `useDebugValue`
96
+ - `forwardRef`, `memo`, `lazy`, `Suspense`, `Fragment`
97
+
98
+ **Next.js:**
99
+ - `Link`, `Image`, `Script` from `next/link`, `next/image`, `next/script`
100
+ - `useRouter`, `usePathname`, `useSearchParams` from `next/navigation`
101
+ - `notFound`, `redirect` from `next/navigation`
102
+ - `headers`, `cookies` from `next/headers`
103
+
104
+ **Node.js (for server code):**
105
+ - `fs`, `path`, `os`, `crypto`, `util`, `stream`, `events`
106
+ - `child_process`, `http`, `https`, `url`, `querystring`
107
+
108
+ {{#if projectWarnings}}
109
+ ### Project-Specific Warnings
110
+ {{projectWarnings}}
111
+ {{/if}}
112
+
113
+ **If you're unsure about a project import path:**
114
+ - DON'T USE IT
115
+ - Write the code inline instead
116
+ - Use a TODO comment: `// TODO: import X from '?'`
117
+
118
+ ## Component Usage Rules
119
+
120
+ These rules prevent the most common LLM mistakes:
121
+
122
+ ### 1. String Literals for Variants/Sizes (MANDATORY)
123
+
124
+ **CORRECT:**
125
+ ```tsx
126
+ <Button variant="primary" size="md">Click</Button>
127
+ <Card variant="default">Content</Card>
128
+ <Input size="lg" />
129
+ ```
130
+
131
+ **WRONG (NEVER DO THIS):**
132
+ ```tsx
133
+ <Button variant={buttonVariants.primary}>Click</Button> // ❌ WRONG
134
+ <Card variant={cardVariants.default}>Content</Card> // ❌ WRONG
135
+ <Input size={inputSizes.lg} /> // ❌ WRONG
136
+ ```
137
+
138
+ ### 2. Exported Arrays Are for Iteration Only
139
+
140
+ Constants like `buttonVariants`, `cardVariants`, `inputSizes` are **ARRAYS** like `['sm', 'md', 'lg']`:
141
+ - ✅ Use them for: `buttonVariants.map(v => ...)` (iteration)
142
+ - ❌ NOT for: `variant={buttonVariants.primary}` (object access)
143
+
144
+ ### 3. Hook Names ≠ File Names
145
+
146
+ File: `use-auth-store.ts` might export: `useAuthState()`, NOT `useAuthStore()`
147
+ - Always use the exact function name shown in the imports above
148
+ - Never guess hook names based on file names
149
+
150
+ ### 4. When in Doubt, Use String Literals
151
+
152
+ If you're unsure whether something is an array or object:
153
+ ```tsx
154
+ // Always safe - string literals
155
+ variant="primary"
156
+ size="md"
157
+ type="submit"
158
+ ```
159
+
160
+ ## Code Rules
161
+
162
+ 1. Use TypeScript with proper types.
163
+ 2. Follow the existing patterns shown in _patterns.md
164
+ 3. Include all necessary imports at the top.
165
+ 4. Add brief JSDoc comments for exported functions/components.
166
+ 5. Do NOT create files that weren't requested.
167
+ 6. Match the project's naming conventions exactly.
168
+ 7. Define types inline if unsure about import path.
169
+
170
+ {{#if customRules}}
171
+ ### Project-Specific Rules
172
+ {{customRules}}
173
+ {{/if}}
174
+
175
+ ## Context Level: {{richnessLevel}}
176
+
177
+ You have been given comprehensive context to ensure high success rate.
178
+ All imports, types, and patterns above are accurate and verified.
179
+
180
+ {{#if verbosityGuidance}}
181
+ ### Implementation Guidance
182
+ {{verbosityGuidance}}
183
+ {{/if}}
184
+
185
+ Use ALL the context provided above. The imports, props, and types shown are
186
+ the source of truth. Do not guess or invent alternatives.
187
+
188
+ {{#if requiresPlan}}
189
+ ## Planning Requirement
190
+
191
+ **IMPORTANT: This task requires explicit planning before implementation.**
192
+
193
+ Task complexity: {{complexity}}
194
+
195
+ Before writing any code, first output your plan inside `<thinking>` tags:
196
+ 1. What changes are needed
197
+ 2. Which imports you will use
198
+ 3. Key implementation decisions
199
+ 4. Any potential edge cases
200
+
201
+ Example:
202
+ ```
203
+ <thinking>
204
+ Plan:
205
+ 1. Create UserCard component with name/email props
206
+ 2. Import Button from @/components/ui/Button
207
+ 3. Use useState for hover state
208
+ 4. Handle optional onEdit callback
209
+ </thinking>
210
+ ```
211
+
212
+ Then output ONLY the code (outside the thinking tags).
213
+ {{/if}}
214
+
215
+ ## Validation
216
+
217
+ After you output code, it will be automatically validated:
218
+ - TypeScript compilation check
219
+ - ESLint check
220
+
221
+ If validation fails, you'll receive the error and must fix it.
222
+ Fix the error and output ONLY the corrected code. No explanations.
223
+
224
+ ═══════════════════════════════════════════════════════════════════════════════
225
+ TASK BOUNDARY - YOUR TASK STARTS BELOW
226
+ ═══════════════════════════════════════════════════════════════════════════════
227
+
228
+ **CRITICAL**: Everything ABOVE this line is PROJECT CONTEXT for REFERENCE ONLY.
229
+ - Do NOT implement types/components from the project context
230
+ - Do NOT confuse project patterns with your actual task
231
+ - ONLY implement what is described in YOUR TASK below
232
+
233
+ ## YOUR TASK (IMPLEMENT THIS)
234
+
235
+ {{#if taskDescription}}
236
+ {{taskDescription}}
237
+ {{else}}
238
+ [Task description will be inserted here by the orchestrator]
239
+ {{/if}}
240
+
241
+ {{#if targetFile}}
242
+ **Target File**: `{{targetFile}}`
243
+ {{/if}}
244
+
245
+ {{#if existingContent}}
246
+ **Current File Content**:
247
+ ```
248
+ {{existingContent}}
249
+ ```
250
+ {{/if}}
251
+
252
+ ═══════════════════════════════════════════════════════════════════════════════
253
+ END OF TASK
254
+ ═══════════════════════════════════════════════════════════════════════════════