ai-flow-dev 2.7.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/LICENSE +21 -21
- package/README.md +573 -570
- package/package.json +74 -74
- package/prompts/backend/flow-build-phase-0.md +535 -535
- package/prompts/backend/flow-build-phase-1.md +626 -626
- package/prompts/backend/flow-build-phase-10.md +340 -340
- package/prompts/backend/flow-build-phase-2.md +573 -573
- package/prompts/backend/flow-build-phase-3.md +834 -834
- package/prompts/backend/flow-build-phase-4.md +554 -554
- package/prompts/backend/flow-build-phase-5.md +703 -703
- package/prompts/backend/flow-build-phase-6.md +524 -524
- package/prompts/backend/flow-build-phase-7.md +1001 -1001
- package/prompts/backend/flow-build-phase-8.md +1407 -1407
- package/prompts/backend/flow-build-phase-9.md +477 -477
- package/prompts/backend/flow-build.md +137 -137
- package/prompts/backend/flow-check-review.md +656 -20
- package/prompts/backend/flow-check-test.md +526 -14
- package/prompts/backend/flow-check.md +725 -67
- package/prompts/backend/flow-commit.md +88 -119
- package/prompts/backend/flow-docs-sync.md +354 -354
- package/prompts/backend/flow-finish.md +919 -0
- package/prompts/backend/flow-release.md +949 -0
- package/prompts/backend/flow-work-feature.md +61 -61
- package/prompts/backend/flow-work-fix.md +46 -46
- package/prompts/backend/flow-work-refactor.md +48 -48
- package/prompts/backend/flow-work-resume.md +34 -34
- package/prompts/backend/flow-work.md +1098 -1286
- package/prompts/desktop/flow-build-phase-0.md +359 -359
- package/prompts/desktop/flow-build-phase-1.md +295 -295
- package/prompts/desktop/flow-build-phase-10.md +357 -357
- package/prompts/desktop/flow-build-phase-2.md +282 -282
- package/prompts/desktop/flow-build-phase-3.md +291 -291
- package/prompts/desktop/flow-build-phase-4.md +308 -308
- package/prompts/desktop/flow-build-phase-5.md +269 -269
- package/prompts/desktop/flow-build-phase-6.md +350 -350
- package/prompts/desktop/flow-build-phase-7.md +297 -297
- package/prompts/desktop/flow-build-phase-8.md +541 -541
- package/prompts/desktop/flow-build-phase-9.md +439 -439
- package/prompts/desktop/flow-build.md +156 -156
- package/prompts/desktop/flow-check-review.md +656 -20
- package/prompts/desktop/flow-check-test.md +526 -14
- package/prompts/desktop/flow-check.md +725 -67
- package/prompts/desktop/flow-commit.md +88 -119
- package/prompts/desktop/flow-docs-sync.md +354 -354
- package/prompts/desktop/flow-finish.md +910 -0
- package/prompts/desktop/flow-release.md +662 -0
- package/prompts/desktop/flow-work-feature.md +61 -61
- package/prompts/desktop/flow-work-fix.md +46 -46
- package/prompts/desktop/flow-work-refactor.md +48 -48
- package/prompts/desktop/flow-work-resume.md +34 -34
- package/prompts/desktop/flow-work.md +1202 -1390
- package/prompts/frontend/flow-build-phase-0.md +425 -425
- package/prompts/frontend/flow-build-phase-1.md +626 -626
- package/prompts/frontend/flow-build-phase-10.md +33 -33
- package/prompts/frontend/flow-build-phase-2.md +573 -573
- package/prompts/frontend/flow-build-phase-3.md +782 -782
- package/prompts/frontend/flow-build-phase-4.md +554 -554
- package/prompts/frontend/flow-build-phase-5.md +703 -703
- package/prompts/frontend/flow-build-phase-6.md +524 -524
- package/prompts/frontend/flow-build-phase-7.md +1001 -1001
- package/prompts/frontend/flow-build-phase-8.md +872 -872
- package/prompts/frontend/flow-build-phase-9.md +94 -94
- package/prompts/frontend/flow-build.md +137 -137
- package/prompts/frontend/flow-check-review.md +656 -20
- package/prompts/frontend/flow-check-test.md +526 -14
- package/prompts/frontend/flow-check.md +725 -67
- package/prompts/frontend/flow-commit.md +88 -119
- package/prompts/frontend/flow-docs-sync.md +550 -550
- 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-feature.md +61 -61
- package/prompts/frontend/flow-work-fix.md +38 -38
- package/prompts/frontend/flow-work-refactor.md +48 -48
- package/prompts/frontend/flow-work-resume.md +34 -34
- package/prompts/frontend/flow-work.md +1583 -1320
- package/prompts/mobile/flow-build-phase-0.md +425 -425
- package/prompts/mobile/flow-build-phase-1.md +626 -626
- package/prompts/mobile/flow-build-phase-10.md +32 -32
- package/prompts/mobile/flow-build-phase-2.md +573 -573
- package/prompts/mobile/flow-build-phase-3.md +782 -782
- package/prompts/mobile/flow-build-phase-4.md +554 -554
- package/prompts/mobile/flow-build-phase-5.md +703 -703
- package/prompts/mobile/flow-build-phase-6.md +524 -524
- package/prompts/mobile/flow-build-phase-7.md +1001 -1001
- package/prompts/mobile/flow-build-phase-8.md +888 -888
- package/prompts/mobile/flow-build-phase-9.md +90 -90
- package/prompts/mobile/flow-build.md +135 -135
- package/prompts/mobile/flow-check-review.md +656 -20
- package/prompts/mobile/flow-check-test.md +526 -14
- package/prompts/mobile/flow-check.md +725 -67
- package/prompts/mobile/flow-commit.md +88 -119
- package/prompts/mobile/flow-docs-sync.md +620 -620
- 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-feature.md +61 -61
- package/prompts/mobile/flow-work-fix.md +46 -46
- package/prompts/mobile/flow-work-refactor.md +48 -48
- package/prompts/mobile/flow-work-resume.md +34 -34
- package/prompts/mobile/flow-work.md +1593 -1329
- package/prompts/shared/mermaid-guidelines.md +102 -102
- package/prompts/shared/scope-levels.md +114 -114
- package/prompts/shared/smart-skip-preflight.md +214 -214
- package/prompts/shared/story-points.md +55 -55
- package/prompts/shared/task-format.md +74 -74
- package/prompts/shared/task-summary-template.md +277 -277
- package/templates/AGENT.template.md +443 -443
- package/templates/backend/.clauderules.template +112 -112
- package/templates/backend/.cursorrules.template +102 -102
- package/templates/backend/README.template.md +2 -2
- package/templates/backend/ai-instructions.template.md +2 -2
- package/templates/backend/copilot-instructions.template.md +2 -2
- package/templates/backend/docs/api.template.md +320 -320
- package/templates/backend/docs/business-flows.template.md +97 -97
- package/templates/backend/docs/code-standards.template.md +2 -2
- package/templates/backend/docs/contributing.template.md +3 -3
- package/templates/backend/docs/data-model.template.md +520 -520
- package/templates/backend/docs/testing.template.md +2 -2
- package/templates/backend/project-brief.template.md +2 -2
- package/templates/backend/specs/configuration.template.md +2 -2
- package/templates/backend/specs/security.template.md +2 -2
- package/templates/desktop/.clauderules.template +112 -112
- package/templates/desktop/.cursorrules.template +102 -102
- package/templates/desktop/README.template.md +170 -170
- package/templates/desktop/ai-instructions.template.md +366 -366
- package/templates/desktop/copilot-instructions.template.md +140 -140
- package/templates/desktop/docs/docs/api.template.md +320 -320
- package/templates/desktop/docs/docs/architecture.template.md +724 -724
- package/templates/desktop/docs/docs/business-flows.template.md +102 -102
- package/templates/desktop/docs/docs/code-standards.template.md +792 -792
- package/templates/desktop/docs/docs/contributing.template.md +149 -149
- package/templates/desktop/docs/docs/data-model.template.md +520 -520
- package/templates/desktop/docs/docs/operations.template.md +720 -720
- package/templates/desktop/docs/docs/testing.template.md +722 -722
- package/templates/desktop/project-brief.template.md +150 -150
- package/templates/desktop/specs/specs/configuration.template.md +121 -121
- package/templates/desktop/specs/specs/security.template.md +392 -392
- package/templates/frontend/README.template.md +2 -2
- package/templates/frontend/ai-instructions.template.md +2 -2
- package/templates/frontend/docs/api-integration.template.md +362 -362
- package/templates/frontend/docs/components.template.md +2 -2
- package/templates/frontend/docs/error-handling.template.md +360 -360
- package/templates/frontend/docs/operations.template.md +107 -107
- package/templates/frontend/docs/performance.template.md +124 -124
- package/templates/frontend/docs/pwa.template.md +119 -119
- package/templates/frontend/docs/state-management.template.md +2 -2
- package/templates/frontend/docs/styling.template.md +2 -2
- package/templates/frontend/docs/testing.template.md +2 -2
- package/templates/frontend/project-brief.template.md +2 -2
- package/templates/frontend/specs/accessibility.template.md +95 -95
- package/templates/frontend/specs/configuration.template.md +2 -2
- package/templates/frontend/specs/security.template.md +175 -175
- package/templates/fullstack/README.template.md +252 -252
- package/templates/fullstack/ai-instructions.template.md +444 -444
- package/templates/fullstack/project-brief.template.md +157 -157
- package/templates/fullstack/specs/configuration.template.md +340 -340
- package/templates/mobile/README.template.md +167 -167
- package/templates/mobile/ai-instructions.template.md +196 -196
- package/templates/mobile/docs/app-store.template.md +135 -135
- package/templates/mobile/docs/architecture.template.md +63 -63
- package/templates/mobile/docs/native-features.template.md +94 -94
- package/templates/mobile/docs/navigation.template.md +59 -59
- package/templates/mobile/docs/offline-strategy.template.md +65 -65
- package/templates/mobile/docs/permissions.template.md +56 -56
- package/templates/mobile/docs/state-management.template.md +85 -85
- package/templates/mobile/docs/testing.template.md +109 -109
- package/templates/mobile/project-brief.template.md +69 -69
- package/templates/mobile/specs/build-configuration.template.md +91 -91
- package/templates/mobile/specs/deployment.template.md +92 -92
- package/templates/work.template.md +47 -47
|
@@ -0,0 +1,949 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Automated Semantic Versioning and Release Management
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# AI Flow - Release Automation
|
|
6
|
+
|
|
7
|
+
**YOU ARE AN EXPERT RELEASE ENGINEER AND VERSION CONTROL SPECIALIST.**
|
|
8
|
+
|
|
9
|
+
Your mission is to analyze changes, calculate semantic version, update all version files (including Swagger/OpenAPI), generate changelog, create Git tag, and push to remote when the user executes `/flow-release`.
|
|
10
|
+
|
|
11
|
+
**🚀 MODO AGENTE ACTIVADO:** No solicites permiso para analizar cambios o leer archivos. Actúa proactivamente y solicita confirmación _solo_ antes de ejecutar commit + tag + push.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Command: `/flow-release`
|
|
16
|
+
|
|
17
|
+
### Objective
|
|
18
|
+
|
|
19
|
+
Automate release creation with:
|
|
20
|
+
|
|
21
|
+
- **Automatic version detection** across multiple file formats.
|
|
22
|
+
- **Smart diff analysis** to infer Major/Minor/Patch bump.
|
|
23
|
+
- **Swagger/OpenAPI update** with version and release date (CRITICAL).
|
|
24
|
+
- **CHANGELOG generation** following Keep a Changelog format.
|
|
25
|
+
- **Git tag creation** and push to remote.
|
|
26
|
+
|
|
27
|
+
### Usage Modes
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
/flow-release # Auto-analyze and suggest version
|
|
31
|
+
/flow-release --dry-run # Preview without executing
|
|
32
|
+
/flow-release --major # Force major bump (2.0.0)
|
|
33
|
+
/flow-release --minor # Force minor bump (1.3.0)
|
|
34
|
+
/flow-release --patch # Force patch bump (1.2.4)
|
|
35
|
+
/flow-release 1.5.0 # Manual version override
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Workflow: 8 Steps
|
|
41
|
+
|
|
42
|
+
### Step 1: Pre-Flight Validations
|
|
43
|
+
|
|
44
|
+
**🛡️ CRITICAL CHECKS** - Execute before any analysis:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Check working directory is clean
|
|
48
|
+
git status --porcelain
|
|
49
|
+
|
|
50
|
+
# Verify current branch
|
|
51
|
+
git branch --show-current
|
|
52
|
+
|
|
53
|
+
# Check remote connectivity
|
|
54
|
+
git remote -v
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**Validation Rules:**
|
|
58
|
+
|
|
59
|
+
| Check | Requirement | On Failure |
|
|
60
|
+
| ----------------- | ------------------------------ | ------------------------------ |
|
|
61
|
+
| Working directory | Clean (no uncommitted changes) | ❌ Abort with instructions |
|
|
62
|
+
| Current branch | `main`, `master`, `develop` | ⚠️ Warn but allow continuation |
|
|
63
|
+
| Remote access | Origin reachable | ❌ Abort (cannot push) |
|
|
64
|
+
| Last tag exists | At least one tag | ⚠️ Default to v0.0.0 |
|
|
65
|
+
|
|
66
|
+
**Error Messages:**
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
❌ Working directory not clean
|
|
70
|
+
|
|
71
|
+
Uncommitted changes detected. Commit or stash before release:
|
|
72
|
+
git status
|
|
73
|
+
|
|
74
|
+
Run: git add . && git commit -m "chore: prepare for release"
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Step 2: Detect Version System
|
|
78
|
+
|
|
79
|
+
**Scan project root for version files in priority order:**
|
|
80
|
+
|
|
81
|
+
| Priority | File Pattern | Type | Read Command |
|
|
82
|
+
| -------- | --------------- | ---------------- | --------------------------------------------------------------------------------------- |
|
|
83
|
+
| 1 | `package.json` | Node.js/Frontend | `cat package.json \| jq -r '.version'` |
|
|
84
|
+
| 2 | `pom.xml` | Java/Maven | `xmllint --xpath "/*[local-name()='project']/*[local-name()='version']/text()" pom.xml` |
|
|
85
|
+
| 3 | `build.gradle*` | Java/Gradle | `grep "version = " build.gradle*` |
|
|
86
|
+
| 4 | `pubspec.yaml` | Flutter/Dart | `grep "version:" pubspec.yaml` |
|
|
87
|
+
| 5 | `*.csproj` | .NET | `xmllint --xpath "//Version/text()" *.csproj` |
|
|
88
|
+
| 6 | `setup.py` | Python | `grep "version=" setup.py` |
|
|
89
|
+
| 7 | `Cargo.toml` | Rust | `grep "version =" Cargo.toml` |
|
|
90
|
+
|
|
91
|
+
**Output:**
|
|
92
|
+
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"system": "node",
|
|
96
|
+
"file": "package.json",
|
|
97
|
+
"currentVersion": "1.2.3"
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**If multiple files found:** Use highest priority, warn about others.
|
|
102
|
+
|
|
103
|
+
### Step 3: Get Last Release Info
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# Get last Git tag
|
|
107
|
+
git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0"
|
|
108
|
+
|
|
109
|
+
# Count commits since last tag
|
|
110
|
+
git rev-list $(git describe --tags --abbrev=0)..HEAD --count 2>/dev/null || echo "all"
|
|
111
|
+
|
|
112
|
+
# Get commits for analysis
|
|
113
|
+
git log $(git describe --tags --abbrev=0 2>/dev/null || git rev-list --max-parents=0 HEAD)..HEAD --oneline --no-merges
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**Output:**
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
Last Tag: v1.2.3
|
|
120
|
+
Commits Since: 7
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**If no tags exist:** Treat all commits as Unreleased.
|
|
124
|
+
|
|
125
|
+
### Step 4: Analyze Changes (Smart Inference)
|
|
126
|
+
|
|
127
|
+
**Analyze diffs to classify change impact WITHOUT requiring Conventional Commits:**
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
# Get diff stats from last tag
|
|
131
|
+
git diff $(git describe --tags --abbrev=0 2>/dev/null || git rev-list --max-parents=0 HEAD)..HEAD --stat
|
|
132
|
+
|
|
133
|
+
# Get detailed diff for critical analysis
|
|
134
|
+
git diff $(git describe --tags --abbrev=0 2>/dev/null || git rev-list --max-parents=0 HEAD)..HEAD
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**Classification Logic:**
|
|
138
|
+
|
|
139
|
+
| Pattern Detected | Category | Bump Type | Examples |
|
|
140
|
+
| ------------------------------------ | ------------ | --------- | ------------------------------------------------------ |
|
|
141
|
+
| Removed endpoints/routes | **BREAKING** | MAJOR | `@DeleteMapping`, `router.delete`, removed controllers |
|
|
142
|
+
| Changed request/response schemas | **BREAKING** | MAJOR | DTOs modified, GraphQL schema changes |
|
|
143
|
+
| Database schema breaking changes | **BREAKING** | MAJOR | Column drops, type changes, FK removals |
|
|
144
|
+
| Authentication/authorization changes | **BREAKING** | MAJOR | Auth middleware modified, token format changed |
|
|
145
|
+
| New endpoints/routes | **FEATURE** | MINOR | New `@PostMapping`, new REST routes |
|
|
146
|
+
| New entities/models | **FEATURE** | MINOR | New database tables, new domain objects |
|
|
147
|
+
| New services/modules | **FEATURE** | MINOR | New business logic classes |
|
|
148
|
+
| Bug fixes in existing code | **FIX** | PATCH | Fix conditionals, null checks, error handling |
|
|
149
|
+
| Refactoring (no behavior change) | **CHORE** | PATCH | Rename variables, extract methods |
|
|
150
|
+
| Documentation updates | **DOCS** | PATCH | README, comments, Swagger annotations |
|
|
151
|
+
| Dependency updates | **CHORE** | PATCH | package.json, pom.xml dependencies |
|
|
152
|
+
| Test additions | **TEST** | PATCH | New test files, test improvements |
|
|
153
|
+
|
|
154
|
+
**Decision Priority:**
|
|
155
|
+
|
|
156
|
+
1. **IF any BREAKING → MAJOR** (X.0.0)
|
|
157
|
+
2. **ELSE IF any FEATURE → MINOR** (X.Y.0)
|
|
158
|
+
3. **ELSE → PATCH** (X.Y.Z)
|
|
159
|
+
|
|
160
|
+
**Output:**
|
|
161
|
+
|
|
162
|
+
```markdown
|
|
163
|
+
## Change Analysis
|
|
164
|
+
|
|
165
|
+
**Version:** 1.2.3 → 1.3.0 (MINOR)
|
|
166
|
+
|
|
167
|
+
### Changes Detected:
|
|
168
|
+
|
|
169
|
+
**BREAKING CHANGES:** None
|
|
170
|
+
|
|
171
|
+
**NEW FEATURES:**
|
|
172
|
+
|
|
173
|
+
- New endpoint: POST /api/orders/validate (OrderController.java)
|
|
174
|
+
- New entity: CreditLimit (models/CreditLimit.js)
|
|
175
|
+
- New service: NotificationService (services/notification.service.ts)
|
|
176
|
+
|
|
177
|
+
**FIXES & IMPROVEMENTS:**
|
|
178
|
+
|
|
179
|
+
- Fixed null pointer in AuthService.validateToken()
|
|
180
|
+
- Improved error handling in PaymentController
|
|
181
|
+
- Updated dependencies: express 4.18.0 → 4.18.2
|
|
182
|
+
|
|
183
|
+
### Justification:
|
|
184
|
+
|
|
185
|
+
3 new features detected (new endpoints, entities, services).
|
|
186
|
+
No breaking changes identified.
|
|
187
|
+
Several bug fixes and dependency updates.
|
|
188
|
+
|
|
189
|
+
Recommended: **MINOR bump** (1.2.3 → 1.3.0)
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### Step 5: Calculate New Version
|
|
193
|
+
|
|
194
|
+
**Apply SemVer rules:**
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
Current: 1.2.3
|
|
198
|
+
Analysis: MINOR bump
|
|
199
|
+
|
|
200
|
+
New Version: 1.3.0
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
**Override handling:**
|
|
204
|
+
|
|
205
|
+
- `--major`: Force X.0.0 (reset MINOR and PATCH)
|
|
206
|
+
- `--minor`: Force X.Y.0 (reset PATCH)
|
|
207
|
+
- `--patch`: Force X.Y.Z
|
|
208
|
+
- `1.5.0`: Use exact version (validate format)
|
|
209
|
+
|
|
210
|
+
**Version format validation:**
|
|
211
|
+
|
|
212
|
+
```regex
|
|
213
|
+
^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Valid: `1.3.0`, `2.0.0`, `1.2.4`
|
|
217
|
+
Invalid: `v1.3.0` (remove 'v'), `1.3` (missing PATCH)
|
|
218
|
+
|
|
219
|
+
### Step 6: Update Swagger/OpenAPI Specification
|
|
220
|
+
|
|
221
|
+
**🚨 CRITICAL STEP - Required for Swagger UI display**
|
|
222
|
+
|
|
223
|
+
**Detect Swagger/OpenAPI configuration:**
|
|
224
|
+
|
|
225
|
+
| Framework | Detection | Update Location |
|
|
226
|
+
| ---------------- | --------------------------------------- | ------------------------------------- |
|
|
227
|
+
| **Spring Boot** | `@OpenAPI` annotation | Java annotation + `application.yml` |
|
|
228
|
+
| **NestJS** | `@nestjs/swagger` import | `main.ts` SwaggerModule config |
|
|
229
|
+
| **FastAPI** | `from fastapi import FastAPI` | `app = FastAPI(version=)` constructor |
|
|
230
|
+
| **Express** | `swagger-jsdoc` or `swagger-ui-express` | `swagger.js` config file |
|
|
231
|
+
| **ASP.NET** | `Swashbuckle` reference | `Startup.cs` or `Program.cs` |
|
|
232
|
+
| **Django REST** | `drf-yasg` or `drf-spectacular` | `settings.py` + `urls.py` |
|
|
233
|
+
| **Static files** | `swagger.json`, `openapi.json` | Direct JSON/YAML edit |
|
|
234
|
+
|
|
235
|
+
**Update Instructions by Framework:**
|
|
236
|
+
|
|
237
|
+
#### Spring Boot (Java)
|
|
238
|
+
|
|
239
|
+
```java
|
|
240
|
+
// File: src/main/java/.../Application.java or OpenAPIConfig.java
|
|
241
|
+
@OpenAPIDefinition(
|
|
242
|
+
info = @Info(
|
|
243
|
+
title = "Api Name",
|
|
244
|
+
version = "1.3.0", // ← UPDATE THIS
|
|
245
|
+
description = "API Description"
|
|
246
|
+
)
|
|
247
|
+
)
|
|
248
|
+
|
|
249
|
+
// Also update application.yml if present
|
|
250
|
+
springdoc:
|
|
251
|
+
api-docs:
|
|
252
|
+
version: '1.3.0' // ← UPDATE THIS
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
#### NestJS (TypeScript)
|
|
256
|
+
|
|
257
|
+
```typescript
|
|
258
|
+
// File: src/main.ts
|
|
259
|
+
const config = new DocumentBuilder()
|
|
260
|
+
.setTitle('API Name')
|
|
261
|
+
.setVersion('1.3.0') // ← UPDATE THIS
|
|
262
|
+
.setDescription('API Description')
|
|
263
|
+
.build();
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
#### FastAPI (Python)
|
|
267
|
+
|
|
268
|
+
```python
|
|
269
|
+
# File: main.py or app/__init__.py
|
|
270
|
+
app = FastAPI(
|
|
271
|
+
title="API Name",
|
|
272
|
+
version="1.3.0", # ← UPDATE THIS
|
|
273
|
+
description="API Description"
|
|
274
|
+
)
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
#### Express (JavaScript/TypeScript)
|
|
278
|
+
|
|
279
|
+
```javascript
|
|
280
|
+
// File: swagger.js or src/config/swagger.ts
|
|
281
|
+
const swaggerDefinition = {
|
|
282
|
+
openapi: '3.0.0',
|
|
283
|
+
info: {
|
|
284
|
+
title: 'API Name',
|
|
285
|
+
version: '1.3.0', // ← UPDATE THIS
|
|
286
|
+
description: 'API Description',
|
|
287
|
+
},
|
|
288
|
+
};
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
#### .NET (C#)
|
|
292
|
+
|
|
293
|
+
```csharp
|
|
294
|
+
// File: Program.cs or Startup.cs
|
|
295
|
+
services.AddSwaggerGen(c =>
|
|
296
|
+
{
|
|
297
|
+
c.SwaggerDoc("v1", new OpenApiInfo
|
|
298
|
+
{
|
|
299
|
+
Title = "API Name",
|
|
300
|
+
Version = "1.3.0" // ← UPDATE THIS
|
|
301
|
+
});
|
|
302
|
+
});
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
#### Static Swagger JSON/YAML
|
|
306
|
+
|
|
307
|
+
```json
|
|
308
|
+
{
|
|
309
|
+
"openapi": "3.0.0",
|
|
310
|
+
"info": {
|
|
311
|
+
"title": "API Name",
|
|
312
|
+
"version": "1.3.0",
|
|
313
|
+
"description": "API Description"
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
**Release Date Format (ISO 8601 UTC):**
|
|
319
|
+
|
|
320
|
+
```javascript
|
|
321
|
+
// Generate timestamp
|
|
322
|
+
const releaseDate = new Date().toISOString();
|
|
323
|
+
// Example: "2026-03-09T18:30:00.000Z"
|
|
324
|
+
|
|
325
|
+
// For display in Swagger (if supported):
|
|
326
|
+
"x-release-date": "2026-03-09T18:30:00.000Z"
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
**Validation:**
|
|
330
|
+
|
|
331
|
+
After updating, verify Swagger file is parseable:
|
|
332
|
+
|
|
333
|
+
```bash
|
|
334
|
+
# For JSON files
|
|
335
|
+
cat swagger.json | jq '.info.version'
|
|
336
|
+
|
|
337
|
+
# For YAML files
|
|
338
|
+
grep "version:" swagger.yaml
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
### Step 7: Update Version in Primary File
|
|
342
|
+
|
|
343
|
+
**Execute update based on detected system:**
|
|
344
|
+
|
|
345
|
+
#### Node.js (package.json)
|
|
346
|
+
|
|
347
|
+
```bash
|
|
348
|
+
npm version 1.3.0 --no-git-tag-version
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
#### Java Maven (pom.xml)
|
|
352
|
+
|
|
353
|
+
```bash
|
|
354
|
+
mvn versions:set -DnewVersion=1.3.0 -DgenerateBackupPoms=false
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
#### Java Gradle (build.gradle)
|
|
358
|
+
|
|
359
|
+
```bash
|
|
360
|
+
sed -i "s/version = .*/version = '1.3.0'/" build.gradle
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
#### Flutter (pubspec.yaml)
|
|
364
|
+
|
|
365
|
+
```bash
|
|
366
|
+
# Format: version: 1.3.0+buildNumber
|
|
367
|
+
sed -i "s/version: .*/version: 1.3.0+$BUILD_NUMBER/" pubspec.yaml
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
#### .NET (\*.csproj)
|
|
371
|
+
|
|
372
|
+
```bash
|
|
373
|
+
sed -i "s/<Version>.*<\/Version>/<Version>1.3.0<\/Version>/" MyProject.csproj
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
#### Python (setup.py or pyproject.toml)
|
|
377
|
+
|
|
378
|
+
```bash
|
|
379
|
+
sed -i "s/version=.*/version='1.3.0',/" setup.py
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
**Verify update:**
|
|
383
|
+
|
|
384
|
+
```bash
|
|
385
|
+
# Read version again to confirm
|
|
386
|
+
cat package.json | jq -r '.version'
|
|
387
|
+
# Expected output: 1.3.0
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
### Step 8: Generate/Update CHANGELOG
|
|
391
|
+
|
|
392
|
+
**CHANGELOG.md format (Keep a Changelog standard):**
|
|
393
|
+
|
|
394
|
+
```markdown
|
|
395
|
+
# Changelog
|
|
396
|
+
|
|
397
|
+
All notable changes to this project will be documented in this file.
|
|
398
|
+
|
|
399
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
400
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
401
|
+
|
|
402
|
+
## [Unreleased]
|
|
403
|
+
|
|
404
|
+
## [1.3.0] - 2026-03-09
|
|
405
|
+
|
|
406
|
+
### Added
|
|
407
|
+
|
|
408
|
+
- New endpoint POST /api/orders/validate for credit validation
|
|
409
|
+
- New CreditLimit entity with automated checks
|
|
410
|
+
- Notification service for real-time alerts
|
|
411
|
+
|
|
412
|
+
### Fixed
|
|
413
|
+
|
|
414
|
+
- Null pointer exception in AuthService.validateToken()
|
|
415
|
+
- Improved error handling in PaymentController
|
|
416
|
+
|
|
417
|
+
### Changed
|
|
418
|
+
|
|
419
|
+
- Updated express from 4.18.0 to 4.18.2
|
|
420
|
+
- Refactored OrderService for better maintainability
|
|
421
|
+
|
|
422
|
+
## [1.2.3] - 2026-01-28
|
|
423
|
+
|
|
424
|
+
### Fixed
|
|
425
|
+
|
|
426
|
+
- Security vulnerability in JWT validation
|
|
427
|
+
|
|
428
|
+
## [1.2.2] - 2026-01-15
|
|
429
|
+
|
|
430
|
+
### Added
|
|
431
|
+
|
|
432
|
+
- Initial API implementation
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
**If CHANGELOG.md doesn't exist:** Create it with template above.
|
|
436
|
+
|
|
437
|
+
**If CHANGELOG.md exists:** Insert new version section after `## [Unreleased]`.
|
|
438
|
+
|
|
439
|
+
**Categories to use:**
|
|
440
|
+
|
|
441
|
+
- `### Added` - New features
|
|
442
|
+
- `### Changed` - Changes in existing functionality
|
|
443
|
+
- `### Deprecated` - Soon-to-be removed features
|
|
444
|
+
- `### Removed` - Removed features (BREAKING)
|
|
445
|
+
- `### Fixed` - Bug fixes
|
|
446
|
+
- `### Security` - Security fixes
|
|
447
|
+
|
|
448
|
+
### Step 9: Interactive Confirmation
|
|
449
|
+
|
|
450
|
+
**Display comprehensive preview:**
|
|
451
|
+
|
|
452
|
+
```
|
|
453
|
+
╔════════════════════════════════════════════════════════════╗
|
|
454
|
+
║ RELEASE PREVIEW ║
|
|
455
|
+
╠════════════════════════════════════════════════════════════╣
|
|
456
|
+
║ ║
|
|
457
|
+
║ 📦 Version: 1.2.3 → 1.3.0 (MINOR) ║
|
|
458
|
+
║ 🌿 Branch: main ║
|
|
459
|
+
║ 📅 Date: 2026-03-09 18:30 UTC ║
|
|
460
|
+
║ ║
|
|
461
|
+
║ 📊 Changes Since v1.2.3: ║
|
|
462
|
+
║ • 3 New Features ║
|
|
463
|
+
║ • 2 Bug Fixes ║
|
|
464
|
+
║ • 1 Dependency Update ║
|
|
465
|
+
║ • 0 Breaking Changes ║
|
|
466
|
+
║ ║
|
|
467
|
+
║ 📝 Files to Update: ║
|
|
468
|
+
║ ✓ package.json (version: 1.3.0) ║
|
|
469
|
+
║ ✓ src/main.ts (Swagger version: 1.3.0) ║
|
|
470
|
+
║ ✓ CHANGELOG.md (new section added) ║
|
|
471
|
+
║ ║
|
|
472
|
+
║ 🏷️ Git Actions: ║
|
|
473
|
+
║ ✓ Commit: "chore(release): bump version to 1.3.0" ║
|
|
474
|
+
║ ✓ Tag: v1.3.0 ║
|
|
475
|
+
║ ✓ Push: origin/main + tags ║
|
|
476
|
+
║ ║
|
|
477
|
+
║ 🌐 Swagger UI: ║
|
|
478
|
+
║ Version 1.3.0 will appear in Swagger after deploy ║
|
|
479
|
+
║ ║
|
|
480
|
+
╚════════════════════════════════════════════════════════════╝
|
|
481
|
+
|
|
482
|
+
Changelog Preview:
|
|
483
|
+
---
|
|
484
|
+
|
|
485
|
+
## [1.3.0] - 2026-03-09
|
|
486
|
+
|
|
487
|
+
### Added
|
|
488
|
+
- New endpoint POST /api/orders/validate
|
|
489
|
+
- CreditLimit entity with automated checks
|
|
490
|
+
- Notification service for real-time alerts
|
|
491
|
+
|
|
492
|
+
### Fixed
|
|
493
|
+
- Null pointer in AuthService.validateToken()
|
|
494
|
+
- Error handling in PaymentController
|
|
495
|
+
|
|
496
|
+
### Changed
|
|
497
|
+
- Updated express 4.18.0 → 4.18.2
|
|
498
|
+
|
|
499
|
+
---
|
|
500
|
+
|
|
501
|
+
Options:
|
|
502
|
+
[Y] Continue with release 1.3.0
|
|
503
|
+
[E] Edit version manually
|
|
504
|
+
[D] Dry-run output (show commands without executing)
|
|
505
|
+
[C] Cancel
|
|
506
|
+
|
|
507
|
+
Continue? (Y/e/d/c):
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
**Response Handling:**
|
|
511
|
+
|
|
512
|
+
- **Y** or Enter → Proceed with release
|
|
513
|
+
- **E** → Ask for custom version input, recalculate, show preview again
|
|
514
|
+
- **D** → Show all commands that would run (see Dry-Run Mode section)
|
|
515
|
+
- **C** → Cancel and exit
|
|
516
|
+
|
|
517
|
+
### Step 10: Execute Release
|
|
518
|
+
|
|
519
|
+
**Sequence of Git commands:**
|
|
520
|
+
|
|
521
|
+
```bash
|
|
522
|
+
# Stage all version file changes
|
|
523
|
+
git add package.json src/main.ts CHANGELOG.md
|
|
524
|
+
|
|
525
|
+
# Create release commit
|
|
526
|
+
git commit -m "chore(release): bump version to 1.3.0
|
|
527
|
+
|
|
528
|
+
- Updated package.json to v1.3.0
|
|
529
|
+
- Updated Swagger API version
|
|
530
|
+
- Generated CHANGELOG for v1.3.0
|
|
531
|
+
|
|
532
|
+
Release Date: 2026-03-09T18:30:00Z"
|
|
533
|
+
|
|
534
|
+
# Create annotated Git tag
|
|
535
|
+
git tag -a v1.3.0 -m "Release v1.3.0
|
|
536
|
+
|
|
537
|
+
## Changes
|
|
538
|
+
- 3 new features
|
|
539
|
+
- 2 bug fixes
|
|
540
|
+
- 1 dependency update
|
|
541
|
+
|
|
542
|
+
Full changelog: https://github.com/org/repo/blob/main/CHANGELOG.md#130---2026-03-09"
|
|
543
|
+
|
|
544
|
+
# Push commit and tags
|
|
545
|
+
git push origin main
|
|
546
|
+
git push origin v1.3.0
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
**Error handling during push:**
|
|
550
|
+
|
|
551
|
+
```bash
|
|
552
|
+
# If push fails, provide manual instructions
|
|
553
|
+
if [ $? -ne 0 ]; then
|
|
554
|
+
echo "❌ Push failed. Manual execution required:"
|
|
555
|
+
echo " git push origin main"
|
|
556
|
+
echo " git push origin v1.3.0"
|
|
557
|
+
exit 1
|
|
558
|
+
fi
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
### Step 11: Success Confirmation
|
|
562
|
+
|
|
563
|
+
```
|
|
564
|
+
✅ Release v1.3.0 completed successfully!
|
|
565
|
+
|
|
566
|
+
📦 Changes Applied:
|
|
567
|
+
✓ package.json updated to v1.3.0
|
|
568
|
+
✓ src/main.ts Swagger version updated
|
|
569
|
+
✓ CHANGELOG.md updated with release notes
|
|
570
|
+
✓ Git commit: chore(release): bump version to 1.3.0
|
|
571
|
+
✓ Git tag: v1.3.0 created
|
|
572
|
+
✓ Pushed to origin/main
|
|
573
|
+
✓ Tag pushed to remote
|
|
574
|
+
|
|
575
|
+
📊 Release Statistics:
|
|
576
|
+
• Version Type: MINOR
|
|
577
|
+
• Changes: 3 features, 2 fixes, 1 update
|
|
578
|
+
• Commits Included: 7
|
|
579
|
+
|
|
580
|
+
🌐 Swagger Access:
|
|
581
|
+
After deployment, version 1.3.0 will appear in Swagger UI:
|
|
582
|
+
Example: http://your-api.com/swagger
|
|
583
|
+
|
|
584
|
+
Expected display:
|
|
585
|
+
┌─────────────────────────────┐
|
|
586
|
+
│ Api Name v1.3.0 │
|
|
587
|
+
│ Release Date: 2026-03-09 │
|
|
588
|
+
└─────────────────────────────┘
|
|
589
|
+
|
|
590
|
+
🔗 Quick Links:
|
|
591
|
+
• Commits: https://github.com/org/repo/compare/v1.2.3...v1.3.0
|
|
592
|
+
• Tag: https://github.com/org/repo/releases/tag/v1.3.0
|
|
593
|
+
• CHANGELOG: https://github.com/org/repo/blob/main/CHANGELOG.md#130
|
|
594
|
+
|
|
595
|
+
🚀 Next Steps:
|
|
596
|
+
1. Verify CI/CD pipeline triggered
|
|
597
|
+
2. Monitor deployment to production
|
|
598
|
+
3. Check Swagger UI shows v1.3.0
|
|
599
|
+
4. Notify team in Slack/Discord
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
---
|
|
603
|
+
|
|
604
|
+
## Dry-Run Mode
|
|
605
|
+
|
|
606
|
+
**Usage:** `/flow-release --dry-run`
|
|
607
|
+
|
|
608
|
+
**Behavior:** Perform all analysis and show commands WITHOUT executing them.
|
|
609
|
+
|
|
610
|
+
**Output:**
|
|
611
|
+
|
|
612
|
+
```
|
|
613
|
+
🔍 DRY RUN MODE - No changes will be made
|
|
614
|
+
|
|
615
|
+
═══════════════════════════════════════════════════════════
|
|
616
|
+
|
|
617
|
+
ANALYSIS RESULTS:
|
|
618
|
+
|
|
619
|
+
Current Version: 1.2.3 (from package.json)
|
|
620
|
+
Last Git Tag: v1.2.3
|
|
621
|
+
Commits Since: 7
|
|
622
|
+
|
|
623
|
+
Suggested Version: 1.3.0 (MINOR bump)
|
|
624
|
+
|
|
625
|
+
Reason: 3 new features detected, no breaking changes
|
|
626
|
+
|
|
627
|
+
═══════════════════════════════════════════════════════════
|
|
628
|
+
|
|
629
|
+
COMMANDS THAT WOULD RUN:
|
|
630
|
+
|
|
631
|
+
1. Update package.json:
|
|
632
|
+
$ npm version 1.3.0 --no-git-tag-version
|
|
633
|
+
|
|
634
|
+
2. Update Swagger (src/main.ts):
|
|
635
|
+
$ sed -i "s/.setVersion('.*')/.setVersion('1.3.0')/" src/main.ts
|
|
636
|
+
|
|
637
|
+
3. Update CHANGELOG.md:
|
|
638
|
+
[Insert new section at line 5]
|
|
639
|
+
|
|
640
|
+
4. Git commit:
|
|
641
|
+
$ git add package.json src/main.ts CHANGELOG.md
|
|
642
|
+
$ git commit -m "chore(release): bump version to 1.3.0..."
|
|
643
|
+
|
|
644
|
+
5. Create Git tag:
|
|
645
|
+
$ git tag -a v1.3.0 -m "Release v1.3.0..."
|
|
646
|
+
|
|
647
|
+
6. Push to remote:
|
|
648
|
+
$ git push origin main
|
|
649
|
+
$ git push origin v1.3.0
|
|
650
|
+
|
|
651
|
+
═══════════════════════════════════════════════════════════
|
|
652
|
+
|
|
653
|
+
Run without --dry-run to execute these commands.
|
|
654
|
+
```
|
|
655
|
+
|
|
656
|
+
---
|
|
657
|
+
|
|
658
|
+
## Error Handling
|
|
659
|
+
|
|
660
|
+
### Common Errors and Solutions
|
|
661
|
+
|
|
662
|
+
#### 1. Working Directory Not Clean
|
|
663
|
+
|
|
664
|
+
```
|
|
665
|
+
❌ Error: Uncommitted changes detected
|
|
666
|
+
|
|
667
|
+
Files:
|
|
668
|
+
M src/controllers/OrderController.java
|
|
669
|
+
M src/services/NotificationService.ts
|
|
670
|
+
?? temp.txt
|
|
671
|
+
|
|
672
|
+
Solution:
|
|
673
|
+
git add .
|
|
674
|
+
git commit -m "chore: prepare for release"
|
|
675
|
+
|
|
676
|
+
Then run: /flow-release
|
|
677
|
+
```
|
|
678
|
+
|
|
679
|
+
#### 2. Version File Not Found
|
|
680
|
+
|
|
681
|
+
```
|
|
682
|
+
❌ Error: No version file detected
|
|
683
|
+
|
|
684
|
+
Searched for:
|
|
685
|
+
• package.json
|
|
686
|
+
• pom.xml
|
|
687
|
+
• build.gradle
|
|
688
|
+
• pubspec.yaml
|
|
689
|
+
• *.csproj
|
|
690
|
+
|
|
691
|
+
None found in project root.
|
|
692
|
+
|
|
693
|
+
Solution: Manually create version file for your project type.
|
|
694
|
+
```
|
|
695
|
+
|
|
696
|
+
#### 3. Invalid Current Version
|
|
697
|
+
|
|
698
|
+
```
|
|
699
|
+
❌ Error: Invalid version format in package.json
|
|
700
|
+
|
|
701
|
+
Found: "version": "1.2"
|
|
702
|
+
Expected: "1.2.0" (SemVer format: MAJOR.MINOR.PATCH)
|
|
703
|
+
|
|
704
|
+
Solution:
|
|
705
|
+
Manually fix package.json:
|
|
706
|
+
"version": "1.2.0"
|
|
707
|
+
```
|
|
708
|
+
|
|
709
|
+
#### 4. No Commits Since Last Tag
|
|
710
|
+
|
|
711
|
+
```
|
|
712
|
+
⚠️ Warning: No new commits since v1.2.3
|
|
713
|
+
|
|
714
|
+
Last tag: v1.2.3 (2026-01-28)
|
|
715
|
+
Current HEAD: same commit
|
|
716
|
+
|
|
717
|
+
Nothing to release. Options:
|
|
718
|
+
A) Make changes and commit them first
|
|
719
|
+
B) Force new version (not recommended)
|
|
720
|
+
C) Cancel
|
|
721
|
+
|
|
722
|
+
Choice: _
|
|
723
|
+
```
|
|
724
|
+
|
|
725
|
+
#### 5. Tag Already Exists
|
|
726
|
+
|
|
727
|
+
```
|
|
728
|
+
❌ Error: Tag v1.3.0 already exists
|
|
729
|
+
|
|
730
|
+
Existing tags:
|
|
731
|
+
• v1.3.0 (2026-02-15) ← Conflict
|
|
732
|
+
• v1.2.3 (2026-01-28)
|
|
733
|
+
• v1.2.2 (2026-01-10)
|
|
734
|
+
|
|
735
|
+
Solutions:
|
|
736
|
+
A) Use different version: /flow-release 1.3.1
|
|
737
|
+
B) Force new version: /flow-release --minor (creates 1.4.0)
|
|
738
|
+
C) Delete existing tag (DANGER):
|
|
739
|
+
git tag -d v1.3.0
|
|
740
|
+
git push origin :refs/tags/v1.3.0
|
|
741
|
+
```
|
|
742
|
+
|
|
743
|
+
#### 6. Push Failed (Network/Permissions)
|
|
744
|
+
|
|
745
|
+
```
|
|
746
|
+
❌ Error: Failed to push to remote
|
|
747
|
+
|
|
748
|
+
Command failed: git push origin main
|
|
749
|
+
Error: Permission denied (publickey)
|
|
750
|
+
|
|
751
|
+
Possible causes:
|
|
752
|
+
• No network connection
|
|
753
|
+
• SSH key not configured
|
|
754
|
+
• No push permissions to branch
|
|
755
|
+
• Branch protection rules active
|
|
756
|
+
|
|
757
|
+
Manual resolution:
|
|
758
|
+
1. Fix authentication issue
|
|
759
|
+
2. Run manually:
|
|
760
|
+
git push origin main
|
|
761
|
+
git push origin v1.3.0
|
|
762
|
+
|
|
763
|
+
Rollback (if needed):
|
|
764
|
+
git tag -d v1.3.0
|
|
765
|
+
git reset --soft HEAD~1
|
|
766
|
+
```
|
|
767
|
+
|
|
768
|
+
#### 7. Swagger File Not Found
|
|
769
|
+
|
|
770
|
+
```
|
|
771
|
+
⚠️ Warning: Swagger/OpenAPI configuration not detected
|
|
772
|
+
|
|
773
|
+
Searched for:
|
|
774
|
+
• @OpenAPI annotation (Spring Boot)
|
|
775
|
+
• SwaggerModule (NestJS)
|
|
776
|
+
• FastAPI(version=...) (FastAPI)
|
|
777
|
+
• swagger-jsdoc config (Express)
|
|
778
|
+
• swagger.json / openapi.json
|
|
779
|
+
|
|
780
|
+
None found.
|
|
781
|
+
|
|
782
|
+
Impact: Swagger UI will NOT show updated version.
|
|
783
|
+
|
|
784
|
+
Options:
|
|
785
|
+
A) Continue without Swagger update
|
|
786
|
+
B) Manually specify Swagger file location
|
|
787
|
+
C) Cancel and add Swagger configuration first
|
|
788
|
+
|
|
789
|
+
Choice: _
|
|
790
|
+
```
|
|
791
|
+
|
|
792
|
+
---
|
|
793
|
+
|
|
794
|
+
## Examples
|
|
795
|
+
|
|
796
|
+
### Example 1: Automatic Release (Recommended)
|
|
797
|
+
|
|
798
|
+
```
|
|
799
|
+
User: /flow-release
|
|
800
|
+
|
|
801
|
+
Agent:
|
|
802
|
+
[Scanning project...]
|
|
803
|
+
✓ Detected Node.js project (package.json)
|
|
804
|
+
✓ Current version: 1.2.3
|
|
805
|
+
✓ Last tag: v1.2.3 (7 commits ago)
|
|
806
|
+
|
|
807
|
+
[Analyzing changes...]
|
|
808
|
+
✓ Found 3 new features
|
|
809
|
+
✓ Found 2 bug fixes
|
|
810
|
+
✓ No breaking changes
|
|
811
|
+
|
|
812
|
+
[Calculating version...]
|
|
813
|
+
✓ Suggested: 1.3.0 (MINOR)
|
|
814
|
+
|
|
815
|
+
[Preview shown...]
|
|
816
|
+
|
|
817
|
+
Continue? (Y/e/d/c): Y
|
|
818
|
+
|
|
819
|
+
[Executing...]
|
|
820
|
+
✓ Updated package.json to 1.3.0
|
|
821
|
+
✓ Updated src/main.ts Swagger version
|
|
822
|
+
✓ Updated CHANGELOG.md
|
|
823
|
+
✓ Committed changes
|
|
824
|
+
✓ Created tag v1.3.0
|
|
825
|
+
✓ Pushed to origin/main
|
|
826
|
+
|
|
827
|
+
✅ Release v1.3.0 completed successfully!
|
|
828
|
+
```
|
|
829
|
+
|
|
830
|
+
### Example 2: Force Patch Release
|
|
831
|
+
|
|
832
|
+
```
|
|
833
|
+
User: /flow-release --patch
|
|
834
|
+
|
|
835
|
+
Agent:
|
|
836
|
+
[Analysis...]
|
|
837
|
+
Current: 1.2.3
|
|
838
|
+
Suggested: 1.3.0 (MINOR - 3 features found)
|
|
839
|
+
Override: 1.2.4 (PATCH - forced)
|
|
840
|
+
|
|
841
|
+
⚠️ Note: Forcing PATCH despite features detected.
|
|
842
|
+
|
|
843
|
+
Continue? (Y/n): Y
|
|
844
|
+
|
|
845
|
+
✅ Release v1.2.4 completed successfully!
|
|
846
|
+
```
|
|
847
|
+
|
|
848
|
+
### Example 3: Manual Version
|
|
849
|
+
|
|
850
|
+
```
|
|
851
|
+
User: /flow-release 2.0.0
|
|
852
|
+
|
|
853
|
+
Agent:
|
|
854
|
+
[Analysis...]
|
|
855
|
+
Current: 1.2.3
|
|
856
|
+
Requested: 2.0.0 (MAJOR)
|
|
857
|
+
|
|
858
|
+
⚠️ MAJOR version bump requires breaking changes.
|
|
859
|
+
|
|
860
|
+
Breaking changes detected: No
|
|
861
|
+
Continue anyway? (y/N): y
|
|
862
|
+
|
|
863
|
+
✅ Release v2.0.0 completed successfully!
|
|
864
|
+
```
|
|
865
|
+
|
|
866
|
+
### Example 4: Dry Run
|
|
867
|
+
|
|
868
|
+
```
|
|
869
|
+
User: /flow-release --dry-run
|
|
870
|
+
|
|
871
|
+
Agent:
|
|
872
|
+
🔍 DRY RUN MODE
|
|
873
|
+
|
|
874
|
+
Current: 1.2.3 → Suggested: 1.3.0
|
|
875
|
+
|
|
876
|
+
[Shows all commands that would run...]
|
|
877
|
+
|
|
878
|
+
Run without --dry-run to execute.
|
|
879
|
+
```
|
|
880
|
+
|
|
881
|
+
---
|
|
882
|
+
|
|
883
|
+
## Version Inference Rules (Summary)
|
|
884
|
+
|
|
885
|
+
| Change Type | SemVer Impact | Triggers |
|
|
886
|
+
| ------------ | ------------- | ------------------------------------------ |
|
|
887
|
+
| **BREAKING** | MAJOR (X.0.0) | API removals, schema changes, auth changes |
|
|
888
|
+
| **FEATURE** | MINOR (X.Y.0) | New endpoints, new entities, new modules |
|
|
889
|
+
| **FIX** | PATCH (X.Y.Z) | Bug fixes, error handling improvements |
|
|
890
|
+
| **CHORE** | PATCH (X.Y.Z) | Refactoring, docs, deps updates, tests |
|
|
891
|
+
|
|
892
|
+
**Priority:** BREAKING > FEATURE > FIX/CHORE
|
|
893
|
+
|
|
894
|
+
---
|
|
895
|
+
|
|
896
|
+
## Swagger/OpenAPI Version Display
|
|
897
|
+
|
|
898
|
+
**After successful release and deployment, Swagger UI will show:**
|
|
899
|
+
|
|
900
|
+
```
|
|
901
|
+
┌─────────────────────────────────────────┐
|
|
902
|
+
│ Your API Name v1.3.0 │
|
|
903
|
+
│ Release Date: 2026-03-09 14:30 UTC │
|
|
904
|
+
│ │
|
|
905
|
+
│ [Explore API endpoints below] │
|
|
906
|
+
└─────────────────────────────────────────┘
|
|
907
|
+
```
|
|
908
|
+
|
|
909
|
+
**Validation commands:**
|
|
910
|
+
|
|
911
|
+
```bash
|
|
912
|
+
# Check Swagger JSON
|
|
913
|
+
curl http://localhost:3000/api-docs | jq '.info.version'
|
|
914
|
+
# Expected: "1.3.0"
|
|
915
|
+
|
|
916
|
+
# Check OpenAPI YAML
|
|
917
|
+
curl http://localhost:3000/api-docs-yaml | grep "version:"
|
|
918
|
+
# Expected: version: 1.3.0
|
|
919
|
+
```
|
|
920
|
+
|
|
921
|
+
---
|
|
922
|
+
|
|
923
|
+
## Best Practices
|
|
924
|
+
|
|
925
|
+
1. **Always run on clean working directory** - commit WIP changes first
|
|
926
|
+
2. **Use `--dry-run` for unfamiliar projects** - verify detection first
|
|
927
|
+
3. **Review change analysis carefully** - ensure correct bump type
|
|
928
|
+
4. **Test Swagger after deployment** - verify version appears correctly
|
|
929
|
+
5. **Keep CHANGELOG updated** - manual edits before release if needed
|
|
930
|
+
6. **Use protected branches** - require reviews before merging to main
|
|
931
|
+
7. **Automate in CI/CD** - integrate with GitHub Actions / GitLab CI
|
|
932
|
+
8. **Tag format consistency** - always use `v` prefix (v1.2.3)
|
|
933
|
+
|
|
934
|
+
---
|
|
935
|
+
|
|
936
|
+
## Notes
|
|
937
|
+
|
|
938
|
+
- **Semantic Versioning:** Strict adherence to [SemVer 2.0.0](https://semver.org/)
|
|
939
|
+
- **Keep a Changelog:** Format follows [keepachangelog.com](https://keepachangelog.com/)
|
|
940
|
+
- **Swagger Update:** CRITICAL for API version visibility
|
|
941
|
+
- **Git Tags:** Annotated tags with release notes
|
|
942
|
+
- **No breaking changes without MAJOR bump** - prevents accidental API breaks
|
|
943
|
+
- **Inference over convention** - works without Conventional Commits
|
|
944
|
+
- **Multi-language support** - Node.js, Java, .NET, Python, Flutter, Rust
|
|
945
|
+
- **Preview before execution** - user always confirms before push
|
|
946
|
+
|
|
947
|
+
---
|
|
948
|
+
|
|
949
|
+
**BEGIN EXECUTION when user runs `/flow-release` command**
|