c4-design
Skill1 starsChanged 32 days agoApache-2.0View on GitHub
Orchestrator skill. Turns an approved implementation plan into a contract-first C4 design in the code graph - components, service classes, classes, interfaces, config and utility classes with HAS/DEPENDS/IMPLEMENTS/CALLS edges - plus the project's EVAL catalog, then locks the design. Use right after the user approves the project plan, or when an accepted ADR adds components or classes.
In this repository4 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/llms.txtllms.txt
- code-graphSkill
- orchestrate-cycleSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Write <project>/design/c4_design.md (for humans.
- Very specific: line 14
Write <project>/design/c4_seed.json (for the graph.
- Distinctive: line 15
Contract first: Before any code exists, every cross-class call has a CALLS edge with an exact signature and purpose, and every extension …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
C4 design → code graph
Prerequisite: the user approved the implementation plan. This skill turns that plan into nodes and contracts that coder agents can build in parallel without rewrites.
Steps
- Set up the graph (once per project):
python code_graph_tool/cg.py install <project_dir>(workspace copy). After that, always use<project_dir>/code_graph/cg.py. - Decompose, following reference/decomposition-guide.md:
- Write
<project>/design/c4_design.md(for humans; template in the guide). - Write
<project>/design/c4_seed.json(for the graph; format in.claude/skills/code-graph/reference/seed-format.md).
- Write
- Contract first. Before any code exists, every cross-class call has a CALLS edge with an exact signature and purpose, and every extension point is an INTERFACE with IMPLEMENTS edges for the planned implementations.
- Import and verify:
cg import design/c4_seed.json --actor orchestrator, thencg check. The design must have zero ERRORs; resolve G03/G04 WARNs unless they are deliberate. - EVALs:
cg eval import .claude/skills/c4-design/reference/baseline-evals.json, then add project-specific EVALs using reference/eval-authoring.md: business invariants, the extensibility claims, and the non-functional requirements. - Review with the user in the UI (
cg serve). Get approval, then runcg design lock --actor orchestrator. - Hand over to the
orchestrate-cycleskill.
Design bar
- Platform first: reusable PLATFORM components expose extension points, and USECASE components only plug into them. PLATFORM never depends on USECASE.
- Extensible without over-engineering: add an abstraction only at an extension point the requirement anticipates.
- Small nodes: aim for one responsibility per class and complexity ≤ 7.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

