Przejdź do treści
Biblioteka skilli
Projektowanie i UX · Budowanie i kod

text-diagram

/text-diagram

Rysuje niezawodne, wyrównane diagramy architektury w tekście ASCII z zagnieżdżonymi ramkami, strzałkami i łącznikami.

Repozytorium
skills ↗
Licencja
MIT
Ostatnia zmiana repozytorium
26.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
3
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 26.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Rysuje niezawodne, wyrównane diagramy architektury w tekście ASCII z zagnieżdżonymi ramkami, strzałkami i łącznikami.

Argumenty

/text-diagram [diagram description or 'from image']
Oryginalny opis (EN)

Draw reliable, well-aligned text/ASCII architecture diagrams with nested boxes, arrows, and connectors. Use when user asks to draw/create text diagrams, ASCII art diagrams, box diagrams, or architecture diagrams in plain text. For rendered image artifacts (PNG/SVG), use vd:diagram instead.

Jak działa

  1. Critical Rules (NEVER violate)
  2. Character Sets
  3. Width Constraints
  4. Drawing Algorithm
  5. Layout Patterns
  6. Common Mistakes to Avoid
  7. Rendering Checklist (Run mentally after drawing)
  8. Examples
Sekcje z nagłówków SKILL.md, w oryginale · 167 linii, 980 słów
Podgląd SKILL.md
---
name: text-diagram
description: Draw reliable, well-aligned text/ASCII architecture diagrams with nested boxes, arrows, and connectors. Use when user asks to draw/create text diagrams, ASCII art diagrams, box diagrams, or architecture diagrams in plain text. For rendered image artifacts (PNG/SVG), use vd:diagram instead.
license: MIT
argument-hint: "[diagram description or 'from image']"
metadata:
  author: vanducng
  version: "0.1.0"
---

# Text Diagram Drawing

Draw professional, pixel-perfect text-based architecture diagrams using monospace characters. Every character must align correctly in a monospace font.

## Critical Rules (NEVER violate)

1. **Calculate widths BEFORE drawing.** Never freehand a diagram. Always compute column widths, box widths, and total widths first, then render.
2. **Every line in a box must be the SAME character length.** Count characters. Verify.
3. **Use ONLY ASCII-safe monospace characters** for borders: `|`, `-`, `+` for basic; or Unicode box-drawing (see charset below). Never mix styles in one diagram.
4. **Pad content with spaces** to fill the full inner width of every box.
5. **Vertical connectors** (`|` or `│`) must be at the EXACT same column position on every line between two boxes.
6. **After drawing, mentally re-count** character positions of the first line, last line, and any connector lines to verify alignment.
7. **One box-drawing style per diagram.** Don't mix `+--+` with `┌──┐`.

## Character Sets

### Style A: Pure ASCII (safest, works everywhere)
```
Corners:  +
Horiz:    -
Vert:     |
Arrow:    -> or -->
Down:     v or V
Cross:    +
T-junc:   +
```

### Style B: Unicode Light Box Drawing (cleaner look)
```
Corners:  ┌ ┐ └ ┘
Horiz:    ─
Vert:     │
T-junc:   ├ ┤ ┬ ┴
Cross:    ┼
Arrow:    → ← ↑ ↓
Triangle: ▼ ▲ ► ◄
```

Style C: Unicode Rounded (`╭ ╮ ╰ ╯`, rest same as B). Style D: Double-line (`╔ ╗ ╚ ╝`, `═`, `║`, T-junc `╠ ╣ ╦ ╩`) for emphasis/outer containers. Style E: Dashed borders (`¦` or `:` or `╎`, horiz `- - -`) for secondary containers.

## Width Constraints

- **Default max width: 80 characters** (standard terminal). Use 120 for wide diagrams.
- If a diagram exceeds the limit, reduce padding, abbreviate labels, or split into multiple diagrams.
- **Never use tab characters.** Always spaces.
- All Unicode box-drawing chars (U+2500-U+257F) are exactly 1 column wide. Safe to use.
- **Avoid:** CJK chars (2-wide), emoji (variable width), heavy/dashed variants if cross-platform rendering matters.

## Drawing Algorithm

**ALWAYS follow these steps in order:**

### Step 1: Plan the Layout
- List all boxes, their nesting depth, and content lines
- Determine layout direction (top-down, left-right, or mixed)
- Identify connectors between boxes

### Step 2: Calculate Dimensions (CRITICAL)
```
For each box:
  inner_width = max(len(line) for line in content_lines) + 2*padding
  outer_width = inner_width + 2  (for left/right borders)

For side-by-side boxes:
  total_width = sum(outer_widths) + gaps_between_boxes

For container boxes:
  container_inner_width = max(total_width_of_children, len(title)) + 2*padding
  container_outer_width = container_inner_width + 2
```

### Step 3: Render Top-Down
- Draw each line as a fixed-width string
- Use `.ljust()` / space-padding to ensure every line in a box is the same width
- For nested boxes: indent children by container's left border + padding
- **Symmetric padding rule:** if you indent a child row with 2 spaces on the LEFT after the container's `│`, you must reserve 2 spaces on the RIGHT before the closing `│`. The most common alignment bug is leaving only 1 space on the right.

### Step 4: Verify Alignment
Run the Rendering Checklist at the end of this file.

## Layout Patterns

### Pattern: Container with Title
```
┌──────────────────────────────┐
│ Container Title              │
│                              │
│  ┌────────┐  ┌────────┐      │
│  │ Box A  │  │ Box B  │      │
│  └────────┘  └────────┘      │
│                              │
└──────────────────────────────┘
```
**Rule:** outer width = 32. Every row (border, title, empty, child rows, bottom) is exactly 32 chars. Right padding before the closing `│` mirrors the left padding (2 spaces) plus any extra slack.

### Pattern: Vertical Flow with Connector
```
┌──────────┐
│  Box A   │
└─────┬────┘
      │
      ▼
┌──────────┐
│  Box B   │
└──────────┘
```
**Rule:** The `│` and `▼` must be at the same column as `┬`: `border_start + 1 + floor(inner_width / 2)` (here: 0 + 1 + 5 = 6).

### Pattern: Horizontal Flow Inside Container
```
┌──────────────────────────────────────┐
│                                      │
│  ┌─────────┐    ┌─────────┐          │
│  │ Step 1  │ →  │ Step 2  │          │
│  └─────────┘    └─────────┘          │
│                                      │
└──────────────────────────────────────┘
```
**Rule:** outer width = 40. Arrow `→` sits at the vertical midpoint of the boxes, between them. Right side keeps ≥2 spaces before the closing `│` to mirror left padding.

### Pattern: Side-by-Side Boxes (Equal Height)
```
┌──────────┐  ┌──────────┐  ┌──────────┐
│ Title A  │  │ Title B  │  │ Title C  │
│ (desc)   │  │ (desc)   │  │ (desc)   │
└──────────┘  └──────────┘  └──────────┘
```
**Rule:** All boxes MUST have the same number of lines. Pad shorter boxes with blank content lines.

### Pattern: Centered Connector Between Sections
```
┌─────────────────────────┐
│ Section A               │
└────────────┬────────────┘
             │
             ▼
┌─────────────────────────┐
│ Section B               │
└─────────────────────────┘
```
**Rule:** Both sections should be the same width. Connector at `width / 2`.

## Common Mistakes to Avoid

| Mistake | Fix |
|---------|-----|
| Vertical connector off by 1 | Calculate center: `border_start + 1 + floor(inner_width / 2)` |
| Arrow not vertically centered on box | Arrow row = top_border_row + 1 + floor(content_lines / 2) |
| Forgot to account for border chars | outer_width = inner_width + 2 (left `│` + right `│`) |

## Rendering Checklist (Run mentally after drawing)

- [ ] Every box: first border line length == last border line length
- [ ] Every box: all content lines == border line length
- [ ] Container boxes: wider than all children combined + gaps + padding
- [ ] Side-by-side boxes: all same height (line count)
- [ ] Vertical connectors: same column on every row
- [ ] No trailing spaces inconsistency
- [ ] Nested boxes indented consistently
- [ ] Arrows aligned to box midpoints
- [ ] Right padding mirrors left padding before the closing border

## Examples

See `references/examples.md` for complete worked examples with dimension calculations, and `references/advanced-patterns.md` for nested architectures, fan-out, and annotated connectors.
Pliki w paczce (3)
  • SKILL.md 8 KB
  • references/advanced-patterns.md 7 KB
  • references/examples.md 10 KB

Wersje

W bazie nie ma innych skilli o nazwie text-diagram.

Migawka bazy z 13.11.2026 · wersja paczki 51ed6cb5eb27 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 2 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100concise-diagram
    Rysuje zwięzłe diagramy architektury, przepływów i sekwencji w Unicode, ASCII lub SVG, z krótkimi etykietami i ponumerowanymi notatkami.
  • 100ascii-art-diagram-creator
    Prawdopodobnie tworzy diagramy ASCII art w ramach kategorii treści wizualnych.
  • 90diagrams:ascii-art
    Tworzy diagramy tekstowe z ramek CP437, do dokumentacji i terminala, nie wychodząc poza 80 znaków szerokości.
  • 100draw-io
    Tworzy i edytuje diagramy draw.io w plikach .drawio, w tym diagramy architektury AWS, oraz konwertuje je do PNG.
  • 100plantuml-ascii
    Generuje diagramy ASCII z PlantUML w trybie tekstowym: diagramy sekwencji, klas i przepływu, także w wersji Unicode z flagą -utxt.
  • 90architecture-diagram
    Rysuje diagram projektu systemu, np. przepływ danych, regiony i ścieżki awarii, w ciemnym HTML z SVG i eksportem PNG lub PDF.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.