@logickernel/agileflow 0.4.0 → 0.4.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,26 +1,26 @@
1
- # Getting Started with AgileFlow
1
+ # Getting Started
2
2
 
3
- Welcome to AgileFlow! This guide will help you get up and running with AgileFlow's version-centric CI/CD approach in just a few minutes.
3
+ Get up and running with AgileFlow in minutes. This guide covers local usage and CI/CD integration.
4
4
 
5
5
  ## What You'll Learn
6
6
 
7
- By the end of this guide, you'll have:
8
- - AgileFlow running in your project
9
- - Automatic semantic versioning based on conventional commits
10
- - Understanding of how the version-centric approach works
7
+ - How to preview your next version locally
8
+ - How to set up automatic versioning in CI/CD
9
+ - How conventional commits affect version bumps
11
10
 
12
11
  ## Prerequisites
13
12
 
14
- Before you begin, ensure you have:
15
- - Node.js 14+ installed (for local usage)
13
+ - Node.js 14+ (for local usage)
16
14
  - A Git repository with commit history
17
- - Basic understanding of Git and conventional commits
15
+ - Basic understanding of conventional commits
16
+
17
+ ---
18
18
 
19
19
  ## Quick Start
20
20
 
21
- ### Local Usage
21
+ ### 1. Preview Your Next Version
22
22
 
23
- Run AgileFlow directly with npx to see your current and next version:
23
+ Run AgileFlow in any Git repository:
24
24
 
25
25
  ```bash
26
26
  npx @logickernel/agileflow
@@ -30,7 +30,6 @@ Example output:
30
30
  ```
31
31
  Current version: v1.2.3
32
32
  Next version: v1.2.4
33
- Commits since current version: 3
34
33
 
35
34
  Changelog:
36
35
  ### fix
@@ -41,153 +40,199 @@ Changelog:
41
40
  - update README with usage examples
42
41
  ```
43
42
 
44
- ### Quiet Mode
43
+ ### 2. Get Just the Version
45
44
 
46
- Use `--quiet` to only output the next version (useful for scripts):
45
+ Use `--quiet` to output only the version (useful for scripts):
47
46
 
48
47
  ```bash
49
48
  VERSION=$(npx @logickernel/agileflow --quiet)
50
- echo "Next version will be: $VERSION"
49
+ echo "Next version: $VERSION"
51
50
  ```
52
51
 
52
+ ---
53
+
53
54
  ## CI/CD Integration
54
55
 
55
- ### GitLab CI
56
+ AgileFlow uses a **decoupled architecture**:
56
57
 
57
- 1. **Configure the AGILEFLOW_TOKEN**
58
-
59
- Go to **Settings > CI/CD > Variables** and add:
60
-
61
- | Variable | Value | Protect | Mask |
62
- |----------|-------|---------|------|
63
- | `AGILEFLOW_TOKEN` | Your GitLab API token | Yes | Yes |
64
-
65
- Create the token at **Settings > Access Tokens** with:
66
- - **Name**: AgileFlow Bot
67
- - **Role**: Maintainer
68
- - **Scopes**: api
69
-
70
- 2. **Add AgileFlow to your pipeline**
71
-
72
- ```yaml
73
- stages:
74
- - version
75
- - build
76
-
77
- agileflow:
78
- stage: version
79
- image: node:20-alpine
80
- script:
81
- - npx @logickernel/agileflow gitlab
82
- only:
83
- - main
84
-
85
- build:
86
- stage: build
87
- script:
88
- - echo "Building..."
89
- needs:
90
- - agileflow
91
- ```
58
+ 1. **AgileFlow creates a version tag** (on merge to main)
59
+ 2. **Your pipelines trigger on the tag** (build, deploy, etc.)
60
+
61
+ ```
62
+ Merge to main ──▶ AgileFlow ──▶ Tag v1.2.3 ──▶ Your build/deploy
63
+ ```
92
64
 
93
65
  ### GitHub Actions
94
66
 
95
- 1. **Configure the AGILEFLOW_TOKEN**
96
-
97
- Go to **Settings > Secrets and variables > Actions** and add a secret:
98
- - **Name**: `AGILEFLOW_TOKEN`
99
- - **Value**: A Personal Access Token with `contents: write` permission
100
-
101
- 2. **Add AgileFlow to your workflow**
102
-
103
- ```yaml
104
- name: Release
105
- on:
106
- push:
107
- branches: [main]
108
-
109
- jobs:
110
- version:
111
- runs-on: ubuntu-latest
112
- steps:
113
- - uses: actions/checkout@v4
114
- with:
115
- fetch-depth: 0 # Required for version history
116
-
117
- - uses: actions/setup-node@v4
118
- with:
119
- node-version: '20'
120
-
121
- - name: Create version tag
122
- env:
123
- AGILEFLOW_TOKEN: ${{ secrets.AGILEFLOW_TOKEN }}
124
- run: npx @logickernel/agileflow github
125
- ```
67
+ **Step 1**: Add a secret `AGILEFLOW_TOKEN` with a Personal Access Token (`contents: write` permission).
68
+
69
+ **Step 2**: Create `.github/workflows/version.yml`:
70
+
71
+ ```yaml
72
+ name: Version
73
+ on:
74
+ push:
75
+ branches: [main]
76
+
77
+ jobs:
78
+ version:
79
+ runs-on: ubuntu-latest
80
+ steps:
81
+ - uses: actions/checkout@v4
82
+ with:
83
+ fetch-depth: 0
84
+
85
+ - uses: actions/setup-node@v4
86
+ with:
87
+ node-version: '20'
88
+
89
+ - name: Create version tag
90
+ env:
91
+ AGILEFLOW_TOKEN: ${{ secrets.AGILEFLOW_TOKEN }}
92
+ run: npx @logickernel/agileflow github
93
+ ```
94
+
95
+ **Step 3**: Create `.github/workflows/release.yml` for builds:
96
+
97
+ ```yaml
98
+ name: Release
99
+ on:
100
+ push:
101
+ tags:
102
+ - 'v*'
103
+
104
+ jobs:
105
+ build:
106
+ runs-on: ubuntu-latest
107
+ steps:
108
+ - uses: actions/checkout@v4
109
+ - run: |
110
+ VERSION=${GITHUB_REF#refs/tags/}
111
+ echo "Building $VERSION"
112
+ docker build -t myapp:$VERSION .
113
+ ```
114
+
115
+ ### GitLab CI
116
+
117
+ **Step 1**: Add a CI/CD variable `AGILEFLOW_TOKEN` with a Project Access Token (`api` scope, `Maintainer` role).
118
+
119
+ **Step 2**: Update `.gitlab-ci.yml`:
120
+
121
+ ```yaml
122
+ # Runs on merge to main - creates the tag
123
+ agileflow:
124
+ stage: version
125
+ image: node:20-alpine
126
+ script:
127
+ - npx @logickernel/agileflow gitlab
128
+ rules:
129
+ - if: '$CI_COMMIT_BRANCH == "main"'
130
+
131
+ # Runs on tag creation - builds the release
132
+ build:
133
+ stage: build
134
+ script:
135
+ - echo "Building $CI_COMMIT_TAG"
136
+ - docker build -t myapp:$CI_COMMIT_TAG .
137
+ rules:
138
+ - if: '$CI_COMMIT_TAG =~ /^v/'
139
+ ```
126
140
 
127
141
  ### Native Git Push
128
142
 
129
- If you prefer using native git commands (requires git credentials):
143
+ For other platforms:
130
144
 
131
145
  ```bash
132
146
  npx @logickernel/agileflow push
133
147
  ```
134
148
 
135
- This creates an annotated tag and pushes it to the origin remote.
149
+ This creates an annotated tag and pushes it. Configure your CI to trigger on tags.
136
150
 
137
- ## How AgileFlow Works
151
+ ---
138
152
 
139
- ### Version Calculation
140
- - Analyzes commit messages since the last version tag
141
- - Uses conventional commits to determine version bump type
142
- - Generates semantic versions automatically (v1.0.0, v1.0.1, etc.)
153
+ ## How Version Bumps Work
143
154
 
144
- ### Version Bump Rules
155
+ AgileFlow analyzes commit messages to determine the bump:
145
156
 
146
157
  | Commit Type | Example | Version Bump |
147
158
  |-------------|---------|--------------|
148
- | Breaking change | `feat!: redesign API` | Major (1.0.0 → 2.0.0) |
149
- | Feature | `feat: add login` | Minor (1.0.0 → 1.1.0) |
150
- | Fix | `fix: resolve crash` | Patch (1.0.0 → 1.0.1) |
151
- | Performance | `perf: optimize query` | Patch |
152
- | Refactor | `refactor: simplify logic` | Patch |
159
+ | Breaking change | `feat!: redesign API` | **Major** (1.0.0 → 2.0.0) |
160
+ | Feature | `feat: add login` | **Minor** (1.0.0 → 1.1.0) |
161
+ | Fix | `fix: resolve crash` | **Patch** (1.0.0 → 1.0.1) |
162
+ | Performance | `perf: optimize query` | **Patch** |
153
163
  | Docs only | `docs: update README` | No bump |
154
- | Chore | `chore: update deps` | No bump |
164
+
165
+ ### Pre-1.0.0 Behavior
166
+
167
+ During initial development (0.x.x):
168
+ - Features and fixes → **patch** bump
169
+ - Breaking changes → **minor** bump
155
170
 
156
171
  ### No Bump Needed
157
172
 
158
- If all commits since the last version are docs/chore/style types, AgileFlow will report "no bump needed" and skip tag creation in push commands.
173
+ If all commits are docs/chore/style types, AgileFlow skips tag creation.
174
+
175
+ ---
176
+
177
+ ## Your First Release
178
+
179
+ ### Starting Fresh
180
+
181
+ No version tags? AgileFlow starts from v0.0.0:
182
+
183
+ ```bash
184
+ git commit -m "feat: initial project setup"
185
+ # → Creates v0.0.1
186
+ ```
187
+
188
+ ### Creating v1.0.0
189
+
190
+ Version 1.0.0 is your first stable release. Create it manually when ready:
191
+
192
+ ```bash
193
+ git tag -a v1.0.0 -m "First stable release"
194
+ git push origin v1.0.0
195
+ ```
196
+
197
+ After v1.0.0, AgileFlow continues with standard semantic versioning.
198
+
199
+ ---
159
200
 
160
201
  ## Common Questions
161
202
 
162
- ### Q: How does AgileFlow determine the next version?
163
- A: AgileFlow analyzes your commit messages using conventional commits. Features bump the minor version, fixes bump the patch version, and breaking changes bump the major version.
203
+ **How does the decoupled approach work?**
164
204
 
165
- ### Q: What if there's no version tag yet?
166
- A: AgileFlow starts from v0.0.0 and calculates the first version based on your commits.
205
+ AgileFlow only creates version tags. Your build/deploy pipelines are separate workflows that trigger on tag creation. This keeps versioning independent from your build process.
167
206
 
168
- ### Q: Can I use this locally before pushing?
169
- A: Yes! Run `npx @logickernel/agileflow` to preview the next version without creating any tags.
207
+ **What if no version bump is needed?**
170
208
 
171
- ### Q: What happens if no version bump is needed?
172
- A: The push commands (`push`, `gitlab`, `github`) will skip tag creation and exit successfully.
209
+ AgileFlow skips tag creation. No tag means no build/deploy triggered.
173
210
 
174
- ## Troubleshooting
211
+ **Can I preview without creating tags?**
175
212
 
176
- ### "Not a git repository" Error
177
- - Ensure you're running AgileFlow from within a git repository
178
- - Check that the `.git` directory exists
213
+ Yes! Running `npx @logickernel/agileflow` without a command shows the next version without creating anything.
214
+
215
+ ---
216
+
217
+ ## Troubleshooting
179
218
 
180
219
  ### "AGILEFLOW_TOKEN not set" Error
181
- - Ensure the environment variable is configured in your CI/CD settings
182
- - Verify the token has the required permissions
220
+ - Verify the environment variable is configured
221
+ - Check token permissions (GitHub: `contents: write`, GitLab: `api` scope)
222
+
223
+ ### Tag Created but Build Didn't Run
224
+ - Ensure your release workflow triggers on `tags: ['v*']`
225
+ - Check the tag pattern in your CI configuration
183
226
 
184
227
  ### No Version Bump Detected
185
- - Ensure you're using conventional commit format
186
- - Check that there are commits since the last version tag
187
- - Verify commits include bump-triggering types (feat, fix, perf, etc.)
228
+ - Use conventional commit format (`type: description`)
229
+ - Include bump-triggering types: `feat`, `fix`, `perf`, etc.
230
+
231
+ ---
188
232
 
189
233
  ## Next Steps
190
234
 
191
- - Read the [CLI Reference](./cli-reference.md) for all available commands
192
- - Learn about [Conventional Commits](./conventional-commits.md)
193
- - Explore [Version-Centric CI/CD](./version-centric-cicd.md) methodology
235
+ - [CLI Reference](./cli-reference.md) All commands and options
236
+ - [Installation Guide](./installation.md) — Detailed setup
237
+ - [Conventional Commits](./conventional-commits.md) — Commit format
238
+ - [Version-Centric CI/CD](./version-centric-cicd.md) — The methodology