@sppg2001/atomize 1.0.3 → 1.2.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.
Binary file
@@ -0,0 +1,215 @@
1
+ # Examples
2
+
3
+ Real-world Atomize template examples. Each file is a working template you can validate and run immediately.
4
+
5
+ ## Files
6
+
7
+ | File | What it demonstrates |
8
+ |------|----------------------|
9
+ | [`backend.yaml`](#backendyaml) | Standard backend API workflow with task dependencies |
10
+ | [`frontend.yaml`](#frontendyaml) | React component development workflow |
11
+ | [`fullstack.yaml`](#fullstackyaml) | Combined backend + frontend with a branching task graph |
12
+ | [`conditional-dependencies-template.yaml`](#conditional-dependencies-templateyaml) | Conditional tasks — tasks that only appear when a story meets specific criteria |
13
+ | [`conditional-percentage-template.yaml`](#conditional-percentage-templateyaml) | Conditional estimation — task weights that adapt to story size and tags |
14
+ | [`advanced-filtering.yaml`](#advanced-filteringyaml) | Full filter criteria showcase: state exclusion, historical states, area/iteration hierarchy, date filters, team override |
15
+
16
+ ---
17
+
18
+ ## backend.yaml
19
+
20
+ A production-ready backend API template. Covers the full development cycle from API design through code review, with dependencies enforcing a logical order.
21
+
22
+ **Matches:** User Stories and Product Backlog Items tagged `backend` or `api`, in states `New`, `Approved`, or `Active`, that don't already have tasks.
23
+
24
+ **Tasks (6):**
25
+ 1. Design API Specification — 10%
26
+ 2. Database Schema Changes — 20%
27
+ 3. Implement Business Logic — 35% *(depends on design + schema)*
28
+ 4. Unit & Integration Tests — 20% *(depends on implementation)*
29
+ 5. API Documentation — 5%
30
+ 6. Code Review & Refinement — 10%
31
+
32
+ **Try it:**
33
+ ```bash
34
+ atomize validate examples/backend.yaml
35
+ atomize generate examples/backend.yaml --platform mock --dry-run
36
+ ```
37
+
38
+ ---
39
+
40
+ ## frontend.yaml
41
+
42
+ A React component development template covering the full UI lifecycle including accessibility testing.
43
+
44
+ **Matches:** User Stories tagged `frontend` or `react`, in states `New` or `Approved`, without existing tasks.
45
+
46
+ **Tasks (6):**
47
+ 1. UI/UX Design Review — 10%
48
+ 2. Component Structure & Setup — 15%
49
+ 3. Component Logic Implementation — 30% *(depends on structure)*
50
+ 4. Styling & Responsive Design — 20%
51
+ 5. Accessibility Testing — 10%
52
+ 6. Component Testing — 15% *(depends on logic)*
53
+
54
+ **Try it:**
55
+ ```bash
56
+ atomize validate examples/frontend.yaml
57
+ atomize generate examples/frontend.yaml --platform mock --dry-run
58
+ ```
59
+
60
+ ---
61
+
62
+ ## fullstack.yaml
63
+
64
+ A combined backend + frontend template for end-to-end features. Uses a branching dependency graph where the backend and frontend tracks run in parallel after the design phase, then converge at integration.
65
+
66
+ **Matches:** User Stories tagged `fullstack`, in states `New` or `Active`, without existing tasks.
67
+
68
+ **Tasks (9):**
69
+ 1. Technical Design — 10%
70
+ 2. Backend API Implementation — 20% *(depends on design)*
71
+ 3. Database Implementation — 15% *(conditional: only if story has `database` tag)*
72
+ 4. Backend Tests — 10% *(depends on backend API)*
73
+ 5. Frontend Components — 20% *(depends on design)*
74
+ 6. Styling & Responsive Design — 10%
75
+ 7. Frontend Tests — 8% *(depends on frontend components)*
76
+ 8. Frontend-Backend Integration — 12% *(depends on both tracks)*
77
+ 9. Documentation — 5%
78
+
79
+ **Try it:**
80
+ ```bash
81
+ atomize validate examples/fullstack.yaml
82
+ atomize generate examples/fullstack.yaml --platform mock --dry-run
83
+ ```
84
+
85
+ ---
86
+
87
+ ## conditional-dependencies-template.yaml
88
+
89
+ Demonstrates **conditional tasks** — tasks that are only created when a story meets specific criteria. When a conditional task is skipped, its estimation is redistributed to the remaining tasks.
90
+
91
+ **Matches:** User Stories tagged `development`.
92
+
93
+ **Key features shown:**
94
+ - `condition` field with tag-based rules (`CONTAINS "backend"`, `CONTAINS "frontend"`, `CONTAINS "security"`)
95
+ - `condition` with compound logic (`AND`, `OR`, `NOT CONTAINS`)
96
+ - `condition` based on numeric fields (`${story.estimation} >= 13`)
97
+ - Dependencies that span conditional tasks (e.g., `unit-tests` depends on `backend-api` and `frontend-ui` — whichever were created)
98
+
99
+ **Tasks (9, most conditional):**
100
+
101
+ | Task | Created when |
102
+ |------|-------------|
103
+ | UI/UX Design | Always |
104
+ | Backend API | Story has `backend` tag |
105
+ | Frontend UI | Story has `frontend` tag |
106
+ | Accessibility Testing | Story has `frontend` tag OR doesn't have `legacy` tag |
107
+ | Security Review | Story has `security` tag AND priority ≤ 2 |
108
+ | Unit Tests | Always *(depends on whichever of backend/frontend exist)* |
109
+ | Integration Tests | Always *(depends on unit tests)* |
110
+ | Performance Testing | Story estimation ≥ 13 points |
111
+ | Documentation | Always *(depends on unit tests)* |
112
+ | Deployment | Always *(depends on integration tests + docs)* |
113
+
114
+ **Try it:**
115
+ ```bash
116
+ atomize validate examples/conditional-dependencies-template.yaml
117
+ atomize generate examples/conditional-dependencies-template.yaml --platform mock --dry-run
118
+ ```
119
+
120
+ ---
121
+
122
+ ## conditional-percentage-template.yaml
123
+
124
+ Demonstrates **`estimationPercentCondition`** — each task's percentage of the story adapts based on the story's size and tags. This is useful when the same task represents different amounts of work depending on story complexity.
125
+
126
+ **Matches:** All User Stories without existing tasks.
127
+
128
+ **Key features shown:**
129
+ - `estimationPercentCondition` on multiple tasks
130
+ - First-match-wins rule evaluation order
131
+ - Conditional task combined with conditional estimation (the `frontend-impl` task is both conditional *and* has an adaptive percentage)
132
+ - Normalization using resolved conditional percentages as the baseline (not static fallbacks)
133
+
134
+ **Tasks (5):**
135
+
136
+ | Task | Default % | Conditional rules |
137
+ |------|-----------|-------------------|
138
+ | Technical Design | 10% | ≥ 13 pts → 20%, ≥ 5 pts → 15% |
139
+ | Backend Implementation | 60% | `fullstack` tag → 40%, ≥ 5 pts → 50% |
140
+ | Frontend Implementation | 30% | `complex-ui` tag → 40% — *only created for `fullstack` stories* |
141
+ | Testing & QA | 20% | `critical` + ≥ 8 pts → 30%, `critical` alone → 25% |
142
+ | Code Review | 5% | Always 5% |
143
+
144
+ **Scenarios and their resolved splits (before normalization):**
145
+
146
+ | Scenario | Design | Backend | Frontend | Testing | Review | Total |
147
+ |----------|--------|---------|----------|---------|--------|-------|
148
+ | Small backend (< 5 pts) | 10% | 60% | — | 20% | 5% | 95% |
149
+ | Medium backend (5–12 pts) | 15% | 50% | — | 20% | 5% | 90% |
150
+ | Medium fullstack (5–12 pts) | 15% | 40% | 30% | 20% | 5% | 110% |
151
+ | Large critical fullstack (≥ 13 pts, `critical`) | 20% | 40% | 30% | 30% | 5% | 125% |
152
+
153
+ All totals are normalized to exactly 100% at generation time.
154
+
155
+ **Try it:**
156
+ ```bash
157
+ atomize validate examples/conditional-percentage-template.yaml
158
+ atomize generate examples/conditional-percentage-template.yaml --platform mock --dry-run
159
+ ```
160
+
161
+ ---
162
+
163
+ ## advanced-filtering.yaml
164
+
165
+ A reference template that demonstrates every available filter option. Use it as a starting point when you need precise control over which work items Atomize processes.
166
+
167
+ **Key features shown:**
168
+
169
+ | Filter | What it does |
170
+ |--------|-------------|
171
+ | `team` | Overrides the `AZURE_DEVOPS_TEAM` env var for this template |
172
+ | `statesExclude` | Excludes items in `Done`, `Removed`, or `Won't Fix` |
173
+ | `statesWereEver` | Matches items that passed through `In Review` historically |
174
+ | `areaPathsUnder` | Matches `MyProject\Backend` **and all sub-areas** (hierarchy traversal) |
175
+ | `iterationsUnder` | Matches all sprints under `Release 3` (not just one sprint) |
176
+ | `changedAfter` | Only items touched in the last 14 days (`@Today-14`) |
177
+ | `createdAfter` | Only items created in the last 90 days (`@Today-90`) |
178
+
179
+ **Supported `@Today` macro syntax:**
180
+ - `@Today` — start of today
181
+ - `@Today-N` — N days in the past (e.g. `@Today-7`)
182
+ - `@Today+N` — N days in the future
183
+ - Also: `@StartOfWeek`, `@StartOfMonth`, `@StartOfYear` (with optional offsets)
184
+
185
+ **Try it:**
186
+ ```bash
187
+ atomize validate examples/advanced-filtering.yaml
188
+ atomize generate examples/advanced-filtering.yaml --platform mock --dry-run
189
+ ```
190
+
191
+ ---
192
+
193
+ ## Running All Examples
194
+
195
+ ```bash
196
+ # Validate all examples
197
+ for f in examples/*.yaml; do
198
+ echo "Validating $f..."
199
+ atomize validate "$f"
200
+ done
201
+
202
+ # Test all examples against mock data
203
+ for f in examples/*.yaml; do
204
+ echo "Testing $f..."
205
+ atomize generate "$f" --platform mock --dry-run
206
+ done
207
+ ```
208
+
209
+ ---
210
+
211
+ ## See Also
212
+
213
+ - [Template Reference](../docs/Template-Reference.md) — full template schema
214
+ - [Validation Modes](../docs/Validation-Modes.md) — strict vs lenient validation
215
+ - [CLI Reference](../docs/Cli-Reference.md) — all commands and flags
@@ -0,0 +1,113 @@
1
+ version: "1.0"
2
+ name: "Advanced Filtering Demo"
3
+ description: |
4
+ Demonstrates the full range of filter criteria: state exclusion, historical
5
+ state matching, area/iteration hierarchy traversal, date-based filters, and
6
+ team override.
7
+ author: "Atomize"
8
+ tags: ["demo", "filtering", "advanced"]
9
+
10
+ # Each option below is independent — in a real template you would only use
11
+ # the subset that makes sense for your workflow.
12
+ filter:
13
+ # Override the team configured in AZURE_DEVOPS_TEAM env var
14
+ team: "Backend Team"
15
+
16
+ workItemTypes:
17
+ - "User Story"
18
+
19
+ # Items currently in these states
20
+ states:
21
+ - "Active"
22
+ - "In Progress"
23
+
24
+ # Exclude items in these states (complements `states`)
25
+ statesExclude:
26
+ - "Done"
27
+ - "Removed"
28
+ - "Won't Fix"
29
+
30
+ # Items that passed through code review at some point (historical match)
31
+ statesWereEver:
32
+ - "In Review"
33
+
34
+ tags:
35
+ include:
36
+ - "backend"
37
+ exclude:
38
+ - "deprecated"
39
+ - "on-hold"
40
+
41
+ # Match items under "MyProject\Backend" and ALL its sub-areas
42
+ areaPathsUnder:
43
+ - "MyProject\\Backend"
44
+
45
+ # Match items in the current sprint or any sprint under the current release
46
+ iterations:
47
+ - "@CurrentIteration"
48
+ iterationsUnder:
49
+ - "MyProject\\Release 3"
50
+
51
+ # Only items assigned to the person running the command
52
+ assignedTo:
53
+ - "@Me"
54
+
55
+ # Only items touched in the last 14 days
56
+ changedAfter: "@Today-14"
57
+
58
+ # Only items created in the last 90 days
59
+ createdAfter: "@Today-90"
60
+
61
+ priority:
62
+ min: 1
63
+ max: 2
64
+
65
+ excludeIfHasTasks: true
66
+
67
+ tasks:
68
+ - id: "design"
69
+ title: "Design: ${story.title}"
70
+ description: "Technical design and approach"
71
+ estimationPercent: 15
72
+ activity: "Design"
73
+ assignTo: "@ParentAssignee"
74
+
75
+ - id: "implement"
76
+ title: "Implement: ${story.title}"
77
+ description: "Core implementation"
78
+ estimationPercent: 55
79
+ activity: "Development"
80
+ assignTo: "@ParentAssignee"
81
+ dependsOn:
82
+ - "design"
83
+
84
+ - id: "tests"
85
+ title: "Tests"
86
+ description: "Unit and integration tests"
87
+ estimationPercent: 20
88
+ activity: "Testing"
89
+ dependsOn:
90
+ - "implement"
91
+
92
+ - id: "review"
93
+ title: "Code Review & Documentation"
94
+ estimationPercent: 10
95
+ activity: "Documentation"
96
+ dependsOn:
97
+ - "tests"
98
+
99
+ estimation:
100
+ strategy: "percentage"
101
+ rounding: "nearest"
102
+ minimumTaskPoints: 0.5
103
+
104
+ validation:
105
+ totalEstimationMustBe: 100
106
+ minTasks: 3
107
+
108
+ metadata:
109
+ category: "Demo"
110
+ difficulty: "beginner"
111
+ recommendedFor:
112
+ - "Learning Atomize filter options"
113
+ estimationGuidelines: "Tasks here are illustrative — adjust percentages to fit your team's workflow."
@@ -0,0 +1,139 @@
1
+ version: "1.0"
2
+ name: "Story-Aware Task Allocation"
3
+ description: >
4
+ Demonstrates estimationPercentCondition — each task's weight adapts to
5
+ the story's size and tags. When the conditional frontend-impl task is
6
+ skipped, the remaining tasks carry their already-resolved conditional
7
+ percents into normalization, so the final split is always accurate.
8
+ author: "Atomize"
9
+ tags: ["demo", "conditional-percent", "adaptive"]
10
+
11
+ filter:
12
+ workItemTypes:
13
+ - "User Story"
14
+ excludeIfHasTasks: true
15
+
16
+ estimation:
17
+ strategy: "percentage"
18
+ rounding: "nearest"
19
+ minimumTaskPoints: 0.5
20
+
21
+ tasks:
22
+ # ── Design ────────────────────────────────────────────────────────────────
23
+ # Allocation scales with story size.
24
+ # Small stories (< 5 pts): 10 % — quick design, no surprises expected
25
+ # Medium stories (5–12 pts): 15 % — moderate up-front work
26
+ # Large stories (≥ 13 pts): 20 % — epic-scale requires thorough design
27
+ - id: "design"
28
+ title: "Technical Design & Architecture"
29
+ description: "Define architecture, API contracts, and data models for ${story.title}"
30
+ activity: "Design"
31
+ assignTo: "@ParentAssignee"
32
+ estimationPercent: 10
33
+ estimationPercentCondition:
34
+ - condition: "${story.estimation} >= 13"
35
+ percent: 20
36
+ - condition: "${story.estimation} >= 5"
37
+ percent: 15
38
+ tags: ["design"]
39
+
40
+ # ── Backend implementation ─────────────────────────────────────────────────
41
+ # Rules evaluated in order — first match wins.
42
+ #
43
+ # • fullstack tag present → 40 % (budget shared with the frontend task)
44
+ # • medium/large story → 50 % (more surface area to cover carefully)
45
+ # • fallback → 60 % (small, pure-backend story)
46
+ - id: "backend-impl"
47
+ title: "Backend Implementation"
48
+ description: "Implement API endpoints and business logic for ${story.title}"
49
+ activity: "Development"
50
+ assignTo: "@ParentAssignee"
51
+ dependsOn: ["design"]
52
+ estimationPercent: 60
53
+ estimationPercentCondition:
54
+ - condition: '${story.tags} CONTAINS "fullstack"'
55
+ percent: 40
56
+ - condition: "${story.estimation} >= 5"
57
+ percent: 50
58
+ tags: ["backend"]
59
+
60
+ # ── Frontend implementation (conditional task) ─────────────────────────────
61
+ # Only created when the story is tagged "fullstack".
62
+ # When this task is SKIPPED, the remaining tasks' resolved conditional
63
+ # percents are used as the baseline for normalization — so Design and
64
+ # Backend get accurate relative weights rather than stale static values.
65
+ #
66
+ # complex-ui tag → extra allocation for non-trivial UIs
67
+ - id: "frontend-impl"
68
+ title: "Frontend Implementation"
69
+ description: "Build UI components and integrate with the API for ${story.title}"
70
+ activity: "Development"
71
+ assignTo: "@ParentAssignee"
72
+ dependsOn: ["design"]
73
+ condition: '${story.tags} CONTAINS "fullstack"'
74
+ estimationPercent: 30
75
+ estimationPercentCondition:
76
+ - condition: '${story.tags} CONTAINS "complex-ui"'
77
+ percent: 40
78
+ tags: ["frontend"]
79
+
80
+ # ── Testing & QA ──────────────────────────────────────────────────────────
81
+ # Critical stories need more thorough test coverage.
82
+ # AND-condition is checked first: critical + large ≥ 8 pts → 30 %
83
+ # If only critical (smaller story) → 25 %
84
+ # Otherwise → 20 %
85
+ - id: "testing"
86
+ title: "Testing & QA"
87
+ description: "Write automated tests and perform QA for ${story.title}"
88
+ activity: "Testing"
89
+ assignTo: "@ParentAssignee"
90
+ dependsOn: ["backend-impl"]
91
+ estimationPercent: 20
92
+ estimationPercentCondition:
93
+ - condition: '${story.tags} CONTAINS "critical" AND ${story.estimation} >= 8'
94
+ percent: 30
95
+ - condition: '${story.tags} CONTAINS "critical"'
96
+ percent: 25
97
+ tags: ["testing"]
98
+
99
+ # ── Code review ────────────────────────────────────────────────────────────
100
+ # Always 5 % — lightweight overhead regardless of story size or tags.
101
+ # No estimationPercentCondition needed here.
102
+ - id: "code-review"
103
+ title: "Code Review & Documentation"
104
+ description: "Peer review and document all changes for ${story.title}"
105
+ activity: "Documentation"
106
+ assignTo: "@ParentAssignee"
107
+ dependsOn: ["testing"]
108
+ estimationPercent: 5
109
+ tags: ["review", "documentation"]
110
+
111
+ # ── Metadata ─────────────────────────────────────────────────────────────────
112
+ metadata:
113
+ category: "Demo"
114
+ difficulty: "intermediate"
115
+ recommendedFor:
116
+ - "Demonstrating estimationPercentCondition"
117
+ - "Adaptive task weighting by story size or tags"
118
+ estimationGuidelines: |
119
+ Effective resolved percentages by scenario (before normalization):
120
+
121
+ Scenario A — small backend-only story (< 5 pts, no "fullstack" tag):
122
+ design=10 backend=60 testing=20 review=5 → total=95 → normalised to 100
123
+ Scenario B — medium backend-only story (5–12 pts):
124
+ design=15 backend=50 testing=20 review=5 → total=90 → normalised to 100
125
+ Scenario C — medium fullstack story (5–12 pts, "fullstack" tag):
126
+ design=15 backend=40 frontend=30 testing=20 review=5 → total=110 → normalised
127
+ Scenario D — large critical fullstack story (≥ 13 pts, "critical" + "fullstack" tags):
128
+ design=20 backend=40 frontend=30 testing=30 review=5 → total=125 → normalised
129
+ Scenario E — medium critical backend-only story (5–12 pts, "critical", no "fullstack"):
130
+ design=15 backend=50 testing=25 review=5 → total=95 → normalised to 100
131
+
132
+ Key behaviour: when frontend-impl is skipped (no "fullstack" tag) the
133
+ remaining tasks already hold their *resolved* conditional percents before
134
+ normalization runs, so the final ratio reflects the per-story adjustments
135
+ rather than the static fallback values.
136
+ examples:
137
+ - "Small pure-backend story (2 pts, tags: [backend])"
138
+ - "Medium fullstack story (8 pts, tags: [fullstack])"
139
+ - "Large critical fullstack story (13 pts, tags: [fullstack, critical, complex-ui])"
@@ -15,11 +15,6 @@ filter:
15
15
  - "fullstack"
16
16
  excludeIfHasTasks: true
17
17
 
18
- # Variables for conditionals
19
- variables:
20
- hasDatabase: true
21
- hasAuth: false
22
-
23
18
  tasks:
24
19
  # Design Phase
25
20
  - id: "design-overview"
@@ -59,7 +54,7 @@ tasks:
59
54
  estimationPercent: 15
60
55
  tags: ["database", "backend"]
61
56
  activity: "Development"
62
- condition: "${variables.hasDatabase}"
57
+ condition: '${story.tags} CONTAINS "database"'
63
58
 
64
59
  - id: "backend-tests"
65
60
  title: "Backend Tests"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sppg2001/atomize",
3
- "version": "1.0.3",
3
+ "version": "1.2.0",
4
4
  "description": "Automatically generate tasks from user stories with smart templates",
5
5
  "type": "module",
6
6
  "main": "./dist/cli/index.js",
@@ -21,7 +21,7 @@
21
21
  "examples"
22
22
  ],
23
23
  "scripts": {
24
- "dev": "bun run src/cli/index.ts",
24
+ "dev": "ATOMIZE_DEV=true bun run src/cli/index.ts",
25
25
  "build": "bun run typecheck && bun run build:bun",
26
26
  "postbuild": "node make-executable.js",
27
27
  "build:bun": "bun build ./src/cli/index.ts --outdir ./dist/cli --target node --format esm",
@@ -37,7 +37,8 @@
37
37
  "validate:package": "test -d dist && test -f dist/cli/index.js && test -d templates/presets",
38
38
  "check": "bun typecheck && bun test",
39
39
  "lint": "bunx biome check --max-diagnostics 100",
40
- "lint:fix": "bunx biome check --fix --max-diagnostics 100"
40
+ "lint:fix": "bunx biome check --fix --max-diagnostics 100",
41
+ "benchmark": "bun run benchmarks/index.ts"
41
42
  },
42
43
  "keywords": [
43
44
  "devops",
@@ -63,20 +64,22 @@
63
64
  "devDependencies": {
64
65
  "@biomejs/biome": "2.3.11",
65
66
  "@types/bun": "1.3.5",
66
- "@types/inquirer": "^9.0.9",
67
- "@types/node": "^25.0.3"
67
+ "@types/keytar": "^4.4.2",
68
+ "@types/node": "^25.0.3",
69
+ "@types/update-notifier": "^6.0.8",
70
+ "mitata": "^1.0.34"
68
71
  },
69
72
  "peerDependencies": {
70
73
  "typescript": "^5.9.3"
71
74
  },
72
75
  "dependencies": {
73
- "@google/generative-ai": "^0.24.1",
76
+ "@clack/prompts": "^1.1.0",
74
77
  "azure-devops-node-api": "^15.1.2",
75
78
  "chalk": "^5.6.2",
76
79
  "commander": "^14.0.2",
77
- "dotenv": "^17.2.3",
78
- "inquirer": "^13.1.0",
80
+ "keytar": "^7.9.0",
79
81
  "ts-pattern": "^5.9.0",
82
+ "update-notifier": "^7.3.1",
80
83
  "winston": "^3.19.0",
81
84
  "yaml": "^2.8.2",
82
85
  "zod": "^4.3.5"