plugins/doc-master/skills/c4-model/SKILL.md
This skill should be used to create or update a C4 architecture diagram alongside an ADR, especially in LikeC4. PROACTIVELY activate on "add a C4 diagram", "create a context diagram", "container view", "LikeC4 model", "draw the architecture", "diagram this decision", "architecture diagram for the ADR", "visualize the components", "C4 view", or "Simon Brown C4." Provides: canonical-C4 Context and Container views from confirmed elements, relationship descriptions, and strict refusal of non-canonical diagram types.
npx skillsauth add JosiahSiegel/claude-plugin-marketplace c4-modelInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Produces a canonical-C4 LikeC4 model — Context and Container views by default, Deployment optional. Refuses every LikeC4 feature that would push the diagram beyond Simon Brown's canonical C4. The canonical-C4 features used here are stable across LikeC4 versions; re-validate with npx likec4 validate to confirm against your installed version.
model.c4 file containing the specification + the model<system>.c4 file scoped to the single system in focusviews.c4 file with one Context view and one Container view (optionally one Deployment view)likec4.config.js file| Refused thing | Why | Architect alternative |
|---|---|---|
| Component views | "Component views belong at a deeper level than ADRs work at." | Use a code-level diagram tool (e.g., Mermaid in source) — outside C4. |
| Dynamic views | Sequence/runtime flows are not canonical C4. | Use a sequence diagram tool separately. |
| Custom element kinds | Canonical C4 has Person / Software System / Container — period. | Use container and put the type in the technology attribute. |
| Custom relationship kinds | Canonical relationships: uses, reads, writes, publishes, consumes. | Pick the closest canonical kind. |
| Custom styles | Diagram should look recognizably C4. | If styling matters more than canonicality, use LikeC4 directly outside this skill. |
| Nested systems | C4 has Context and Container; nesting systems-in-systems muddies the levels. | Split into separate models. |
| Multiple systems in focus | One system per .c4 file is canonical. | Make separate models for each, link via externalSystem. |
The refusals are the point. An architect who wants full LikeC4 freedom should not use this skill.
system definition per .c4 file.Use this specification block verbatim. Do not edit, extend, or rename.
specification {
element actor {
style {
shape person
}
}
element externalSystem {
style {
color secondary
}
}
element system
element container
relationship uses
relationship reads
relationship writes
relationship publishes
relationship consumes
tag open-question {
style {
color red
border dashed
}
}
}
For elements or relationships that exist but have unresolved details:
#open-questionOPEN Q<N>: matching the entry number in docs/architecture/open-questions.mdExample:
container payments-service "Payments Service" "OPEN Q7: tech stack unconfirmed" {
#open-question
}
If docs/architecture/discovery-brief.md exists with CONFIRMED elements, use it directly — do not re-ask. Otherwise walk the architect through each element one at a time (one question per turn, same discipline as adr-discovery).
Glob **/*.c4 and **/likec4.config.*. Two cases:
model.c4, <system>.c4, views.c4, likec4.config.js at the architect's chosen path (default likec4/ at the repo root).Three blocks in model.c4:
system block. See references/likec4-dsl-cheatsheet.md.views.c4: one context view (the system + its actors + external systems), one container view (containers inside the system), optionally one deployment view.Before validation, run the 11-item checklist:
| # | Check |
|---|---|
| 1 | Exactly one system definition. |
| 2 | All containers nested inside that one system. |
| 3 | All actors at top level (not inside the system). |
| 4 | All external systems at top level. |
| 5 | Every relationship has a non-empty description. |
| 6 | No relationship kinds outside the canonical five. |
| 7 | No element kinds beyond actor, externalSystem, system, container. |
| 8 | No nested systems. |
| 9 | No views beyond context, container, deployment. |
| 10 | Specification block matches the locked block verbatim. |
| 11 | No #open-question tagged element lacks a OPEN Q<N>: description prefix. |
Print PASS or FAIL with a numbered list of violations. Do not proceed on FAIL.
Render the proposed file changes as a diff, hunk by hunk. Per-hunk approval. Do not write files until the architect approves.
Run npx likec4 validate. If validation fails, surface the error to the architect — do not auto-fix.
Tell the architect how to view the diagram. Do not start a server uninvited.
To view: npx likec4 start # interactive browser at http://localhost:5173
To serve: npx likec4 serve # static export
Glob ADR directories (docs/adr/, docs/decisions/, docs/architecture/decisions/, **/adr/*.md; also check legacy architecture/decisions/). For each ADR, compare component names mentioned in the text against names in the LikeC4 model. Report name mismatches as drift candidates — let the architect choose which side is canonical. Do not auto-rename either side.
For complex DSL questions (scoped views, extend, deployment specs), consult references/likec4-dsl-cheatsheet.md. For features that fall outside canonical C4, refer the architect to the upstream LikeC4 documentation rather than implementing them in this skill.
references/likec4-dsl-cheatsheet.md — minimal cheat-sheet of canonical-C4 LikeC4 DSLreferences/canonical-c4-refusals.md — verbatim refusal scripts for the disallowed featuresadr-discovery skill — upstream source of confirmed elements and relationshipsadr-critique skill — downstream consumer for drift detection against ADRsdevelopment
This skill should be used when the user asks to train, debug, scale, or improve ML models. PROACTIVELY activate for: (1) PyTorch, TensorFlow/Keras, JAX, Flax, Hugging Face Trainer/Accelerate training loops, (2) distributed training, DDP/FSDP/DeepSpeed, TPU/GPU setup, (3) mixed precision AMP/bf16, gradient accumulation, checkpointing, seeding, (4) overfitting, imbalance, loss functions, regularization, LR schedules, warmup, (5) memory optimization, gradient checkpointing, offloading, quantization-aware training. Provides: reproducible training best practices across deep learning and classical ML.
development
This skill should be used when the user asks to productionize, track, version, govern, monitor, or automate ML systems. PROACTIVELY activate for: (1) MLflow, Weights & Biases, Neptune, Comet, ClearML experiment tracking, (2) model registry, model versioning, artifact lineage, reproducibility, (3) Kubeflow, SageMaker Pipelines, Vertex AI Pipelines, Azure ML pipelines, Databricks workflows, (4) CI/CD, continuous training/evaluation, A/B tests, canary/shadow deployments, (5) drift detection, model monitoring, data validation, responsible AI governance. Provides: end-to-end MLOps architecture and operational safeguards.
development
This skill should be used when the user asks to optimize, export, serve, compress, or accelerate ML inference. PROACTIVELY activate for: (1) latency, throughput, p95/p99, batching, concurrency, KV cache, memory, or cost issues, (2) quantization INT8/INT4, GPTQ, AWQ, bitsandbytes, pruning, sparsity, distillation, (3) ONNX export, ONNX Runtime, TensorRT, TorchScript, torch.compile, XLA, OpenVINO, Core ML, TFLite, (4) Triton, TorchServe, TF Serving, BentoML, Seldon, KServe configuration, (5) edge deployment, CPU/GPU/TPU/Inferentia serving. Provides: hardware-aware inference optimization and safe benchmarking.
testing
This skill should be used when the user asks to tune hyperparameters, run sweeps, optimize search spaces, or use AutoML. PROACTIVELY activate for: (1) Optuna, Ray Tune, FLAML, AutoGluon, Hyperopt, Nevergrad, KerasTuner, W&B sweeps, (2) grid search, random search, Bayesian optimization, TPE, Gaussian processes, evolutionary search, (3) ASHA, Hyperband, successive halving, multi-fidelity optimization, population-based training, (4) learning-rate finder, batch-size search, early stopping, pruning, (5) reproducible sweep design and experiment analysis. Provides: budget-aware hyperparameter search strategy.