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,262 +805,398 @@ 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
|
|
778
820
|
|
|
779
|
-
|
|
780
|
-
- Branch: [branch-name]
|
|
781
|
-
- Files changed: [N]
|
|
782
|
-
- Commits: [N]
|
|
783
|
-
- Duration: [X min]
|
|
821
|
+
**To proceed:** Type `/flow-finish` in the chat
|
|
784
822
|
|
|
785
|
-
|
|
823
|
+
---
|
|
786
824
|
|
|
787
|
-
|
|
788
|
-
β Record analytics, delete work files, clean state
|
|
825
|
+
### Option B: Manual Finalization
|
|
789
826
|
|
|
790
|
-
|
|
791
|
-
β Record analytics, rename folder to [task]-completed
|
|
827
|
+
If you prefer granular control over each step:
|
|
792
828
|
|
|
793
|
-
|
|
794
|
-
|
|
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
|
|
795
833
|
|
|
796
|
-
|
|
797
|
-
|
|
834
|
+
---
|
|
835
|
+
|
|
836
|
+
**What would you like to do?**
|
|
837
|
+
|
|
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
|
-
2. Show: `βΈοΈ Task paused. Resume with: /flow-work`
|
|
880
|
-
3. **END finalization**
|
|
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
|
|
881
886
|
|
|
882
|
-
**
|
|
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
|
|
892
|
+
|
|
893
|
+
5οΈβ£ **Optional Push (Step 5)**
|
|
894
|
+
- Always asks for confirmation
|
|
895
|
+
- Shows branch name and remote
|
|
896
|
+
- Never pushes without explicit approval
|
|
897
|
+
|
|
898
|
+
**Would you like to run it now?** (y/n): _
|
|
899
|
+
```
|
|
900
|
+
|
|
901
|
+
**END WORKFLOW**
|
|
902
|
+
|
|
903
|
+
---
|
|
904
|
+
|
|
905
|
+
## Orchestration Rules
|
|
883
906
|
|
|
884
|
-
|
|
885
|
-
|
|
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.
|
|
886
914
|
|
|
887
915
|
---
|
|
888
916
|
|
|
889
|
-
|
|
917
|
+
## Phase 99: Informative Response
|
|
890
918
|
|
|
891
|
-
**
|
|
919
|
+
**This phase handles questions, reports, and analysis requests WITHOUT creating work files or branches.**
|
|
892
920
|
|
|
893
|
-
|
|
894
|
-
π Generate ticket summary?
|
|
921
|
+
### 1. Analyze Request Type
|
|
895
922
|
|
|
896
|
-
|
|
923
|
+
**Classify the informative request:**
|
|
897
924
|
|
|
898
|
-
|
|
899
|
-
|
|
925
|
+
- **Technical Question:** How does X work? Why do we use Y?
|
|
926
|
+
- **UI Component Explanation:** Explain this window/panel/dialog
|
|
927
|
+
- **Architecture Review:** Show me the application structure/threading model
|
|
928
|
+
- **Project Report:** Generate report on dependencies/JAR size/test coverage
|
|
929
|
+
- **File Location:** Where is X class? Find Y service
|
|
930
|
+
- **Comparison:** Compare Swing vs JavaFX approach
|
|
931
|
+
- **Best Practices:** What's the best way to handle X in desktop apps?
|
|
900
932
|
|
|
901
|
-
|
|
933
|
+
### 2. Load Relevant Context
|
|
902
934
|
|
|
903
|
-
|
|
935
|
+
**Based on request type, load specific documentation:**
|
|
904
936
|
|
|
905
|
-
|
|
906
|
-
[ -f .ai-flow/prompts/shared/task-summary-template.md ]
|
|
907
|
-
```
|
|
937
|
+
**IF question about architecture/patterns:**
|
|
908
938
|
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
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
|
|
939
|
+
- Read `ai-instructions.md` (NEVER/ALWAYS rules)
|
|
940
|
+
- Read `docs/architecture.md` (MVC/MVP/MVVM, threading, layers)
|
|
941
|
+
- Search codebase for examples
|
|
917
942
|
|
|
918
|
-
|
|
919
|
-
- Generate basic summary:
|
|
943
|
+
**IF question about specific component:**
|
|
920
944
|
|
|
921
|
-
|
|
922
|
-
|
|
945
|
+
- Search codebase for class/form files
|
|
946
|
+
- Read relevant specs from `specs/`
|
|
947
|
+
- Check UI thread handling
|
|
923
948
|
|
|
924
|
-
|
|
925
|
-
**Type**: [feature|refactor|fix]
|
|
926
|
-
**Duration**: [X min]
|
|
927
|
-
**Story Points**: [N]
|
|
928
|
-
**Commits**: [N]
|
|
929
|
-
**Branch**: [branch-name]
|
|
930
|
-
**Status**: β
Complete
|
|
949
|
+
**IF report request:**
|
|
931
950
|
|
|
932
|
-
|
|
933
|
-
|
|
951
|
+
- Run appropriate analysis (JAR size, dependencies, coverage)
|
|
952
|
+
- Read relevant docs for context
|
|
953
|
+
- Generate structured report
|
|
934
954
|
|
|
935
|
-
|
|
936
|
-
[git log --oneline output]
|
|
937
|
-
```
|
|
955
|
+
**IF file location request:**
|
|
938
956
|
|
|
939
|
-
|
|
957
|
+
- Search codebase with grep/semantic search
|
|
958
|
+
- List relevant classes with descriptions
|
|
940
959
|
|
|
941
|
-
|
|
960
|
+
### 3. Provide Comprehensive Answer
|
|
942
961
|
|
|
943
|
-
|
|
944
|
-
βοΈ Skipping ticket summary
|
|
945
|
-
```
|
|
962
|
+
**Structure your response:**
|
|
946
963
|
|
|
947
|
-
|
|
964
|
+
```markdown
|
|
965
|
+
## [Question/Request]
|
|
948
966
|
|
|
949
|
-
###
|
|
967
|
+
### Answer
|
|
950
968
|
|
|
951
|
-
|
|
952
|
-
|
|
969
|
+
[Detailed explanation with code examples if relevant]
|
|
970
|
+
|
|
971
|
+
### Related Documentation
|
|
972
|
+
|
|
973
|
+
- [Link to relevant docs]
|
|
974
|
+
- [Link to class/component examples]
|
|
953
975
|
|
|
954
|
-
|
|
976
|
+
### Additional Context
|
|
955
977
|
|
|
956
|
-
|
|
978
|
+
[Architecture decisions, threading considerations, platform differences]
|
|
979
|
+
|
|
980
|
+
### Related User Stories/Features
|
|
981
|
+
|
|
982
|
+
[If applicable, link to planning docs]
|
|
957
983
|
```
|
|
958
984
|
|
|
959
|
-
**
|
|
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 Swing chosen over JavaFX?
|
|
991
|
+
- **Threading safety:** Highlight EDT/Platform.runLater usage
|
|
992
|
+
- **Provide sources:** Always cite where information comes from
|
|
993
|
+
|
|
994
|
+
### 4. Offer Follow-up Actions
|
|
995
|
+
|
|
996
|
+
**After answering, offer next steps:**
|
|
960
997
|
|
|
961
|
-
```bash
|
|
962
|
-
git push origin [branch-name]
|
|
963
998
|
```
|
|
999
|
+
β
Answer provided.
|
|
964
1000
|
|
|
965
|
-
|
|
1001
|
+
Would you like me to:
|
|
1002
|
+
A) Implement changes based on this analysis
|
|
1003
|
+
B) Create a work plan for improvements
|
|
1004
|
+
C) Generate a spec/doc for this
|
|
1005
|
+
D) Nothing, just the answer
|
|
966
1006
|
|
|
1007
|
+
Your choice (or just ask another question): _
|
|
967
1008
|
```
|
|
968
|
-
β
Pushed to origin/[branch-name]
|
|
969
1009
|
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
-
|
|
973
|
-
-
|
|
1010
|
+
**IF user chooses A or B:**
|
|
1011
|
+
|
|
1012
|
+
- Return to Phase 0 with refined objective
|
|
1013
|
+
- Create appropriate work.md and proceed with execution
|
|
1014
|
+
|
|
1015
|
+
**IF user chooses C:**
|
|
1016
|
+
|
|
1017
|
+
- Create spec/doc file in appropriate location
|
|
1018
|
+
- Commit with descriptive message
|
|
1019
|
+
|
|
1020
|
+
**IF user chooses D or asks another question:**
|
|
1021
|
+
|
|
1022
|
+
- **END WORKFLOW** (no files created, no branches)
|
|
1023
|
+
|
|
1024
|
+
### 5. Example Interactions
|
|
1025
|
+
|
|
1026
|
+
**Example 1: Technical Question**
|
|
1027
|
+
|
|
1028
|
+
````
|
|
1029
|
+
User: /flow-work ΒΏcΓ³mo funciona el threading model en Swing?
|
|
1030
|
+
|
|
1031
|
+
Agent:
|
|
1032
|
+
π Detected: Informative request (question)
|
|
1033
|
+
|
|
1034
|
+
## How Threading Works in This Desktop Application
|
|
1035
|
+
|
|
1036
|
+
### Swing Threading Model
|
|
1037
|
+
|
|
1038
|
+
Our application follows Swing's single-threaded model:
|
|
1039
|
+
- **EDT (Event Dispatch Thread):** All UI updates
|
|
1040
|
+
- **Worker Threads:** Background tasks (DB, network, file I/O)
|
|
1041
|
+
|
|
1042
|
+
### Implementation Pattern
|
|
1043
|
+
|
|
1044
|
+
```java
|
|
1045
|
+
// Example from UserService.java
|
|
1046
|
+
public void loadUsersAsync(Consumer<List<User>> callback) {
|
|
1047
|
+
// Background thread for DB query
|
|
1048
|
+
SwingWorker<List<User>, Void> worker = new SwingWorker<>() {
|
|
1049
|
+
@Override
|
|
1050
|
+
protected List<User> doInBackground() throws Exception {
|
|
1051
|
+
return userRepository.findAll(); // Runs on worker thread
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
@Override
|
|
1055
|
+
protected void done() {
|
|
1056
|
+
try {
|
|
1057
|
+
List<User> users = get();
|
|
1058
|
+
SwingUtilities.invokeLater(() -> {
|
|
1059
|
+
callback.accept(users); // Update UI on EDT
|
|
1060
|
+
});
|
|
1061
|
+
} catch (Exception e) {
|
|
1062
|
+
handleError(e);
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
};
|
|
1066
|
+
worker.execute();
|
|
1067
|
+
}
|
|
1068
|
+
````
|
|
1069
|
+
|
|
1070
|
+
### Key Rules in This Project
|
|
1071
|
+
|
|
1072
|
+
1. **NEVER block EDT:** All long operations use SwingWorker
|
|
1073
|
+
2. **ALWAYS update UI on EDT:** Use `SwingUtilities.invokeLater()`
|
|
1074
|
+
3. **Use SwingWorker for progress:** `publish()` and `process()` for updates
|
|
1075
|
+
|
|
1076
|
+
### Common Patterns
|
|
1077
|
+
|
|
1078
|
+
```java
|
|
1079
|
+
// Pattern 1: Simple async task
|
|
1080
|
+
SwingUtilities.invokeLater(() -> {
|
|
1081
|
+
label.setText("Updated"); // Safe: runs on EDT
|
|
1082
|
+
});
|
|
1083
|
+
|
|
1084
|
+
// Pattern 2: Background with progress
|
|
1085
|
+
SwingWorker<Result, Integer> worker = new SwingWorker<>() {
|
|
1086
|
+
@Override
|
|
1087
|
+
protected Result doInBackground() {
|
|
1088
|
+
for (int i = 0; i < 100; i++) {
|
|
1089
|
+
// Long operation
|
|
1090
|
+
publish(i); // Report progress
|
|
1091
|
+
}
|
|
1092
|
+
return result;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
@Override
|
|
1096
|
+
protected void process(List<Integer> chunks) {
|
|
1097
|
+
progressBar.setValue(chunks.get(chunks.size() - 1));
|
|
1098
|
+
}
|
|
1099
|
+
};
|
|
974
1100
|
```
|
|
975
1101
|
|
|
976
|
-
|
|
1102
|
+
### Where to Find Examples
|
|
1103
|
+
|
|
1104
|
+
- `src/services/UserService.java` - Database operations
|
|
1105
|
+
- `src/ui/MainWindow.java` - File loading
|
|
1106
|
+
- `src/ui/ReportDialog.java` - Report generation
|
|
1107
|
+
|
|
1108
|
+
### Related Documentation
|
|
1109
|
+
|
|
1110
|
+
- `ai-instructions.md` - Threading rules (NEVER block EDT)
|
|
1111
|
+
- `docs/architecture.md` - Service layer patterns
|
|
1112
|
+
|
|
1113
|
+
Would you like me to review other classes for threading issues? (Y/N): \_
|
|
977
1114
|
|
|
978
1115
|
```
|
|
979
|
-
βοΈ Skipping push
|
|
980
1116
|
|
|
981
|
-
|
|
982
|
-
|
|
1117
|
+
**Example 2: Report Request**
|
|
1118
|
+
|
|
983
1119
|
```
|
|
984
1120
|
|
|
985
|
-
|
|
1121
|
+
User: /flow-work genera un informe de dependencias del proyecto
|
|
986
1122
|
|
|
987
|
-
|
|
1123
|
+
Agent:
|
|
1124
|
+
π Detected: Informative request (report)
|
|
988
1125
|
|
|
989
|
-
|
|
990
|
-
β
Task Finalization Complete
|
|
1126
|
+
## Project Dependencies Report
|
|
991
1127
|
|
|
992
|
-
|
|
993
|
-
- [β
|β οΈ] Validation passed
|
|
994
|
-
- [β
|βοΈ] Documentation updated
|
|
995
|
-
- [β
|βοΈ] Task archived
|
|
996
|
-
- [β
|βοΈ] Ticket summary generated
|
|
997
|
-
- [β
|βοΈ] Pushed to remote
|
|
1128
|
+
[Analyzes pom.xml/build.gradle]
|
|
998
1129
|
|
|
999
|
-
|
|
1000
|
-
Branch: [branch-name]
|
|
1001
|
-
Duration: [X min]
|
|
1002
|
-
Commits: [N]
|
|
1130
|
+
### Build System: Maven
|
|
1003
1131
|
|
|
1004
|
-
|
|
1132
|
+
### Java Version: 17
|
|
1133
|
+
|
|
1134
|
+
### Total Dependencies: 18 (12 compile, 6 test)
|
|
1135
|
+
|
|
1136
|
+
#### Core Dependencies
|
|
1137
|
+
|
|
1138
|
+
| Dependency | Version | Scope | Size | Purpose |
|
|
1139
|
+
| ------------------- | ------- | ------- | ------ | ------------------ |
|
|
1140
|
+
| H2 Database | 2.1.214 | runtime | 2.3 MB | Embedded database |
|
|
1141
|
+
| FlatLaf | 3.2.1 | compile | 1.1 MB | Modern Look & Feel |
|
|
1142
|
+
| Jackson Databind | 2.15.2 | compile | 1.5 MB | JSON processing |
|
|
1143
|
+
| SLF4J + Logback | 2.0.9 | compile | 800 KB | Logging |
|
|
1144
|
+
| Apache Commons Lang | 3.13.0 | compile | 640 KB | Utilities |
|
|
1145
|
+
| Apache Commons IO | 2.13.0 | compile | 510 KB | File operations |
|
|
1146
|
+
|
|
1147
|
+
#### Test Dependencies
|
|
1148
|
+
|
|
1149
|
+
| Dependency | Version | Scope | Purpose |
|
|
1150
|
+
| ------------- | ------- | ----- | ----------------- |
|
|
1151
|
+
| JUnit Jupiter | 5.10.0 | test | Unit testing |
|
|
1152
|
+
| AssertJ Core | 3.24.2 | test | Fluent assertions |
|
|
1153
|
+
| AssertJ Swing | 3.17.1 | test | UI testing |
|
|
1154
|
+
| Mockito | 5.5.0 | test | Mocking |
|
|
1155
|
+
|
|
1156
|
+
### JAR Size Analysis
|
|
1157
|
+
|
|
1158
|
+
- Application JAR: 450 KB
|
|
1159
|
+
- Dependencies: ~8 MB
|
|
1160
|
+
- **Total**: ~8.5 MB
|
|
1161
|
+
|
|
1162
|
+
### Dependency Tree
|
|
1163
|
+
|
|
1164
|
+
```
|
|
1165
|
+
com.example.app:1.0.0
|
|
1166
|
+
βββ H2 Database:2.1.214
|
|
1167
|
+
βββ FlatLaf:3.2.1
|
|
1168
|
+
β βββ FlatLaf Core (transitive)
|
|
1169
|
+
βββ Jackson Databind:2.15.2
|
|
1170
|
+
β βββ Jackson Core (transitive)
|
|
1171
|
+
β βββ Jackson Annotations (transitive)
|
|
1172
|
+
βββ Logback:1.4.11
|
|
1173
|
+
βββ SLF4J API (transitive)
|
|
1005
1174
|
```
|
|
1006
1175
|
|
|
1007
|
-
|
|
1176
|
+
### Security Report
|
|
1008
1177
|
|
|
1009
|
-
|
|
1178
|
+
β
No known vulnerabilities (checked against CVE database)
|
|
1010
1179
|
|
|
1011
|
-
|
|
1180
|
+
### Recommendations
|
|
1012
1181
|
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1182
|
+
1. β
All dependencies up to date
|
|
1183
|
+
2. β
No deprecated libraries
|
|
1184
|
+
3. π‘ Consider ProGuard/R8 for distribution (reduce size by ~40%)
|
|
1185
|
+
4. π‘ H2 database could be replaced with SQLite (smaller: 1.2 MB)
|
|
1186
|
+
|
|
1187
|
+
### License Compliance
|
|
1188
|
+
|
|
1189
|
+
- Apache 2.0: 14 dependencies β
|
|
1190
|
+
- MIT: 3 dependencies β
|
|
1191
|
+
- EPL 2.0: 1 dependency (H2) β
|
|
1192
|
+
|
|
1193
|
+
All licenses compatible with commercial use.
|
|
1194
|
+
|
|
1195
|
+
Would you like me to create a plan to reduce bundle size? (Y/N): \_
|
|
1196
|
+
|
|
1197
|
+
```
|
|
1020
1198
|
|
|
1021
1199
|
---
|
|
1022
1200
|
|
|
1023
1201
|
**BEGIN EXECUTION when user runs `/flow-work [args]`**
|
|
1202
|
+
```
|