c4doc

c4doc is a skill for Claude Code, Codex from stefanrossmeier/ai-craftkit. It costs 46 tokens per session (2,782 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

Written for no agent in particular: nothing here depends on one.

Good fit Use it to create or refresh architecture views, component relationships, and runtime flows for a software repository.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/stefanrossmeier/ai-craftkit/c4doc
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.

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/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for c4doc

Your own site · 80×15
<a href="https://agentmods.dev/skills/stefanrossmeier/ai-craftkit/c4doc"><img src="https://agentmods.dev/badge/skills/stefanrossmeier/ai-craftkit/c4doc.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,782 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00046 $0.02782
Opus 5.5 $0.00018 $0.01113
Sonnet 5.5 $0.00009 $0.00556
Haiku 4.5 $0.00005 $0.00278

Measured 1mo ago against content hash 90bdc8b8aedc, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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 · 529 lines

How it starts

The opening of the file, as written. The whole thing — 529 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 · 529 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. 1mo ago Changed · +6 lines · +46 tokens per session 90bdc8b8aedc
  2. 2mo 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 4d ago), licensed Apache-2.0. It adds 46 tokens to every session and 2,782 once invoked, about $0.0002 per session on Opus 5.5. 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

c4doc compared with skills from other repositories

c4doc next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
c4docstefanrossmeier/ai-craftkitSkill54d agoApache-2.0A46Claude Code, Codex
architecture-decision-record-maintainer-skillarchitecture-decision-record/architecture-decision-recordSkill17k8d agononeA92Claude Code, Codex
architecture-decision-record-skillarchitecture-decision-record/architecture-decision-recordSkill17k8d agononeA108Claude Code, Codex
atlas-adrtonone-ai/tononeSkill7723d agoMITA51Claude Code
bootstrapEvolveHQ/docflowSkill1615d agoMITA114Claude Code, Codex
agent-waveEvolveHQ/docflowSkill1615d agoMITA82Claude Code, Codex
new-planEvolveHQ/docflowSkill1615d agoMITA118Claude Code, Codex