ai-flow-dev 2.5.3 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +16 -13
  2. package/dist/cli.js +30 -2
  3. package/dist/cli.js.map +1 -1
  4. package/package.json +1 -1
  5. package/prompts/backend/flow-build-phase-0.md +115 -5
  6. package/prompts/backend/flow-build-phase-3.md +52 -0
  7. package/prompts/desktop/flow-build-phase-0.md +359 -0
  8. package/prompts/desktop/flow-build-phase-1.md +295 -0
  9. package/prompts/desktop/flow-build-phase-10.md +357 -0
  10. package/prompts/desktop/flow-build-phase-2.md +282 -0
  11. package/prompts/desktop/flow-build-phase-3.md +291 -0
  12. package/prompts/desktop/flow-build-phase-4.md +308 -0
  13. package/prompts/desktop/flow-build-phase-5.md +269 -0
  14. package/prompts/desktop/flow-build-phase-6.md +350 -0
  15. package/prompts/desktop/flow-build-phase-7.md +297 -0
  16. package/prompts/desktop/flow-build-phase-8.md +541 -0
  17. package/prompts/desktop/flow-build-phase-9.md +439 -0
  18. package/prompts/desktop/flow-build.md +156 -0
  19. package/prompts/desktop/flow-check-review.md +20 -0
  20. package/prompts/desktop/flow-check-test.md +14 -0
  21. package/prompts/desktop/flow-check.md +67 -0
  22. package/prompts/desktop/flow-commit.md +119 -0
  23. package/prompts/desktop/flow-docs-sync.md +354 -0
  24. package/prompts/desktop/flow-work-feature.md +61 -0
  25. package/prompts/desktop/flow-work-fix.md +46 -0
  26. package/prompts/desktop/flow-work-refactor.md +48 -0
  27. package/prompts/desktop/flow-work-resume.md +34 -0
  28. package/prompts/desktop/flow-work.md +1023 -0
  29. package/templates/AGENT.template.md +1 -1
  30. package/templates/desktop/.clauderules.template +112 -0
  31. package/templates/desktop/.cursorrules.template +102 -0
  32. package/templates/desktop/README.template.md +170 -0
  33. package/templates/desktop/ai-instructions.template.md +366 -0
  34. package/templates/desktop/copilot-instructions.template.md +140 -0
  35. package/templates/desktop/docs/docs/api.template.md +320 -0
  36. package/templates/desktop/docs/docs/architecture.template.md +724 -0
  37. package/templates/desktop/docs/docs/business-flows.template.md +102 -0
  38. package/templates/desktop/docs/docs/code-standards.template.md +792 -0
  39. package/templates/desktop/docs/docs/contributing.template.md +149 -0
  40. package/templates/desktop/docs/docs/data-model.template.md +520 -0
  41. package/templates/desktop/docs/docs/operations.template.md +720 -0
  42. package/templates/desktop/docs/docs/testing.template.md +722 -0
  43. package/templates/desktop/project-brief.template.md +150 -0
  44. package/templates/desktop/specs/specs/configuration.template.md +121 -0
  45. package/templates/desktop/specs/specs/security.template.md +392 -0
@@ -122,6 +122,32 @@ Java:
122
122
  H) 🏆 Spring Boot - Enterprise standard
123
123
  I) Quarkus - Modern (cloud-native, fast startup)
124
124
 
125
+ Java (NetBeans - Ant Based):
126
+ J) ⚡ NetBeans + Servlets/JSP - Traditional Java web
127
+ - Java EE web applications
128
+ - Servlet containers (Tomcat, GlassFish)
129
+ - JSP for server-side rendering
130
+ - JDBC for database access
131
+
132
+ K) 🔥 NetBeans + JAX-RS - RESTful API
133
+ - Jersey or RESTEasy implementation
134
+ - JSON/XML response formats
135
+ - Bean Validation support
136
+ - GlassFish or Payara server
137
+
138
+ L) 🏆 NetBeans + Spring Framework (Ant)
139
+ - Spring MVC or Spring Boot
140
+ - Dependency injection
141
+ - Can use Ant instead of Maven
142
+ - Tomcat embedded or standalone
143
+
144
+ Java (Eclipse - Maven/Gradle):
145
+ M) 🏆 Eclipse + Spring Boot (Maven/Gradle)
146
+ - Spring MVC or Spring REST
147
+ - Modern build tools
148
+ - Better dependency management
149
+ - Extensive Eclipse tooling
150
+
125
151
  Go:
126
152
  J) ⚡ Gin - Popular (fast, minimalist)
127
153
  K) Echo - Feature-rich (middleware, routing)
@@ -165,6 +191,31 @@ C) ⚡ yarn - Popular alternative
165
191
  D) 🚀 bun - Ultra fast (if using Bun runtime)
166
192
  E) 🐍 pip/poetry (Python)
167
193
  F) ☕ Maven/Gradle (Java)
194
+ G) 🐜 Apache Ant (NetBeans default, Java)
195
+
196
+ **For NetBeans Projects:**
197
+
198
+ Build Tool:
199
+ A) ⭐ Apache Ant - Default for NetBeans (build.xml)
200
+ B) Maven - Modern alternative (pom.xml)
201
+ C) Gradle - Modern alternative (build.gradle)
202
+
203
+ If using Ant:
204
+ - Dependencies managed via lib/ folder
205
+ - Manual JAR management or Ant + Ivy
206
+ - Build targets: compile, jar, run, clean
207
+
208
+ **For Eclipse Projects:**
209
+
210
+ Build Tool:
211
+ A) ⭐ Maven - Recommended (pom.xml)
212
+ B) 🔥 Gradle - Modern alternative (build.gradle)
213
+ C) Ant - Legacy (build.xml)
214
+
215
+ Eclipse uses:
216
+ - m2e (Maven integration)
217
+ - Buildship (Gradle integration)
218
+ - Automatic classpath management
168
219
  ```
169
220
 
170
221
  **3.3 Architecture Pattern**
@@ -763,6 +814,7 @@ Execute `read_file()` for both documents to refresh context before continuing.
763
814
  ## 📝 Generated Documents
764
815
 
765
816
  After Phase 3, generate/update:
817
+
766
818
  - `docs/architecture.md` - Technical stack and patterns
767
819
  - `ai-instructions.md` - Instructions for AI agents
768
820
 
@@ -0,0 +1,359 @@
1
+ ## PHASE 0: Context Discovery (2-5 min)
2
+
3
+ > **Order for this phase:** ALWAYS executed FIRST if an existing project is detected. Skip ONLY for new projects.
4
+
5
+ > **📌 Scope-based behavior:**
6
+ >
7
+ > - **Interactive Mode:** Ask user for permission to scan files layer by layer.
8
+ > - **Autonomous Mode:** Scan all layers automatically and present the final report.
9
+
10
+ ### Objective
11
+
12
+ Efficiently analyze existing desktop Java projects (NetBeans/Eclipse) using a **layered, incremental approach**.
13
+
14
+ ---
15
+
16
+ ## 🚫 Critical Exclusion Rules
17
+
18
+ To avoid false-positive detections, **IGNORE** the following folders and files during all detection steps:
19
+
20
+ - `.ai-flow/work/` (contains active development tasks)
21
+ - `.ai-flow/archive/` (contains completed tasks)
22
+ - `.agent/` (contains AI workflows)
23
+ - `docs/` and `specs/` (if they contain AI Flow generated documentation)
24
+ - `planning/` (if it contains AI Flow generated roadmap and user stories)
25
+ - `project-brief.md`, `ai-instructions.md`, `AGENT.md`
26
+
27
+ **A project is considered "Existing" only if it contains functional source code or framework configuration files OUTSIDE these excluded paths.**
28
+
29
+ ---
30
+
31
+ ## 0.0 Check for Existing Analysis (Layer 0)
32
+
33
+ Check if `.ai-flow/cache/docs-analysis.json` exists and is fresh.
34
+
35
+ **If found:**
36
+ Ask user to use cached analysis or re-analyze.
37
+
38
+ **If not found:**
39
+ Proceed to Layer 1.
40
+
41
+ ---
42
+
43
+ // turbo
44
+
45
+ ## ⚡ Layer 1: Fast Metadata Scan (10-20 seconds)
46
+
47
+ **Purpose:** Detect IDE (NetBeans/Eclipse), UI framework (Swing/JavaFX/SWT), build tool, and existing AI configurations.
48
+
49
+ ⭐ **Context Links:**
50
+
51
+ - NetBeans: [nbproject/project.xml](file:///nbproject/project.xml) | [build.xml](file:///build.xml)
52
+ - Eclipse: [.project](file:///.project) | [.classpath](file:///.classpath)
53
+ - Maven: [pom.xml](file:///pom.xml)
54
+ - Gradle: [build.gradle](file:///build.gradle) | [build.gradle.kts](file:///build.gradle.kts)
55
+ - Java Sources: [src/](file:///src/) | [src/main/java/](file:///src/main/java/)
56
+
57
+ ### 0.1.1 Desktop Project Detection
58
+
59
+ **Action:** Detect IDE, UI framework, build system, and Java version.
60
+
61
+ **NetBeans Project Detection:**
62
+
63
+ Check for NetBeans-specific markers:
64
+
65
+ - `nbproject/project.xml` - NetBeans project descriptor
66
+ - `build.xml` - Ant build configuration
67
+ - `manifest.mf` - JAR manifest file
68
+ - `src/` with Java source files
69
+ - `lib/` for dependencies (Ant-based projects)
70
+
71
+ **Swing Detection (NetBeans):**
72
+
73
+ - `.form` files in `src/` (NetBeans GUI Builder)
74
+ - Java files with `JFrame`, `JPanel`, `JDialog` imports
75
+ - GUI initialization code: `new JFrame()`, `SwingUtilities.invokeLater()`
76
+
77
+ **JavaFX Detection (NetBeans):**
78
+
79
+ - `.fxml` files (Scene Builder)
80
+ - Java files with `javafx.*` imports
81
+ - Main class extends `javafx.application.Application`
82
+ - Maven/Gradle dependencies: `org.openjfx:javafx-*`
83
+
84
+ **Eclipse Project Detection:**
85
+
86
+ Check for Eclipse-specific markers:
87
+
88
+ - `.project` - Eclipse project descriptor
89
+ - `.classpath` - Classpath configuration
90
+ - `.settings/` - IDE settings directory
91
+ - `pom.xml` (Maven) or `build.gradle` (Gradle)
92
+ - `src/main/java/` or `src/` for source code
93
+
94
+ **Swing Detection (Eclipse):**
95
+
96
+ - Java files with `JFrame`, `JPanel`, `JDialog` imports
97
+ - WindowBuilder metadata (`.wbp-component-cache`)
98
+ - GUI initialization code
99
+
100
+ **JavaFX Detection (Eclipse):**
101
+
102
+ - `.fxml` files
103
+ - Java files with `javafx.*` imports
104
+ - e(fx)clipse project nature in `.project`
105
+ - Maven/Gradle dependencies: `org.openjfx:javafx-*`
106
+
107
+ **SWT/JFace Detection (Eclipse only):**
108
+
109
+ - Java files with `org.eclipse.swt.*` imports
110
+ - Java files with `org.eclipse.jface.*` imports
111
+ - Main class uses `Display`, `Shell`, `ApplicationWorkbenchAdvisor`
112
+ - `.product` file (Eclipse RCP)
113
+ - Maven/Gradle dependencies: `org.eclipse.platform:org.eclipse.swt.*`
114
+
115
+ **Project Type Classification:**
116
+
117
+ 1. **NetBeans Desktop (Swing):**
118
+ - Has `.form` files
119
+ - Swing imports present
120
+ - No web/ directory
121
+ - Build.xml with desktop-related targets
122
+
123
+ 2. **NetBeans Desktop (JavaFX):**
124
+ - Has `.fxml` files
125
+ - JavaFX imports present
126
+ - Main extends `Application`
127
+ - Maven/Gradle with JavaFX deps
128
+
129
+ 3. **Eclipse Desktop (Swing):**
130
+ - Has `.project` file
131
+ - Swing imports present
132
+ - Maven/Gradle build
133
+ - No web facets
134
+
135
+ 4. **Eclipse Desktop (JavaFX):**
136
+ - Has `.project` file
137
+ - JavaFX imports and `.fxml` files
138
+ - e(fx)clipse nature
139
+ - Maven/Gradle with JavaFX deps
140
+
141
+ 5. **Eclipse RCP (SWT):**
142
+ - Has `.project` and `.product` files
143
+ - SWT/JFace imports
144
+ - Plugin dependencies
145
+ - OSGi manifest
146
+
147
+ **Build System Detection:**
148
+
149
+ NetBeans:
150
+
151
+ - Default: Apache Ant (`build.xml`)
152
+ - Modern: Maven (`pom.xml`) or Gradle (`build.gradle`)
153
+ - Hybrid: Ant + Ivy
154
+
155
+ Eclipse:
156
+
157
+ - Default: Maven (`pom.xml`) or Gradle (`build.gradle`)
158
+ - Legacy: Ant with Eclipse compiler
159
+ - PDE: Eclipse Plugin Development
160
+
161
+ **Java Version Detection:**
162
+
163
+ - NetBeans: Check `nbproject/project.properties` for `javac.source` and `javac.target`
164
+ - Eclipse: Check `.classpath` for `org.eclipse.jdt.launching.JRE_CONTAINER`
165
+ - Maven: Check `<maven.compiler.source>` and `<maven.compiler.target>`
166
+ - Gradle: Check `sourceCompatibility` and `targetCompatibility`
167
+
168
+ **Packaging Detection:**
169
+
170
+ - JAR: Standard executable JAR with manifest
171
+ - Native: jpackage, launch4j, exe4j
172
+ - Installer: NSIS, Inno Setup, WiX
173
+ - Mac: .app bundle, .dmg
174
+ - Windows: .exe, .msi
175
+ - Linux: .deb, .rpm, AppImage
176
+
177
+ ---
178
+
179
+ ## 🔍 Layer 2: Architecture Analysis (30-60 seconds)
180
+
181
+ **Purpose:** Understand package structure, main entry points, UI components, and design patterns.
182
+
183
+ ### 0.2.1 Source Code Structure
184
+
185
+ Scan `src/` or `src/main/java/` for:
186
+
187
+ 1. **Package Structure:**
188
+ - Main package: `com.company.app`
189
+ - UI packages: `ui`, `view`, `gui`, `swing`, `javafx`
190
+ - Logic packages: `controller`, `service`, `business`
191
+ - Data packages: `model`, `entity`, `dao`, `repository`
192
+ - Util packages: `util`, `helper`, `common`
193
+
194
+ 2. **Main Entry Point:**
195
+ - NetBeans Swing: Class with `public static void main()` and `SwingUtilities.invokeLater()`
196
+ - JavaFX: Class extends `javafx.application.Application` with `start(Stage)`
197
+ - SWT: Class with `Display.getDefault()` and `Shell`
198
+
199
+ 3. **UI Components:**
200
+ - Forms/Windows: Count of `JFrame`, `JDialog`, `Stage`, `Shell` classes
201
+ - Panels: Count of `JPanel`, `Pane`, `Composite` classes
202
+ - Custom components: Subclasses of UI classes
203
+
204
+ 4. **Design Patterns:**
205
+ - MVC: Separate `model`, `view`, `controller` packages
206
+ - MVP: Presenter classes
207
+ - MVVM: ViewModel classes (JavaFX properties)
208
+ - Observer: EventListeners, PropertyChangeListeners
209
+ - Singleton: Database connections, controllers
210
+
211
+ ### 0.2.2 Data Layer Detection
212
+
213
+ Check for:
214
+
215
+ - **JDBC:** `java.sql.*` imports, `Connection`, `PreparedStatement`
216
+ - **JPA/Hibernate:** `javax.persistence.*` annotations, `persistence.xml`
217
+ - **Embedded DB:** H2, Derby, SQLite dependencies
218
+ - **External DB:** MySQL, PostgreSQL, Oracle drivers
219
+ - **File Storage:** Serialization, XML, JSON, Properties files
220
+ - **Preferences:** `java.util.prefs.Preferences`
221
+
222
+ ### 0.2.3 External Libraries
223
+
224
+ Check dependencies in:
225
+
226
+ - Maven: `pom.xml` → `<dependencies>`
227
+ - Gradle: `build.gradle` → `dependencies { }`
228
+ - Ant: `lib/` folder or `ivy.xml`
229
+
230
+ Common libraries:
231
+
232
+ - Swing: Substance, FlatLaf, Darcula LAF
233
+ - JavaFX: ControlsFX, JFoenix, TilesFX
234
+ - SWT: Nebula, Opal
235
+ - HTTP: Apache HttpClient, OkHttp
236
+ - JSON: Jackson, Gson, org.json
237
+ - Logging: Log4j, SLF4J, Logback
238
+ - Testing: JUnit, Mockito, TestFX
239
+
240
+ ---
241
+
242
+ ## 🧩 Layer 3: Detailed Component Inventory (1-2 minutes)
243
+
244
+ **Purpose:** List all UI screens, controllers, models, and business logic.
245
+
246
+ ### 0.3.1 UI Screens Inventory
247
+
248
+ For each UI screen, document:
249
+
250
+ - File name: `MainWindow.java`, `LoginDialog.java`
251
+ - Type: JFrame, JDialog, Stage, Shell
252
+ - Purpose: Login, Dashboard, Settings, etc.
253
+ - Layout: BorderLayout, GridBagLayout, VBox, GridLayout
254
+ - Components: Buttons, text fields, tables, trees, etc.
255
+
256
+ ### 0.3.2 Controllers/Presenters
257
+
258
+ List all controller classes:
259
+
260
+ - Naming pattern: `*Controller`, `*Presenter`, `*Handler`
261
+ - Responsibilities: Business logic, event handling, data binding
262
+
263
+ ### 0.3.3 Models/Entities
264
+
265
+ List all data models:
266
+
267
+ - POJOs: Simple Java objects
268
+ - JPA Entities: Classes with `@Entity`
269
+ - JavaFX Properties: ObservableList, SimpleStringProperty
270
+ - Table models: AbstractTableModel, ObservableList
271
+
272
+ ### 0.3.4 Services/Business Logic
273
+
274
+ List service classes:
275
+
276
+ - Naming pattern: `*Service`, `*Manager`, `*Facade`
277
+ - Responsibilities: Data access, business rules, validation
278
+
279
+ ---
280
+
281
+ ## 📊 Phase 0 Output
282
+
283
+ After all layers, generate a summary:
284
+
285
+ ```
286
+ 📋 PHASE 0 SUMMARY: Desktop Project Discovery
287
+
288
+ **IDE & Build System:**
289
+ - IDE: [NetBeans 17 / Eclipse 2024-03]
290
+ - Build Tool: [Ant / Maven / Gradle]
291
+ - Java Version: [Java 17]
292
+
293
+ **UI Framework:**
294
+ - Framework: [Swing / JavaFX / SWT]
295
+ - Layout Manager: [BorderLayout / FXML / GridLayout]
296
+ - LAF/Theme: [FlatLaf Dark / Modena / GTK]
297
+
298
+ **Project Structure:**
299
+ - Main Package: com.company.app
300
+ - Entry Point: MainApp.java
301
+ - UI Screens: 8 windows, 15 dialogs
302
+ - Controllers: 12 classes
303
+ - Models: 20 entities
304
+ - Services: 8 classes
305
+
306
+ **Data Layer:**
307
+ - Database: [H2 embedded / PostgreSQL]
308
+ - ORM: [JDBC / JPA + Hibernate]
309
+ - Local Storage: Preferences API, JSON files
310
+
311
+ **Dependencies:**
312
+ - UI Libraries: FlatLaf, MigLayout
313
+ - Data Libraries: H2, Hibernate
314
+ - Utilities: Apache Commons, Jackson
315
+
316
+ **Packaging:**
317
+ - Output: Executable JAR
318
+ - Native: jpackage (Windows .exe, Mac .app)
319
+ - Installer: NSIS (Windows), DMG (Mac)
320
+
321
+ Is this correct? (Yes/No)
322
+ ```
323
+
324
+ ---
325
+
326
+ ### 📄 Cache Results
327
+
328
+ Save analysis to `.ai-flow/cache/docs-analysis.json`:
329
+
330
+ ```json
331
+ {
332
+ "timestamp": "2025-02-03T10:30:00Z",
333
+ "projectType": "desktop",
334
+ "ide": "netbeans",
335
+ "uiFramework": "swing",
336
+ "buildTool": "maven",
337
+ "javaVersion": "17",
338
+ "mainPackage": "com.company.app",
339
+ "entryPoint": "MainApp.java",
340
+ "screens": 8,
341
+ "controllers": 12,
342
+ "models": 20,
343
+ "services": 8,
344
+ "database": "h2",
345
+ "orm": "hibernate",
346
+ "dependencies": ["flatlaf", "miglayout", "h2", "hibernate", "jackson"]
347
+ }
348
+ ```
349
+
350
+ ---
351
+
352
+ **Next Phase:** Phase 1 - Discovery & UX Desktop (15-20 min)
353
+
354
+ Read: `.ai-flow/prompts/desktop/flow-build-phase-1.md`
355
+
356
+ ---
357
+
358
+ **Last Updated:** 2025-02-03
359
+ **Version:** 1.0.0