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.
- package/.workflow/agents/reviewer.md +81 -0
- package/.workflow/agents/security.md +94 -0
- package/.workflow/agents/story-writer.md +58 -0
- package/.workflow/bridges/base-bridge.js +395 -0
- package/.workflow/bridges/claude-bridge.js +434 -0
- package/.workflow/bridges/index.js +130 -0
- package/.workflow/lib/assumption-detector.js +481 -0
- package/.workflow/lib/config-substitution.js +371 -0
- package/.workflow/lib/failure-categories.js +478 -0
- package/.workflow/state/app-map.md.template +15 -0
- package/.workflow/state/architecture.md.template +24 -0
- package/.workflow/state/component-index.json.template +5 -0
- package/.workflow/state/decisions.md.template +15 -0
- package/.workflow/state/feedback-patterns.md.template +9 -0
- package/.workflow/state/knowledge-sync.json.template +6 -0
- package/.workflow/state/progress.md.template +14 -0
- package/.workflow/state/ready.json.template +7 -0
- package/.workflow/state/request-log.md.template +14 -0
- package/.workflow/state/session-state.json.template +11 -0
- package/.workflow/state/stack.md.template +33 -0
- package/.workflow/state/testing.md.template +36 -0
- package/.workflow/templates/claude-md.hbs +257 -0
- package/.workflow/templates/correction-report.md +67 -0
- package/.workflow/templates/gemini-md.hbs +52 -0
- package/README.md +1802 -0
- package/bin/flow +205 -0
- package/lib/index.js +33 -0
- package/lib/installer.js +467 -0
- package/lib/release-channel.js +269 -0
- package/lib/skill-registry.js +526 -0
- package/lib/upgrader.js +401 -0
- package/lib/utils.js +305 -0
- package/package.json +64 -0
- package/scripts/flow +985 -0
- package/scripts/flow-adaptive-learning.js +1259 -0
- package/scripts/flow-aggregate.js +488 -0
- package/scripts/flow-archive +133 -0
- package/scripts/flow-auto-context.js +1015 -0
- package/scripts/flow-auto-learn.js +615 -0
- package/scripts/flow-bridge.js +223 -0
- package/scripts/flow-browser-suggest.js +316 -0
- package/scripts/flow-bug.js +247 -0
- package/scripts/flow-cascade.js +711 -0
- package/scripts/flow-changelog +85 -0
- package/scripts/flow-checkpoint.js +483 -0
- package/scripts/flow-cli.js +403 -0
- package/scripts/flow-code-intelligence.js +760 -0
- package/scripts/flow-complexity.js +502 -0
- package/scripts/flow-config-set.js +152 -0
- package/scripts/flow-constants.js +157 -0
- package/scripts/flow-context +152 -0
- package/scripts/flow-context-init.js +482 -0
- package/scripts/flow-context-monitor.js +384 -0
- package/scripts/flow-context-scoring.js +886 -0
- package/scripts/flow-correct.js +458 -0
- package/scripts/flow-damage-control.js +985 -0
- package/scripts/flow-deps +101 -0
- package/scripts/flow-diff.js +700 -0
- package/scripts/flow-done +151 -0
- package/scripts/flow-done.js +489 -0
- package/scripts/flow-durable-session.js +1541 -0
- package/scripts/flow-entropy-monitor.js +345 -0
- package/scripts/flow-export-profile +349 -0
- package/scripts/flow-export-scanner.js +1046 -0
- package/scripts/flow-figma-confirm.js +400 -0
- package/scripts/flow-figma-extract.js +496 -0
- package/scripts/flow-figma-generate.js +683 -0
- package/scripts/flow-figma-index.js +909 -0
- package/scripts/flow-figma-match.js +617 -0
- package/scripts/flow-figma-mcp-server.js +518 -0
- package/scripts/flow-figma-pipeline.js +414 -0
- package/scripts/flow-file-ops.js +301 -0
- package/scripts/flow-gate-confidence.js +825 -0
- package/scripts/flow-guided-edit.js +659 -0
- package/scripts/flow-health +185 -0
- package/scripts/flow-health.js +413 -0
- package/scripts/flow-hooks.js +556 -0
- package/scripts/flow-http-client.js +249 -0
- package/scripts/flow-hybrid-detect.js +167 -0
- package/scripts/flow-hybrid-interactive.js +591 -0
- package/scripts/flow-hybrid-test.js +152 -0
- package/scripts/flow-import-profile +439 -0
- package/scripts/flow-init +253 -0
- package/scripts/flow-instruction-richness.js +827 -0
- package/scripts/flow-jira-integration.js +579 -0
- package/scripts/flow-knowledge-router.js +522 -0
- package/scripts/flow-knowledge-sync.js +589 -0
- package/scripts/flow-linear-integration.js +631 -0
- package/scripts/flow-links.js +774 -0
- package/scripts/flow-log-manager.js +559 -0
- package/scripts/flow-loop-enforcer.js +1246 -0
- package/scripts/flow-loop-retry-learning.js +630 -0
- package/scripts/flow-lsp.js +923 -0
- package/scripts/flow-map-index +348 -0
- package/scripts/flow-map-sync +201 -0
- package/scripts/flow-memory-blocks.js +668 -0
- package/scripts/flow-memory-compactor.js +350 -0
- package/scripts/flow-memory-db.js +1110 -0
- package/scripts/flow-memory-sync.js +484 -0
- package/scripts/flow-metrics.js +353 -0
- package/scripts/flow-migrate-ids.js +370 -0
- package/scripts/flow-model-adapter.js +802 -0
- package/scripts/flow-model-router.js +884 -0
- package/scripts/flow-models.js +1231 -0
- package/scripts/flow-morning.js +517 -0
- package/scripts/flow-multi-approach.js +660 -0
- package/scripts/flow-new-feature +86 -0
- package/scripts/flow-onboard +1042 -0
- package/scripts/flow-orchestrate-llm.js +459 -0
- package/scripts/flow-orchestrate.js +3592 -0
- package/scripts/flow-output.js +123 -0
- package/scripts/flow-parallel-detector.js +399 -0
- package/scripts/flow-parallel-dispatch.js +987 -0
- package/scripts/flow-parallel.js +428 -0
- package/scripts/flow-pattern-enforcer.js +600 -0
- package/scripts/flow-prd-manager.js +282 -0
- package/scripts/flow-progress.js +323 -0
- package/scripts/flow-project-analyzer.js +975 -0
- package/scripts/flow-prompt-composer.js +487 -0
- package/scripts/flow-providers.js +1381 -0
- package/scripts/flow-queue.js +308 -0
- package/scripts/flow-ready +82 -0
- package/scripts/flow-ready.js +189 -0
- package/scripts/flow-regression.js +396 -0
- package/scripts/flow-response-parser.js +450 -0
- package/scripts/flow-resume.js +284 -0
- package/scripts/flow-rules-sync.js +439 -0
- package/scripts/flow-run-trace.js +718 -0
- package/scripts/flow-safety.js +587 -0
- package/scripts/flow-search +104 -0
- package/scripts/flow-security.js +481 -0
- package/scripts/flow-session-end +106 -0
- package/scripts/flow-session-end.js +437 -0
- package/scripts/flow-session-state.js +671 -0
- package/scripts/flow-setup-hooks +216 -0
- package/scripts/flow-setup-hooks.js +377 -0
- package/scripts/flow-skill-create.js +329 -0
- package/scripts/flow-skill-creator.js +572 -0
- package/scripts/flow-skill-generator.js +1046 -0
- package/scripts/flow-skill-learn.js +880 -0
- package/scripts/flow-skill-matcher.js +578 -0
- package/scripts/flow-spec-generator.js +820 -0
- package/scripts/flow-stack-wizard.js +895 -0
- package/scripts/flow-standup +162 -0
- package/scripts/flow-start +74 -0
- package/scripts/flow-start.js +235 -0
- package/scripts/flow-status +110 -0
- package/scripts/flow-status.js +301 -0
- package/scripts/flow-step-browser.js +83 -0
- package/scripts/flow-step-changelog.js +217 -0
- package/scripts/flow-step-comments.js +306 -0
- package/scripts/flow-step-complexity.js +234 -0
- package/scripts/flow-step-coverage.js +218 -0
- package/scripts/flow-step-knowledge.js +193 -0
- package/scripts/flow-step-pr-tests.js +364 -0
- package/scripts/flow-step-regression.js +89 -0
- package/scripts/flow-step-review.js +516 -0
- package/scripts/flow-step-security.js +162 -0
- package/scripts/flow-step-silent-failures.js +290 -0
- package/scripts/flow-step-simplifier.js +346 -0
- package/scripts/flow-story +105 -0
- package/scripts/flow-story.js +500 -0
- package/scripts/flow-suspend.js +252 -0
- package/scripts/flow-sync-daemon.js +654 -0
- package/scripts/flow-task-analyzer.js +606 -0
- package/scripts/flow-team-dashboard.js +748 -0
- package/scripts/flow-team-sync.js +752 -0
- package/scripts/flow-team.js +977 -0
- package/scripts/flow-tech-options.js +528 -0
- package/scripts/flow-templates.js +812 -0
- package/scripts/flow-tiered-learning.js +728 -0
- package/scripts/flow-trace +204 -0
- package/scripts/flow-transcript-chunking.js +1106 -0
- package/scripts/flow-transcript-digest.js +7918 -0
- package/scripts/flow-transcript-language.js +465 -0
- package/scripts/flow-transcript-parsing.js +1085 -0
- package/scripts/flow-transcript-stories.js +2194 -0
- package/scripts/flow-update-map +224 -0
- package/scripts/flow-utils.js +2242 -0
- package/scripts/flow-verification.js +644 -0
- package/scripts/flow-verify.js +1177 -0
- package/scripts/flow-voice-input.js +638 -0
- package/scripts/flow-watch +168 -0
- package/scripts/flow-workflow-steps.js +521 -0
- package/scripts/flow-workflow.js +1029 -0
- package/scripts/flow-worktree.js +489 -0
- package/scripts/hooks/adapters/base-adapter.js +102 -0
- package/scripts/hooks/adapters/claude-code.js +359 -0
- package/scripts/hooks/adapters/index.js +79 -0
- package/scripts/hooks/core/component-check.js +341 -0
- package/scripts/hooks/core/index.js +35 -0
- package/scripts/hooks/core/loop-check.js +241 -0
- package/scripts/hooks/core/session-context.js +294 -0
- package/scripts/hooks/core/task-gate.js +177 -0
- package/scripts/hooks/core/validation.js +230 -0
- package/scripts/hooks/entry/claude-code/post-tool-use.js +65 -0
- package/scripts/hooks/entry/claude-code/pre-tool-use.js +89 -0
- package/scripts/hooks/entry/claude-code/session-end.js +87 -0
- package/scripts/hooks/entry/claude-code/session-start.js +46 -0
- package/scripts/hooks/entry/claude-code/stop.js +43 -0
- package/scripts/postinstall.js +139 -0
- package/templates/browser-test-flow.json +56 -0
- package/templates/bug-report.md +43 -0
- package/templates/component-detail.md +42 -0
- package/templates/component.stories.tsx +49 -0
- package/templates/context/constraints.md +83 -0
- package/templates/context/conventions.md +177 -0
- package/templates/context/stack.md +60 -0
- package/templates/correction-report.md +90 -0
- package/templates/feature-proposal.md +35 -0
- package/templates/hybrid/_base.md +254 -0
- package/templates/hybrid/_patterns.md +45 -0
- package/templates/hybrid/create-component.md +127 -0
- package/templates/hybrid/create-file.md +56 -0
- package/templates/hybrid/create-hook.md +145 -0
- package/templates/hybrid/create-service.md +70 -0
- package/templates/hybrid/fix-bug.md +33 -0
- package/templates/hybrid/modify-file.md +55 -0
- package/templates/story.md +68 -0
- package/templates/task.json +56 -0
- package/templates/trace.md +69 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Project Patterns
|
|
2
|
+
|
|
3
|
+
This file will be auto-generated during onboarding based on your actual codebase patterns.
|
|
4
|
+
|
|
5
|
+
Run `./scripts/flow templates generate` to populate this file with real examples from your project.
|
|
6
|
+
|
|
7
|
+
## Naming Conventions
|
|
8
|
+
|
|
9
|
+
- Components: PascalCase (e.g., `UserProfile.tsx`)
|
|
10
|
+
- Hooks: camelCase with `use` prefix (e.g., `useAuth.ts`)
|
|
11
|
+
- Services: camelCase with `Service` suffix (e.g., `authService.ts`)
|
|
12
|
+
- Utilities: camelCase (e.g., `formatDate.ts`)
|
|
13
|
+
- Types/Interfaces: PascalCase (e.g., `UserProfile`, `AuthResponse`)
|
|
14
|
+
|
|
15
|
+
## Import Order
|
|
16
|
+
|
|
17
|
+
1. React/framework imports
|
|
18
|
+
2. Third-party libraries
|
|
19
|
+
3. Aliased imports (@/ or ~/)
|
|
20
|
+
4. Relative imports
|
|
21
|
+
5. Type imports (with `type` keyword)
|
|
22
|
+
|
|
23
|
+
## Project-Specific Import Patterns
|
|
24
|
+
|
|
25
|
+
{{#if importPatterns}}
|
|
26
|
+
{{importPatterns}}
|
|
27
|
+
{{else}}
|
|
28
|
+
Use the import patterns you see in the existing file or context.
|
|
29
|
+
{{/if}}
|
|
30
|
+
|
|
31
|
+
## Available Shared Components
|
|
32
|
+
|
|
33
|
+
{{#if availableComponents}}
|
|
34
|
+
These components exist in this project. Use them instead of creating new ones:
|
|
35
|
+
{{availableComponents}}
|
|
36
|
+
{{/if}}
|
|
37
|
+
|
|
38
|
+
## Type Locations
|
|
39
|
+
|
|
40
|
+
{{#if typeLocations}}
|
|
41
|
+
{{typeLocations}}
|
|
42
|
+
{{else}}
|
|
43
|
+
- Feature types: Typically in `./types.ts` or `../api/types.ts` relative to the feature
|
|
44
|
+
- Shared types: `@/types/` or `src/types/`
|
|
45
|
+
{{/if}}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
{{include _base.md}}
|
|
2
|
+
|
|
3
|
+
# Task: Create React Component
|
|
4
|
+
|
|
5
|
+
{{include _patterns.md}}
|
|
6
|
+
|
|
7
|
+
## Component Specification
|
|
8
|
+
|
|
9
|
+
**CRITICAL - You are creating this component:**
|
|
10
|
+
|
|
11
|
+
| Field | Value |
|
|
12
|
+
|-------|-------|
|
|
13
|
+
| **Component Name** | `{{name}}` |
|
|
14
|
+
| **File Path** | `{{path}}` |
|
|
15
|
+
| **Props Interface** | `{{name}}Props` |
|
|
16
|
+
|
|
17
|
+
**Description:**
|
|
18
|
+
{{description}}
|
|
19
|
+
|
|
20
|
+
**Props (if any):**
|
|
21
|
+
{{props}}
|
|
22
|
+
|
|
23
|
+
**Must Use These Existing Components/Hooks:**
|
|
24
|
+
{{uses}}
|
|
25
|
+
|
|
26
|
+
**Expected Behavior:**
|
|
27
|
+
{{behavior}}
|
|
28
|
+
|
|
29
|
+
## What You MUST Create
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
// File: {{path}}
|
|
33
|
+
// Component: {{name}}
|
|
34
|
+
// Interface: {{name}}Props
|
|
35
|
+
|
|
36
|
+
import { ... } from 'react';
|
|
37
|
+
|
|
38
|
+
interface {{name}}Props {
|
|
39
|
+
// props here
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* [Brief description of {{name}}]
|
|
44
|
+
*/
|
|
45
|
+
export function {{name}}({ ...props }: {{name}}Props) {
|
|
46
|
+
return (
|
|
47
|
+
// JSX for {{name}} here
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## What NOT to Create
|
|
53
|
+
|
|
54
|
+
❌ Do NOT create any component except `{{name}}`
|
|
55
|
+
❌ Do NOT create types/interfaces from the project context section
|
|
56
|
+
❌ Do NOT create components mentioned as "available" - those already exist
|
|
57
|
+
❌ Do NOT output anything except the code for `{{name}}`
|
|
58
|
+
|
|
59
|
+
## Requirements Checklist
|
|
60
|
+
|
|
61
|
+
1. [ ] Component is named exactly `{{name}}` (not something else!)
|
|
62
|
+
2. [ ] Props interface is named `{{name}}Props`
|
|
63
|
+
3. [ ] Exported as: `export function {{name}}`
|
|
64
|
+
4. [ ] Uses only imports from "Available Components" or standard React
|
|
65
|
+
5. [ ] Follows the component pattern from _patterns.md
|
|
66
|
+
6. [ ] Has JSDoc comment
|
|
67
|
+
7. [ ] Contains JSX (this is a .tsx file)
|
|
68
|
+
|
|
69
|
+
## Golden Example (Follow This Pattern)
|
|
70
|
+
|
|
71
|
+
This example shows the CORRECT output format:
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
'use client';
|
|
75
|
+
|
|
76
|
+
import { useState, useCallback } from 'react';
|
|
77
|
+
import { Button } from '@/components/ui/Button';
|
|
78
|
+
|
|
79
|
+
interface UserCardProps {
|
|
80
|
+
name: string;
|
|
81
|
+
email: string;
|
|
82
|
+
onEdit?: () => void;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Displays user information with optional edit action.
|
|
87
|
+
*/
|
|
88
|
+
export function UserCard({ name, email, onEdit }: UserCardProps) {
|
|
89
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
90
|
+
|
|
91
|
+
const handleMouseEnter = useCallback(() => setIsHovered(true), []);
|
|
92
|
+
const handleMouseLeave = useCallback(() => setIsHovered(false), []);
|
|
93
|
+
|
|
94
|
+
return (
|
|
95
|
+
<div
|
|
96
|
+
className="p-4 rounded-lg border"
|
|
97
|
+
onMouseEnter={handleMouseEnter}
|
|
98
|
+
onMouseLeave={handleMouseLeave}
|
|
99
|
+
>
|
|
100
|
+
<h3 className="font-medium">{name}</h3>
|
|
101
|
+
<p className="text-gray-600">{email}</p>
|
|
102
|
+
{onEdit && isHovered && (
|
|
103
|
+
<Button variant="ghost" size="sm" onClick={onEdit}>
|
|
104
|
+
Edit
|
|
105
|
+
</Button>
|
|
106
|
+
)}
|
|
107
|
+
</div>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**Notice:**
|
|
113
|
+
- 'use client' directive at the very top (if needed)
|
|
114
|
+
- Standard React imports only (useState, useCallback)
|
|
115
|
+
- Project imports use exact paths from "Available Components"
|
|
116
|
+
- Props interface defined inline with Props suffix
|
|
117
|
+
- JSDoc comment briefly describes the component
|
|
118
|
+
- Function exported with `export function`
|
|
119
|
+
- All variant/size props use string literals: `variant="ghost"` NOT `variant={variants.ghost}`
|
|
120
|
+
|
|
121
|
+
## Output
|
|
122
|
+
|
|
123
|
+
Output the complete file content starting with imports.
|
|
124
|
+
No markdown code blocks. No explanations. Just the code.
|
|
125
|
+
|
|
126
|
+
Start with imports (or 'use client'/'use server' directive if needed for Next.js).
|
|
127
|
+
The code must define and export `{{name}}`.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{{include _base.md}}
|
|
2
|
+
|
|
3
|
+
# Task: Create File
|
|
4
|
+
|
|
5
|
+
{{include _patterns.md}}
|
|
6
|
+
|
|
7
|
+
## File Specification
|
|
8
|
+
|
|
9
|
+
**CRITICAL - You are creating this file:**
|
|
10
|
+
|
|
11
|
+
| Field | Value |
|
|
12
|
+
|-------|-------|
|
|
13
|
+
| **File Path** | `{{path}}` |
|
|
14
|
+
| **File Type** | `{{fileType}}` |
|
|
15
|
+
|
|
16
|
+
**Description:**
|
|
17
|
+
{{description}}
|
|
18
|
+
|
|
19
|
+
**Content Guidance:**
|
|
20
|
+
{{content_guidance}}
|
|
21
|
+
|
|
22
|
+
## What You MUST Create
|
|
23
|
+
|
|
24
|
+
Create a complete, functional file at the specified path.
|
|
25
|
+
|
|
26
|
+
{{#if isTypeScript}}
|
|
27
|
+
- Include proper TypeScript types
|
|
28
|
+
- Add necessary imports at the top
|
|
29
|
+
- Export appropriately (named or default as needed)
|
|
30
|
+
{{/if}}
|
|
31
|
+
|
|
32
|
+
{{#if isConfig}}
|
|
33
|
+
- Follow the format expected by the tool/framework
|
|
34
|
+
- Include all required fields
|
|
35
|
+
- Add comments explaining non-obvious settings
|
|
36
|
+
{{/if}}
|
|
37
|
+
|
|
38
|
+
## What NOT to Create
|
|
39
|
+
|
|
40
|
+
❌ Do NOT create a different file than `{{path}}`
|
|
41
|
+
❌ Do NOT output partial content
|
|
42
|
+
❌ Do NOT wrap in markdown code blocks
|
|
43
|
+
|
|
44
|
+
## Requirements
|
|
45
|
+
|
|
46
|
+
1. Create the complete file content
|
|
47
|
+
2. Follow project conventions and patterns from _patterns.md
|
|
48
|
+
3. Include proper imports if TypeScript/JavaScript
|
|
49
|
+
4. Add appropriate comments/JSDoc if needed
|
|
50
|
+
5. Ensure the file is complete and functional
|
|
51
|
+
|
|
52
|
+
## Output
|
|
53
|
+
|
|
54
|
+
Output the complete file content.
|
|
55
|
+
No markdown code blocks. No explanations. Just the raw file content.
|
|
56
|
+
Start directly with the first line of the file.
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
{{include _base.md}}
|
|
2
|
+
|
|
3
|
+
# Task: Create React Hook
|
|
4
|
+
|
|
5
|
+
{{include _patterns.md}}
|
|
6
|
+
|
|
7
|
+
## Hook Specification
|
|
8
|
+
|
|
9
|
+
**CRITICAL - You are creating this hook:**
|
|
10
|
+
|
|
11
|
+
| Field | Value |
|
|
12
|
+
|-------|-------|
|
|
13
|
+
| **Hook Name** | `{{name}}` |
|
|
14
|
+
| **File Path** | `{{path}}` |
|
|
15
|
+
| **Return Type** | `{{name}}Result` or similar |
|
|
16
|
+
|
|
17
|
+
**Description:**
|
|
18
|
+
{{description}}
|
|
19
|
+
|
|
20
|
+
**Return Values:**
|
|
21
|
+
{{returns}}
|
|
22
|
+
|
|
23
|
+
**Dependencies/Uses:**
|
|
24
|
+
{{uses}}
|
|
25
|
+
|
|
26
|
+
## What You MUST Create
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
// File: {{path}}
|
|
30
|
+
// Hook: {{name}}
|
|
31
|
+
|
|
32
|
+
import { useState, useCallback, ... } from 'react';
|
|
33
|
+
|
|
34
|
+
interface {{name}}Result {
|
|
35
|
+
// return properties
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* [Brief description of {{name}}]
|
|
40
|
+
*/
|
|
41
|
+
export function {{name}}(/* params */): {{name}}Result {
|
|
42
|
+
// implementation
|
|
43
|
+
return {
|
|
44
|
+
// returned values
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## What NOT to Create
|
|
50
|
+
|
|
51
|
+
❌ Do NOT create any hook except `{{name}}`
|
|
52
|
+
❌ Do NOT create types/interfaces from the project context section
|
|
53
|
+
❌ Do NOT create a component - this is a HOOK file
|
|
54
|
+
❌ Do NOT output anything except the code for `{{name}}`
|
|
55
|
+
|
|
56
|
+
## Requirements Checklist
|
|
57
|
+
|
|
58
|
+
1. [ ] Hook is named exactly `{{name}}` (must start with "use")
|
|
59
|
+
2. [ ] Return type interface is defined
|
|
60
|
+
3. [ ] Exported as: `export function {{name}}`
|
|
61
|
+
4. [ ] Returns an object with named properties (not array)
|
|
62
|
+
5. [ ] Handles loading/error states if applicable
|
|
63
|
+
6. [ ] Follows the hook pattern from _patterns.md
|
|
64
|
+
7. [ ] Has JSDoc comment
|
|
65
|
+
|
|
66
|
+
## Golden Example (Follow This Pattern)
|
|
67
|
+
|
|
68
|
+
This example shows the CORRECT output format for a data-fetching hook:
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
'use client';
|
|
72
|
+
|
|
73
|
+
import { useState, useEffect, useCallback } from 'react';
|
|
74
|
+
|
|
75
|
+
interface User {
|
|
76
|
+
id: string;
|
|
77
|
+
name: string;
|
|
78
|
+
email: string;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
interface UseUserResult {
|
|
82
|
+
user: User | null;
|
|
83
|
+
isLoading: boolean;
|
|
84
|
+
error: Error | null;
|
|
85
|
+
refetch: () => void;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Fetches and manages user data for the given user ID.
|
|
90
|
+
*/
|
|
91
|
+
export function useUser(userId: string): UseUserResult {
|
|
92
|
+
const [user, setUser] = useState<User | null>(null);
|
|
93
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
94
|
+
const [error, setError] = useState<Error | null>(null);
|
|
95
|
+
|
|
96
|
+
const fetchUser = useCallback(async () => {
|
|
97
|
+
if (!userId) return;
|
|
98
|
+
|
|
99
|
+
setIsLoading(true);
|
|
100
|
+
setError(null);
|
|
101
|
+
|
|
102
|
+
try {
|
|
103
|
+
const response = await fetch(`/api/users/${userId}`);
|
|
104
|
+
if (!response.ok) {
|
|
105
|
+
throw new Error('Failed to fetch user');
|
|
106
|
+
}
|
|
107
|
+
const data = await response.json();
|
|
108
|
+
setUser(data);
|
|
109
|
+
} catch (err) {
|
|
110
|
+
setError(err instanceof Error ? err : new Error('Unknown error'));
|
|
111
|
+
} finally {
|
|
112
|
+
setIsLoading(false);
|
|
113
|
+
}
|
|
114
|
+
}, [userId]);
|
|
115
|
+
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
fetchUser();
|
|
118
|
+
}, [fetchUser]);
|
|
119
|
+
|
|
120
|
+
return {
|
|
121
|
+
user,
|
|
122
|
+
isLoading,
|
|
123
|
+
error,
|
|
124
|
+
refetch: fetchUser,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Notice:**
|
|
130
|
+
- 'use client' directive at the very top (if needed for client-side React)
|
|
131
|
+
- Hook name starts with "use"
|
|
132
|
+
- Return type interface clearly defines all returned values
|
|
133
|
+
- JSDoc comment briefly describes the hook's purpose
|
|
134
|
+
- Returns object with named properties (NOT array like `[user, setUser]`)
|
|
135
|
+
- Handles loading and error states
|
|
136
|
+
- Memoizes callbacks with useCallback
|
|
137
|
+
- Exports with `export function`
|
|
138
|
+
|
|
139
|
+
## Output
|
|
140
|
+
|
|
141
|
+
Output the complete file content starting with imports.
|
|
142
|
+
No markdown code blocks. No explanations. Just the code.
|
|
143
|
+
|
|
144
|
+
Start with imports (or 'use client' directive if needed for Next.js client hooks).
|
|
145
|
+
The code must define and export `{{name}}`.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{{include _base.md}}
|
|
2
|
+
|
|
3
|
+
# Task: Create Service
|
|
4
|
+
|
|
5
|
+
{{include _patterns.md}}
|
|
6
|
+
|
|
7
|
+
## Service Specification
|
|
8
|
+
|
|
9
|
+
**CRITICAL - You are creating this service:**
|
|
10
|
+
|
|
11
|
+
| Field | Value |
|
|
12
|
+
|-------|-------|
|
|
13
|
+
| **Service Name** | `{{name}}` |
|
|
14
|
+
| **File Path** | `{{path}}` |
|
|
15
|
+
|
|
16
|
+
**Description:**
|
|
17
|
+
{{description}}
|
|
18
|
+
|
|
19
|
+
**Methods:**
|
|
20
|
+
{{methods}}
|
|
21
|
+
|
|
22
|
+
**Types to Define:**
|
|
23
|
+
{{types}}
|
|
24
|
+
|
|
25
|
+
## What You MUST Create
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
// File: {{path}}
|
|
29
|
+
// Service: {{name}}
|
|
30
|
+
|
|
31
|
+
// Type definitions
|
|
32
|
+
interface SomeInput { ... }
|
|
33
|
+
interface SomeOutput { ... }
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* [Brief description of {{name}}]
|
|
37
|
+
*/
|
|
38
|
+
export const {{name}} = {
|
|
39
|
+
/**
|
|
40
|
+
* [Method description]
|
|
41
|
+
*/
|
|
42
|
+
async someMethod(input: SomeInput): Promise<SomeOutput> {
|
|
43
|
+
// implementation
|
|
44
|
+
},
|
|
45
|
+
// ... other methods
|
|
46
|
+
};
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## What NOT to Create
|
|
50
|
+
|
|
51
|
+
❌ Do NOT create any service except `{{name}}`
|
|
52
|
+
❌ Do NOT create types/interfaces from the project context section
|
|
53
|
+
❌ Do NOT create a React component or hook - this is a SERVICE file
|
|
54
|
+
❌ Do NOT output anything except the code for `{{name}}`
|
|
55
|
+
|
|
56
|
+
## Requirements Checklist
|
|
57
|
+
|
|
58
|
+
1. [ ] Service is named exactly `{{name}}`
|
|
59
|
+
2. [ ] All TypeScript types are defined for parameters and returns
|
|
60
|
+
3. [ ] Exported as: `export const {{name}}` or `export class {{name}}`
|
|
61
|
+
4. [ ] Errors are handled appropriately
|
|
62
|
+
5. [ ] Follows the service pattern from _patterns.md
|
|
63
|
+
6. [ ] Has JSDoc comments for each method
|
|
64
|
+
|
|
65
|
+
## Output
|
|
66
|
+
|
|
67
|
+
Output the complete file content starting with imports (if any).
|
|
68
|
+
No markdown code blocks. No explanations. Just the code.
|
|
69
|
+
|
|
70
|
+
The code must define and export `{{name}}`.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{{include _base.md}}
|
|
2
|
+
|
|
3
|
+
# Task: Fix Bug
|
|
4
|
+
|
|
5
|
+
## Bug Details
|
|
6
|
+
|
|
7
|
+
**File:** {{path}}
|
|
8
|
+
**Bug Description:** {{bugDescription}}
|
|
9
|
+
**Expected Behavior:** {{expectedBehavior}}
|
|
10
|
+
**Actual Behavior:** {{actualBehavior}}
|
|
11
|
+
|
|
12
|
+
## Current File Content
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
{{currentContent}}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Error Message (if any)
|
|
19
|
+
|
|
20
|
+
{{errorMessage}}
|
|
21
|
+
|
|
22
|
+
## Requirements
|
|
23
|
+
|
|
24
|
+
1. Identify the root cause
|
|
25
|
+
2. Fix ONLY what's necessary
|
|
26
|
+
3. Don't refactor unrelated code
|
|
27
|
+
4. Ensure the fix doesn't break other functionality
|
|
28
|
+
5. Add a comment explaining the fix if it's not obvious
|
|
29
|
+
|
|
30
|
+
## Output
|
|
31
|
+
|
|
32
|
+
Output the COMPLETE fixed file.
|
|
33
|
+
No markdown code blocks.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{{include _base.md}}
|
|
2
|
+
|
|
3
|
+
{{include _patterns.md}}
|
|
4
|
+
|
|
5
|
+
# Task: Modify Existing File
|
|
6
|
+
|
|
7
|
+
## File to Modify
|
|
8
|
+
|
|
9
|
+
**CRITICAL - You are modifying this file:**
|
|
10
|
+
|
|
11
|
+
| Field | Value |
|
|
12
|
+
|-------|-------|
|
|
13
|
+
| **File Path** | `{{path}}` |
|
|
14
|
+
| **Task** | Apply the changes described below |
|
|
15
|
+
|
|
16
|
+
## Current File Content
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
{{currentContent}}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Required Changes
|
|
23
|
+
|
|
24
|
+
{{modifications}}
|
|
25
|
+
|
|
26
|
+
## What You MUST Do
|
|
27
|
+
|
|
28
|
+
1. Start with ALL existing imports from the current file
|
|
29
|
+
2. Apply ONLY the specified changes
|
|
30
|
+
3. Preserve ALL existing code not mentioned in changes
|
|
31
|
+
4. Output the COMPLETE file (not a diff or snippet)
|
|
32
|
+
|
|
33
|
+
## What NOT to Do
|
|
34
|
+
|
|
35
|
+
❌ Do NOT remove existing code unless explicitly told to
|
|
36
|
+
❌ Do NOT change import paths
|
|
37
|
+
❌ Do NOT reorganize or reformat existing code
|
|
38
|
+
❌ Do NOT add features not mentioned in Required Changes
|
|
39
|
+
❌ Do NOT output partial code or diffs
|
|
40
|
+
❌ Do NOT create new files - modify the existing one
|
|
41
|
+
|
|
42
|
+
## CRITICAL Requirements
|
|
43
|
+
|
|
44
|
+
1. [ ] Output is a COMPLETE valid TypeScript file
|
|
45
|
+
2. [ ] ALL existing imports are preserved
|
|
46
|
+
3. [ ] Only specified changes are applied
|
|
47
|
+
4. [ ] File maintains its existing structure and style
|
|
48
|
+
5. [ ] Output size is similar to original (not drastically smaller)
|
|
49
|
+
|
|
50
|
+
## Output
|
|
51
|
+
|
|
52
|
+
Output the COMPLETE modified file with all changes applied.
|
|
53
|
+
The output must be the ENTIRE file content, not a partial snippet.
|
|
54
|
+
Start directly with the first import statement.
|
|
55
|
+
No markdown code blocks. No explanations.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# [wf-XXXXXXXX] [Title]
|
|
2
|
+
|
|
3
|
+
## User Story
|
|
4
|
+
**As a** [user type]
|
|
5
|
+
**I want** [action/capability]
|
|
6
|
+
**So that** [benefit/value]
|
|
7
|
+
|
|
8
|
+
## Description
|
|
9
|
+
[2-4 sentences explaining the context, what needs to be built, and why it matters.]
|
|
10
|
+
|
|
11
|
+
## Acceptance Criteria
|
|
12
|
+
|
|
13
|
+
### Scenario 1: [Happy path]
|
|
14
|
+
**Given** [initial context/state]
|
|
15
|
+
**When** [action taken]
|
|
16
|
+
**Then** [expected outcome]
|
|
17
|
+
**And** [additional outcome if needed]
|
|
18
|
+
|
|
19
|
+
### Scenario 2: [Alternative path]
|
|
20
|
+
**Given** [context]
|
|
21
|
+
**When** [action]
|
|
22
|
+
**Then** [outcome]
|
|
23
|
+
|
|
24
|
+
### Scenario 3: [Error handling]
|
|
25
|
+
**Given** [context]
|
|
26
|
+
**When** [invalid action or error condition]
|
|
27
|
+
**Then** [error handling behavior]
|
|
28
|
+
|
|
29
|
+
## Technical Notes
|
|
30
|
+
- **Components**:
|
|
31
|
+
- Use existing: [from app-map]
|
|
32
|
+
- Create new: [add to app-map after]
|
|
33
|
+
- **API**: [endpoints if any]
|
|
34
|
+
- **State**: [state management notes]
|
|
35
|
+
- **Constraints**: [technical limitations]
|
|
36
|
+
|
|
37
|
+
## Test Strategy
|
|
38
|
+
- [ ] Unit: [what to test]
|
|
39
|
+
- [ ] Integration: [what to test]
|
|
40
|
+
- [ ] E2E: [user flow to verify]
|
|
41
|
+
|
|
42
|
+
## Test Steps (Verification Checklist)
|
|
43
|
+
<!-- Quick verification steps to confirm the feature works -->
|
|
44
|
+
1. [ ] [Step 1: Verify specific behavior]
|
|
45
|
+
2. [ ] [Step 2: Verify another behavior]
|
|
46
|
+
3. [ ] [Step 3: Verify edge case]
|
|
47
|
+
|
|
48
|
+
## Dependencies
|
|
49
|
+
- [wf-XXXXXXXX] - [why needed first]
|
|
50
|
+
- None
|
|
51
|
+
|
|
52
|
+
## Complexity
|
|
53
|
+
[Low / Medium / High] - [justification]
|
|
54
|
+
|
|
55
|
+
## Out of Scope
|
|
56
|
+
- [What this does NOT include]
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Implementation Notes
|
|
61
|
+
<!-- Developer fills this in during implementation -->
|
|
62
|
+
|
|
63
|
+
## Completion Checklist
|
|
64
|
+
- [ ] All acceptance criteria scenarios pass
|
|
65
|
+
- [ ] Tests written per test strategy
|
|
66
|
+
- [ ] Components added to app-map (if new)
|
|
67
|
+
- [ ] Request-log updated
|
|
68
|
+
- [ ] Code reviewed
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"feature": "[feature-name]",
|
|
3
|
+
"created": "[ISO date]",
|
|
4
|
+
"tasks": [
|
|
5
|
+
{
|
|
6
|
+
"id": "TASK-001",
|
|
7
|
+
"title": "[Descriptive title]",
|
|
8
|
+
"type": "feature",
|
|
9
|
+
"status": "pending",
|
|
10
|
+
"priority": "high",
|
|
11
|
+
"complexity": "medium",
|
|
12
|
+
"phase": null,
|
|
13
|
+
"dependencies": [],
|
|
14
|
+
"userStory": {
|
|
15
|
+
"asA": "[user type]",
|
|
16
|
+
"iWant": "[action/capability]",
|
|
17
|
+
"soThat": "[benefit/value]"
|
|
18
|
+
},
|
|
19
|
+
"description": "[2-4 sentences of context explaining what and why]",
|
|
20
|
+
"acceptanceCriteria": [
|
|
21
|
+
{
|
|
22
|
+
"scenario": "Happy path",
|
|
23
|
+
"given": "[initial state]",
|
|
24
|
+
"when": "[action]",
|
|
25
|
+
"then": "[outcome]"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"scenario": "Error case",
|
|
29
|
+
"given": "[state]",
|
|
30
|
+
"when": "[invalid action]",
|
|
31
|
+
"then": "[error handling]"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"testSteps": [
|
|
35
|
+
"Step 1: Verify [specific behavior]",
|
|
36
|
+
"Step 2: Verify [another behavior]"
|
|
37
|
+
],
|
|
38
|
+
"technicalNotes": {
|
|
39
|
+
"componentsExisting": ["Button", "Input"],
|
|
40
|
+
"componentsNew": [],
|
|
41
|
+
"api": "",
|
|
42
|
+
"state": "",
|
|
43
|
+
"constraints": ""
|
|
44
|
+
},
|
|
45
|
+
"testStrategy": {
|
|
46
|
+
"unit": "[what to test]",
|
|
47
|
+
"integration": "[what to test]",
|
|
48
|
+
"e2e": "[flow to verify]"
|
|
49
|
+
},
|
|
50
|
+
"outOfScope": [],
|
|
51
|
+
"implemented": false,
|
|
52
|
+
"tested": false,
|
|
53
|
+
"commitHash": null
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|