@sppg2001/atomize 0.0.1 → 1.0.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.
package/.env.example CHANGED
@@ -1,3 +1,3 @@
1
- AZURE_DEVOPS_ORG_URL=https://dev.azure.com/your-org
2
- AZURE_DEVOPS_PROJECT=YourProject
3
- AZURE_DEVOPS_PAT=your-personal-access-token
1
+ AZURE_DEVOPS_ORG_URL=https://dev.azure.com/your-org
2
+ AZURE_DEVOPS_PROJECT=YourProject
3
+ AZURE_DEVOPS_PAT=your-personal-access-token
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Simao-Pereira-Gomes
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Simao-Pereira-Gomes
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,17 +1,504 @@
1
- # Atomize
2
- Atomic task generation for agile teams
3
-
4
- ## Getting Started
5
- To install dependencies:
6
-
7
- ```bash
8
- bun install
9
- ```
10
-
11
- To run:
12
-
13
- ```bash
14
- bun run index.ts
15
- ```
16
-
17
- This project was created using `bun init` in bun v1.3.4. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime.
1
+ # Atomize
2
+
3
+ [![CI](https://github.com/Simao-Pereira-Gomes/atomize/actions/workflows/ci.yml/badge.svg)](https://github.com/Simao-Pereira-Gomes/atomize/actions/workflows/ci.yml)
4
+ [![Code Quality](https://github.com/Simao-Pereira-Gomes/atomize/actions/workflows/code-quality.yml/badge.svg)](https://github.com/Simao-Pereira-Gomes/atomize/actions/workflows/code-quality.yml)
5
+ [![NPM Version](https://img.shields.io/npm/v/@sppg2001/atomize)](https://www.npmjs.com/package/@sppg2001/atomize)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+ [![Node Version](https://img.shields.io/node/v/@sppg2001/atomize)](https://nodejs.org)
8
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.9-blue.svg)](https://www.typescriptlang.org/)
9
+
10
+
11
+ **Break down stories, build up velocity.**
12
+
13
+ Atomize is a CLI tool that automatically generates granular tasks from user stories using YAML templates. Streamline your agile workflow with AI-powered task breakdowns, preset templates, and smart estimation distribution.
14
+
15
+ ---
16
+
17
+ ## Features
18
+
19
+ - **🤖 AI-Powered Generation** - Create templates using Google Gemini or local Ollama (completely free)
20
+ - **📋 Preset Templates** - Start with battle-tested templates for common workflows
21
+ - **🧠 Story Learning** - Generate templates by analyzing your existing work items
22
+ - **🎯 Smart Estimation** - Automatically distribute story points across tasks
23
+ - **🔗 Azure DevOps Integration** - Native support with more platforms coming soon
24
+ - **⚡ Zero Config** - Works out of the box with sensible defaults
25
+ - **🎨 Interactive Wizards** - User-friendly prompts guide you through everything
26
+ - **✅ Built-in Validation** - Catch template errors before they cause problems
27
+
28
+ ---
29
+
30
+ ## 📦 Installation
31
+
32
+ ### Global Installation (Recommended)
33
+
34
+ ```bash
35
+ npm install -g @sppg2001/atomize
36
+ ```
37
+
38
+ ### Using npx (No Installation)
39
+
40
+ ```bash
41
+ npx @sppg2001/atomize --help
42
+ ```
43
+
44
+ ### Local Development
45
+
46
+ ```bash
47
+ git clone https://github.com/Simao-Pereira-Gomes/atomize.git
48
+ cd atomize
49
+ bun install
50
+ bun run dev
51
+ ```
52
+
53
+ ---
54
+
55
+ ## 🎯 Quick Start
56
+
57
+ ### 1. Generate Tasks from a Template
58
+
59
+ ```bash
60
+ # Use a preset template
61
+ atomize generate templates/backend-api.yaml
62
+
63
+ # Interactive mode
64
+ atomize generate
65
+ ```
66
+
67
+ ### 2. Create Your First Template
68
+
69
+ ```bash
70
+ # AI-powered creation (free!)
71
+ atomize template create --ai "Backend API with authentication"
72
+
73
+ # From a preset
74
+ atomize template create --preset backend-api
75
+
76
+ # Learn from an existing story
77
+ atomize template create --from-story STORY-123
78
+
79
+ # Step-by-step wizard
80
+ atomize template create --scratch
81
+ ```
82
+
83
+ ### 3. Validate a Template
84
+
85
+ ```bash
86
+ atomize validate templates/my-template.yaml
87
+ ```
88
+
89
+ ---
90
+
91
+ ## 📖 Usage Guide
92
+
93
+ ### Generate Command
94
+
95
+ The `generate` command creates tasks in your work item management system based on a template.
96
+
97
+ ```bash
98
+ # Basic usage
99
+ atomize generate templates/backend-api.yaml
100
+
101
+ # With options
102
+ atomize generate templates/backend-api.yaml \
103
+ --platform azure-devops \
104
+ --execute \
105
+ --verbose
106
+
107
+ # Dry run (preview only)
108
+ atomize generate templates/backend-api.yaml --dry-run
109
+ ```
110
+
111
+ **Options:**
112
+ - `--platform <type>` - Platform to use (azure-devops, mock)
113
+ - `--execute` - Actually create tasks (default is dry-run)
114
+ - `--dry-run` - Preview without creating tasks
115
+ - `--continue-on-error` - Keep processing if errors occur
116
+ - `--verbose` - Show detailed output
117
+
118
+ **Example Output:**
119
+ ```
120
+ ✓ Loaded template: Backend API Development
121
+ ✓ Found 3 matching user stories
122
+ ✓ Generated 18 tasks (6 per story)
123
+ ✓ Created 18 tasks in Azure DevOps
124
+
125
+ Summary:
126
+ Stories processed: 3
127
+ Tasks created: 18
128
+ Execution time: 2.3s
129
+ ```
130
+
131
+ ### Template Commands
132
+
133
+ #### Create a Template
134
+
135
+ ```bash
136
+ # AI-powered (best for quick starts)
137
+ atomize template create --ai "Create template for React component development"
138
+
139
+ # From preset (fastest)
140
+ atomize template create --preset frontend-feature
141
+
142
+ # Learn from story (best for matching your workflow)
143
+ atomize template create --from-story STORY-456 --platform azure-devops
144
+
145
+ # Interactive wizard (most control)
146
+ atomize template create --scratch
147
+ ```
148
+
149
+ #### List Available Presets
150
+
151
+ ```bash
152
+ atomize template list
153
+ ```
154
+
155
+ **Available Presets:**
156
+ - `backend-api` - Backend API with database integration
157
+ - `frontend-feature` - React/Vue UI component development
158
+ - `bug-fix` - Bug investigation and resolution workflow
159
+ - `fullstack` - Complete full-stack feature
160
+
161
+ #### Validate a Template
162
+
163
+ ```bash
164
+ atomize validate templates/my-template.yaml
165
+
166
+ # With detailed output
167
+ atomize validate templates/my-template.yaml --verbose
168
+ ```
169
+
170
+ ---
171
+
172
+ ## 🏗️ Template Structure
173
+
174
+ Templates are YAML files that define how to break down user stories into tasks.
175
+
176
+ ### Basic Template
177
+
178
+ ```yaml
179
+ version: "1.0"
180
+ name: "Backend API Development"
181
+ description: "Standard backend API workflow"
182
+
183
+ # Which stories to process
184
+ filter:
185
+ workItemTypes: ["User Story"]
186
+ states: ["New", "Active"]
187
+ tags:
188
+ include: ["backend", "api"]
189
+ excludeIfHasTasks: true
190
+
191
+ # Task breakdown
192
+ tasks:
193
+ - title: "Design API Endpoints: ${story.title}"
194
+ description: "Design REST API endpoints and schemas"
195
+ estimationPercent: 15
196
+ activity: "Design"
197
+ tags: ["design", "api"]
198
+
199
+ - title: "Implement Core Logic: ${story.title}"
200
+ description: "Implement business logic and validation"
201
+ estimationPercent: 40
202
+ activity: "Development"
203
+ tags: ["implementation"]
204
+
205
+ - title: "Write Tests"
206
+ description: "Unit and integration tests"
207
+ estimationPercent: 30
208
+ activity: "Testing"
209
+ tags: ["testing"]
210
+
211
+ - title: "Code Review & Documentation"
212
+ description: "Review and document the implementation"
213
+ estimationPercent: 15
214
+ activity: "Documentation"
215
+ tags: ["review", "docs"]
216
+
217
+ # Estimation settings
218
+ estimation:
219
+ rounding: "nearest"
220
+ minimumTaskPoints: 0.5
221
+
222
+ # Validation rules
223
+ validation:
224
+ totalEstimationMustBe: 100
225
+ minTasks: 3
226
+ maxTasks: 10
227
+ ```
228
+
229
+ ### Template Features
230
+
231
+ #### Variable Interpolation
232
+ Use story data in task titles and descriptions:
233
+ - `${story.title}` - Story title
234
+ - `${story.id}` - Story ID
235
+ - `${story.description}` - Story description
236
+
237
+ #### Task Assignment
238
+ ```yaml
239
+ assignTo: "@ParentAssignee" # Inherit from story
240
+ assignTo: "@Me" # Current user
241
+ assignTo: "user@email.com" # Specific user
242
+ ```
243
+
244
+ #### Conditional Tasks
245
+ ```yaml
246
+ - title: "Security Review"
247
+ estimationPercent: 10
248
+ condition: '${story.tags} CONTAINS "security"'
249
+ ```
250
+
251
+ #### Task Dependencies
252
+ ```yaml
253
+ tasks:
254
+ - id: "design"
255
+ title: "Design Phase"
256
+ estimationPercent: 20
257
+
258
+ - id: "implement"
259
+ title: "Implementation"
260
+ estimationPercent: 60
261
+ dependsOn: ["design"] # Must complete design first
262
+ ```
263
+
264
+ ---
265
+
266
+ ## 🤖 AI-Powered Template Creation
267
+
268
+ Atomize supports two free AI providers for template generation:
269
+
270
+ ### Google Gemini (Cloud - Recommended)
271
+
272
+ 1. Get a free API key: https://makersuite.google.com/app/apikey
273
+ 2. Set environment variable:
274
+ ```bash
275
+ export GOOGLE_AI_API_KEY="your-key-here"
276
+ ```
277
+ 3. Create templates:
278
+ ```bash
279
+ atomize template create --ai "Backend API with OAuth authentication"
280
+ ```
281
+
282
+ ### Ollama (Local - Complete Privacy)
283
+
284
+ 1. Install Ollama: https://ollama.ai
285
+ 2. Download a model:
286
+ ```bash
287
+ ollama pull llama3.2
288
+ ```
289
+ 3. Start the service:
290
+ ```bash
291
+ ollama serve
292
+ ```
293
+ 4. Create templates:
294
+ ```bash
295
+ atomize template create --ai-provider ollama --ai "Mobile-first React component"
296
+ ```
297
+
298
+ ### AI Tips
299
+
300
+ - Be specific: "Backend API with JWT auth, rate limiting, and PostgreSQL"
301
+ - Mention your tech stack: "React component with TypeScript and Tailwind CSS"
302
+ - Specify testing requirements: "Include unit tests and E2E tests"
303
+ - Refine iteratively: Use the refine option to adjust the generated template
304
+
305
+ ---
306
+
307
+ ## 🔗 Platform Setup
308
+
309
+ ### Azure DevOps
310
+
311
+ 1. **Get a Personal Access Token (PAT)**
312
+ - Go to: `https://dev.azure.com/[your-org]/_usersSettings/tokens`
313
+ - Create token with `Work Items (Read, Write)` scope
314
+
315
+ 2. **Configure Environment Variables**
316
+ ```bash
317
+ export AZURE_DEVOPS_ORG_URL="https://dev.azure.com/your-org"
318
+ export AZURE_DEVOPS_PROJECT="YourProject"
319
+ export AZURE_DEVOPS_PAT="your-personal-access-token"
320
+ ```
321
+
322
+ 3. **Or Use Interactive Setup**
323
+ ```bash
324
+ atomize generate templates/backend-api.yaml
325
+ # CLI will prompt for configuration
326
+ ```
327
+
328
+ ### Mock Platform (Testing)
329
+
330
+ ```bash
331
+ atomize generate templates/backend-api.yaml --platform mock
332
+ ```
333
+
334
+ ---
335
+
336
+ ## Real-World Examples
337
+
338
+ ### Example 1: Backend API Feature
339
+
340
+ **Story:** "As a user, I want to reset my password via email"
341
+
342
+ **Generated Tasks:**
343
+ 1. Design password reset flow and email templates (1.5 pts)
344
+ 2. Implement password reset endpoint (3.5 pts)
345
+ 3. Create email service integration (1.5 pts)
346
+ 4. Write unit and integration tests (2 pts)
347
+ 5. Add API documentation (0.5 pts)
348
+ 6. Security review and rate limiting (1 pt)
349
+
350
+ **Total:** 10 story points perfectly distributed
351
+
352
+ ## 🛠️ Advanced Usage
353
+
354
+ ### Custom Filters
355
+
356
+ Filter stories with precise criteria:
357
+
358
+ ```yaml
359
+ filter:
360
+ workItemTypes: ["User Story", "Bug"]
361
+ states: ["New", "Approved"]
362
+ tags:
363
+ include: ["backend"]
364
+ exclude: ["deprecated"]
365
+ areaPaths: ["MyProject\\Backend\\API"]
366
+ iterations: ["Sprint 23", "Sprint 24"]
367
+ assignedTo: ["john@company.com", "jane@company.com"]
368
+ priority:
369
+ min: 1
370
+ max: 2
371
+ excludeIfHasTasks: true
372
+ ```
373
+
374
+ ### Estimation Strategies
375
+
376
+ ```yaml
377
+ estimation:
378
+ strategy: "percentage" # Distribute story points by percentage
379
+ rounding: "nearest" # nearest, up, down, none
380
+ minimumTaskPoints: 0.5 # Minimum points per task
381
+ ```
382
+
383
+ ### Learning from Existing Stories
384
+
385
+ ```bash
386
+ # Analyze a story and create a template
387
+ atomize template create --from-story STORY-123
388
+
389
+ # With percentage normalization
390
+ atomize template create --from-story STORY-123 --normalize
391
+
392
+ # Keep original percentages
393
+ atomize template create --from-story STORY-123 --no-normalize
394
+ ```
395
+
396
+ ---
397
+
398
+ ## 🧪 Testing
399
+
400
+ ```bash
401
+ # Run all tests
402
+ bun test
403
+
404
+ # Run specific test suite
405
+ bun test tests/unit/atomizer.test.ts
406
+
407
+ # Run with coverage
408
+ bun test --coverage
409
+
410
+ # Watch mode
411
+ bun test --watch
412
+ ```
413
+
414
+ ### Development Setup
415
+
416
+ ```bash
417
+ # Clone the repository
418
+ git clone https://github.com/Simao-Pereira-Gomes/atomize.git
419
+ cd atomize
420
+
421
+ # Install dependencies
422
+ bun install
423
+
424
+ # Run in development mode
425
+ bun run dev
426
+
427
+ # Run tests
428
+ bun test
429
+
430
+ # Build
431
+ bun run build
432
+ ```
433
+
434
+ ---
435
+
436
+ ## 📝 Roadmap
437
+
438
+ ### v0.1.0 - Initial Release ✅
439
+ - [x] Core task generation engine
440
+ - [x] Azure DevOps integration
441
+ - [x] AI-powered template creation
442
+ - [x] Preset templates
443
+ - [x] Story learning
444
+ - [x] Interactive wizards
445
+
446
+ ### v0.2.0 - Enhanced Features
447
+ - [ ] GitHub Issues integration
448
+ - [ ] Jira integration
449
+ - [ ] VS Code extension
450
+
451
+ ### v0.3.0 - Advanced Capabilities
452
+ - [ ] Multi-story batch processing
453
+ - [ ] Custom estimation formulas
454
+ - [ ] Template inheritance
455
+ - [ ] Workflow automation
456
+ - [ ] Analytics dashboard
457
+
458
+ ---
459
+
460
+ ## 🐛 Troubleshooting
461
+
462
+ ### Common Issues
463
+
464
+ **"Not authenticated" error**
465
+ ```bash
466
+ # Make sure environment variables are set
467
+ echo $AZURE_DEVOPS_PAT
468
+
469
+ # Or use interactive mode
470
+ atomize generate --interactive
471
+ ```
472
+
473
+ **"Template validation failed"**
474
+ ```bash
475
+ # Check your template
476
+ atomize validate templates/my-template.yaml --verbose
477
+
478
+ # Common issues:
479
+ # - Total estimation must equal 100%
480
+ # - Task dependencies reference non-existent IDs
481
+ # - Missing required fields
482
+ ```
483
+
484
+ **AI provider not available**
485
+ ```bash
486
+ # For Gemini
487
+ export GOOGLE_AI_API_KEY="your-key"
488
+
489
+ # For Ollama
490
+ ollama serve # Must be running
491
+ ollama pull llama3.2 # Model must be downloaded
492
+ ```
493
+
494
+ ---
495
+
496
+ ## 📄 License
497
+
498
+ MIT License - see [LICENSE](LICENSE) file for details
499
+
500
+ ## 📧 Support
501
+
502
+ - 🐛 [Report a Bug](https://github.com/Simao-Pereira-Gomes/atomize/issues)
503
+ - 💡 [Request a Feature](https://github.com/Simao-Pereira-Gomes/atomize/issues)
504
+ - 💬 [Discussions](https://github.com/Simao-Pereira-Gomes/atomize/discussions)