design
Recipe card from the charly-internals plugin (Development — contributor internals).
This card has additional detail pages:
design — conforming to DESIGN.md and DESIGN.cue (R11)
Section titled “design — conforming to DESIGN.md and DESIGN.cue (R11)”Overview
Section titled “Overview”DESIGN.md is the normative architecture of OpenCharly, and DESIGN.cue is its schema. Together
they say what must be true when the work is done: the laws, the mechanisms, the vocabulary, the
data shapes every repo shares and the requirements that govern each area. The umbrella rulebook
makes following them the ground-truth rule R11 (AGENTS.md). This skill is the how.
The rule is a ratchet:
- Conform to what you touch. A change conforms to every DESIGN requirement it touches. R11 is conformance, not negotiation: a planned change the design does not permit is redesigned until it does.
- Never widen the gap. A change never moves code, config or documentation further from DESIGN.
- Never fit the design to the code. The design is not edited to accommodate an implementation, and an implementation cutover carries no design change. DESIGN states the deviation process itself (its header: “with operator sign-off”; Appendix A.6): a design change whose decision is needed is the operator’s cutover — put to them and STOPPED on, never declared by the change.
- Debt is filed, not a block. Existing non-conforming code that a change does not touch is design debt. It is recorded and filed, and it does not block the change.
Authority — which text decides
Section titled “Authority — which text decides”| Surface | What it is | When two disagree |
|---|---|---|
DESIGN.md |
the design, normative; every requirement has a stable id D-<AREA>-<n> and every sentence of a requirement is binding |
it states each rule once; other places cite its id |
DESIGN.cue |
the schema of DESIGN.md, the single copy of every target shape (authoring schema, user configuration, core↔plugin protocol) | the design check (below) fails on any prose ↔ CUE disagreement, so neither side “wins”: the disagreement is a defect to fix in the change that finds it |
spec’s CUE packages and each plugin’s CUE module |
where a DESIGN.cue definition lives once it is implemented (DESIGN §10.2, A.1) | code that diverges from DESIGN is a defect (DESIGN header); fix the code. The design is not edited to match it — a deviation is the operator’s decision |
design/ |
the design check’s inputs: examples, negative cases, the capability ledger, the baselines | generated and checked by the scripts of DESIGN Appendix A |
DESIGN is a target architecture. Much of the current code predates it, and the capability
ledger (design/dulling.tsv, rendered as design/dulling-disposition.md) records how each current
capability maps onto the target. “The code does it differently today” is therefore not a reason to
diverge. It is the gap the ratchet closes, one touched area at a time.
Before you design anything
Section titled “Before you design anything”-
Grep the contract first. Before adding a field, a shape, a kind, a verb, a capability or a mechanism, search
DESIGN.mdandDESIGN.cuefor it, and read the row that governs the area:Terminal window grep -n '<word>' DESIGN.md DESIGN.cuegrep -n '^| D-<AREA>-' DESIGN.md # the area's requirement table -
Find its mechanism. Every capability is an instance of exactly one mechanism of DESIGN §1.1 (M1–M8). A new engine, hypervisor, cluster tool, recorder or application is a ROW of a mechanism, never a new kind, verb, command group or plugin (D-LAW-8). If nothing fits, the change is redesigned until it is a row of an existing mechanism; it never invents a parallel one, and it never edits the design to create one — if the design genuinely has no row for it, that is a STOP put to the operator.
-
Judge the proposal by P1–P4 (DESIGN §1): mechanism not instance, one term for many instances, derived not authored, no foreign concept. A proposal that needs an exception to one of them is redesigned, not amended.
-
Spike the candidate shapes before writing code against one (R12). When the change answers a cause, every plausible shape for it is spiked; a risky shape gets the schema spike — the def compiles, the generated type round-trips, the gate accepts and rejects as intended. The round’s form is
/charly-internals:strict-policy(“Spike-first”). The winning candidate does not go straight to code: it goes to the plan conformance pass below.
The plan conformance pass (after the spike, before the first implementation edit)
Section titled “The plan conformance pass (after the spike, before the first implementation edit)”R11 fires twice, and the first pass is the one that keeps a plan honest: once R12’s round has
named its winning candidate and before the first implementation edit, and again over the diff
before the push. Every planned change is validated against DESIGN.md, DESIGN.cue and
design/ before the first implementation edit. The first pass produces a map — one row per
planned change — and that map is the draft of the PR body’s ## Rulebook compliance, so the second
pass reads the same artifact back against the diff instead of writing a fresh story about it.
The grain is the change, not the file. One row for each field, shape, kind, verb, capability, mechanism, dependency or config key, and emitted artifact the plan touches. The file table is a different claim, and it belongs with the body’s evidence.
Per row, settle two things — the second is the one R11 exists for.
| Column | What it holds |
|---|---|
| the planned change | what will exist afterwards, in the design’s own vocabulary — a mechanism row (M1–M8), a kind:, a verb:, a capability type, a CUE definition, a config key, a Containerfile section or an ai.opencharly.* label |
| its DESIGN requirement, and that it CONFORMS | the D-<AREA>-<n> (or §) in DESIGN.md, the definition in DESIGN.cue, or the design/ entry that governs it — found with the grep above, never recalled from memory — and the sentence of it the change satisfies. A row that cannot name that sentence is not conforming |
The map’s disposition set is exactly conforms and debt filed #<n> (a separable pre-existing gap
the change does not widen). There is no third value: amending the design is not a disposition of
a planned change.
A row with no governing requirement stops the pass. There are exactly two outcomes, and “implement it anyway” is neither: the planned change is a row of a mechanism DESIGN §1.1 already has (find its row and cite it), or the change is redesigned until it is. The design is never edited to fit the implementation — a deviation is the operator’s decision and its amendment is its own cutover (DESIGN header, A.6), so the pass ENDS there and the question goes to the operator. An implementation plan that reaches for a design edit has a wrong plan, not a wrong design.
A new capability path owes a ledger row. design/dulling-admission.tsv (DESIGN A.8) records,
per way a new capability can enter — a kind, a verb, an operation, a driver row, a capability
type, a stage — whether that path can be taken without changing the design. If the plan adds one,
that row is part of the plan: its guideline is the governing D-id and its
can_add_without_amending is the answer this pass has just given. scripts/design-ledger.sh
demands the row later whether or not the pass named it.
The map is checked, so it has one shape. marketplace/scripts/pr_body_lint.py refuses a body
whose ## Rulebook compliance carries no ### Plan conformance block, whose rows leave the
disposition set, whose debt filed row names no issue (or one absent from ## Filed issues), or
whose **Winning candidate:** line is missing. scripts/check-pr-body-diff.mjs refuses a
DESIGN-surface diff whose block claims conformance — the same diff cannot both edit the design and
claim to conform to it — and a design-change declaration whose diff changes no design surface. A
change that touches no governed surface — a typo, a comment, prose only — says so in one line
instead of the table:
### Plan conformanceNo DESIGN-governed surface — <reason>What the pass is not. It is not the design check (bash scripts/design-check.sh judges the
committed tree, mechanically, after the fact), not the spike (R12 decides which candidate works;
this pass decides whether the winner may be built at all), and not a substitute for R10. And it
proves the map is complete and consistent — never that it was written before the first edit: the
ordering evidence is that its **Winning candidate:** and the ### Spike block’s **Winner:**
name the same candidate, and the validator cross-checks them.
The two dispositions a planned change can have
Section titled “The two dispositions a planned change can have”The dispositions are settled at PLAN time and re-read against the diff (the pass above); this table
is the vocabulary both passes use. For each D-id the change touches, the PR body’s
## Rulebook compliance states one of these:
| Disposition | Meaning | Evidence |
|---|---|---|
| conforms | the changed code does what the cited requirement says | the D-id and the line or behaviour that satisfies it |
| debt filed | the touched area still diverges in a way this change does not widen, and the gap is separable | the issue number, under ## Filed issues (R1 file it) |
A change that widens a gap has no legal disposition. Redesign it. And there is no
amends DESIGN disposition: a design change is not something an implementation declares about
itself.
When the plan does not conform
Section titled “When the plan does not conform”This is the STOP, and it is deliberately short. If a planned change cannot be made to conform:
- Redesign it. Almost every mismatch is a plan that reached for a new mechanism where an existing row already does the job (DESIGN §1.1). Find the row.
- If it still does not conform, stop and put it to the operator. A deviation is the operator’s
decision — DESIGN’s own header says a deviation is settled “with operator sign-off”, and A.6
makes the amendment its own cutover (
DESIGN.cuefirst, then examples, then prose, then the design check), never a paragraph bolted onto an implementation PR.
What an agent never does: edit DESIGN.md, DESIGN.cue or design/ to make its own plan legal,
write a Design change declaration to get past the gate, or treat “the design is wrong” as a
finding it may act on. A design-change cutover exists, it is the operator’s, and it is gated:
every change to DESIGN.md, DESIGN.cue or design/ requires a maintainer sign-off — a PR
comment from a maintainer-set account (AGENTS.md Part II #7), which an agent never posts on its
own initiative — and the design-check output on the final tree. The Design change — <reason>
block form the linter accepts is for exactly that cutover and for nothing else. An implementation
that reaches for it has the wrong plan.
The design check
Section titled “The design check”bash scripts/design-check.sh # or: ./charly/bin/charly task design-checkIt runs, in order, the pinned CUE toolchain, DESIGN.md ↔ DESIGN.cue consistency, the examples and
their negatives, the capability ledger, the citation control and the schema-pattern gate (DESIGN
Appendix A.2). It stops at the first failure. The umbrella’s pre-push hook
runs it for every push whose commits touch one of the surfaces it reads. That surface set is defined
once, in scripts/design-gate-inputs.sh. What each control proves, and the files it reads, are in
DESIGN Appendix A. This skill points there and never copies it.
How R11 meets the other rules
Section titled “How R11 meets the other rules”The R-rules and the D-laws are two statements of one obligation. Neither replaces the other, and a
change is judged against both. The crosswalk is in references/crosswalk.md.
Cross-References
Section titled “Cross-References”AGENTS.mdR11 — the mandate this skill operationalizes./charly-internals:go— the SDD pipeline (CUE first, generated Go) that implements D-LAW-4./charly-internals:plugin— placement: core, sdk or plugin (D-LAW-3, DESIGN §3.1)./charly-internals:strict-policy— R1–R5, whose D-law twins are in the crosswalk./charly-internals:cutover-policy— a change is one cutover; a design change is the operator’s own, never folded into an implementation.
When to Use This Skill
Section titled “When to Use This Skill”Invoke before adding or reshaping any field, shape, kind, verb, capability or mechanism; after a
spike round has named its winning candidate and before the first implementation edit (the plan
conformance pass); before editing DESIGN.md, DESIGN.cue or design/; when a change must cite
the D-ids it touches; and whenever the design check fails.

