bsene/skills

c4-diagram

Generates C4 model architecture diagrams using Structurizr DSL (primary) or Mermaid C4 (fallback).

Ver código fuente
Documento original del Skill

Contenido del repositorio de origen con títulos, ejemplos, código, tablas, enlaces e imágenes preservados.

C4 Diagram

Workflow

  1. Pick the C4 level — match diagram depth to the question (see table below)
  2. Choose the tool — Structurizr DSL by default; Mermaid for quick inline previews (see table below)
  3. Generate the diagram — follow Diagram Rules, then the DSL reference for the chosen tool
  4. Render — follow the Rendering fallback chain

C4 Level Selector

Question typeC4 levelStructurizr view type
"Show the whole organisation / all systems"Supporting — System LandscapesystemLandscape (no Mermaid equivalent)
"What does this system do?" / "Who uses it?"Level 1 — ContextsystemContext
"What are the main services/apps/databases?"Level 2 — Containercontainer
"How is this service structured internally?"Level 3 — Componentcomponent
"How does this specific class/module work?"Level 4 — CodeNo diagram — Level 4 has no C4 diagram equivalent

Default to Level 2 (Container) — it covers most "show me the architecture" requests. Level 1 for stakeholder overviews, Level 3 for deep dives into a single service.

Tool Selector

NeedUse
Quick inline preview in chatMermaid → references/c4-mermaid.md
Export PNG/SVG for docs/wikiStructurizr → references/c4-structurizr.md
Multiple views from one modelStructurizr
Organisation-wide system landscapeStructurizr (no Mermaid C4 equivalent)
Dynamic / numbered interaction flowEither (C4Dynamic or Structurizr dynamic)
Deployment / infrastructure viewStructurizr (Mermaid C4Deployment is limited)
Class/method level detail (Level 4)Mermaid classDiagram — no Structurizr equivalent
No tooling availableMermaid

Default to Structurizr DSL unless the user explicitly wants a quick Mermaid preview.

Diagram Rules

  • Every element must have: name, type (Person/System/Container/Component), and brief description
  • Containers and components must state their technology (e.g. "Node.js Express", "PostgreSQL")
  • Every relationship must be labeled with action + protocol (e.g. "Reads events via gRPC", not just "Uses")
  • Mark external systems/people with tags "External" in the model
  • Boundaries are implicit: systemContext and container views auto-scope. Use group for logical sub-groupings within a boundary
  • Keep diagrams under ~12 elements — split into multiple diagrams if larger

Rendering

Run in order, stop at first success. Native svg/png export does not exist in the Structurizr CLI — always export to PlantUML/Mermaid/D2 first, then render with that tool.

  1. CLI available (binary is structurizr.sh from local install / Docker, or structurizr-cli from Homebrew/Scoop) — save DSL to /tmp/<name>.dsl, then:
bash
   structurizr.sh export -workspace /tmp/<name>.dsl -format plantuml -output /tmp/structurizr-out/
   # render the .puml to SVG/PNG with `plantuml /tmp/structurizr-out/*.puml`

Share output path with user.

  1. Docker available — save DSL to /tmp/<name>.dsl, give user:
bash
   # Active replacement (recommended):
   docker run -it --rm -p 8080:8080 -v /tmp:/usr/local/structurizr structurizr/structurizr local
   # Legacy (archived but functional):
   docker run -it --rm -p 8080:8080 -v /tmp:/usr/local/structurizr structurizr/lite

Point to http://localhost:8080.

  1. Neither — output DSL as a dsl code block. Note: paste at https://playground.structurizr.com/ to render online.

→ Structurizr DSL syntax: references/c4-structurizr.md → Mermaid C4 syntax: references/c4-mermaid.md


Benchmark

Scenario: .benchmarks/scenarios/c4-diagram-001-container-view.md · Run: 2026-08-31 · Log: .benchmarks/runs/2026-08-31/c4-diagram-001-container-view.json

ModelWithoutWithDelta
claude-opus-4-867%100%+33%
claude-sonnet-4-6100%100%+0%
claude-haiku-4-5100%100%+0%
PASS (run 2026-08-31). Opus +33 (67→100); sonnet/haiku already at ceiling. No regressions. Gate per .agents/skills/skill-optimizer/rules/release-gates.md.
del mismo repositorio

Más Skills

Todos los Skills
bsene
Comunidad

clean-code

Use when writing new code, naming modules/files/functions/classes/variables, reviewing or refactoring code for readability, assessing/reducing complexity, deciding whether an abstraction belongs, or reviewing with CUPID. For behavior-preserving refactors within a function, class, or file, route to the refactoring/ sub-skill. Trigger on requests like "name this function", "is this a good variable name", "review this for clean code", "reduce complexity", "should I add a comment here", "should I abstract this", "review with CUPID", "code smell", "extract method", or "refactor this class". Covers human-scale design, naming, complexity budgets, comments, CUPID, and in-place refactoring. Pairs with language-specific skills (typescript, go, clojurescript) for syntax/idiom concerns.

instalaciones
1
GitHub Stars
5
Actualizado
21 sept
bsene
Comunidad

clojurescript

Write, review, debug, and configure ClojureScript code and projects. Use this whenever the user mentions ClojureScript, .cljs/.cljc files, shadow-cljs, figwheel, the CLJS compiler, JS interop from Clojure, Reagent/re-frame/Reagent-style UI code, or asks to convert JS/TS logic into ClojureScript. Also use it for questions about CLJS compiler options (:optimizations, :main, :npm-deps, :externs, etc.), consuming JS/npm libraries from CLJS, source maps, Google Closure Library usage, or the newer ^:async/await function support. Also trigger for CLJS recursion/stack-overflow/trampoline questions. Trigger even if the user just pastes CLJS code with an error and asks "what's wrong here" or asks to set up a new CLJS project. Do NOT use for nbb (babashka/nbb) scripts, nbb.edn projects, or anything meant to run via nbb script.cljs/npx nbb — those have a different (SCI-interpreted, no-Closure-Compiler) language surface; those are out of scope for this skill — consult nbb's own documentation.

instalaciones
1
GitHub Stars
5
Actualizado
21 sept
bsene
Comunidad

communication

Analyze a real communication artifact (Slack/Teams message, email, meeting transcript, pitch or presentation draft, CV, or resume) and coach it sharper using seven rhetoric + structure techniques: ethos/logos/pathos, reframing tough questions, centering the other person, the Pyramid Principle, pattern interrupt, making ideas feel safe, and the cognitive-load through-line. Diagnose what works, what's missing, then rewrite. TRIGGER when: user wants to improve communication, "review my email/Slack/CV", "analyze this transcript", prep for a meeting/pitch/presentation, "how do I say this", be more persuasive/assertive, handle a tough question, talk to execs, "is this too long-winded". Also trigger for author style presets under references/authors/: DHH (blunt/direct), Uncle Bob (defend a quality/testing standard), Jessitron (reflective systems-thinking essay), Martin Fowler (measured mixed-feelings stance). DO NOT USE for raw text generation with no analysis, marketing/copywriting, translation, or code/docs.

instalaciones
1
GitHub Stars
5
Actualizado
21 sept
bsene
Comunidad

dantotsu

Use this skill when the user wants to investigate a bug, defect, incident, or quality issue and find its root cause — including requests to run a "5 whys" analysis, write a postmortem, do a root-cause analysis (RCA), figure out why a bug reached production or slipped past code review/QA, set up a recurring defect-analysis routine, or run a daily/weekly quality-improvement (Kaizen) triage. Also known as the Dantotsu method (Sadao Nomura's Toyota-derived defect-analysis approach, adapted for software). Trigger even if the user doesn't name the method explicitly — e.g. "why did this bug get through code review", "a client reported a bug, help me analyze it", "I want to understand why this keeps happening", "write up a root cause report for this defect", or "help me prioritize which fixes to actually ship this week".

instalaciones
1
GitHub Stars
5
Actualizado
21 sept