ai-flow-dev 2.1.9 → 2.2.1

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 (77) hide show
  1. package/README.md +26 -29
  2. package/dist/cli.js +10 -4
  3. package/dist/cli.js.map +1 -1
  4. package/package.json +1 -1
  5. package/prompts/backend/flow-build-phase-0.md +278 -1738
  6. package/prompts/backend/flow-build-phase-1.md +19 -0
  7. package/prompts/backend/flow-build-phase-10.md +1 -0
  8. package/prompts/backend/flow-build-phase-2.md +19 -0
  9. package/prompts/backend/flow-build-phase-3.md +19 -0
  10. package/prompts/backend/flow-build-phase-4.md +19 -0
  11. package/prompts/backend/flow-build-phase-5.md +19 -0
  12. package/prompts/backend/flow-build-phase-6.md +19 -0
  13. package/prompts/backend/flow-build-phase-7.md +19 -0
  14. package/prompts/backend/flow-build-phase-8.md +6 -7
  15. package/prompts/backend/flow-build-phase-9.md +15 -0
  16. package/prompts/backend/flow-build.md +59 -836
  17. package/prompts/backend/flow-check-review.md +20 -0
  18. package/prompts/backend/flow-check-test.md +14 -0
  19. package/prompts/backend/flow-check.md +65 -0
  20. package/prompts/backend/flow-commit.md +51 -0
  21. package/prompts/backend/flow-docs-sync.md +53 -53
  22. package/prompts/backend/flow-work-feature.md +42 -0
  23. package/prompts/backend/flow-work-fix.md +33 -0
  24. package/prompts/backend/flow-work-refactor.md +32 -0
  25. package/prompts/backend/flow-work-resume.md +32 -0
  26. package/prompts/backend/flow-work.md +127 -0
  27. package/prompts/frontend/flow-build-phase-0.md +323 -426
  28. package/prompts/frontend/flow-build-phase-1.md +433 -404
  29. package/prompts/frontend/flow-build-phase-10.md +33 -0
  30. package/prompts/frontend/flow-build-phase-2.md +508 -872
  31. package/prompts/frontend/flow-build-phase-3.md +629 -562
  32. package/prompts/frontend/flow-build-phase-4.md +438 -382
  33. package/prompts/frontend/flow-build-phase-5.md +559 -362
  34. package/prompts/frontend/flow-build-phase-6.md +383 -452
  35. package/prompts/frontend/flow-build-phase-7.md +818 -392
  36. package/prompts/frontend/flow-build-phase-8.md +27 -16
  37. package/prompts/frontend/flow-build-phase-9.md +94 -0
  38. package/prompts/frontend/flow-build.md +68 -414
  39. package/prompts/frontend/flow-check-review.md +20 -0
  40. package/prompts/frontend/flow-check-test.md +14 -0
  41. package/prompts/frontend/flow-check.md +65 -0
  42. package/prompts/frontend/flow-commit.md +51 -0
  43. package/prompts/frontend/flow-docs-sync.md +36 -34
  44. package/prompts/frontend/flow-work-feature.md +42 -0
  45. package/prompts/frontend/flow-work-fix.md +33 -0
  46. package/prompts/frontend/flow-work-refactor.md +32 -0
  47. package/prompts/frontend/flow-work-resume.md +32 -0
  48. package/prompts/frontend/flow-work.md +127 -0
  49. package/prompts/mobile/flow-build-phase-0.md +335 -319
  50. package/prompts/mobile/flow-build-phase-1.md +438 -493
  51. package/prompts/mobile/flow-build-phase-10.md +32 -0
  52. package/prompts/mobile/flow-build-phase-2.md +458 -464
  53. package/prompts/mobile/flow-build-phase-3.md +613 -487
  54. package/prompts/mobile/flow-build-phase-4.md +439 -258
  55. package/prompts/mobile/flow-build-phase-5.md +582 -250
  56. package/prompts/mobile/flow-build-phase-6.md +389 -359
  57. package/prompts/mobile/flow-build-phase-7.md +871 -285
  58. package/prompts/mobile/flow-build-phase-8.md +27 -16
  59. package/prompts/mobile/flow-build-phase-9.md +90 -0
  60. package/prompts/mobile/flow-build.md +67 -426
  61. package/prompts/mobile/flow-check-review.md +20 -0
  62. package/prompts/mobile/flow-check-test.md +14 -0
  63. package/prompts/mobile/flow-check.md +65 -0
  64. package/prompts/mobile/flow-commit.md +51 -0
  65. package/prompts/mobile/flow-docs-sync.md +37 -40
  66. package/prompts/mobile/flow-work-feature.md +42 -0
  67. package/prompts/mobile/flow-work-fix.md +33 -0
  68. package/prompts/mobile/flow-work-refactor.md +32 -0
  69. package/prompts/mobile/flow-work-resume.md +32 -0
  70. package/prompts/mobile/flow-work.md +127 -0
  71. package/prompts/shared/smart-skip-preflight.md +214 -0
  72. package/prompts/backend/flow-dev-commit.md +0 -829
  73. package/prompts/backend/flow-dev-feature.md +0 -1948
  74. package/prompts/backend/flow-dev-fix.md +0 -952
  75. package/prompts/backend/flow-dev-refactor.md +0 -690
  76. package/prompts/backend/flow-dev-review.md +0 -372
  77. package/prompts/backend/flow-dev-work.md +0 -1081
@@ -18,29 +18,33 @@ Detect changes in the frontend codebase compared to the last documented state (s
18
18
 
19
19
  ### Step 1: Check for Analysis File
20
20
 
21
+ // turbo
22
+ ```bash
23
+ cat .ai-flow/cache/docs-analysis.json
21
24
  ```
22
- First, check if `.ai-flow/cache/docs-analysis.json` exists:
23
25
 
24
26
  - ✅ If exists → Proceed to Step 2 (Compare Changes)
25
27
  - ❌ If NOT exists → Execute full Phase 0 analysis first:
26
- - Run complete frontend code analysis (as described in Phase 0)
28
+ - Run complete frontend code analysis (Project Discovery)
27
29
  - Create `.ai-flow/cache/docs-analysis.json` with current state
28
30
  - Then proceed to Step 2
29
- ```
30
31
 
31
32
  ### Step 2: Detect Changes
32
33
 
33
34
  **Reuse Phase 0 Analysis Logic:**
34
35
 
35
36
  1. **Perform Current Code Analysis:**
36
-
37
- - Execute the same analysis as Phase 0 (frontend/flow-build-phase-0-context.md):
38
- - File structure analysis
39
- - Component detection and analysis
40
- - State management pattern detection
41
- - Styling approach detection
42
- - Routing pattern detection
43
- - Dependency analysis
37
+ - Execute project-wide discovery using cross-platform commands:
38
+ // turbo
39
+ ```bash
40
+ ls -R . --exclude-standard
41
+ ```
42
+ - Analyze current state for:
43
+ - View & UI components architecture
44
+ - Interface definitions (Routing patterns, public exports, entry points)
45
+ - State management and data flow (Global stores, Contexts, Hooks)
46
+ - Style definitions and design tokens
47
+ - Core dependencies and configuration
44
48
  - Generate current state snapshot
45
49
 
46
50
  2. **Compare with Previous State:**
@@ -48,12 +52,12 @@ First, check if `.ai-flow/cache/docs-analysis.json` exists:
48
52
  - Load `.ai-flow/cache/docs-analysis.json`
49
53
  - Compare current state vs previous state
50
54
  - Detect changes in:
51
- - **Components:** New, modified, or deleted components
52
- - **State Management:** New stores, hooks, or state patterns
53
- - **Styling:** New stylesheets, design tokens, or styling approach changes
54
- - **Dependencies:** New libraries, updated versions
55
- - **Architecture:** New modules, changed patterns, routing changes
56
- - **Configuration:** New environment variables, external services
55
+ - **Interfaces:** New, modified, or deleted "entry points" (Routes, Exports)
56
+ - **UI Structures:** New, modified, or deleted views/components
57
+ - **State Logic:** New, modified, or deleted state containers/logic
58
+ - **Style Forms:** New, modified, or deleted styling tokens/approaches
59
+ - **Dependencies:** Manifest changes (version bumps, new packages)
60
+ - **Configuration:** New environment keys or external integrations
57
61
 
58
62
  3. **Generate Change Report:**
59
63
  - Categorize changes by type
@@ -189,20 +193,19 @@ Update cancelled. Run `/flow-docs-sync` when you're ready to update the document
189
193
  ---
190
194
  ## Change Detection Rules
191
195
 
192
- ### Components Detection
196
+ ### UI & View Detection (Agnostic)
193
197
 
194
- **What triggers `docs/components.md` update:**
198
+ **What triggers document update (e.g., `docs/components.md`):**
195
199
 
196
- - New component files (`.tsx`, `.jsx`, `.vue`, `.svelte`)
197
- - New component directories or structure changes
198
- - Modified component exports or patterns
200
+ - New component definitions or file markers (e.g., standard exports, folder structures)
201
+ - Modified component hierarchies or patterns
199
202
  - Deleted components
200
203
 
201
204
  **How to update:**
202
205
 
203
- - Add new components following existing component conventions from Phase 2
204
- - Use same format, naming conventions, and patterns as existing components
205
- - Maintain all existing components unchanged
206
+ - Update component catalogs following established project conventions
207
+ - Refresh hierarchy diagrams (Mermaid) to reflect new structures
208
+ - Maintain existing documentation for stable components
206
209
 
207
210
  ### State Management Detection
208
211
 
@@ -220,20 +223,19 @@ Update cancelled. Run `/flow-docs-sync` when you're ready to update the document
220
223
  - Update state patterns if changed
221
224
  - Maintain all existing state management documentation
222
225
 
223
- ### Styling Detection
226
+ ### Style & Design Detection (Agnostic)
224
227
 
225
- **What triggers `docs/styling.md` update:**
228
+ **What triggers document update (e.g., `docs/styling.md`):**
226
229
 
227
- - New stylesheet files (`.css`, `.scss`, `.module.css`)
228
- - New design token files
229
- - Changes in `tailwind.config.*`, `postcss.config.*`
230
- - Modified styling approach
230
+ - New style manifest files or token definitions
231
+ - Modified design systems or styling approaches
232
+ - Structural changes in asset organization
231
233
 
232
234
  **How to update:**
233
235
 
234
- - Add new design tokens or styling patterns
235
- - Update styling guidelines if approach changed
236
- - Maintain all existing styling documentation
236
+ - Document new styling patterns or tokens
237
+ - Update architecture guides if styling methodology changed
238
+ - Maintain existing documentation for core design principles
237
239
 
238
240
  ### Dependencies Detection
239
241
 
@@ -0,0 +1,42 @@
1
+ ---
2
+ description: Internal logic for Feature implementation within flow-work
3
+ ---
4
+
5
+ # AI Flow - Feature Logic
6
+
7
+ This file contains the detailed execution logic for implementing new features, imported by `@flow-work.md`.
8
+
9
+ ---
10
+ ## 🚀 Feature Implementation Flow
11
+
12
+ ### 1. Specification (auto-skip if User Story)
13
+ - Extract requirements from User Story or Roadmap.
14
+ - If interactive, ask clarification questions (Multiple Choice).
15
+ - Save to `specs/ai-flow/work/[feature]/spec.md`.
16
+
17
+ ### 2. Technical Planning
18
+ - Analyze codebase for patterns.
19
+ - Generate `plan.md` with Fibonacci estimation.
20
+ - Organize tasks into layers (Data, Logic, API, Test, Docs).
21
+ - **User Confirmation Required.**
22
+
23
+ ### 3. Progressive Implementation
24
+ Choose mode:
25
+ - **Auto**: Complete all tasks without pausing.
26
+ - **Phase-by-phase**: Pause and validate after each phase.
27
+ - **Task-by-task**: Pause after each task.
28
+
29
+ ### 4. Definition of Done (DoD)
30
+ - If HU mode: Validate against Gherkin scenarios.
31
+ - Run tests and linting.
32
+ - Perform security check.
33
+
34
+ ---
35
+ ## 🌿 Git Branching Strategy
36
+ - Generate slug from name.
37
+ - Execute `git checkout -b feature/[slug]`.
38
+ - Maintain `status.json` with commit history.
39
+
40
+ ---
41
+ ## 📦 status.json Persistence
42
+ Ensure `progress`, `git`, and `metadata` sections are always updated.
@@ -0,0 +1,33 @@
1
+ ---
2
+ description: Internal logic for Bug Fixes within flow-work
3
+ ---
4
+
5
+ # AI Flow - Fix Logic
6
+
7
+ This file contains the detailed execution logic for bug fixes, imported by `@flow-work.md`.
8
+
9
+ ---
10
+ ## 🔧 Bug Fix Workflow
11
+
12
+ ### 1. Classification
13
+ - **QUICK**: 1 file, obvious cause (typo, null check).
14
+ - **COMPLEX**: Multiple files, investigation needed.
15
+
16
+ ### 2. Deep Analysis (Complex Fix)
17
+ - Create work directory.
18
+ - Document root cause in `analysis.md`.
19
+ - Map side effects.
20
+
21
+ ### 3. Implementation
22
+ - **Test-First Approach**: Add a failing test case that reproduces the bug before fixing it.
23
+ - Apply the fix.
24
+ - Verify tests pass.
25
+
26
+ ---
27
+ ## 🌿 Git Branching Strategy
28
+ - **QUICK**: Usually work on current branch.
29
+ - **COMPLEX**: Execute `git checkout -b fix/[slug]`.
30
+
31
+ ---
32
+ ## 📦 status.json Persistence
33
+ Track root cause details and verification test status.
@@ -0,0 +1,32 @@
1
+ ---
2
+ description: Internal logic for Refactor implementation within flow-work
3
+ ---
4
+
5
+ # AI Flow - Refactor Logic
6
+
7
+ This file contains the detailed execution logic for code refactoring, imported by `@flow-work.md`.
8
+
9
+ ---
10
+ ## 🔄 Refactoring Workflow
11
+
12
+ ### 1. Scope Identification
13
+ - Map affected files and dependencies.
14
+ - Confirm no behavior change is expected.
15
+ - Validate against architecture patterns.
16
+
17
+ ### 2. Implementation Strategy
18
+ - Use `plan.md` to map extraction/renaming/moving steps.
19
+ - Set "No behavior change" as the primary constraint.
20
+
21
+ ### 3. Execution & Safety
22
+ - Update imports and references across the codebase.
23
+ - **Critical**: Existing tests must pass without modification (unless test itself is refactored).
24
+ - Run `/flow-check` to verify no regressions.
25
+
26
+ ---
27
+ ## 🌿 Git Branching Strategy
28
+ - Execute `git checkout -b refactor/[slug]`.
29
+
30
+ ---
31
+ ## 📦 status.json Persistence
32
+ Track `percentage` of updated occurrences and updated file paths.
@@ -0,0 +1,32 @@
1
+ ---
2
+ description: Internal logic for Resuming work within flow-work
3
+ ---
4
+
5
+ # AI Flow - Resume Logic
6
+
7
+ This file contains the logic for detecting and resuming paused work items, imported by `@flow-work.md`.
8
+
9
+ ---
10
+ ## ⏸️ Resume Workflow
11
+
12
+ ### 1. Work Detection
13
+ - Scan `specs/ai-flow/work/` for any directories.
14
+ - Group by type and last updated timestamp.
15
+
16
+ ### 2. Selection Menu
17
+ - Show active tasks with percentage and current branch.
18
+ - Identify current Git branch and match with work items (⭐⭐ marker).
19
+
20
+ ### 3. Context Restoration
21
+ - Load `spec.md`, `plan.md`, `task.md`, and `status.json`.
22
+ - Verify Git branch:
23
+ - If mismatch: Prompt to switch to `git.branchName`.
24
+ - Identify the first incomplete task in `task.md`.
25
+
26
+ ### 4. Implementation Continuation
27
+ - Resume with the previously saved `implementationMode`.
28
+ - Continue execution from where it was paused.
29
+
30
+ ---
31
+ ## 📦 status.json Persistence
32
+ Update `timestamps.lastUpdated` upon resuming.
@@ -0,0 +1,127 @@
1
+ ---
2
+ description: Central Orchestrator for Feature, Refactor, and Fix workflows
3
+ ---
4
+
5
+ # AI Flow - Unified Work Orchestrator
6
+
7
+ **YOU ARE AN EXPERT SOFTWARE ARCHITECT AND WORKFLOW COORDINATOR.**
8
+
9
+ Your mission is to orchestrate development tasks through an interactive workflow when the user executes `/flow-work`.
10
+
11
+ ---
12
+ ## Command: `/flow-work`
13
+
14
+ ### Objective
15
+ Provide a single, intelligent entry point for all development work (New Features, Refactorings, and Bug Fixes) with automatic context detection and interactive planning.
16
+
17
+ ### Usage Modes
18
+ - **`/flow-work`** → Resume paused work (if exists) or Interactive mode.
19
+ - **`/flow-work [description]`** → Semantic detection (Feature, Refactor, or Fix).
20
+ - **`/flow-work HU-XXX-XXX`** → Implement specific User Story.
21
+ - **`/flow-work [Feature Name]`** → Implement feature from roadmap.md.
22
+
23
+ ---
24
+ ## Phase 0: Detection & Strategy (Automatic)
25
+
26
+ **1. Semantic Analysis of Input:**
27
+
28
+ | Input Pattern | Mode | Source / Action |
29
+ |---------------|------|-----------------|
30
+ | `HU-\d{3}-\d{3}` | `USER_STORY` | Load from `docs/user-stories/**/HU-XXX-XXX.md` |
31
+ | `EP-\d{3}` | `EPIC` | Analyze/List User Stories for Epic `EP-XXX` |
32
+ | `T\d{3}(-T\d{3})?` | `TASKS` | Target specific task or range (e.g., `T025-T030`) |
33
+ | `HU-XXX-XXX TXXX-TXXX`| `STORY_TASKS` | Targeted tasks within a specific User Story |
34
+ | Matches `docs/roadmap.md` | `ROADMAP_FEATURE`| Extract section from `docs/roadmap.md` (Partial matches allowed) |
35
+ | "refactor", "move", "extract" | `REFACTOR` | Use `flow-work-refactor.md` |
36
+ | "fix", "bug", "error", "falla" | `FIX` | Detect complexity (Quick vs Complex) |
37
+ | "implement", "create", "new" | `FEATURE` | Use `flow-work-feature.md` |
38
+ | No arguments | `RESUME` | Search for paused work in `specs/ai-flow/work/` |
39
+
40
+ **2. Detection Logic Details:**
41
+ - **USER_STORY / EPIC**: Load metadata from `docs/user-stories/` or `docs/roadmap.md`.
42
+ - **ROADMAP_FEATURE**: Fuzzy search in `docs/roadmap.md` for titles like "User Management" or "Feature 2.2".
43
+ - **TASK RANGES**: If `T025-T030` is provided, find the parent Story or Feature in current context or roadmap.
44
+ - **SIMPLE FIX**: Affects 1 file, obvious cause, <10 lines fix. → Use `flow-work-fix.md` (Quick).
45
+ - **COMPLEX FIX**: Multi-file, architectural, performance/security. → Use `flow-work-fix.md` (Deep).
46
+
47
+ ---
48
+ ## Phase 1: Interactive Analysis
49
+
50
+ **1. Context Loading (Multi-Source):**
51
+ **CRITICAL**: Regardless of whether a `USER_STORY` ID or a `ROADMAP_FEATURE` name is provided, you MUST attempt to load context from **BOTH** sources:
52
+ - **`docs/roadmap.md`**: To understand high-level scope, epic relationships, and technical dependencies.
53
+ - **`docs/user-stories/**/HU-XXX-XXX.md`**: To get granular details (Acceptance Criteria, Gherkin Scenarios, QA cases).
54
+
55
+ **2. Interactive Questions:**
56
+ - IF both sources provide 100% clarity: Skip questions.
57
+ - IF there is missing info or ambiguity: Ask 3-5 key questions with **Multiple Choice Options** and **Defaults (marked with ⭐)**.
58
+
59
+ **Example Interaction:**
60
+ > 📝 I need to clarify some details for this feature:
61
+ > 1. What authentication provider should we use? [default: A]
62
+ > A) JWT (Local) ⭐
63
+ > B) OAuth2 (Google/GitHub)
64
+ > C) Firebase Auth
65
+ >
66
+ > 2. Should we implement audit logs for this? [default: B]
67
+ > A) Yes
68
+ > B) No ⭐
69
+
70
+ ---
71
+ ## Phase 2: Planning & Documentation
72
+
73
+ 1. **`spec.md`**: Generate/Update in `specs/ai-flow/work/[task-name]/spec.md`.
74
+ - Ask for user approval.
75
+ 2. **`plan.md`**: Generate technical approach and task list.
76
+ - Assign Feature Number (NNN).
77
+ - Story Points estimation (Fibonacci).
78
+ - Phase organization.
79
+ - Ask for user approval.
80
+ 3. **`task.md`**: Generate the checklist of tactical tasks.
81
+ 4. **`status.json`**: Initialize/Update metadata (progress, branch, validation state).
82
+
83
+ ---
84
+ ## Phase 3: Execution (Branch Creation)
85
+
86
+ **Upon confirmation to start implementation:**
87
+
88
+ 1. **Generate Branch Name**:
89
+ - `feature/[slug]`
90
+ - `refactor/[slug]`
91
+ - `fix/[slug]`
92
+ 2. **Execute**: `git checkout -b [branch-name]`.
93
+ 3. **Update `status.json`**: Record branch name and start timestamp.
94
+ 4. **Implementation**: Proceed according to the selected mode (Auto, Phase-by-phase, Task-by-task).
95
+
96
+ ---
97
+ ## Phase 4: Finalization & Archiving
98
+
99
+ **When all tasks in `task.md` are complete (✅) and validated:**
100
+
101
+ 1. **Sugerir Próximos Pasos**:
102
+ - **`/flow-check`**: Ejecutar tests y revisión de código combinada.
103
+ - **`/flow-docs-sync`**: Sincronizar la documentación técnica.
104
+ - **`/flow-commit`**: Crear commits atómicos.
105
+
106
+ 2. **Proceso de Archivado (Automático tras aprobación)**:
107
+ - Una vez el usuario confirma que el trabajo está listo para ser cerrado:
108
+ - **Mover**: `specs/ai-flow/work/[task-name]/` → `specs/ai-flow/archive/YYYY-MM/[task-name]/`.
109
+ - **Actualizar `status.json`**: Cambiar `status` a `"COMPLETED"` y registrar `timestamps.completed`.
110
+ - **Cleanup**: Mantener limpia la carpeta `work` para que `/flow-work` detecte solo tareas activas.
111
+
112
+ 3. **Resumen Final**:
113
+ - Mostrar estadísticas finales de tiempo, archivos y cobertura antes de archivar.
114
+
115
+ ---
116
+ ## Orchestration Rules
117
+
118
+ - **DRY Logic**: This file handles the high-level orchestration.
119
+ - **Delegation**:
120
+ - Detailed Feature logic → `@flow-work-feature.md`
121
+ - Detailed Refactor logic → `@flow-work-refactor.md`
122
+ - Detailed Fix logic → `@flow-work-fix.md`
123
+ - Resume logic → `@flow-work-resume.md`
124
+ - **State Persistence**: Always read/write to `specs/ai-flow/work/[name]/status.json` to maintain state across sessions.
125
+
126
+ ---
127
+ **BEGIN EXECUTION when user runs `/flow-work [args]`**