@logickernel/agileflow 0.16.1 → 0.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,300 +0,0 @@
1
- # Installation Guide
2
-
3
- AgileFlow requires no installation for local use — just run it with npx. For CI/CD integration, you'll configure a workflow that creates version tags, which then trigger your build and deploy pipelines.
4
-
5
- ## Prerequisites
6
-
7
- - **Node.js 14+** (or a Node.js CI image)
8
- - **Git repository** with commit history
9
- - **Access token** with permission to create tags
10
-
11
- ## Local Usage
12
-
13
- Preview your next version without any setup:
14
-
15
- ```bash
16
- npx @logickernel/agileflow
17
- ```
18
-
19
- Or install globally:
20
-
21
- ```bash
22
- npm install -g @logickernel/agileflow
23
- agileflow
24
- ```
25
-
26
- ---
27
-
28
- ## Architecture Overview
29
-
30
- AgileFlow uses a **decoupled two-step approach**:
31
-
32
- ```
33
- ┌─────────────────┐ ┌─────────────────┐
34
- │ Merge to main │ │ Tag: v1.2.3 │
35
- │ │ ──────▶ │ │
36
- │ (AgileFlow │ │ (Your build/ │
37
- │ creates tag) │ │ deploy runs) │
38
- └─────────────────┘ └─────────────────┘
39
- ```
40
-
41
- 1. **Versioning workflow**: Runs AgileFlow on merge to main → creates version tag
42
- 2. **Release workflow**: Triggered by tag creation → builds and deploys
43
-
44
- This separation keeps versioning independent from your build/deploy process.
45
-
46
- ---
47
-
48
- ## GitHub Actions
49
-
50
- ### Step 1: Create an Access Token
51
-
52
- 1. Go to **Settings → Developer settings → Personal access tokens → Fine-grained tokens**
53
- 2. Click **Generate new token**
54
- 3. Configure:
55
- - **Name**: `AgileFlow`
56
- - **Repository access**: Select your repositories
57
- - **Permissions**: `Contents: Read and write`
58
- 4. Copy the token
59
-
60
- ### Step 2: Add the Token as a Secret
61
-
62
- 1. Go to your repository's **Settings → Secrets and variables → Actions**
63
- 2. Click **New repository secret**
64
- 3. Add:
65
- - **Name**: `AGILEFLOW_TOKEN`
66
- - **Value**: Your token
67
-
68
- ### Step 3: Create the Versioning Workflow
69
-
70
- Create `.github/workflows/version.yml`:
71
-
72
- ```yaml
73
- name: Version
74
- on:
75
- push:
76
- branches: [main]
77
-
78
- jobs:
79
- version:
80
- runs-on: ubuntu-latest
81
- steps:
82
- - uses: actions/checkout@v4
83
- with:
84
- fetch-depth: 0 # Required for commit history
85
-
86
- - uses: actions/setup-node@v4
87
- with:
88
- node-version: '20'
89
-
90
- - name: Create version tag
91
- env:
92
- AGILEFLOW_TOKEN: ${{ secrets.AGILEFLOW_TOKEN }}
93
- run: npx @logickernel/agileflow github
94
- ```
95
-
96
- ### Step 4: Create the Release Workflow
97
-
98
- Create `.github/workflows/release.yml` to handle builds triggered by tags:
99
-
100
- ```yaml
101
- name: Release
102
- on:
103
- push:
104
- tags:
105
- - 'v*'
106
-
107
- jobs:
108
- build:
109
- runs-on: ubuntu-latest
110
- steps:
111
- - uses: actions/checkout@v4
112
-
113
- - name: Get version from tag
114
- run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
115
-
116
- - name: Build
117
- run: |
118
- echo "Building version $VERSION"
119
- docker build -t myapp:$VERSION .
120
- docker push myapp:$VERSION
121
-
122
- deploy-staging:
123
- needs: build
124
- runs-on: ubuntu-latest
125
- environment: staging
126
- steps:
127
- - name: Deploy to staging
128
- run: kubectl set image deployment/myapp myapp=myapp:$VERSION
129
-
130
- deploy-production:
131
- needs: build
132
- runs-on: ubuntu-latest
133
- environment: production
134
- steps:
135
- - name: Deploy to production
136
- run: kubectl set image deployment/myapp myapp=myapp:$VERSION
137
- ```
138
-
139
- ### Step 5: Test the Setup
140
-
141
- 1. Push a commit with conventional format:
142
- ```bash
143
- git commit -m "feat: add new feature"
144
- git push
145
- ```
146
- 2. The version workflow creates a tag (e.g., `v1.2.3`)
147
- 3. The tag triggers the release workflow
148
- 4. Build and deploy jobs run automatically
149
-
150
- ---
151
-
152
- ## GitLab CI
153
-
154
- ### Step 1: Create an Access Token
155
-
156
- **Option A: Project Access Token (Recommended)**
157
- 1. Go to project **Settings → Access tokens**
158
- 2. Create:
159
- - **Name**: `AgileFlow`
160
- - **Role**: `Maintainer`
161
- - **Scopes**: `api`
162
- 3. Copy the token
163
-
164
- **Option B: Personal Access Token**
165
- 1. Go to user **Settings → Access tokens**
166
- 2. Create:
167
- - **Name**: `AgileFlow`
168
- - **Scopes**: `api`
169
- 3. Copy the token
170
-
171
- ### Step 2: Add the Token as a CI/CD Variable
172
-
173
- 1. Go to project **Settings → CI/CD → Variables**
174
- 2. Add:
175
- - **Key**: `AGILEFLOW_TOKEN`
176
- - **Value**: Your token
177
- - **Flags**: Protected, Masked
178
-
179
- ### Step 3: Configure Your Pipeline
180
-
181
- Update `.gitlab-ci.yml`:
182
-
183
- ```yaml
184
- stages:
185
- - version
186
- - build
187
- - deploy
188
-
189
- # Versioning job - runs on merge to main
190
- agileflow:
191
- stage: version
192
- image: node:20
193
- script:
194
- - npm install @logickernel/agileflow
195
- - npx @logickernel/agileflow gitlab
196
- rules:
197
- - if: '$CI_COMMIT_BRANCH == "main"'
198
-
199
- # Build job - runs on tag creation
200
- build:
201
- stage: build
202
- script:
203
- # Script to build your software, usually a docker image that is pulled to a registry
204
- rules:
205
- - if: '$CI_COMMIT_TAG =~ /^v/'
206
-
207
- # Deploy jobs - run on tag creation
208
- deploy-staging:
209
- stage: deploy
210
- script:
211
- # Script to deploy your software in staging
212
- environment:
213
- name: staging
214
- rules:
215
- - if: '$CI_COMMIT_TAG =~ /^v/'
216
-
217
- deploy-production:
218
- stage: deploy
219
- script:
220
- # Script to deploy your software in production
221
- environment:
222
- name: production
223
- rules:
224
- - if: '$CI_COMMIT_TAG =~ /^v/'
225
- when: manual
226
- ```
227
-
228
- ### Step 4: Test the Setup
229
-
230
- 1. Push a commit with conventional format:
231
- ```bash
232
- git commit -m "feat: add new feature"
233
- git push
234
- ```
235
- 2. The `agileflow` job creates a tag
236
- 3. A new pipeline starts for the tag
237
- 4. Build and deploy jobs run
238
-
239
- ---
240
-
241
- ## Other CI/CD Platforms
242
-
243
- For platforms without native API integration, use the `push` command:
244
-
245
- ```yaml
246
- version:
247
- script:
248
- - git config user.name "CI Bot"
249
- - git config user.email "ci@example.com"
250
- - npx @logickernel/agileflow push
251
- ```
252
-
253
- Then configure your platform to trigger pipelines on tag creation.
254
-
255
- ---
256
-
257
- ## How It Works
258
-
259
- AgileFlow uses platform APIs to create version tags:
260
-
261
- 1. **Analyzes commits** since the last version tag
262
- 2. **Calculates version** based on conventional commits
263
- 3. **Creates tag** via API (GitHub/GitLab) or git push
264
- 4. **Tag triggers** your build/deploy workflows
265
-
266
- ### Benefits
267
-
268
- - **No repository write permissions** for CI jobs (uses API tokens)
269
- - **Decoupled architecture** — versioning separate from builds
270
- - **Works with protected branches**
271
- - **Any process can hook into tag creation**
272
-
273
- ---
274
-
275
- ## Troubleshooting
276
-
277
- ### Token Permission Errors
278
-
279
- **GitHub**: Ensure token has `contents: write` permission.
280
-
281
- **GitLab**: Ensure token has `api` scope and `Maintainer` role.
282
-
283
- ### Tag Not Created
284
-
285
- - Check you're pushing to the main branch
286
- - Verify conventional commit format
287
- - Check pipeline logs for errors
288
-
289
- ### Build Not Triggered
290
-
291
- - Ensure release workflow is configured for tag events
292
- - Check tag pattern matches (`v*` for GitHub, `/^v/` for GitLab)
293
-
294
- ---
295
-
296
- ## Next Steps
297
-
298
- - [Getting Started](./getting-started.md) — Quick start guide
299
- - [CLI Reference](./cli-reference.md) — Commands and options
300
- - [Troubleshooting](./troubleshooting.md) — Common issues
@@ -1,303 +0,0 @@
1
- # Migration Guide
2
-
3
- This guide helps you transition to AgileFlow's decoupled, version-centric approach.
4
-
5
- ## What You're Changing
6
-
7
- ### From Traditional Approach
8
-
9
- - Version calculation mixed with build/deploy
10
- - Branch-based deployments
11
- - Manual version management
12
- - Environment-specific branches
13
-
14
- ### To AgileFlow Approach
15
-
16
- - **Decoupled versioning** — AgileFlow only creates tags
17
- - **Tag-triggered pipelines** — Build/deploy on tag events
18
- - **Automatic versions** — Based on conventional commits
19
- - **Single main branch** — All versions from one source
20
-
21
- ---
22
-
23
- ## Architecture Overview
24
-
25
- ```
26
- ┌─────────────────┐ ┌─────────────────┐
27
- │ Merge to main │ │ Tag: v1.2.3 │
28
- │ │ ──────▶ │ │
29
- │ Versioning │ │ Release │
30
- │ workflow │ │ workflow │
31
- └─────────────────┘ └─────────────────┘
32
- │ │
33
- ▼ ▼
34
- AgileFlow Build/Deploy
35
- creates tag your pipelines
36
- ```
37
-
38
- ---
39
-
40
- ## Migration Steps
41
-
42
- ### Phase 1: Preparation
43
-
44
- #### Train Your Team
45
-
46
- - Introduce conventional commits
47
- - Explain the decoupled approach
48
- - Share commit message examples
49
-
50
- #### Create Access Token
51
-
52
- **GitHub:**
53
- 1. Settings → Developer settings → Personal access tokens
54
- 2. Create token with `contents: write`
55
- 3. Add as secret `AGILEFLOW_TOKEN`
56
-
57
- **GitLab:**
58
- 1. Project Settings → Access tokens
59
- 2. Create token with `api` scope, `Maintainer` role
60
- 3. Add as variable `AGILEFLOW_TOKEN`
61
-
62
- ### Phase 2: Add Versioning Workflow
63
-
64
- **GitHub Actions** — Create `.github/workflows/version.yml`:
65
-
66
- ```yaml
67
- name: Version
68
- on:
69
- push:
70
- branches: [main]
71
-
72
- jobs:
73
- version:
74
- runs-on: ubuntu-latest
75
- steps:
76
- - uses: actions/checkout@v4
77
- with:
78
- fetch-depth: 0
79
-
80
- - uses: actions/setup-node@v4
81
- with:
82
- node-version: '20'
83
-
84
- - name: Create version tag
85
- env:
86
- AGILEFLOW_TOKEN: ${{ secrets.AGILEFLOW_TOKEN }}
87
- run: npx @logickernel/agileflow github
88
- ```
89
-
90
- **GitLab CI** — Add to `.gitlab-ci.yml`:
91
-
92
- ```yaml
93
- agileflow:
94
- stage: version
95
- image: node:20-alpine
96
- script:
97
- - npx @logickernel/agileflow gitlab
98
- rules:
99
- - if: '$CI_COMMIT_BRANCH == "main"'
100
- ```
101
-
102
- ### Phase 3: Add Release Workflow
103
-
104
- **GitHub Actions** — Create `.github/workflows/release.yml`:
105
-
106
- ```yaml
107
- name: Release
108
- on:
109
- push:
110
- tags:
111
- - 'v*'
112
-
113
- jobs:
114
- build:
115
- runs-on: ubuntu-latest
116
- steps:
117
- - uses: actions/checkout@v4
118
-
119
- - name: Get version
120
- run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
121
-
122
- - name: Build
123
- run: docker build -t myapp:$VERSION .
124
-
125
- deploy:
126
- needs: build
127
- runs-on: ubuntu-latest
128
- steps:
129
- - name: Deploy
130
- run: kubectl set image deployment/myapp myapp=myapp:$VERSION
131
- ```
132
-
133
- **GitLab CI** — Add to `.gitlab-ci.yml`:
134
-
135
- ```yaml
136
- build:
137
- stage: build
138
- script:
139
- - docker build -t myapp:$CI_COMMIT_TAG .
140
- rules:
141
- - if: '$CI_COMMIT_TAG =~ /^v/'
142
-
143
- deploy:
144
- stage: deploy
145
- script:
146
- - kubectl set image deployment/myapp myapp=myapp:$CI_COMMIT_TAG
147
- rules:
148
- - if: '$CI_COMMIT_TAG =~ /^v/'
149
- ```
150
-
151
- ### Phase 4: Remove Old Logic
152
-
153
- Once the new workflows are working:
154
-
155
- 1. **Remove version calculation** from existing build pipelines
156
- 2. **Remove environment branches** (staging, production)
157
- 3. **Remove branch-based triggers** for deployments
158
-
159
- ---
160
-
161
- ## Common Migration Patterns
162
-
163
- ### Simple Application
164
-
165
- **Before:**
166
- ```yaml
167
- # Single workflow doing everything
168
- on: push to main
169
- → calculate version
170
- → build
171
- → deploy
172
- ```
173
-
174
- **After:**
175
- ```yaml
176
- # Workflow 1: version.yml
177
- on: push to main
178
- → AgileFlow creates tag
179
-
180
- # Workflow 2: release.yml
181
- on: tag v*
182
- → build
183
- → deploy
184
- ```
185
-
186
- ### Microservices
187
-
188
- **After (same version for all services):**
189
- ```yaml
190
- # release.yml
191
- build-backend:
192
- script:
193
- - docker build -t backend:$VERSION ./backend
194
-
195
- build-frontend:
196
- script:
197
- - docker build -t frontend:$VERSION ./frontend
198
-
199
- deploy:
200
- needs: [build-backend, build-frontend]
201
- script:
202
- - kubectl set image deployment/backend backend=backend:$VERSION
203
- - kubectl set image deployment/frontend frontend=frontend:$VERSION
204
- ```
205
-
206
- ---
207
-
208
- ## Migration Challenges
209
-
210
- ### Existing Version Logic
211
-
212
- **Challenge:** Current pipeline calculates versions.
213
-
214
- **Solution:** Keep both temporarily, then remove old logic:
215
- ```yaml
216
- # Phase 1: Add AgileFlow alongside existing logic
217
- # Phase 2: Switch release workflow to use tags
218
- # Phase 3: Remove old version calculation
219
- ```
220
-
221
- ### Team Learning Conventional Commits
222
-
223
- **Challenge:** Team not familiar with format.
224
-
225
- **Solutions:**
226
- - Start with just `feat:` and `fix:`
227
- - Use commit linting
228
- - Provide IDE snippets
229
-
230
- ### Existing Environment Branches
231
-
232
- **Challenge:** Using staging/production branches.
233
-
234
- **Solution:** After migration works, delete them:
235
- ```bash
236
- git branch -d staging
237
- git push origin --delete staging
238
- ```
239
-
240
- ---
241
-
242
- ## Testing Your Migration
243
-
244
- ### Verify Version Creation
245
-
246
- ```bash
247
- # Push a conventional commit
248
- git commit -m "feat: test feature"
249
- git push
250
-
251
- # Check for new tag
252
- git tag --sort=-version:refname | head -1
253
- ```
254
-
255
- ### Verify Release Workflow
256
-
257
- - Confirm tag triggers your release workflow
258
- - Check build uses the tag as version
259
- - Verify deployment works
260
-
261
- ### End-to-End Test
262
-
263
- 1. Push conventional commit to main
264
- 2. AgileFlow creates tag (e.g., v1.2.3)
265
- 3. Release workflow triggers
266
- 4. Build creates artifact tagged v1.2.3
267
- 5. Deployment uses correct version
268
-
269
- ---
270
-
271
- ## Rollback Plan
272
-
273
- If migration fails:
274
-
275
- 1. **Revert workflow changes**
276
- ```bash
277
- git revert <workflow-commit>
278
- ```
279
-
280
- 2. **Keep running old pipeline** until issues resolved
281
-
282
- 3. **Document issues** for next attempt
283
-
284
- ---
285
-
286
- ## Post-Migration Checklist
287
-
288
- - [ ] Versioning workflow creates tags on merge to main
289
- - [ ] Release workflow triggers on tag creation
290
- - [ ] Builds use tag as version
291
- - [ ] Deployments use correct version
292
- - [ ] Team uses conventional commits
293
- - [ ] Old version logic removed
294
- - [ ] Old environment branches deleted
295
-
296
- ---
297
-
298
- ## Related Documentation
299
-
300
- - [Getting Started](./getting-started.md) — Quick start
301
- - [Installation Guide](./installation.md) — Setup
302
- - [Best Practices](./best-practices.md) — Recommendations
303
- - [Troubleshooting](./troubleshooting.md) — Common issues