c4doc

c4doc is a skill for Claude Code, Codex from stefanrossmeier/ai-craftkit. It costs 0 tokens per session (2,722 once invoked), scanned A, original, Apache-2.0.

A guide for documenting a software system's architecture using the C4 model, which describes systems at different levels of detail. It creates Markdown files with Mermaid diagrams that can render on GitHub.

In plain words
What is it for?
Use it to create or refresh architecture views, component relationships, and runtime flows for a software repository.
Why use it?
It helps developers understand how a repository is organised and how its parts interact without forcing every project into unnecessary diagrams.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/stefanrossmeier/ai-craftkit/c4doc
Any agent
npx skills add stefanrossmeier/ai-craftkit --skill c4doc
Clone the repo
git clone --depth 1 https://github.com/stefanrossmeier/ai-craftkit

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for c4doc

README.md
[![agentmods](https://agentmods.dev/badge/skills/stefanrossmeier/ai-craftkit/c4doc.svg)](https://agentmods.dev/skills/stefanrossmeier/ai-craftkit/c4doc)
Your own site
<a href="https://agentmods.dev/skills/stefanrossmeier/ai-craftkit/c4doc"><img src="https://agentmods.dev/badge/skills/stefanrossmeier/ai-craftkit/c4doc.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,722 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.02722
Opus 5 $0.00000 $0.01361
Sonnet 5 $0.00000 $0.00544
Haiku 4.5 $0.00000 $0.00272

Measured 4d ago against content hash 8de30693224a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

c4doc scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/c4doc/SKILL.md · 523 lines

How it starts

The opening of the file, as written. The whole thing — 523 lines — stays where its author put it; the contents beside it link to each section on GitHub.

C4 Architecture Documentation Skill

Command: /c4doc

Use this skill when the user calls /c4doc or asks to generate or refresh C4 architecture documentation for the current repository.

Purpose

Use this skill to generate or refresh practical C4-style architecture documentation for a software repository.

The generated documentation must be stored in Markdown files and must use standard Mermaid diagrams that render in GitHub Markdown. Do not use Mermaid C4 syntax. Use ordinary flowchart diagrams for static architecture views and sequenceDiagram only for dynamic runtime flows.

The goal is not to force every repository into every C4 level. The goal is to create the minimum useful architecture documentation set for the repository, with clear diagrams, evidence, assumptions, and review notes.

Slash Command

Use this skill when the user calls:

/c4doc

The skill should inspect the current repository, create or refresh repository-specific C4 architecture documentation, and treat any additional user text as scoping guidance for which systems, views, or areas need attention.

Primary Output Location

Create or update files under the repository being documented:

docs/c4-documentation/

Recommended structure:

docs/c4-documentation/
  index.md
  architecture-model.md
  generation-report.md
  system-context.md
  container.md
  components/
    <container-name>.md
  code/
    <component-name>.md
  deployment/
    <environment-or-platform>.md
  dynamic/
    <use-case>.md

Use stable, lowercase, hyphenated filenames.

Lightweight Provenance Block

Every generated Markdown document must include a small provenance block near the top, directly after the title and before status fields, summary tables, or document metadata.

This applies to generated C4 indexes, architecture models, generation reports, system context views, container views, component views, code views, deployment views, and dynamic views created or updated by this skill.

Read the full file on GitHub · 523 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 523 lines · 0 tokens per session scan A 8de30693224a

Subscribe to this mod's changes

c4doc is a skill published in the GitHub repository stefanrossmeier/ai-craftkit (5 stars, last pushed 28d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 2,722 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

documentation-patterns

Technical documentation patterns for READMEs, ADRs, API docs (OpenAPI 3.1), changelogs, and writing style guides. Use when creating project documentation, writing architecture decisions, documenting APIs, or maintaining changelogs.

yonatangross/orchestkit · 53 tokens

bootstrap

Scaffold or retrofit documentation-led conventions (AGENTS.md, CLAUDE.md, CONVENTIONS.md, ADR catalogue, plan/ queue, agent/ coordination) into a repo. Use when the user asks to "set up conventions", "bootstrap ADRs", "scaffold the documentation-led layout", "add AGENTS.md and a plan queue", or invokes /bootstrap.…

EvolveHQ/docflow · 118 tokens

doc-quality-review

Assess documentation quality across readability, consistency, audience fit, and prose clarity. Produces a scored review with actionable findings. This skill should be used before releases, during doc reviews, or when documentation feels unclear or inconsistent.

NickCrew/Claude-Cortex · 48 tokens

doc-completeness-audit

Audit documentation completeness by mapping what a doc set should cover against what it actually covers. Produces a prioritized gap report by topic, not just by file. This skill should be used after shipping features, before releases, or when users report missing documentation.

NickCrew/Claude-Cortex · 57 tokens

adr-format-structured-madr

This skill should be used when the user asks about "structured MADR", "structured-madr", "frontmatter ADR", "comprehensive ADR", "auditable ADR", or needs guidance on creating ADRs using the Structured MADR format with YAML frontmatter and audit sections.

zircote-plugins/adr · 63 tokens

adr-integration

This skill should be used when the user asks about "ADR integration", "ADR CI/CD", "ADR tooling", "ADR automation", "export ADRs", "ADR documentation site", or needs guidance on integrating ADRs with CI/CD, documentation sites, and other tools.

zircote-plugins/adr · 59 tokens