Skip to content

Commit 3f3df91

Browse files
authored
Fix for ASCII art diagrams line alignment issue #32
Fix for ASCII art diagrams line alignment issues
2 parents 855d161 + 65d1f2d commit 3f3df91

File tree

3 files changed

+132
-1
lines changed

3 files changed

+132
-1
lines changed
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+

aidlc-rules/aws-aidlc-rule-details/common/content-validation.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@
44

55
**CRITICAL**: All generated content MUST be validated before writing to files to prevent parsing errors.
66

7+
## ASCII Diagram Standards
8+
9+
**CRITICAL**: Before creating ANY file with ASCII diagrams:
10+
11+
1. **LOAD** `common/ascii-diagram-standards.md`
12+
2. **VALIDATE** each diagram:
13+
- Count characters per line (all lines MUST be same width)
14+
- Use ONLY: `+` `-` `|` `^` `v` `<` `>` and spaces
15+
- NO Unicode box-drawing characters
16+
- Spaces only (NO tabs)
17+
3. **TEST** alignment by verifying box corners align vertically
18+
19+
**See `common/ascii-diagram-standards.md` for patterns and validation checklist.**
20+
721
## Mermaid Diagram Validation
822

923
### Required Validation Steps
@@ -61,4 +75,4 @@ Phase 1: INCEPTION
6175
1. **Log the error**: Record what failed validation
6276
2. **Use fallback content**: Switch to text-based alternative
6377
3. **Continue workflow**: Don't block on content validation failures
64-
4. **Inform user**: Mention simplified content was used due to parsing constraints
78+
4. **Inform user**: Mention simplified content was used due to parsing constraints

aidlc-rules/aws-aidlc-rules/core-workflow.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ The AI model intelligently assesses what stages are needed based on:
2323
## MANDATORY: Content Validation
2424
**CRITICAL**: Before creating ANY file, you MUST validate content according to `common/content-validation.md` rules:
2525
- Validate Mermaid diagram syntax
26+
- Validate ASCII art diagrams (see `common/ascii-diagram-standards.md`)
2627
- Escape special characters properly
2728
- Provide text alternatives for complex visual content
2829
- Test content parsing compatibility

0 commit comments

Comments
 (0)