ai-flow-dev 2.6.0 → 2.8.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/README.md +24 -21
- package/package.json +6 -6
- package/prompts/backend/flow-check-review.md +648 -12
- package/prompts/backend/flow-check-test.md +520 -8
- package/prompts/backend/flow-check.md +687 -29
- package/prompts/backend/flow-commit.md +18 -49
- package/prompts/backend/flow-finish.md +919 -0
- package/prompts/backend/flow-release.md +949 -0
- package/prompts/backend/flow-work.md +296 -221
- package/prompts/desktop/flow-check-review.md +648 -12
- package/prompts/desktop/flow-check-test.md +520 -8
- package/prompts/desktop/flow-check.md +687 -29
- package/prompts/desktop/flow-commit.md +18 -49
- package/prompts/desktop/flow-finish.md +910 -0
- package/prompts/desktop/flow-release.md +662 -0
- package/prompts/desktop/flow-work.md +398 -219
- package/prompts/frontend/flow-check-review.md +648 -12
- package/prompts/frontend/flow-check-test.md +520 -8
- package/prompts/frontend/flow-check.md +687 -29
- package/prompts/frontend/flow-commit.md +18 -49
- package/prompts/frontend/flow-finish.md +910 -0
- package/prompts/frontend/flow-release.md +519 -0
- package/prompts/frontend/flow-work-api.md +1540 -0
- package/prompts/frontend/flow-work.md +774 -218
- package/prompts/mobile/flow-check-review.md +648 -12
- package/prompts/mobile/flow-check-test.md +520 -8
- package/prompts/mobile/flow-check.md +687 -29
- package/prompts/mobile/flow-commit.md +18 -49
- package/prompts/mobile/flow-finish.md +910 -0
- package/prompts/mobile/flow-release.md +751 -0
- package/prompts/mobile/flow-work-api.md +1493 -0
- package/prompts/mobile/flow-work.md +792 -222
- package/templates/AGENT.template.md +1 -1
|
@@ -27,6 +27,88 @@ Provide a single, intelligent entry point for all development work (New Features
|
|
|
27
27
|
|
|
28
28
|
---
|
|
29
29
|
|
|
30
|
+
## Phase -1: Intent Classification (PRE-DETECTION)
|
|
31
|
+
|
|
32
|
+
**CRITICAL: Determine if this is an INFORMATIVE request vs EXECUTION request BEFORE any workflow.**
|
|
33
|
+
|
|
34
|
+
**🔍 INFORMATIVE Patterns (Answer directly, NO execution workflow):**
|
|
35
|
+
|
|
36
|
+
- **Questions:** Starts with `¿`, `how`, `why`, `what`, `when`, `cómo`, `por qué`, `qué`, `cuál`
|
|
37
|
+
- **Analysis verbs:** `explain`, `show`, `list`, `analyze`, `describe`, `compare`, `explica`, `muestra`, `analiza`, `describe`, `compara`
|
|
38
|
+
- **Report requests:** `report`, `informe`, `document`, `documenta`, `summary`, `resumen`, `generate report`, `genera informe`
|
|
39
|
+
- **Exploration:** `find`, `search`, `busca`, `encuentra`, `where is`, `dónde está`
|
|
40
|
+
- **Review requests:** `review`, `revisa`, `check`, `verifica`, `audit`, `audita`
|
|
41
|
+
|
|
42
|
+
**🛠️ EXECUTION Patterns (Enter workflow):**
|
|
43
|
+
|
|
44
|
+
- **Action verbs:** `implement`, `create`, `refactor`, `fix`, `add`, `remove`, `update`, `delete`, `build`, `develop`
|
|
45
|
+
- **Task codes:** `HU-\d{3}-\d{3}`, `EP-\d{3}`, `T\d{3}`
|
|
46
|
+
- **Imperative:** `new feature`, `nueva feature`, `crear`, `implementar`
|
|
47
|
+
|
|
48
|
+
**Detection Logic:**
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
import re
|
|
52
|
+
|
|
53
|
+
# Normalize input
|
|
54
|
+
input_lower = input.strip().lower()
|
|
55
|
+
|
|
56
|
+
# INFORMATIVE patterns (high priority)
|
|
57
|
+
informative_patterns = [
|
|
58
|
+
r'^(¿|how|why|what|when|where|cómo|por qué|qué|cuál|dónde)',
|
|
59
|
+
r'^(explain|show|list|analyze|describe|compare|explica|muestra|analiza|describe|compara)',
|
|
60
|
+
r'(report|informe|document|documenta|summary|resumen)',
|
|
61
|
+
r'(find|search|busca|encuentra)',
|
|
62
|
+
r'(review|revisa|check|verifica|audit|audita)',
|
|
63
|
+
]
|
|
64
|
+
|
|
65
|
+
for pattern in informative_patterns:
|
|
66
|
+
if re.search(pattern, input_lower):
|
|
67
|
+
return "INFORMATIVE" # → Jump to Phase 99
|
|
68
|
+
|
|
69
|
+
# EXECUTION patterns
|
|
70
|
+
execution_patterns = [
|
|
71
|
+
r'(HU-\d{3}-\d{3}|EP-\d{3}|T\d{3})', # Task codes
|
|
72
|
+
r'^(implement|create|refactor|fix|add|remove|update|delete|build|develop)',
|
|
73
|
+
r'(implementar|crear|nueva feature|new feature)',
|
|
74
|
+
]
|
|
75
|
+
|
|
76
|
+
for pattern in execution_patterns:
|
|
77
|
+
if re.search(pattern, input_lower):
|
|
78
|
+
return "EXECUTION" # → Continue to Phase 0
|
|
79
|
+
|
|
80
|
+
# Ambiguous case - ask user
|
|
81
|
+
return "AMBIGUOUS"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**Action based on detection:**
|
|
85
|
+
|
|
86
|
+
**IF mode == "INFORMATIVE":**
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
🔍 Detected: Informative request (question/report/analysis)
|
|
90
|
+
|
|
91
|
+
I'll provide a detailed answer without creating work files or branches.
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
→ **Jump to Phase 99: Informative Response**
|
|
95
|
+
|
|
96
|
+
**IF mode == "EXECUTION":**
|
|
97
|
+
|
|
98
|
+
→ **Continue to Phase 0** (current workflow)
|
|
99
|
+
|
|
100
|
+
**IF mode == "AMBIGUOUS":**
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
❓ I'm not sure if this is:
|
|
104
|
+
A) A question/report request (I'll answer directly)
|
|
105
|
+
B) A task to implement (I'll create work plan and execute)
|
|
106
|
+
|
|
107
|
+
Please clarify (A/B): _
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
30
112
|
## Phase 0: Detection & Strategy (Automatic)
|
|
31
113
|
|
|
32
114
|
**1. Semantic Analysis of Input:**
|
|
@@ -657,48 +739,9 @@ git status --porcelain
|
|
|
657
739
|
- All checkboxes in work.md marked complete
|
|
658
740
|
- User explicitly requests finalization
|
|
659
741
|
|
|
660
|
-
**CRITICAL: This phase requires EXPLICIT user confirmations at each step.**
|
|
661
|
-
|
|
662
|
-
---
|
|
663
|
-
|
|
664
|
-
### Step 1: Validation Check
|
|
665
|
-
|
|
666
|
-
```
|
|
667
|
-
🔍 Running validation...
|
|
668
|
-
```
|
|
669
|
-
|
|
670
|
-
Execute:
|
|
671
|
-
|
|
672
|
-
```bash
|
|
673
|
-
npm test # or project-specific test command
|
|
674
|
-
npm run lint # or project-specific lint command
|
|
675
|
-
```
|
|
676
|
-
|
|
677
|
-
Show results:
|
|
678
|
-
|
|
679
|
-
```
|
|
680
|
-
📊 Validation Results
|
|
681
|
-
|
|
682
|
-
Tests: [✅ Passed | ❌ Failed (N tests)]
|
|
683
|
-
Lint: [✅ Clean | ⚠️ N warnings | ❌ N errors]
|
|
684
|
-
Coverage: [X%]
|
|
685
|
-
|
|
686
|
-
Proceed with finalization?
|
|
687
|
-
|
|
688
|
-
a) Yes, continue ⭐
|
|
689
|
-
b) No, let me fix issues
|
|
690
|
-
c) Skip validation (not recommended)
|
|
691
|
-
|
|
692
|
-
Your choice: _
|
|
693
|
-
```
|
|
694
|
-
|
|
695
|
-
- **'b'**: Return to Phase 3 for fixes, END finalization
|
|
696
|
-
- **'c'**: Show warning, ask confirmation again, then continue
|
|
697
|
-
- **'a'**: Continue to Step 2
|
|
698
|
-
|
|
699
742
|
---
|
|
700
743
|
|
|
701
|
-
###
|
|
744
|
+
### Source Documentation Update (Interactive)
|
|
702
745
|
|
|
703
746
|
**Detect source references:**
|
|
704
747
|
|
|
@@ -762,261 +805,293 @@ Your choice: _
|
|
|
762
805
|
|
|
763
806
|
---
|
|
764
807
|
|
|
765
|
-
|
|
808
|
+
## ✅ Development Work Complete
|
|
766
809
|
|
|
767
|
-
|
|
810
|
+
Your code is ready for finalization. You have two options:
|
|
768
811
|
|
|
769
|
-
|
|
770
|
-
git diff --stat
|
|
771
|
-
git log --oneline origin/[base-branch]..HEAD
|
|
772
|
-
```
|
|
812
|
+
### Option A: Run Full Finalization Now (Recommended) ⭐
|
|
773
813
|
|
|
774
|
-
|
|
814
|
+
Execute `/flow-finish` to complete all finalization steps automatically:
|
|
775
815
|
|
|
776
|
-
|
|
777
|
-
|
|
816
|
+
- ✅ **Smart Validation** - Runs tests + lint only if needed (or revalidates if requested)
|
|
817
|
+
- 📦 **Work Archiving** - Records analytics to `.ai-flow/archive/analytics.jsonl`, cleans workspace
|
|
818
|
+
- 🤖 **AI-Powered Summaries** - Generates professional PR/Jira descriptions (~1,200 tokens)
|
|
819
|
+
- 🚀 **Optional Push** - Pushes to remote with explicit confirmation
|
|
820
|
+
|
|
821
|
+
**To proceed:** Type `/flow-finish` in the chat
|
|
822
|
+
|
|
823
|
+
---
|
|
778
824
|
|
|
779
|
-
|
|
780
|
-
- Branch: [branch-name]
|
|
781
|
-
- Files changed: [N]
|
|
782
|
-
- Commits: [N]
|
|
783
|
-
- Duration: [X min]
|
|
825
|
+
### Option B: Manual Finalization
|
|
784
826
|
|
|
785
|
-
|
|
827
|
+
If you prefer granular control over each step:
|
|
786
828
|
|
|
787
|
-
|
|
788
|
-
|
|
829
|
+
1. **Validation:** `/flow-check` - Run comprehensive validation (tests + code review)
|
|
830
|
+
2. **Commit:** `/flow-commit` - Create conventional commit with auto-generated message
|
|
831
|
+
3. **Archive:** Manually record analytics and clean `.ai-flow/work/[task-name]/`
|
|
832
|
+
4. **Push:** `git push origin [branch-name]` when ready
|
|
789
833
|
|
|
790
|
-
|
|
791
|
-
→ Record analytics, rename folder to [task]-completed
|
|
834
|
+
---
|
|
792
835
|
|
|
793
|
-
|
|
794
|
-
→ Keep work files for later resume
|
|
836
|
+
**What would you like to do?**
|
|
795
837
|
|
|
796
|
-
|
|
797
|
-
|
|
838
|
+
```
|
|
839
|
+
a) Run /flow-finish now ⭐ (Recommended - comprehensive automation)
|
|
840
|
+
b) I'll handle finalization manually (granular control)
|
|
841
|
+
c) Tell me more about what /flow-finish does
|
|
798
842
|
|
|
799
843
|
Your choice: _
|
|
800
844
|
```
|
|
801
845
|
|
|
802
|
-
**
|
|
803
|
-
|
|
804
|
-
```
|
|
805
|
-
✅ Archiving task...
|
|
806
|
-
```
|
|
807
|
-
|
|
808
|
-
1. **Extract metadata:**
|
|
809
|
-
|
|
810
|
-
```javascript
|
|
811
|
-
// IF complexity == "COMPLEX" (has status.json):
|
|
812
|
-
analytics = {
|
|
813
|
-
task: '[task-name]',
|
|
814
|
-
type: '[feature|refactor|fix]',
|
|
815
|
-
src: '[HU-001-002|roadmap-2.3|manual]',
|
|
816
|
-
dur: Math.round((completed - created) / 60000), // minutes
|
|
817
|
-
start: timestamps.created,
|
|
818
|
-
end: new Date().toISOString(),
|
|
819
|
-
tasks: progress.totalTasks,
|
|
820
|
-
sp: extract_story_points_from_work_md(),
|
|
821
|
-
commits: git.commits.length,
|
|
822
|
-
valid: validation.tests.passed && validation.lint.passed,
|
|
823
|
-
};
|
|
824
|
-
|
|
825
|
-
// IF complexity == "MEDIUM" (only work.md):
|
|
826
|
-
analytics = {
|
|
827
|
-
task: '[task-name]',
|
|
828
|
-
type: '[detected-from-folder-name]',
|
|
829
|
-
src: 'manual',
|
|
830
|
-
dur: estimate_duration_from_git_log(),
|
|
831
|
-
start: get_first_commit_timestamp(),
|
|
832
|
-
end: new Date().toISOString(),
|
|
833
|
-
tasks: count_checkboxes_in_work_md(),
|
|
834
|
-
sp: extract_story_points_from_work_md() || null,
|
|
835
|
-
commits: count_commits_in_branch(),
|
|
836
|
-
valid: validation_passed,
|
|
837
|
-
};
|
|
838
|
-
```
|
|
846
|
+
**If 'a':** Execute `/flow-finish` immediately
|
|
839
847
|
|
|
840
|
-
|
|
848
|
+
**If 'b':** Show confirmation and end workflow:
|
|
841
849
|
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
```
|
|
850
|
+
```
|
|
851
|
+
✅ Understood. Development complete.
|
|
845
852
|
|
|
846
|
-
|
|
853
|
+
📋 Manual finalization checklist:
|
|
854
|
+
- [ ] Run validation: /flow-check
|
|
855
|
+
- [ ] Commit changes: /flow-commit
|
|
856
|
+
- [ ] Archive work folder
|
|
857
|
+
- [ ] Push to remote
|
|
858
|
+
- [ ] Create PR/MR
|
|
847
859
|
|
|
848
|
-
|
|
849
|
-
rm -rf .ai-flow/work/[task-name]/
|
|
850
|
-
```
|
|
860
|
+
💡 Tip: You can run /flow-finish anytime to automate these steps.
|
|
851
861
|
|
|
852
|
-
|
|
862
|
+
🎉 Great work!
|
|
863
|
+
```
|
|
853
864
|
|
|
854
|
-
|
|
855
|
-
✅ Task archived successfully
|
|
865
|
+
**If 'c':** Show detailed explanation:
|
|
856
866
|
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
- Story Points: [N]
|
|
860
|
-
- Commits: [N]
|
|
861
|
-
- Validation: [✅ Passed | ❌ Failed]
|
|
862
|
-
```
|
|
867
|
+
```
|
|
868
|
+
📖 About /flow-finish
|
|
863
869
|
|
|
864
|
-
|
|
870
|
+
/flow-finish is an intelligent finalization workflow that:
|
|
865
871
|
|
|
866
|
-
1
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
```
|
|
871
|
-
3. Show: `✅ Task marked complete. Files kept in: .ai-flow/work/[task]-completed/`
|
|
872
|
+
1️⃣ **Smart Validation (Step 1)**
|
|
873
|
+
- Detects if /flow-check was already run successfully
|
|
874
|
+
- Only re-runs if explicitly requested or validation failed
|
|
875
|
+
- Shows comprehensive test + lint results
|
|
872
876
|
|
|
873
|
-
**
|
|
877
|
+
2️⃣ **Smart Commit (Step 2)**
|
|
878
|
+
- Detects uncommitted changes automatically
|
|
879
|
+
- Runs /flow-commit only if needed
|
|
880
|
+
- Generates conventional commit messages
|
|
874
881
|
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
882
|
+
3️⃣ **Work Archiving (Step 3)**
|
|
883
|
+
- Extracts analytics: duration, story points, commits
|
|
884
|
+
- Appends to .ai-flow/archive/analytics.jsonl
|
|
885
|
+
- Deletes .ai-flow/work/[task-name]/ folder
|
|
886
|
+
|
|
887
|
+
4️⃣ **AI Summaries (Step 4)**
|
|
888
|
+
- Reads git diff + commit history
|
|
889
|
+
- Generates professional PR description
|
|
890
|
+
- Generates ticket update (Jira/ClickUp/Linear)
|
|
891
|
+
- ~1,200 tokens, markdown-formatted
|
|
881
892
|
|
|
882
|
-
**
|
|
893
|
+
5️⃣ **Optional Push (Step 5)**
|
|
894
|
+
- Always asks for confirmation
|
|
895
|
+
- Shows branch name and remote
|
|
896
|
+
- Never pushes without explicit approval
|
|
883
897
|
|
|
884
|
-
|
|
885
|
-
|
|
898
|
+
**Would you like to run it now?** (y/n): _
|
|
899
|
+
```
|
|
900
|
+
|
|
901
|
+
**END WORKFLOW**
|
|
886
902
|
|
|
887
903
|
---
|
|
888
904
|
|
|
889
|
-
|
|
905
|
+
## Orchestration Rules
|
|
890
906
|
|
|
891
|
-
**
|
|
907
|
+
- **DRY Logic**: This file handles the high-level orchestration.
|
|
908
|
+
- **Delegation**:
|
|
909
|
+
- Detailed Feature logic → `@flow-work-feature.md`
|
|
910
|
+
- Detailed Refactor logic → `@flow-work-refactor.md`
|
|
911
|
+
- Detailed Fix logic → `@flow-work-fix.md`
|
|
912
|
+
- Resume logic → `@flow-work-resume.md`
|
|
913
|
+
- **State Persistence**: Always read/write to `.ai-flow/work/[name]/status.json` to maintain state across sessions.
|
|
892
914
|
|
|
893
|
-
|
|
894
|
-
📋 Generate ticket summary?
|
|
915
|
+
---
|
|
895
916
|
|
|
896
|
-
|
|
917
|
+
## Phase 99: Informative Response
|
|
897
918
|
|
|
898
|
-
|
|
899
|
-
```
|
|
919
|
+
**This phase handles questions, reports, and analysis requests WITHOUT creating work files or branches.**
|
|
900
920
|
|
|
901
|
-
|
|
921
|
+
### 1. Analyze Request Type
|
|
902
922
|
|
|
903
|
-
|
|
923
|
+
**Classify the informative request:**
|
|
904
924
|
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
925
|
+
- **Technical Question:** How does X work? Why do we use Y?
|
|
926
|
+
- **Code Explanation:** Explain this component/service/function
|
|
927
|
+
- **Architecture Review:** Show me the architecture/patterns
|
|
928
|
+
- **Project Report:** Generate report on tests/coverage/dependencies
|
|
929
|
+
- **File Location:** Where is X? Find Y
|
|
930
|
+
- **Comparison:** Compare X vs Y
|
|
931
|
+
- **Best Practices:** What's the best way to do X?
|
|
908
932
|
|
|
909
|
-
2.
|
|
910
|
-
- Read template
|
|
911
|
-
- Extract data from:
|
|
912
|
-
- Last line of `analytics.jsonl`
|
|
913
|
-
- Git stats: `git diff --stat`, `git log --oneline`
|
|
914
|
-
- Branch info
|
|
915
|
-
- Populate template with real data
|
|
916
|
-
- Show formatted summary
|
|
933
|
+
### 2. Load Relevant Context
|
|
917
934
|
|
|
918
|
-
|
|
919
|
-
- Generate basic summary:
|
|
935
|
+
**Based on request type, load specific documentation:**
|
|
920
936
|
|
|
921
|
-
|
|
922
|
-
📋 Task Summary
|
|
937
|
+
**IF question about architecture/patterns:**
|
|
923
938
|
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
**Story Points**: [N]
|
|
928
|
-
**Commits**: [N]
|
|
929
|
-
**Branch**: [branch-name]
|
|
930
|
-
**Status**: ✅ Complete
|
|
939
|
+
- Read `ai-instructions.md` (NEVER/ALWAYS rules)
|
|
940
|
+
- Read `docs/architecture.md` (patterns, layers, structure)
|
|
941
|
+
- Search codebase for examples
|
|
931
942
|
|
|
932
|
-
|
|
933
|
-
[git diff --stat output]
|
|
943
|
+
**IF question about specific feature:**
|
|
934
944
|
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
945
|
+
- Search codebase for related files
|
|
946
|
+
- Read relevant specs from `specs/`
|
|
947
|
+
- Check `planning/roadmap.md` or User Stories
|
|
938
948
|
|
|
939
|
-
|
|
949
|
+
**IF report request:**
|
|
940
950
|
|
|
941
|
-
|
|
951
|
+
- Run appropriate analysis (coverage, dependencies, etc.)
|
|
952
|
+
- Read relevant docs for context
|
|
953
|
+
- Generate structured report
|
|
942
954
|
|
|
943
|
-
|
|
944
|
-
⏭️ Skipping ticket summary
|
|
945
|
-
```
|
|
955
|
+
**IF file location request:**
|
|
946
956
|
|
|
947
|
-
|
|
957
|
+
- Search codebase with grep/semantic search
|
|
958
|
+
- List relevant files with descriptions
|
|
948
959
|
|
|
949
|
-
###
|
|
960
|
+
### 3. Provide Comprehensive Answer
|
|
950
961
|
|
|
951
|
-
|
|
952
|
-
🚀 Push changes to remote?
|
|
962
|
+
**Structure your response:**
|
|
953
963
|
|
|
954
|
-
|
|
964
|
+
```markdown
|
|
965
|
+
## [Question/Request]
|
|
955
966
|
|
|
956
|
-
|
|
957
|
-
```
|
|
967
|
+
### Answer
|
|
958
968
|
|
|
959
|
-
|
|
969
|
+
[Detailed explanation with code examples if relevant]
|
|
960
970
|
|
|
961
|
-
|
|
962
|
-
git push origin [branch-name]
|
|
963
|
-
```
|
|
971
|
+
### Related Documentation
|
|
964
972
|
|
|
965
|
-
|
|
973
|
+
- [Link to relevant docs]
|
|
974
|
+
- [Link to code examples]
|
|
966
975
|
|
|
967
|
-
|
|
968
|
-
|
|
976
|
+
### Additional Context
|
|
977
|
+
|
|
978
|
+
[Architecture decisions, best practices, warnings]
|
|
969
979
|
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
- Update project board
|
|
980
|
+
### Related User Stories/Features
|
|
981
|
+
|
|
982
|
+
[If applicable, link to planning docs]
|
|
974
983
|
```
|
|
975
984
|
|
|
976
|
-
**
|
|
985
|
+
**Guidelines:**
|
|
986
|
+
|
|
987
|
+
- **Be comprehensive:** Load all relevant context, don't guess
|
|
988
|
+
- **Show examples:** Include actual code from the project
|
|
989
|
+
- **Reference docs:** Link to `docs/`, `specs/`, `planning/`
|
|
990
|
+
- **Explain trade-offs:** Why was X chosen over Y?
|
|
991
|
+
- **Provide sources:** Always cite where information comes from
|
|
992
|
+
|
|
993
|
+
### 4. Offer Follow-up Actions
|
|
994
|
+
|
|
995
|
+
**After answering, offer next steps:**
|
|
977
996
|
|
|
978
997
|
```
|
|
979
|
-
|
|
998
|
+
✅ Answer provided.
|
|
980
999
|
|
|
981
|
-
|
|
982
|
-
|
|
1000
|
+
Would you like me to:
|
|
1001
|
+
A) Implement changes based on this analysis
|
|
1002
|
+
B) Create a work plan for improvements
|
|
1003
|
+
C) Generate a spec/doc for this
|
|
1004
|
+
D) Nothing, just the answer
|
|
1005
|
+
|
|
1006
|
+
Your choice (or just ask another question): _
|
|
983
1007
|
```
|
|
984
1008
|
|
|
985
|
-
|
|
1009
|
+
**IF user chooses A or B:**
|
|
1010
|
+
|
|
1011
|
+
- Return to Phase 0 with refined objective
|
|
1012
|
+
- Create appropriate work.md and proceed with execution
|
|
1013
|
+
|
|
1014
|
+
**IF user chooses C:**
|
|
1015
|
+
|
|
1016
|
+
- Create spec/doc file in appropriate location
|
|
1017
|
+
- Commit with descriptive message
|
|
986
1018
|
|
|
987
|
-
|
|
1019
|
+
**IF user chooses D or asks another question:**
|
|
1020
|
+
|
|
1021
|
+
- **END WORKFLOW** (no files created, no branches)
|
|
1022
|
+
|
|
1023
|
+
### 5. Example Interactions
|
|
1024
|
+
|
|
1025
|
+
**Example 1: Technical Question**
|
|
988
1026
|
|
|
989
1027
|
```
|
|
990
|
-
|
|
1028
|
+
User: /flow-work ¿cómo funciona la autenticación JWT?
|
|
991
1029
|
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
- [✅|⏭️] Documentation updated
|
|
995
|
-
- [✅|⏭️] Task archived
|
|
996
|
-
- [✅|⏭️] Ticket summary generated
|
|
997
|
-
- [✅|⏭️] Pushed to remote
|
|
1030
|
+
Agent:
|
|
1031
|
+
🔍 Detected: Informative request (question)
|
|
998
1032
|
|
|
999
|
-
|
|
1000
|
-
Branch: [branch-name]
|
|
1001
|
-
Duration: [X min]
|
|
1002
|
-
Commits: [N]
|
|
1033
|
+
## How JWT Authentication Works in This Project
|
|
1003
1034
|
|
|
1004
|
-
|
|
1035
|
+
### Implementation
|
|
1036
|
+
|
|
1037
|
+
Our JWT implementation is in `src/services/auth.service.ts`:
|
|
1038
|
+
- Token generation: `generateToken(userId, email)`
|
|
1039
|
+
- Token validation: `verifyToken(token)`
|
|
1040
|
+
- Refresh mechanism: `refreshToken(refreshToken)`
|
|
1041
|
+
|
|
1042
|
+
[Shows actual code from project]
|
|
1043
|
+
|
|
1044
|
+
### Flow
|
|
1045
|
+
1. User logs in → POST /auth/login
|
|
1046
|
+
2. Server validates credentials
|
|
1047
|
+
3. Generates JWT with 1h expiration
|
|
1048
|
+
4. Returns { accessToken, refreshToken }
|
|
1049
|
+
5. Client includes token in Authorization header
|
|
1050
|
+
|
|
1051
|
+
### Security Considerations
|
|
1052
|
+
- Tokens are signed with HS256
|
|
1053
|
+
- Secret stored in environment variable
|
|
1054
|
+
- Refresh tokens have 7-day expiration
|
|
1055
|
+
- No sensitive data in payload
|
|
1056
|
+
|
|
1057
|
+
### Related Documentation
|
|
1058
|
+
- `specs/security.md` - Authentication specs
|
|
1059
|
+
- `docs/api.md` - Auth endpoints
|
|
1060
|
+
|
|
1061
|
+
Would you like me to implement any changes to this? (Y/N): _
|
|
1005
1062
|
```
|
|
1006
1063
|
|
|
1007
|
-
**
|
|
1064
|
+
**Example 2: Report Request**
|
|
1008
1065
|
|
|
1009
|
-
|
|
1066
|
+
```
|
|
1067
|
+
User: /flow-work genera un informe de cobertura de tests
|
|
1010
1068
|
|
|
1011
|
-
|
|
1069
|
+
Agent:
|
|
1070
|
+
🔍 Detected: Informative request (report)
|
|
1012
1071
|
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1072
|
+
## Test Coverage Report
|
|
1073
|
+
|
|
1074
|
+
[Runs coverage analysis]
|
|
1075
|
+
|
|
1076
|
+
### Overall Coverage: 78.5%
|
|
1077
|
+
|
|
1078
|
+
| Category | Coverage | Files |
|
|
1079
|
+
|-----------------|----------|-------|
|
|
1080
|
+
| Services | 92% | 12/13 |
|
|
1081
|
+
| Controllers | 85% | 8/10 |
|
|
1082
|
+
| Repositories | 95% | 10/10 |
|
|
1083
|
+
| Utilities | 45% | 5/11 |
|
|
1084
|
+
|
|
1085
|
+
### Areas Needing Improvement
|
|
1086
|
+
1. `src/utils/validators.ts` - 20% coverage
|
|
1087
|
+
2. `src/utils/formatters.ts` - 35% coverage
|
|
1088
|
+
3. `src/controllers/reports.controller.ts` - 60% coverage
|
|
1089
|
+
|
|
1090
|
+
### Recommendation
|
|
1091
|
+
Focus on utilities first (high reusability, low coverage).
|
|
1092
|
+
|
|
1093
|
+
Would you like me to create a work plan to improve coverage? (Y/N): _
|
|
1094
|
+
```
|
|
1020
1095
|
|
|
1021
1096
|
---
|
|
1022
1097
|
|