cadora 0.1.0__py3-none-any.whl

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.
Files changed (52) hide show
  1. cadora/__init__.py +3 -0
  2. cadora/aidlc_rules/LICENSE +17 -0
  3. cadora/aidlc_rules/RULES_VERSION +7 -0
  4. cadora/aidlc_rules/core-workflow.md +539 -0
  5. cadora/aidlc_rules/rule-details/common/ascii-diagram-standards.md +116 -0
  6. cadora/aidlc_rules/rule-details/common/content-validation.md +78 -0
  7. cadora/aidlc_rules/rule-details/common/depth-levels.md +73 -0
  8. cadora/aidlc_rules/rule-details/common/error-handling.md +373 -0
  9. cadora/aidlc_rules/rule-details/common/overconfidence-prevention.md +100 -0
  10. cadora/aidlc_rules/rule-details/common/process-overview.md +141 -0
  11. cadora/aidlc_rules/rule-details/common/question-format-guide.md +369 -0
  12. cadora/aidlc_rules/rule-details/common/session-continuity.md +53 -0
  13. cadora/aidlc_rules/rule-details/common/terminology.md +187 -0
  14. cadora/aidlc_rules/rule-details/common/welcome-message.md +109 -0
  15. cadora/aidlc_rules/rule-details/common/workflow-changes.md +285 -0
  16. cadora/aidlc_rules/rule-details/construction/build-and-test.md +360 -0
  17. cadora/aidlc_rules/rule-details/construction/code-generation.md +217 -0
  18. cadora/aidlc_rules/rule-details/construction/functional-design.md +119 -0
  19. cadora/aidlc_rules/rule-details/construction/infrastructure-design.md +99 -0
  20. cadora/aidlc_rules/rule-details/construction/nfr-design.md +95 -0
  21. cadora/aidlc_rules/rule-details/construction/nfr-requirements.md +99 -0
  22. cadora/aidlc_rules/rule-details/extensions/resiliency/baseline/resiliency-baseline.md +490 -0
  23. cadora/aidlc_rules/rule-details/extensions/resiliency/baseline/resiliency-baseline.opt-in.md +26 -0
  24. cadora/aidlc_rules/rule-details/extensions/security/baseline/security-baseline.md +307 -0
  25. cadora/aidlc_rules/rule-details/extensions/security/baseline/security-baseline.opt-in.md +20 -0
  26. cadora/aidlc_rules/rule-details/extensions/testing/property-based/property-based-testing.md +284 -0
  27. cadora/aidlc_rules/rule-details/extensions/testing/property-based/property-based-testing.opt-in.md +22 -0
  28. cadora/aidlc_rules/rule-details/inception/application-design.md +147 -0
  29. cadora/aidlc_rules/rule-details/inception/requirements-analysis.md +190 -0
  30. cadora/aidlc_rules/rule-details/inception/reverse-engineering.md +311 -0
  31. cadora/aidlc_rules/rule-details/inception/units-generation.md +188 -0
  32. cadora/aidlc_rules/rule-details/inception/user-stories.md +327 -0
  33. cadora/aidlc_rules/rule-details/inception/workflow-planning.md +469 -0
  34. cadora/aidlc_rules/rule-details/inception/workspace-detection.md +97 -0
  35. cadora/aidlc_rules/rule-details/operations/operations.md +19 -0
  36. cadora/archive.py +85 -0
  37. cadora/cli.py +189 -0
  38. cadora/executors/__init__.py +36 -0
  39. cadora/executors/antigravity.py +60 -0
  40. cadora/executors/base.py +47 -0
  41. cadora/executors/claude_code.py +178 -0
  42. cadora/executors/codex.py +89 -0
  43. cadora/executors/kiro.py +44 -0
  44. cadora/gates.py +39 -0
  45. cadora/runner.py +92 -0
  46. cadora/topology.py +78 -0
  47. cadora/workspace.py +82 -0
  48. cadora-0.1.0.dist-info/METADATA +94 -0
  49. cadora-0.1.0.dist-info/RECORD +52 -0
  50. cadora-0.1.0.dist-info/WHEEL +4 -0
  51. cadora-0.1.0.dist-info/entry_points.txt +2 -0
  52. cadora-0.1.0.dist-info/licenses/LICENSE +21 -0
cadora/__init__.py ADDED
@@ -0,0 +1,3 @@
1
+ """Cadora — an AI-DLC workflow conductor for agentic delivery."""
2
+
3
+ __version__ = "0.1.0"
@@ -0,0 +1,17 @@
1
+ MIT No Attribution
2
+
3
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so.
10
+
11
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
13
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
14
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
15
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
16
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17
+
@@ -0,0 +1,7 @@
1
+ ai-dlc-rules: 1.0.0
2
+ source: https://github.com/awslabs/aidlc-workflows
3
+ commit: e273af0a310ef3968d3636acc7e0afec6f7dad22
4
+ ref: main
5
+ retrieved: 2026-06-19T15:29:29Z
6
+ license: MIT-0 (see ./LICENSE)
7
+ note: vendored by scripts/refresh-aidlc-rules.sh — do not edit by hand
@@ -0,0 +1,539 @@
1
+ # PRIORITY: This workflow OVERRIDES all other built-in workflows
2
+ # When user requests software development, ALWAYS follow this workflow FIRST
3
+
4
+ ## Adaptive Workflow Principle
5
+ **The workflow adapts to the work, not the other way around.**
6
+
7
+ The AI model intelligently assesses what stages are needed based on:
8
+ 1. User's stated intent and clarity
9
+ 2. Existing codebase state (if any)
10
+ 3. Complexity and scope of change
11
+ 4. Risk and impact assessment
12
+
13
+ ## MANDATORY: Rule Details Loading
14
+ **CRITICAL**: When performing any phase, you MUST read and use relevant content from rule detail files. Check these paths in order and use the first one that exists, regardless of which IDE or setup method was used:
15
+ - `.aidlc/aidlc-rules/aws-aidlc-rule-details/` (typical with AI-assisted setup)
16
+ - `.aidlc-rule-details/` (typical with Cursor, Cline, Claude Code, GitHub Copilot, OpenAI Codex)
17
+ - `.kiro/aws-aidlc-rule-details/` (typical with Kiro IDE and CLI)
18
+ - `.amazonq/aws-aidlc-rule-details/` (typical with Amazon Q Developer)
19
+
20
+ All subsequent rule detail file references (e.g., `common/process-overview.md`, `inception/workspace-detection.md`) are relative to whichever rule details directory was resolved above.
21
+
22
+ **Common Rules**: ALWAYS load common rules at workflow start:
23
+ - Load `common/process-overview.md` for workflow overview
24
+ - Load `common/session-continuity.md` for session resumption guidance
25
+ - Load `common/content-validation.md` for content validation requirements
26
+ - Load `common/question-format-guide.md` for question formatting rules
27
+ - Reference these throughout the workflow execution
28
+
29
+ ## MANDATORY: Extensions Loading (Context-Optimized)
30
+ **CRITICAL**: At workflow start, scan the `extensions/` directory recursively but load ONLY lightweight opt-in files — NOT full rule files. Full rule files are loaded on-demand after the user opts in.
31
+
32
+ **Loading process**:
33
+ 1. List all subdirectories under `extensions/` (e.g., `extensions/security/`, `extensions/compliance/`)
34
+ 2. In each subdirectory, load ONLY `*.opt-in.md` files — these contain the extension's opt-in prompt. The corresponding rules file is derived by convention: strip the `.opt-in.md` suffix and append `.md` (e.g., `security-baseline.opt-in.md` → `security-baseline.md`)
35
+ 3. Do NOT load full rule files (e.g., `security-baseline.md`) at this stage
36
+
37
+ **Deferred Rule Loading**:
38
+ - During Requirements Analysis, opt-in prompts from the loaded `*.opt-in.md` files are presented to the user
39
+ - When the user opts IN for an extension, load the corresponding rules file (derived by naming convention) at that point
40
+ - When the user opts OUT, the full rules file is never loaded — saving context
41
+ - Extensions without a matching `*.opt-in.md` file are always enforced — load their rule files immediately at workflow start
42
+
43
+ **Enforcement** (applies only to loaded/enabled extensions):
44
+ - Extension rules are hard constraints, not optional guidance
45
+ - At each stage, the model intelligently evaluates which extension rules are applicable based on the stage's purpose, the artifacts being produced, and the context of the work — enforce only those rules that are relevant
46
+ - Rules that are not applicable to the current stage should be marked as N/A in the compliance summary (this is not a blocking finding)
47
+ - Non-compliance with any applicable enabled extension rule is a **blocking finding** — do NOT present stage completion until resolved
48
+ - When presenting stage completion, include a summary of extension rule compliance (compliant/non-compliant/N/A per rule, with brief rationale for N/A determinations)
49
+
50
+ **Conditional Enforcement**: Extensions may be conditionally enabled/disabled. See `inception/requirements-analysis.md` for the opt-in mechanism. Before enforcing any extension at ANY stage, check its `Enabled` status in `aidlc-docs/aidlc-state.md` under `## Extension Configuration`. Skip disabled extensions and log the skip in audit.md. Default to enforced if no configuration exists.
51
+
52
+ ## MANDATORY: Content Validation
53
+ **CRITICAL**: Before creating ANY file, you MUST validate content according to `common/content-validation.md` rules:
54
+ - Validate Mermaid diagram syntax
55
+ - Validate ASCII art diagrams (see `common/ascii-diagram-standards.md`)
56
+ - Escape special characters properly
57
+ - Provide text alternatives for complex visual content
58
+ - Test content parsing compatibility
59
+
60
+ ## MANDATORY: Question File Format
61
+ **CRITICAL**: When asking questions at any phase, you MUST follow question format guidelines.
62
+
63
+ **See `common/question-format-guide.md` for complete question formatting rules including**:
64
+ - Multiple choice format (A, B, C, D, E options)
65
+ - [Answer]: tag usage
66
+ - Answer validation and ambiguity resolution
67
+
68
+ ## MANDATORY: Custom Welcome Message
69
+ **CRITICAL**: When starting ANY software development request, you MUST display the welcome message.
70
+
71
+ **How to Display Welcome Message**:
72
+ 1. Load the welcome message from `common/welcome-message.md` (in the resolved rule details directory)
73
+ 2. Display the complete message to the user
74
+ 3. This should only be done ONCE at the start of a new workflow
75
+ 4. Do NOT load this file in subsequent interactions to save context space
76
+
77
+ # Adaptive Software Development Workflow
78
+
79
+ ---
80
+
81
+ # INCEPTION PHASE
82
+
83
+ **Purpose**: Planning, requirements gathering, and architectural decisions
84
+
85
+ **Focus**: Determine WHAT to build and WHY
86
+
87
+ **Stages in INCEPTION PHASE**:
88
+ - Workspace Detection (ALWAYS)
89
+ - Reverse Engineering (CONDITIONAL - Brownfield only)
90
+ - Requirements Analysis (ALWAYS - Adaptive depth)
91
+ - User Stories (CONDITIONAL)
92
+ - Workflow Planning (ALWAYS)
93
+ - Application Design (CONDITIONAL)
94
+ - Units Generation (CONDITIONAL)
95
+
96
+ ---
97
+
98
+ ## Workspace Detection (ALWAYS EXECUTE)
99
+
100
+ 1. **MANDATORY**: Log initial user request in audit.md with complete raw input
101
+ 2. Load all steps from `inception/workspace-detection.md`
102
+ 3. Execute workspace detection:
103
+ - Check for existing aidlc-state.md (resume if found)
104
+ - Scan workspace for existing code
105
+ - Determine if brownfield or greenfield
106
+ - Check for existing reverse engineering artifacts
107
+ 4. Determine next phase: Reverse Engineering (if brownfield and no artifacts) OR Requirements Analysis
108
+ 5. **MANDATORY**: Log findings in audit.md
109
+ 6. Present completion message to user (see workspace-detection.md for message formats)
110
+ 7. Automatically proceed to next phase
111
+
112
+ ## Reverse Engineering (CONDITIONAL - Brownfield Only)
113
+
114
+ **Execute IF**:
115
+ - Existing codebase detected
116
+ - No previous reverse engineering artifacts found
117
+
118
+ **Skip IF**:
119
+ - Greenfield project
120
+ - Previous reverse engineering artifacts exist
121
+
122
+ **Execution**:
123
+ 1. **MANDATORY**: Log start of reverse engineering in audit.md
124
+ 2. Load all steps from `inception/reverse-engineering.md`
125
+ 3. Execute reverse engineering:
126
+ - Analyze all packages and components
127
+ - Generate a business overview of the whole system covering the business transactions
128
+ - Generate architecture documentation
129
+ - Generate code structure documentation
130
+ - Generate API documentation
131
+ - Generate component inventory
132
+ - Generate Interaction Diagrams depicting how business transactions are implemented across components
133
+ - Generate technology stack documentation
134
+ - Generate dependencies documentation
135
+
136
+ 4. **Wait for Explicit Approval**: Present detailed completion message (see reverse-engineering.md for message format) - DO NOT PROCEED until user confirms
137
+ 5. **MANDATORY**: Log user's response in audit.md with complete raw input
138
+
139
+ ## Requirements Analysis (ALWAYS EXECUTE - Adaptive Depth)
140
+
141
+ **Always executes** but depth varies based on request clarity and complexity:
142
+ - **Minimal**: Simple, clear request - just document intent analysis
143
+ - **Standard**: Normal complexity - gather functional and non-functional requirements
144
+ - **Comprehensive**: Complex, high-risk - detailed requirements with traceability
145
+
146
+ **Execution**:
147
+ 1. **MANDATORY**: Log any user input during this phase in audit.md
148
+ 2. Load all steps from `inception/requirements-analysis.md`
149
+ 3. Execute requirements analysis:
150
+ - Load reverse engineering artifacts (if brownfield)
151
+ - Analyze user request (intent analysis)
152
+ - Determine requirements depth needed
153
+ - Assess current requirements
154
+ - Ask clarifying questions (if needed)
155
+ - Generate requirements document
156
+ 4. Execute at appropriate depth (minimal/standard/comprehensive)
157
+ 5. **Wait for Explicit Approval**: Follow approval format from requirements-analysis.md detailed steps - DO NOT PROCEED until user confirms
158
+ 6. **MANDATORY**: Log user's response in audit.md with complete raw input
159
+
160
+ ## User Stories (CONDITIONAL)
161
+
162
+ **INTELLIGENT ASSESSMENT**: Use multi-factor analysis to determine if user stories add value:
163
+
164
+ **ALWAYS Execute IF** (High Priority Indicators):
165
+ - New user-facing features or functionality
166
+ - Changes affecting user workflows or interactions
167
+ - Multiple user types or personas involved
168
+ - Complex business requirements with acceptance criteria needs
169
+ - Cross-functional team collaboration required
170
+ - Customer-facing API or service changes
171
+ - New product capabilities or enhancements
172
+
173
+ **LIKELY Execute IF** (Medium Priority - Assess Complexity):
174
+ - Modifications to existing user-facing features
175
+ - Backend changes that indirectly affect user experience
176
+ - Integration work that impacts user workflows
177
+ - Performance improvements with user-visible benefits
178
+ - Security enhancements affecting user interactions
179
+ - Data model changes affecting user data or reports
180
+
181
+ **COMPLEXITY-BASED ASSESSMENT**: For medium priority cases, execute user stories if:
182
+ - Request involves multiple components or services
183
+ - Changes span multiple user touchpoints
184
+ - Business logic is complex or has multiple scenarios
185
+ - Requirements have ambiguity that stories could clarify
186
+ - Implementation affects multiple user journeys
187
+ - Change has significant business impact or risk
188
+
189
+ **SKIP ONLY IF** (Low Priority - Simple Cases):
190
+ - Pure internal refactoring with zero user impact
191
+ - Simple bug fixes with clear, isolated scope
192
+ - Infrastructure changes with no user-facing effects
193
+ - Technical debt cleanup with no functional changes
194
+ - Developer tooling or build process improvements
195
+ - Documentation-only updates
196
+
197
+ **ASSESSMENT CRITERIA**: When in doubt, favor inclusion of user stories for:
198
+ - Requests with business stakeholder involvement
199
+ - Changes requiring user acceptance testing
200
+ - Features with multiple implementation approaches
201
+ - Work that benefits from shared team understanding
202
+ - Projects where requirements clarity is valuable
203
+
204
+ **ASSESSMENT PROCESS**:
205
+ 1. Analyze request complexity and scope
206
+ 2. Identify user impact (direct or indirect)
207
+ 3. Evaluate business context and stakeholder needs
208
+ 4. Consider team collaboration benefits
209
+ 5. Default to inclusion for borderline cases
210
+
211
+ **Note**: If Requirements Analysis executed, Stories can reference and build upon those requirements.
212
+
213
+ **User Stories has two parts within one stage**:
214
+ 1. **Part 1 - Planning**: Create story plan with questions, collect answers, analyze for ambiguities, get approval
215
+ 2. **Part 2 - Generation**: Execute approved plan to generate stories and personas
216
+
217
+ **Execution**:
218
+ 1. **MANDATORY**: Log any user input during this phase in audit.md
219
+ 2. Load all steps from `inception/user-stories.md`
220
+ 3. **MANDATORY**: Perform intelligent assessment (Step 1 in user-stories.md) to validate user stories are needed
221
+ 4. Load reverse engineering artifacts (if brownfield)
222
+ 5. If Requirements exist, reference them when creating stories
223
+ 6. Execute at appropriate depth (minimal/standard/comprehensive)
224
+ 7. **PART 1 - Planning**: Create story plan with questions, wait for user answers, analyze for ambiguities, get approval
225
+ 8. **PART 2 - Generation**: Execute approved plan to generate stories and personas
226
+ 9. **Wait for Explicit Approval**: Follow approval format from user-stories.md detailed steps - DO NOT PROCEED until user confirms
227
+ 10. **MANDATORY**: Log user's response in audit.md with complete raw input
228
+
229
+ ## Workflow Planning (ALWAYS EXECUTE)
230
+
231
+ 1. **MANDATORY**: Log any user input during this phase in audit.md
232
+ 2. Load all steps from `inception/workflow-planning.md`
233
+ 3. **MANDATORY**: Load content validation rules from `common/content-validation.md`
234
+ 4. Load all prior context:
235
+ - Reverse engineering artifacts (if brownfield)
236
+ - Intent analysis
237
+ - Requirements (if executed)
238
+ - User stories (if executed)
239
+ 5. Execute workflow planning:
240
+ - Determine which phases to execute
241
+ - Determine depth level for each phase
242
+ - Create multi-package change sequence (if brownfield)
243
+ - Generate workflow visualization (VALIDATE Mermaid syntax before writing)
244
+ 6. **MANDATORY**: Validate all content before file creation per content-validation.md rules
245
+ 7. **Wait for Explicit Approval**: Present recommendations using language from workflow-planning.md Step 9, emphasizing user control to override recommendations - DO NOT PROCEED until user confirms
246
+ 8. **MANDATORY**: Log user's response in audit.md with complete raw input
247
+
248
+ ## Application Design (CONDITIONAL)
249
+
250
+ **Execute IF**:
251
+ - New components or services needed
252
+ - Component methods and business rules need definition
253
+ - Service layer design required
254
+ - Component dependencies need clarification
255
+
256
+ **Skip IF**:
257
+ - Changes within existing component boundaries
258
+ - No new components or methods
259
+ - Pure implementation changes
260
+
261
+ **Execution**:
262
+ 1. **MANDATORY**: Log any user input during this phase in audit.md
263
+ 2. Load all steps from `inception/application-design.md`
264
+ 3. Load reverse engineering artifacts (if brownfield)
265
+ 4. Execute at appropriate depth (minimal/standard/comprehensive)
266
+ 5. **Wait for Explicit Approval**: Present detailed completion message (see application-design.md for message format) - DO NOT PROCEED until user confirms
267
+ 6. **MANDATORY**: Log user's response in audit.md with complete raw input
268
+
269
+ ## Units Generation (CONDITIONAL)
270
+
271
+ **Execute IF**:
272
+ - System needs decomposition into multiple units of work
273
+ - Multiple services or modules required
274
+ - Complex system requiring structured breakdown
275
+
276
+ **Skip IF**:
277
+ - Single simple unit
278
+ - No decomposition needed
279
+ - Straightforward single-component implementation
280
+
281
+ **Execution**:
282
+ 1. **MANDATORY**: Log any user input during this phase in audit.md
283
+ 2. Load all steps from `inception/units-generation.md`
284
+ 3. Load reverse engineering artifacts (if brownfield)
285
+ 4. Execute at appropriate depth (minimal/standard/comprehensive)
286
+ 5. **Wait for Explicit Approval**: Present detailed completion message (see units-generation.md for message format) - DO NOT PROCEED until user confirms
287
+ 6. **MANDATORY**: Log user's response in audit.md with complete raw input
288
+
289
+ ---
290
+
291
+ # 🟢 CONSTRUCTION PHASE
292
+
293
+ **Purpose**: Detailed design, NFR implementation, and code generation
294
+
295
+ **Focus**: Determine HOW to build it
296
+
297
+ **Stages in CONSTRUCTION PHASE**:
298
+ - Per-Unit Loop (executes for each unit):
299
+ - Functional Design (CONDITIONAL, per-unit)
300
+ - NFR Requirements (CONDITIONAL, per-unit)
301
+ - NFR Design (CONDITIONAL, per-unit)
302
+ - Infrastructure Design (CONDITIONAL, per-unit)
303
+ - Code Generation (ALWAYS, per-unit)
304
+ - Build and Test (ALWAYS - after all units complete)
305
+
306
+ **Note**: Each unit is completed fully (design + code) before moving to the next unit.
307
+
308
+ ---
309
+
310
+ ## Per-Unit Loop (Executes for Each Unit)
311
+
312
+ **For each unit of work, execute the following stages in sequence:**
313
+
314
+ ### Functional Design (CONDITIONAL, per-unit)
315
+
316
+ **Execute IF**:
317
+ - New data models or schemas
318
+ - Complex business logic
319
+ - Business rules need detailed design
320
+
321
+ **Skip IF**:
322
+ - Simple logic changes
323
+ - No new business logic
324
+
325
+ **Execution**:
326
+ 1. **MANDATORY**: Log any user input during this stage in audit.md
327
+ 2. Load all steps from `construction/functional-design.md`
328
+ 3. Execute functional design for this unit
329
+ 4. **MANDATORY**: Present standardized 2-option completion message as defined in functional-design.md - DO NOT use emergent 3-option behavior
330
+ 5. **Wait for Explicit Approval**: User must choose between "Request Changes" or "Continue to Next Stage" - DO NOT PROCEED until user confirms
331
+ 6. **MANDATORY**: Log user's response in audit.md with complete raw input
332
+
333
+ ### NFR Requirements (CONDITIONAL, per-unit)
334
+
335
+ **Execute IF**:
336
+ - Performance requirements exist
337
+ - Security considerations needed
338
+ - Scalability concerns present
339
+ - Tech stack selection required
340
+
341
+ **Skip IF**:
342
+ - No NFR requirements
343
+ - Tech stack already determined
344
+
345
+ **Execution**:
346
+ 1. **MANDATORY**: Log any user input during this stage in audit.md
347
+ 2. Load all steps from `construction/nfr-requirements.md`
348
+ 3. Execute NFR assessment for this unit
349
+ 4. **MANDATORY**: Present standardized 2-option completion message as defined in nfr-requirements.md - DO NOT use emergent behavior
350
+ 5. **Wait for Explicit Approval**: User must choose between "Request Changes" or "Continue to Next Stage" - DO NOT PROCEED until user confirms
351
+ 6. **MANDATORY**: Log user's response in audit.md with complete raw input
352
+
353
+ ### NFR Design (CONDITIONAL, per-unit)
354
+
355
+ **Execute IF**:
356
+ - NFR Requirements was executed
357
+ - NFR patterns need to be incorporated
358
+
359
+ **Skip IF**:
360
+ - No NFR requirements
361
+ - NFR Requirements was skipped
362
+
363
+ **Execution**:
364
+ 1. **MANDATORY**: Log any user input during this stage in audit.md
365
+ 2. Load all steps from `construction/nfr-design.md`
366
+ 3. Execute NFR design for this unit
367
+ 4. **MANDATORY**: Present standardized 2-option completion message as defined in nfr-design.md - DO NOT use emergent behavior
368
+ 5. **Wait for Explicit Approval**: User must choose between "Request Changes" or "Continue to Next Stage" - DO NOT PROCEED until user confirms
369
+ 6. **MANDATORY**: Log user's response in audit.md with complete raw input
370
+
371
+ ### Infrastructure Design (CONDITIONAL, per-unit)
372
+
373
+ **Execute IF**:
374
+ - Infrastructure services need mapping
375
+ - Deployment architecture required
376
+ - Cloud resources need specification
377
+
378
+ **Skip IF**:
379
+ - No infrastructure changes
380
+ - Infrastructure already defined
381
+
382
+ **Execution**:
383
+ 1. **MANDATORY**: Log any user input during this stage in audit.md
384
+ 2. Load all steps from `construction/infrastructure-design.md`
385
+ 3. Execute infrastructure design for this unit
386
+ 4. **MANDATORY**: Present standardized 2-option completion message as defined in infrastructure-design.md - DO NOT use emergent behavior
387
+ 5. **Wait for Explicit Approval**: User must choose between "Request Changes" or "Continue to Next Stage" - DO NOT PROCEED until user confirms
388
+ 6. **MANDATORY**: Log user's response in audit.md with complete raw input
389
+
390
+ ### Code Generation (ALWAYS EXECUTE, per-unit)
391
+
392
+ **Always executes for each unit**
393
+
394
+ **Code Generation has two parts within one stage**:
395
+ 1. **Part 1 - Planning**: Create detailed code generation plan with explicit steps
396
+ 2. **Part 2 - Generation**: Execute approved plan to generate code, tests, and artifacts
397
+
398
+ **Execution**:
399
+ 1. **MANDATORY**: Log any user input during this stage in audit.md
400
+ 2. Load all steps from `construction/code-generation.md`
401
+ 3. **PART 1 - Planning**: Create code generation plan with checkboxes, get user approval
402
+ 4. **PART 2 - Generation**: Execute approved plan to generate code for this unit
403
+ 5. **MANDATORY**: Present standardized 2-option completion message as defined in code-generation.md - DO NOT use emergent behavior
404
+ 6. **Wait for Explicit Approval**: User must choose between "Request Changes" or "Continue to Next Stage" - DO NOT PROCEED until user confirms
405
+ 7. **MANDATORY**: Log user's response in audit.md with complete raw input
406
+
407
+ ---
408
+
409
+ ## Build and Test (ALWAYS EXECUTE)
410
+
411
+ 1. **MANDATORY**: Log any user input during this phase in audit.md
412
+ 2. Load all steps from `construction/build-and-test.md`
413
+ 3. Generate comprehensive build and test instructions:
414
+ - Build instructions for all units
415
+ - Unit test execution instructions
416
+ - Integration test instructions (test interactions between units)
417
+ - Performance test instructions (if applicable)
418
+ - Additional test instructions as needed (contract tests, security tests, e2e tests)
419
+ 4. Create instruction files in build-and-test/ subdirectory: build-instructions.md, unit-test-instructions.md, integration-test-instructions.md, performance-test-instructions.md, build-and-test-summary.md
420
+ 5. **Wait for Explicit Approval**: Ask: "**Build and test instructions complete. Ready to proceed to Operations stage?**" - DO NOT PROCEED until user confirms
421
+ 6. **MANDATORY**: Log user's response in audit.md with complete raw input
422
+
423
+ ---
424
+
425
+ # 🟡 OPERATIONS PHASE
426
+
427
+ **Purpose**: Placeholder for future deployment and monitoring workflows
428
+
429
+ **Focus**: How to DEPLOY and RUN it (future expansion)
430
+
431
+ **Stages in OPERATIONS PHASE**:
432
+ - Operations (PLACEHOLDER)
433
+
434
+ ---
435
+
436
+ ## Operations (PLACEHOLDER)
437
+
438
+ **Status**: This stage is currently a placeholder for future expansion.
439
+
440
+ The Operations stage will eventually include:
441
+ - Deployment planning and execution
442
+ - Monitoring and observability setup
443
+ - Incident response procedures
444
+ - Maintenance and support workflows
445
+ - Production readiness checklists
446
+
447
+ **Current State**: All build and test activities are handled in the CONSTRUCTION phase.
448
+
449
+ ## Key Principles
450
+
451
+ - **Adaptive Execution**: Only execute stages that add value
452
+ - **Transparent Planning**: Always show execution plan before starting
453
+ - **User Control**: User can request stage inclusion/exclusion
454
+ - **Progress Tracking**: Update aidlc-state.md with executed and skipped stages
455
+ - **Complete Audit Trail**: Log ALL user inputs and AI responses in audit.md with timestamps
456
+ - **CRITICAL**: Capture user's COMPLETE RAW INPUT exactly as provided
457
+ - **CRITICAL**: Never summarize or paraphrase user input in audit log
458
+ - **CRITICAL**: Log every interaction, not just approvals
459
+ - **Quality Focus**: Complex changes get full treatment, simple changes stay efficient
460
+ - **Content Validation**: Always validate content before file creation per content-validation.md rules
461
+ - **NO EMERGENT BEHAVIOR**: Construction phases MUST use standardized 2-option completion messages as defined in their respective rule files. DO NOT create 3-option menus or other emergent navigation patterns.
462
+
463
+ ## MANDATORY: Plan-Level Checkbox Enforcement
464
+
465
+ ### MANDATORY RULES FOR PLAN EXECUTION
466
+ 1. **NEVER complete any work without updating plan checkboxes**
467
+ 2. **IMMEDIATELY after completing ANY step described in a plan file, mark that step [x]**
468
+ 3. **This must happen in the SAME interaction where the work is completed**
469
+ 4. **NO EXCEPTIONS**: Every plan step completion MUST be tracked with checkbox updates
470
+
471
+ ### Two-Level Checkbox Tracking System
472
+ - **Plan-Level**: Track detailed execution progress within each stage
473
+ - **Stage-Level**: Track overall workflow progress in aidlc-state.md
474
+ - **Update immediately**: All progress updates in SAME interaction where work is completed
475
+
476
+ ## Prompts Logging Requirements
477
+ - **MANDATORY**: Log EVERY user input (prompts, questions, responses) with timestamp in audit.md
478
+ - **MANDATORY**: Capture user's COMPLETE RAW INPUT exactly as provided (never summarize)
479
+ - **MANDATORY**: Log every approval prompt with timestamp before asking the user
480
+ - **MANDATORY**: Record every user response with timestamp after receiving it
481
+ - **CRITICAL**: ALWAYS append changes to EDIT audit.md file, NEVER use tools and commands that completely overwrite its contents
482
+ - **CRITICAL**: NEVER use file writing tools and commands that overwrite the entire contents of audit.md, as this causes duplication
483
+ - Use ISO 8601 format for timestamps (YYYY-MM-DDTHH:MM:SSZ)
484
+ - Include stage context for each entry
485
+
486
+ ### Audit Log Format:
487
+ ```markdown
488
+ ## [Stage Name or Interaction Type]
489
+ **Timestamp**: [ISO timestamp]
490
+ **User Input**: "[Complete raw user input - never summarized]"
491
+ **AI Response**: "[AI's response or action taken]"
492
+ **Context**: [Stage, action, or decision made]
493
+
494
+ ---
495
+ ```
496
+
497
+ ### Correct Tool Usage for audit.md
498
+
499
+ ✅ CORRECT:
500
+
501
+ 1. Read the audit.md file
502
+ 2. Append/Edit the file to make changes
503
+
504
+ ❌ WRONG:
505
+
506
+ 1. Read the audit.md file
507
+ 2. Completely overwrite the audit.md with the contents of what you read, plus the new changes you want to add to it
508
+
509
+ ## Directory Structure
510
+
511
+ ```text
512
+ <WORKSPACE-ROOT>/ # ⚠️ APPLICATION CODE HERE
513
+ ├── [project-specific structure] # Varies by project (see code-generation.md)
514
+
515
+ ├── aidlc-docs/ # 📄 DOCUMENTATION ONLY
516
+ │ ├── inception/ # 🔵 INCEPTION PHASE
517
+ │ │ ├── plans/
518
+ │ │ ├── reverse-engineering/ # Brownfield only
519
+ │ │ ├── requirements/
520
+ │ │ ├── user-stories/
521
+ │ │ └── application-design/
522
+ │ ├── construction/ # 🟢 CONSTRUCTION PHASE
523
+ │ │ ├── plans/
524
+ │ │ ├── {unit-name}/
525
+ │ │ │ ├── functional-design/
526
+ │ │ │ ├── nfr-requirements/
527
+ │ │ │ ├── nfr-design/
528
+ │ │ │ ├── infrastructure-design/
529
+ │ │ │ └── code/ # Markdown summaries only
530
+ │ │ └── build-and-test/
531
+ │ ├── operations/ # 🟡 OPERATIONS PHASE (placeholder)
532
+ │ ├── aidlc-state.md
533
+ │ └── audit.md
534
+ ```
535
+
536
+ **CRITICAL RULE**:
537
+ - Application code: Workspace root (NEVER in aidlc-docs/)
538
+ - Documentation: aidlc-docs/ only
539
+ - Project structure: See code-generation.md for patterns by project type
@@ -0,0 +1,116 @@
1
+ # ASCII Diagram Standards
2
+
3
+ ## MANDATORY: Use Basic ASCII Only
4
+
5
+ **CRITICAL**: ALWAYS use basic ASCII characters for diagrams (maximum compatibility).
6
+
7
+ ### ✅ ALLOWED: `+` `-` `|` `^` `v` `<` `>` and alphanumeric text
8
+
9
+ ### ❌ FORBIDDEN: Unicode box-drawing characters
10
+ - NO: `┌` `─` `│` `└` `┐` `┘` `├` `┤` `┬` `┴` `┼` `▼` `▲` `►` `◄`
11
+ - Reason: Inconsistent rendering across fonts/platforms
12
+
13
+ ## Standard ASCII Diagram Patterns
14
+
15
+ ### CRITICAL: Character Width Rule
16
+ **Every line in a box MUST have EXACTLY the same character count (including spaces)**
17
+
18
+ ✅ CORRECT (all lines = 67 chars):
19
+ ```
20
+ +---------------------------------------------------------------+
21
+ | Component Name |
22
+ | Description text here |
23
+ +---------------------------------------------------------------+
24
+ ```
25
+
26
+ ❌ WRONG (inconsistent widths):
27
+ ```
28
+ +---------------------------------------------------------------+
29
+ | Component Name |
30
+ | Description text here |
31
+ +---------------------------------------------------------------+
32
+ ```
33
+
34
+ ### Box Pattern
35
+ ```
36
+ +-----------------------------------------------------+
37
+ | |
38
+ | Calculator Application |
39
+ | |
40
+ | Provides basic arithmetic operations for users |
41
+ | through a web-based interface |
42
+ | |
43
+ +-----------------------------------------------------+
44
+ ```
45
+
46
+ ### Nested Boxes
47
+ ```
48
+ +-------------------------------------------------------+
49
+ | Web Server (PHP Runtime) |
50
+ | +-------------------------------------------------+ |
51
+ | | index.php (Monolithic Application) | |
52
+ | | +-------------------------------------------+ | |
53
+ | | | HTML Template (View Layer) | | |
54
+ | | | - Form rendering | | |
55
+ | | | - Result display | | |
56
+ | | +-------------------------------------------+ | |
57
+ | +-------------------------------------------------+ |
58
+ +-------------------------------------------------------+
59
+ ```
60
+
61
+ ### Arrows and Connections
62
+ ```
63
+ +----------+
64
+ | Source |
65
+ +----------+
66
+ |
67
+ | HTTP POST
68
+ v
69
+ +----------+
70
+ | Target |
71
+ +----------+
72
+ ```
73
+
74
+ ### Horizontal Flow
75
+ ```
76
+ +-------+ +-------+ +-------+
77
+ | Step1 | --> | Step2 | --> | Step3 |
78
+ +-------+ +-------+ +-------+
79
+ ```
80
+
81
+ ### Vertical Flow with Labels
82
+ ```
83
+ User Action Flow:
84
+ |
85
+ v
86
+ +----------+
87
+ | Input |
88
+ +----------+
89
+ |
90
+ | validates
91
+ v
92
+ +----------+
93
+ | Process |
94
+ +----------+
95
+ |
96
+ | returns
97
+ v
98
+ +----------+
99
+ | Output |
100
+ +----------+
101
+ ```
102
+
103
+ ## Validation
104
+
105
+ Before creating diagrams:
106
+ - [ ] Basic ASCII only: `+` `-` `|` `^` `v` `<` `>`
107
+ - [ ] No Unicode box-drawing
108
+ - [ ] Spaces (not tabs) for alignment
109
+ - [ ] Corners use `+`
110
+ - [ ] **ALL box lines same character width** (count characters including spaces)
111
+ - [ ] Test: Verify corners align vertically in monospace font
112
+
113
+ ## Alternative
114
+
115
+ For complex diagrams, use Mermaid (see `content-validation.md`)
116
+