astragentic 1.0.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.
@@ -0,0 +1,210 @@
1
+ # Change Workflow
2
+
3
+ > New requirement: capture → analyze impact → update docs → regenerate tasks
4
+
5
+ ---
6
+
7
+ ## When to Use
8
+
9
+ - Stakeholder requests new feature or modification
10
+ - Bug requires spec/arch change
11
+ - Technical debt or refactor needed
12
+ - External dependency change affects design
13
+
14
+ ---
15
+
16
+ ## Phases
17
+
18
+ ### Phase 1: Capture
19
+
20
+ **Goal:** Document the change request
21
+
22
+ **Actions:**
23
+ 1. Record change title and description
24
+ 2. Identify change type:
25
+ - Feature (new capability)
26
+ - Enhancement (modify existing)
27
+ - Fix (correct behavior)
28
+ - Refactor (technical improvement)
29
+ 3. Note source (stakeholder, bug report, tech debt)
30
+ 4. Generate CHG ID: `CHG-{YYYY-MM-DD}-{slug}`
31
+
32
+ **Output:** Change record at `05-changes/impact/CHG-{ID}.md`
33
+
34
+ ```markdown
35
+ ---
36
+ id: CHG-2026-01-04-add-refund-flow
37
+ title: Add refund flow
38
+ type: Feature
39
+ status: Open
40
+ domain: order
41
+ impact: Medium
42
+ created: 2026-01-04
43
+ ---
44
+
45
+ # CHG-2026-01-04-add-refund-flow: Add refund flow
46
+
47
+ ## Summary
48
+ Add ability to refund orders within 30 days
49
+
50
+ **Type:** Feature
51
+ **Source:** Stakeholder request
52
+ **Requested:** 2026-01-04
53
+ ```
54
+
55
+ ---
56
+
57
+ ### Phase 2: Impact
58
+
59
+ **Goal:** Analyze what existing docs are affected
60
+
61
+ **Actions:**
62
+ 1. Search `.astraler-docs/` for related content
63
+ 2. Identify affected domains
64
+ 3. For each affected artifact:
65
+ - Spec: Which flows/rules change? (`02-spec/domains/{domain}.md`)
66
+ - Arch: Which components/contracts change? (`03-arch/domains/{domain}.arch.md`)
67
+ - Tasks: Which existing tasks are impacted? (`04-tasks/domains/{domain}.tasks.md`)
68
+ 4. Classify impact level:
69
+ - **Low:** Single domain, no contract changes
70
+ - **Medium:** Single domain, contract changes
71
+ - **High:** Multi-domain or breaking changes
72
+
73
+ **Mermaid Diagram Required:**
74
+ ```mermaid
75
+ flowchart TD
76
+ CHG[CHG-ID] --> S1[Affected Spec]
77
+ CHG --> A1[Affected Arch]
78
+ CHG --> T1[Affected Tasks]
79
+ style CHG fill:#fff3e0
80
+ ```
81
+
82
+ **Output:** Impact analysis in CHG record with visual diagram
83
+
84
+ ```markdown
85
+ ## Impact Analysis
86
+
87
+ **Affected Domains:** order, payment
88
+ **Impact Level:** Medium
89
+
90
+ ### Affected Artifacts
91
+ | File | Section | Change Type |
92
+ |------|---------|-------------|
93
+ | 02-spec/domains/order.md | flows | Add refund flow |
94
+ | 03-arch/domains/order.arch.md | contracts | New endpoint |
95
+ | 03-arch/domains/payment.arch.md | contracts | Refund integration |
96
+
97
+ ### Breaking Changes
98
+ - None (additive only)
99
+
100
+ ### ADR Required?
101
+ - No (no architectural decision needed)
102
+ ```
103
+
104
+ **Human Gate:** Confirm impact assessment before proceeding
105
+
106
+ ---
107
+
108
+ ### Phase 3: Update
109
+
110
+ **Goal:** Modify affected documentation
111
+
112
+ **Actions:**
113
+ 1. For each affected artifact:
114
+ - If `Approved`: Check CHG is recorded, then edit
115
+ - If `Draft`: Edit directly
116
+ 2. Update spec flows/rules as needed
117
+ 3. Update arch contracts/components as needed
118
+ 4. Bump version numbers appropriately:
119
+ - Patch: Clarification only
120
+ - Minor: New flow within scope
121
+ - Major: Contract/boundary change
122
+ 5. Add change reference to doc headers
123
+
124
+ **Output:** Updated documentation with CHG traceability
125
+
126
+ ---
127
+
128
+ ### Phase 4: Replan
129
+
130
+ **Goal:** Regenerate or update tasks
131
+
132
+ **Actions:**
133
+ 1. Identify tasks that are:
134
+ - **New:** Required by the change
135
+ - **Modified:** Scope changed
136
+ - **Obsolete:** No longer needed
137
+ 2. Generate new tasks with proper refs in `04-tasks/domains/{domain}.tasks.md`
138
+ 3. Update existing task descriptions/AC
139
+ 4. Mark obsolete tasks as `CANCELLED`
140
+ 5. Update `04-tasks/milestones.md` if epic-level change
141
+
142
+ **Update Task Diagrams:**
143
+ When tasks change, update the task file diagrams:
144
+ - **`pie` chart:** Update counts for TODO/DOING/DONE/CANCELLED
145
+ - **`flowchart`:** Add new task nodes, update styles for changed status
146
+
147
+ **Output:** Updated task backlog with refreshed diagrams
148
+
149
+ ```markdown
150
+ ## Task Changes
151
+
152
+ ### New Tasks
153
+ - TSK-order-015: Implement refund endpoint
154
+ - TSK-order-016: Add refund validation rules
155
+
156
+ ### Modified Tasks
157
+ - TSK-order-008: Update order status enum (add REFUNDED)
158
+
159
+ ### Obsolete Tasks
160
+ - None
161
+
162
+ ### Suggested Sprint
163
+ - Add to current sprint (3 tasks, ~Medium effort)
164
+ ```
165
+
166
+ ---
167
+
168
+ ## Completion
169
+
170
+ When change is fully processed:
171
+ 1. Run `/astra:verify` to check consistency
172
+ 2. Update `05-changes/changelog.md` with summary
173
+ 3. Mark CHG status as `Applied`
174
+ 4. Present change summary
175
+ 5. Suggest: review updated docs, approve if ready
176
+
177
+ ---
178
+
179
+ ## Quick Reference
180
+
181
+ ```
182
+ /astra:change "Add refund flow"
183
+
184
+
185
+ [1. Capture] ──► Create 05-changes/impact/CHG-*.md
186
+
187
+
188
+ [2. Impact] ──► Analyze affected 02-spec, 03-arch, 04-tasks
189
+
190
+ ◆ Human confirms impact
191
+
192
+
193
+ [3. Update] ──► Modify affected domain files
194
+
195
+
196
+ [4. Replan] ──► Update 04-tasks/domains/*.tasks.md
197
+
198
+
199
+ [Complete] ──► Verify + update changelog
200
+ ```
201
+
202
+ ---
203
+
204
+ ## Rules
205
+
206
+ - Every edit to `Approved` doc must reference CHG
207
+ - Multi-domain changes require explicit human approval
208
+ - Breaking changes require ADR in `03-arch/decisions.md`
209
+ - Version bumps follow semantic rules
210
+ - CHG records stored in `05-changes/impact/`
@@ -0,0 +1,415 @@
1
+ # Greenfield Workflow
2
+
3
+ > Atlas-first: analyze everything → generate complete atlas → auto-expand to full structure
4
+
5
+ ---
6
+
7
+ ## When to Use
8
+
9
+ - New project with no existing code
10
+ - Have stakeholder documents, notes, or requirements
11
+ - Need complete project blueprint before building
12
+
13
+ ---
14
+
15
+ ## Flow Overview
16
+
17
+ ```
18
+ /astra:start
19
+
20
+
21
+ [1. Assess]
22
+
23
+ ├── Detailed ────────────────┐
24
+ │ │
25
+ │ Vague │
26
+ ▼ │
27
+ [2. Discover] │
28
+ │ │
29
+ ◆ Cognitive Sync │
30
+ │ (ALL domains, ALL flows) │
31
+ │ │
32
+ └────────────────────────────┘
33
+
34
+
35
+ [3. Generate Complete Atlas]
36
+
37
+ ◆ Human Approves Atlas
38
+
39
+
40
+ [4. Auto-Expand to Full Structure]
41
+
42
+
43
+ [Ready to Build]
44
+ ```
45
+
46
+ **Key principle:** Analyze everything upfront, generate everything at once. No per-domain iteration.
47
+
48
+ ---
49
+
50
+ ## Phase 1: Assess
51
+
52
+ **Goal:** Evaluate input quality and determine path
53
+
54
+ **Actions:**
55
+ 1. User provides raw materials (docs, specs, notes, diagrams)
56
+ 2. Inventory all provided materials
57
+ 3. Evaluate completeness against criteria
58
+
59
+ **Assessment Criteria:**
60
+
61
+ | Signal | Detailed | Vague |
62
+ |--------|----------|-------|
63
+ | Entities | Tables/fields specified | "We need users" |
64
+ | Screens | Specific pages listed | "A dashboard" |
65
+ | API | Endpoints documented | "REST API" |
66
+ | Tech stack | Already decided | Open question |
67
+ | Business rules | Edge cases covered | Happy path only |
68
+ | Data relationships | FK/references clear | Implied only |
69
+
70
+ **Path Selection:**
71
+ - **3+ Detailed signals** → Skip to Phase 3 (Generate Atlas)
72
+ - **Otherwise** → Phase 2 (Discover)
73
+
74
+ ---
75
+
76
+ ## Phase 2: Discover (If Needed)
77
+
78
+ **Goal:** Build complete understanding of ALL domains through dialogue
79
+
80
+ **Actions:**
81
+ 1. Read provided materials thoroughly
82
+ 2. Identify ALL domains, ALL flows, ALL entities
83
+ 3. Generate targeted questions for gaps
84
+ 4. Iterate Q&A until complete understanding
85
+ 5. Present Cognitive Sync Checkpoint
86
+
87
+ ### Cognitive Sync Checkpoint
88
+
89
+ Validate complete understanding before generation:
90
+
91
+ ```markdown
92
+ ## My Understanding
93
+
94
+ ### What We're Building
95
+ {1-2 sentence summary}
96
+
97
+ ### Tech Stack
98
+ | Layer | Choice | Rationale |
99
+ |-------|--------|-----------|
100
+ | Runtime | {choice} | {why} |
101
+ | Database | {choice} | {why} |
102
+ | Framework | {choice} | {why} |
103
+
104
+ ### All Domains Identified
105
+ | Domain | Purpose | Priority | Key Entities |
106
+ |--------|---------|----------|--------------|
107
+ | {domain} | {purpose} | P0/P1/P2 | {entities} |
108
+ {repeat for ALL domains}
109
+
110
+ ### All Screens Identified
111
+ | Screen | Route | Domain | Auth |
112
+ |--------|-------|--------|------|
113
+ {ALL screens listed}
114
+
115
+ ### All Key Flows
116
+ 1. {flow}: {steps summary}
117
+ {ALL major flows listed}
118
+
119
+ ### All Core Entities
120
+ | Entity | Domain | Key Fields |
121
+ |--------|--------|------------|
122
+ {ALL entities listed}
123
+
124
+ ### What We're NOT Building
125
+ - {anti-goal}: {why excluded}
126
+
127
+ ---
128
+ **Is this complete and correct?**
129
+ [y] Yes, generate Atlas | [n] No, let me clarify | [p] Partially, refine
130
+ ```
131
+
132
+ **Human Gate:** Confirm complete understanding before Atlas generation
133
+
134
+ ---
135
+
136
+ ## Phase 3: Generate Complete Atlas
137
+
138
+ **Goal:** Produce comprehensive project blueprint covering ALL domains
139
+
140
+ **Actions:**
141
+ 1. Create `.astraler-docs/` folder structure
142
+ 2. Generate complete `atlas/` folder
143
+ 3. Generate supporting files
144
+
145
+ ### Atlas Folder Structure
146
+
147
+ ```
148
+ .astraler-docs/
149
+ ├── _index.md
150
+ ├── atlas/
151
+ │ ├── index.md # Vision, tech stack, ALL domains
152
+ │ ├── database.md # Complete schema, ALL entities
153
+ │ ├── screens.md # ALL screens, ALL domains
154
+ │ ├── api.md # ALL endpoints, ALL domains
155
+ │ └── tasks.md # ALL tasks, ALL domains
156
+ ├── context/
157
+ │ ├── constraints.md
158
+ │ ├── assumptions.md
159
+ │ └── glossary.md
160
+ ├── changes/
161
+ │ ├── changelog.md
162
+ │ └── impact/
163
+ └── ai/
164
+ ├── guardrails.md
165
+ └── quality_gates.md
166
+ ```
167
+
168
+ ### Atlas File Specifications
169
+
170
+ #### `atlas/index.md`
171
+ - Project vision and success metrics
172
+ - Complete tech stack table
173
+ - ALL domains with purpose and priority
174
+ - Domain relationship diagram (Mermaid)
175
+ - Project structure (folder tree)
176
+ - External integrations
177
+
178
+ #### `atlas/database.md`
179
+ - Complete ERD (Mermaid) showing ALL entities
180
+ - ALL tables with columns, types, constraints
181
+ - ALL relationships and foreign keys
182
+ - ALL indexes
183
+ - Cross-domain references
184
+ - Migration strategy
185
+
186
+ #### `atlas/screens.md`
187
+ - Navigation map (Mermaid) showing ALL screens
188
+ - ALL screens table (route, domain, auth)
189
+ - Screen details for each (purpose, components, actions, API calls)
190
+
191
+ #### `atlas/api.md`
192
+ - Base URL and authentication
193
+ - ALL endpoints summary table
194
+ - Endpoint details for each (request, response, errors)
195
+ - Webhooks (if applicable)
196
+ - Rate limiting
197
+
198
+ #### `atlas/tasks.md`
199
+ - Milestone overview (Mermaid gantt)
200
+ - Task dependency graph (Mermaid flowchart)
201
+ - ALL tasks with ID, domain, dependencies, acceptance criteria
202
+ - Definition of Done
203
+
204
+ ---
205
+
206
+ ### Human Gate: Atlas Approval
207
+
208
+ After Atlas generation, present for review:
209
+
210
+ ```markdown
211
+ ## Atlas Complete
212
+
213
+ ### Generated Files
214
+ - `atlas/index.md` — {X} domains, tech stack defined
215
+ - `atlas/database.md` — {Y} tables, {Z} relationships
216
+ - `atlas/screens.md` — {W} screens across all domains
217
+ - `atlas/api.md` — {V} endpoints across all domains
218
+ - `atlas/tasks.md` — {U} tasks in {T} phases
219
+
220
+ ### Domains Covered
221
+ | Domain | Entities | Screens | Endpoints | Tasks |
222
+ |--------|----------|---------|-----------|-------|
223
+ | {domain} | {count} | {count} | {count} | {count} |
224
+ {ALL domains listed}
225
+
226
+ ### Ready to Expand
227
+ Upon approval, will auto-generate:
228
+ - 02-spec/core/* (3 files)
229
+ - 02-spec/domains/* ({N} files)
230
+ - 03-arch/* (3 files + {N} domain files)
231
+ - 04-tasks/* (1 file + {N} domain files)
232
+
233
+ ---
234
+ **Approve Atlas?**
235
+ [y] Yes, expand to full structure | [e] Edit specific file | [r] Redo section
236
+ ```
237
+
238
+ ---
239
+
240
+ ## Phase 4: Auto-Expand to Full Structure
241
+
242
+ **Goal:** Automatically generate complete Astraler Docs structure from Atlas
243
+
244
+ **This phase is automatic — no human iteration required.**
245
+
246
+ ### Expansion Mapping
247
+
248
+ | Atlas Source | Generates |
249
+ |--------------|-----------|
250
+ | `atlas/index.md` | `02-spec/core/overview.md` |
251
+ | `atlas/index.md` | `03-arch/overview.md` |
252
+ | `atlas/index.md` (domains) | `02-spec/domains/{domain}.md` (overview section) |
253
+ | `atlas/database.md` | `03-arch/data-schema.md` |
254
+ | `atlas/database.md` (per domain) | `03-arch/domains/{domain}.arch.md` (data models) |
255
+ | `atlas/screens.md` (per domain) | `02-spec/domains/{domain}.md` (screens section) |
256
+ | `atlas/api.md` (cross-domain) | `02-spec/core/flows.md` |
257
+ | `atlas/api.md` (per domain) | `02-spec/domains/{domain}.md` (API section) |
258
+ | `atlas/api.md` (per domain) | `03-arch/domains/{domain}.arch.md` (contracts) |
259
+ | `atlas/tasks.md` (milestones) | `04-tasks/milestones.md` |
260
+ | `atlas/tasks.md` (per domain) | `04-tasks/domains/{domain}.tasks.md` |
261
+
262
+ ### Generated Structure
263
+
264
+ ```
265
+ .astraler-docs/
266
+ ├── _index.md
267
+ ├── atlas/ # SOURCE (human-approved)
268
+ │ ├── index.md
269
+ │ ├── database.md
270
+ │ ├── screens.md
271
+ │ ├── api.md
272
+ │ └── tasks.md
273
+
274
+ ├── 02-spec/ # AUTO-GENERATED from Atlas
275
+ │ ├── _index.md
276
+ │ ├── core/
277
+ │ │ ├── overview.md # ← from atlas/index.md
278
+ │ │ ├── flows.md # ← from atlas/api.md (cross-domain)
279
+ │ │ └── rules.md # ← from atlas/api.md (validation)
280
+ │ └── domains/
281
+ │ ├── auth.md # ← from atlas (auth sections)
282
+ │ ├── catalog.md # ← from atlas (catalog sections)
283
+ │ ├── order.md # ← from atlas (order sections)
284
+ │ └── ... # One per domain
285
+
286
+ ├── 03-arch/ # AUTO-GENERATED from Atlas
287
+ │ ├── _index.md
288
+ │ ├── overview.md # ← from atlas/index.md
289
+ │ ├── data-schema.md # ← from atlas/database.md
290
+ │ ├── standards.md # ← generated (DoD, conventions)
291
+ │ ├── decisions.md # ← generated (ADR template)
292
+ │ └── domains/
293
+ │ ├── auth.arch.md # ← from atlas (auth sections)
294
+ │ ├── catalog.arch.md # ← from atlas (catalog sections)
295
+ │ ├── order.arch.md # ← from atlas (order sections)
296
+ │ └── ... # One per domain
297
+
298
+ ├── 04-tasks/ # AUTO-GENERATED from Atlas
299
+ │ ├── _index.md
300
+ │ ├── milestones.md # ← from atlas/tasks.md
301
+ │ └── domains/
302
+ │ ├── auth.tasks.md # ← from atlas/tasks.md (auth)
303
+ │ ├── catalog.tasks.md # ← from atlas/tasks.md (catalog)
304
+ │ ├── order.tasks.md # ← from atlas/tasks.md (order)
305
+ │ └── ... # One per domain
306
+
307
+ ├── 05-changes/
308
+ │ ├── _index.md
309
+ │ ├── changelog.md
310
+ │ └── impact/
311
+
312
+ ├── context/
313
+ │ ├── constraints.md
314
+ │ ├── assumptions.md
315
+ │ └── glossary.md
316
+
317
+ └── ai/
318
+ ├── guardrails.md
319
+ └── quality_gates.md
320
+ ```
321
+
322
+ ### Expansion Rules
323
+
324
+ 1. **All generated files include proper headers** (status, version, owner)
325
+ 2. **All generated files include required Mermaid diagrams**
326
+ 3. **All generated files are marked `status: Draft`** (human can approve later)
327
+ 4. **Atlas remains the source of truth** — changes flow Atlas → expanded files
328
+ 5. **Cross-references are maintained** between files
329
+
330
+ ### Post-Expansion Summary
331
+
332
+ ```markdown
333
+ ## Expansion Complete
334
+
335
+ ### Files Generated
336
+ | Folder | Files | From Atlas |
337
+ |--------|-------|------------|
338
+ | 02-spec/core/ | 3 | index.md, api.md |
339
+ | 02-spec/domains/ | {N} | All atlas files |
340
+ | 03-arch/ | 4 | index.md, database.md |
341
+ | 03-arch/domains/ | {N} | database.md, api.md |
342
+ | 04-tasks/ | 1 | tasks.md |
343
+ | 04-tasks/domains/ | {N} | tasks.md |
344
+ | **Total** | **{total}** | |
345
+
346
+ ### Ready to Build
347
+ - Start with: `04-tasks/domains/{first-priority-domain}.tasks.md`
348
+ - Reference: `atlas/` for complete picture
349
+ - Changes: Use `/astra:change` to modify approved docs
350
+ ```
351
+
352
+ ---
353
+
354
+ ## Completion
355
+
356
+ After expansion:
357
+ 1. **Atlas** = Source of truth (Approved status)
358
+ 2. **Expanded files** = Detailed views (Draft status, can be approved individually)
359
+ 3. **Implementation** = Start from `04-tasks/`
360
+ 4. **Changes** = Modify Atlas first, re-expand affected sections
361
+
362
+ ---
363
+
364
+ ## Quick Reference
365
+
366
+ ```
367
+ /astra:start
368
+
369
+
370
+ [1. Assess] ─── Detailed? ───┐
371
+ │ │
372
+ │ Vague │
373
+ ▼ │
374
+ [2. Discover] │
375
+ │ │
376
+ ◆ Cognitive Sync │
377
+ │ │
378
+ └─────────────────────┘
379
+
380
+
381
+ [3. Generate Atlas]
382
+
383
+ ◆ Human Approves
384
+
385
+
386
+ [4. Auto-Expand]
387
+
388
+
389
+ [Ready to Build]
390
+ ```
391
+
392
+ ---
393
+
394
+ ## Checklist
395
+
396
+ ### Before Atlas Generation
397
+ - [ ] All domains identified
398
+ - [ ] All key flows understood
399
+ - [ ] All core entities recognized
400
+ - [ ] Tech stack decided
401
+ - [ ] Cognitive Sync confirmed
402
+
403
+ ### Atlas Files Complete
404
+ - [ ] `atlas/index.md` — All domains, tech stack
405
+ - [ ] `atlas/database.md` — All entities, relationships
406
+ - [ ] `atlas/screens.md` — All screens, navigation
407
+ - [ ] `atlas/api.md` — All endpoints, contracts
408
+ - [ ] `atlas/tasks.md` — All tasks, dependencies
409
+
410
+ ### After Expansion
411
+ - [ ] `02-spec/` — Core + all domain specs
412
+ - [ ] `03-arch/` — Overview + all domain arch
413
+ - [ ] `04-tasks/` — Milestones + all domain tasks
414
+ - [ ] All files have proper headers
415
+ - [ ] All files have required diagrams