From b3a78c119c91f17d9da8f5ddaf4ef5ea193f8e7c Mon Sep 17 00:00:00 2001 From: ramsani <97571563+ramsani@users.noreply.github.com> Date: Sat, 16 May 2026 16:26:08 -0700 Subject: [PATCH 1/3] feat(diagrams): add patterns 23-25 for Mermaid and Chart.js native support --- patterns/23-mermaid-architecture.md | 130 ++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 patterns/23-mermaid-architecture.md diff --git a/patterns/23-mermaid-architecture.md b/patterns/23-mermaid-architecture.md new file mode 100644 index 0000000..169dca7 --- /dev/null +++ b/patterns/23-mermaid-architecture.md @@ -0,0 +1,130 @@ +# Pattern: Mermaid Architecture Diagram + +## When to Use + +Use this pattern when you need to visualize a system, service, or component architecture as a diagram that shows: + +- Modules, services, or components with their connections +- Data flow between components (HTTP, events, queues) +- Boundary markers (teams, environments, deployment units) +- Interface points and protocol information + +Do **not** use this pattern for: +- Code-level internal structure (use Module Map instead) +- Workflows with decision points (use Process Workflow Flowchart) +- Timeline-based visualizations (use Project Progress Deck) + +## Trigger Phrases + +- "architecture diagram" +- "system diagram" +- "service map" +- "microservices diagram" +- "component diagram" +- "module architecture" + +## Artifact Structure + +```html + + + + + +
+

Architecture: [System Name]

+

Pattern: 23-mermaid-architecture | Purpose: [intended use]

+
+ + +
+flowchart TB + subgraph frontend["Frontend"] + A[Browser App] --> B[API Gateway] + end + subgraph backend["Backend Services"] + B --> C[Auth Service] + B --> D[Core API] + D --> E[(Database)] + D --> F[Queue] + end + subgraph external["External Services"] + F --> G[Payment Provider] + F --> H[Email Service] + end + classDef data fill:#e1f5fe + classDef service fill:#fff3e0 + class E,G,H data + class C,D,F service +
+ + +
+

Legend

+ +
+ +
+

What I checked

+ +
+ +
+

Recommendation

+

[What this architecture enables and what risks exist]

+
+ +
+

Next action

+

[What to do next with this understanding]

+
+ +
+

Save decision

+

[save/private/refresh/supersede/discard — why]

+
+``` + +## Quality Dimensions + +The artifact should show: + +1. **Components clearly identified** — each module/service has a name and purpose +2. **Connection types visible** — data flow direction and type (sync/async/external) +3. **Boundary markers present** — logical groupings (team, environment, deployment unit) +4. **Evidence of inspection** — what files/configs were reviewed +5. **Recommendation early** — the insight should appear in the first 2000 characters +6. **Next action clear** — what to do with this architecture understanding + +## Mermaid Syntax Tips + +- Use `flowchart TB` (top-bottom) or `flowchart LR` (left-right) depending on diagram shape +- Use `[square brackets]` for rectangular nodes (processes) +- Use `[(cylinder)]` for database nodes +- Use `{diamond}` for decision nodes +- Use `-->|` for arrows with labels +- Use `---` for unlabeled connections +- Use `subgraph name["label"]` for grouping +- Use `classDef` to apply visual styles to node types + +## Validation + +The artifact must: + +1. Have a `
` block with valid Mermaid syntax +2. Pass `audit-artifact.py` at 90+ +3. Render correctly when opened in a browser (Mermaid CDN loaded) +4. Include evidence of what was inspected to build the diagram + +## Related Patterns + +- [04-module-map.md](../04-module-map.md) — Code-level module structure +- [10-process-workflow-flowchart.md](../10-process-workflow-flowchart.md) — Decision-driven workflows +- [09-architecture-diagram.md](../09-architecture-diagram.md) — Non-Mermaid architecture (CSS/SVG) \ No newline at end of file From 422f035c6a6d26231622fdd67dabbc6cb23eb8c8 Mon Sep 17 00:00:00 2001 From: ramsani <97571563+ramsani@users.noreply.github.com> Date: Sat, 16 May 2026 16:26:10 -0700 Subject: [PATCH 2/3] feat: add pattern 24 - Mermaid flowchart --- patterns/24-mermaid-flowchart.md | 84 ++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 patterns/24-mermaid-flowchart.md diff --git a/patterns/24-mermaid-flowchart.md b/patterns/24-mermaid-flowchart.md new file mode 100644 index 0000000..81bd9be --- /dev/null +++ b/patterns/24-mermaid-flowchart.md @@ -0,0 +1,84 @@ +# Pattern: Mermaid Process Flowchart + +## When to Use + +Use this pattern when you need to visualize a process, decision tree, or workflow as a diagram that shows: + +- Sequential steps in a process +- Decision points (yes/no branches) +- Parallel or conditional paths +- Role or system responsible for each step + +Do **not** use this pattern for: +- Static architecture showing components (use Mermaid Architecture Diagram) +- Timeline-based work (use Project Progress Deck) +- Code module relationships (use Module Map) + +## Trigger Phrases + +- "process flowchart" +- "decision tree" +- "workflow diagram" +- "process map" +- "flow diagram" +- "user journey" + +## Artifact Structure + +```html + + + +
+

Process: [Process Name]

+

Pattern: 24-mermaid-flowchart | Purpose: [intended use]

+
+ +
+flowchart TD + A([Start]) --> B{Decision: Is condition met?} + B -->|Yes| C[Action 1] + B -->|No| D[Action 2] + C --> E{Another decision?} + E -->|Continue| F[Action 3] + E -->|Stop| G([End]) + F --> G + D --> G +
+ +
+

What I checked

+ +
+ +
+

Key insight

+

[What the process enables and where the risks are]

+
+ +
+

Next action

+

[What to do with this process understanding]

+
+``` + +## Mermaid Syntax Tips + +- `flowchart TD` for top-down, `LR` for left-right, `BT` for bottom-top +- Use `{text}` for decision diamonds +- Use `-->|` for labeled edges (arrows with text on the branch) +- Use `([text])` for stadium/rounded nodes (start/end) +- Use `[(text)]` for cylinder (database) + +## Validation + +1. `
` with valid syntax +2. Passes `audit-artifact.py` at 90+ +3. Includes evidence of process inspection + +## Related Patterns + +- [10-process-workflow-flowchart.md](../10-process-workflow-flowchart.md) — CSS/SVG flowchart alternative +- [23-mermaid-architecture.md](../23-mermaid-architecture.md) — System architecture with Mermaid \ No newline at end of file From 7cae54e2c38b78e174355a1f40f6490cb8271189 Mon Sep 17 00:00:00 2001 From: ramsani <97571563+ramsani@users.noreply.github.com> Date: Sat, 16 May 2026 16:26:12 -0700 Subject: [PATCH 3/3] feat: add pattern 25 - Chart.js dashboard --- patterns/25-chart-dashboard.md | 118 +++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 patterns/25-chart-dashboard.md diff --git a/patterns/25-chart-dashboard.md b/patterns/25-chart-dashboard.md new file mode 100644 index 0000000..65346f0 --- /dev/null +++ b/patterns/25-chart-dashboard.md @@ -0,0 +1,118 @@ +# Pattern: Chart.js Data Dashboard + +## When to Use + +Use this pattern when you need to display data-driven visualizations that communicate: + +- Comparative metrics across options, features, or entities +- Numeric scores with visual weight (bar charts, radar) +- Distribution or composition data (what proportion of what) +- Progress or completion metrics with visual clarity + +Do **not** use this pattern for: +- Non-numeric comparisons (use Decision Deck) +- Architecture or process diagrams (use Mermaid patterns) +- Static information displays (use standard HTML tables) + +## Trigger Phrases + +- "dashboard" +- "data visualization" +- "chart" +- "comparison chart" +- "score comparison" +- "metric comparison" +- "radar chart" +- "bar chart" + +## Artifact Structure + +```html + + +
+

Dashboard: [Topic]

+

Pattern: 25-chart-dashboard | Data sources: [what was used]

+
+ + + +
+

[Chart Title]

+
+ +
+
+ + + +
+

What I checked

+
    +
  • [What data sources or evidence were used]
  • +
+
+ +
+

Insight

+

[What the data shows and what to do with it]

+
+ +
+ +
+``` + +## Chart.js Chart Types + +| Type | Use when | Key config | +|------|----------|-----------| +| bar | Comparing numeric scores | `labels`, `datasets[].data` | +| line | Showing trends over time | `labels` = time periods, `datasets[].data` | +| radar | Multi-dimensional comparison | Same as bar, circular layout | +| doughnut | Showing composition/proportions | `datasets[].data` as proportions | + +## Data Validation + +The artifact must include valid Chart.js config: +- `labels`: array of strings +- `datasets`: array with at least one entry containing `data` (array of numbers) +- `type`: one of 'bar', 'line', 'radar', 'doughnut', 'pie', 'scatter' + +## Validation + +1. Passes `audit-artifact.py` at 90+ +2. Includes `` with valid Chart.js config +3. Export button copies chart data as JSON +4. Includes evidence of what data was used + +## Related Patterns + +- [14-research-comparison-map.md](../14-research-comparison-map.md) — Non-chart comparison +- [11-technical-decision-deck.md](../11-technical-decision-deck.md) — Decision with scores \ No newline at end of file