@ericrisco/rsc 1.0.33 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/manifest.json +45 -2
- package/package.json +1 -1
- package/scripts/doctor.js +5 -0
- package/scripts/lib/design-identity.js +117 -0
- package/scripts/lib/domains.js +1 -1
- package/scripts/lib/recommend.js +2 -0
- package/skills/animate/SKILL.md +623 -0
- package/skills/design/SKILL.md +2 -1
- package/skills/design-dna/PROMPT.md +211 -0
- package/skills/design-dna/SKILL.md +158 -0
- package/skills/design-dna/design-dna.schema.json +230 -0
- package/skills/design-dna/evals/README.md +64 -0
- package/skills/design-dna/evals/cases.yaml +68 -0
- package/skills/design-dna/references/method.md +436 -0
- package/skills/design-dna/scripts/emit.py +164 -0
- package/skills/design-dna/templates/PROMPT.md.tmpl +42 -0
- package/skills/design-dna/templates/SKILL.md.tmpl +42 -0
- package/skills/design-dna/templates/check.py.tmpl +143 -0
- package/skills/design-eng/SKILL.md +19 -655
- package/skills/design-loop/SKILL.md +152 -0
- package/skills/design-loop/evals/README.md +56 -0
- package/skills/design-loop/evals/cases.yaml +60 -0
- package/skills/review-animations/SKILL.md +51 -0
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
<!-- design-dna: the standalone prompt.
|
|
2
|
+
Paste into any session and attach the winning design. Nothing else is needed.
|
|
3
|
+
Kept verbatim from the source method; edit only if you also edit ../SKILL.md. -->
|
|
4
|
+
|
|
5
|
+
You are a design forensics analyst. I am going to give you one design I love.
|
|
6
|
+
|
|
7
|
+
Your job is not to praise it, describe it, or make something like it. Your job is
|
|
8
|
+
to CODIFY it: reduce it to the smallest set of rules that will reproduce its
|
|
9
|
+
identity on completely different content, forever, across any medium.
|
|
10
|
+
|
|
11
|
+
The output is a reusable skill. Treat the design in front of you as evidence,
|
|
12
|
+
not as a brief.
|
|
13
|
+
|
|
14
|
+
## THE STANDARD YOU ARE HELD TO
|
|
15
|
+
|
|
16
|
+
A specification that cannot fail is not a specification.
|
|
17
|
+
|
|
18
|
+
If every rule you write is one a bad output could still satisfy, you have written
|
|
19
|
+
a mood board. Every rule must be checkable against a finished piece, and capable
|
|
20
|
+
of returning FAIL.
|
|
21
|
+
|
|
22
|
+
## WHAT ACTUALLY CARRIES A DESIGN'S IDENTITY
|
|
23
|
+
|
|
24
|
+
Read this before you start. Getting it wrong is the standard failure.
|
|
25
|
+
|
|
26
|
+
1. RELATIONSHIPS, NOT VALUES. "The headline is 96px" is nearly worthless. "The
|
|
27
|
+
headline is 8x the body, never under 6x" is the identity. Style lives in the
|
|
28
|
+
ratios between elements. A list of measurements is exactly that information
|
|
29
|
+
thrown away.
|
|
30
|
+
2. PROPORTIONS OF COLOUR, NOT JUST COLOUR. The same three hex codes at 60/30/10
|
|
31
|
+
and at 90/8/2 are two unrelated designs. Always record coverage.
|
|
32
|
+
3. ONE BREAK IN THE SYSTEM. Almost every design worth copying has exactly one
|
|
33
|
+
deliberate exception: type crossing an image, a rule overshooting its margin,
|
|
34
|
+
a numeral clipped by the canvas edge. It is the highest-information element
|
|
35
|
+
present and the first thing a mechanical extraction loses, because extraction
|
|
36
|
+
looks for systems and this is a break from the system. Find it. Name it.
|
|
37
|
+
4. REFUSALS, NOT JUST PERMISSIONS. Listing six colours tells a model it may use
|
|
38
|
+
six. If the reference uses one accent on 3% of the canvas, the design's real
|
|
39
|
+
content is a refusal. Write the refusals down.
|
|
40
|
+
5. ABSENCE IS DESIGN. No shadows. No icons. No curves. Nothing centred. Record
|
|
41
|
+
what is missing with the same care as what is present.
|
|
42
|
+
6. STRUCTURE, NOT ONLY STYLING. If a style has no named layouts, output #8 will
|
|
43
|
+
not sit beside output #1 as a set. You get consistent styling and
|
|
44
|
+
inconsistent structure, which reads as sloppiness.
|
|
45
|
+
|
|
46
|
+
## RUN THIS IN SEVEN STEPS. SHOW YOUR WORK AT EACH.
|
|
47
|
+
|
|
48
|
+
### STEP 1 - OBSERVE. Do not interpret.
|
|
49
|
+
|
|
50
|
+
Produce a flat inventory of literal observations. Measure, do not describe.
|
|
51
|
+
|
|
52
|
+
Sample real colours. Estimate what share of the canvas each covers. Count the
|
|
53
|
+
type sizes, the weights, the accent uses. Measure the ratio between largest and
|
|
54
|
+
smallest type. Note margins as a percentage of the canvas, not in pixels. Record
|
|
55
|
+
texture, grain, edges, image treatment. Write down what is absent.
|
|
56
|
+
|
|
57
|
+
No judgements yet. Interpretation here is how you end up specifying a design
|
|
58
|
+
that is not the one in front of you.
|
|
59
|
+
|
|
60
|
+
### STEP 2 - DEBATE IT WITH YOURSELF. Two loops, honestly opposed.
|
|
61
|
+
|
|
62
|
+
LOOP A, THE MAXIMALIST. Argue: anything not written down will be improvised, and
|
|
63
|
+
improvisation is where consistency dies. List every property exhaustively.
|
|
64
|
+
Miss nothing.
|
|
65
|
+
|
|
66
|
+
LOOP B, THE MINIMALIST. Argue: a copy can match every value and still look
|
|
67
|
+
generic. Identity lives in a handful of moves and a wall of refusals. Name the
|
|
68
|
+
3-9 moves that actually carry it, and the bans that keep output off the average.
|
|
69
|
+
Attack Loop A's list. Say which entries are load-bearing and which are trivia.
|
|
70
|
+
|
|
71
|
+
ADJUDICATE. For every property, ask:
|
|
72
|
+
|
|
73
|
+
If I changed this value, would the output stop looking like the reference?
|
|
74
|
+
|
|
75
|
+
Yes, it is load-bearing. No, it is trivia, and trivia dilutes attention.
|
|
76
|
+
|
|
77
|
+
Then resolve the debate the right way, which is NOT a compromise. Both sides are
|
|
78
|
+
correct about different documents:
|
|
79
|
+
|
|
80
|
+
- The EXHAUSTIVE record is for me and for build tools. Any size, because a
|
|
81
|
+
compiler does not sample.
|
|
82
|
+
- The PROMPT PAYLOAD is for a model with a finite attention budget. Hard cap:
|
|
83
|
+
2KB of text. Compliance drops as rules pile up, and material in the middle of
|
|
84
|
+
a long document gets recovered far worse than material at either end.
|
|
85
|
+
|
|
86
|
+
### STEP 3 - CODIFY. Write dna.json.
|
|
87
|
+
|
|
88
|
+
Fill these keys. Omit any that genuinely do not apply.
|
|
89
|
+
|
|
90
|
+
meta name, slug, source files, date, medium of origin,
|
|
91
|
+
not_copied (any real logo, wordmark or licensed image -
|
|
92
|
+
reproduce the SYSTEM, never the MARKS)
|
|
93
|
+
soul one_line (max 160 chars, concrete nouns, no marketing words),
|
|
94
|
+
3-5 adjectives, lineage (Swiss editorial / 90s flyer / brutalist),
|
|
95
|
+
read_distance (thumb | arms-length | desk | room | street),
|
|
96
|
+
energy: density, variance, contrast, warmth - each 1-10
|
|
97
|
+
palette colors[]: role, hex, descriptive name ("dusty plum", never
|
|
98
|
+
"accent-500" - image and video models cannot read token names)
|
|
99
|
+
coverage: percentage of canvas per role, summing to ~100
|
|
100
|
+
banned: colour behaviours forbidden
|
|
101
|
+
type families[]: role, family, REQUIRED fallback, weights, licence risk
|
|
102
|
+
scale: display_to_body_ratio (the typographic signature),
|
|
103
|
+
steps, max_sizes_per_frame
|
|
104
|
+
treatment: tracking, leading, case, measure, numerals
|
|
105
|
+
space grid, margin_pct, gutter_pct, alignment, rhythm,
|
|
106
|
+
negative_space (where the emptiness is and how big),
|
|
107
|
+
safe_area per platform
|
|
108
|
+
USE PERCENTAGES so one spec drives a 1080x1350 carousel and a
|
|
109
|
+
1920x1080 slide without a rewrite
|
|
110
|
+
surface texture (kind, opacity, scale, stacking order), edges, elevation,
|
|
111
|
+
imagery treatment, iconography
|
|
112
|
+
signatures[] 3-9. move (name it like a technique), how (AS A RATIO OR
|
|
113
|
+
RELATIONSHIP), when it appears, never (how it gets used wrong)
|
|
114
|
+
weird_move the single break in the system. Its own key, deliberately.
|
|
115
|
+
archetypes[] named layouts: id, purpose in a sequence, anatomy, content budget
|
|
116
|
+
motion easing curves, durations, entrances, what NEVER moves,
|
|
117
|
+
reduced-motion fallback. Omit for static work.
|
|
118
|
+
voice register, sentence length, headline shape, banned words.
|
|
119
|
+
Copy is part of the design.
|
|
120
|
+
bans[] minimum 5, written as absolutes
|
|
121
|
+
tests[] minimum 8. See Step 4.
|
|
122
|
+
|
|
123
|
+
### STEP 4 - WRITE TESTS THAT CAN FAIL. Eight to twelve.
|
|
124
|
+
|
|
125
|
+
Binary and measurable:
|
|
126
|
+
|
|
127
|
+
- "Accent colour covers under 8% of the canvas."
|
|
128
|
+
- "No more than 3 type sizes in a single frame."
|
|
129
|
+
- "Largest-to-smallest type ratio is above 6:1."
|
|
130
|
+
- "Smallest type is at least 28px at 1080px canvas width."
|
|
131
|
+
- "The weird move is present, exactly once."
|
|
132
|
+
- "Body copy stays under 65 characters per line."
|
|
133
|
+
- "Squint from three metres. Does the mass distribution match the reference?"
|
|
134
|
+
|
|
135
|
+
Not tests: "feels premium", "looks clean". If two people could disagree about
|
|
136
|
+
the answer, it is not a test. Mark which ones a script could decide.
|
|
137
|
+
|
|
138
|
+
### STEP 5 - RECONSTRUCT AND DIFF. Do not skip this.
|
|
139
|
+
|
|
140
|
+
Rebuild the original reference using only dna.json. Close the reference. Work
|
|
141
|
+
from the spec alone.
|
|
142
|
+
|
|
143
|
+
Put your rebuild beside the original. List every single difference.
|
|
144
|
+
|
|
145
|
+
Every difference is a field the spec forgot. Fold each one back in. Record what
|
|
146
|
+
was missing. Go again. Repeat until a stranger could not pick the copy from the
|
|
147
|
+
original.
|
|
148
|
+
|
|
149
|
+
This is the only honest test of completeness that exists. A spec that has never
|
|
150
|
+
been used to rebuild its own source has never been tested. Expect two or three
|
|
151
|
+
passes. Expect the gaps to be things you were sure were obvious.
|
|
152
|
+
|
|
153
|
+
### STEP 6 - EMIT THE SKILL.
|
|
154
|
+
|
|
155
|
+
Write a folder named after meta.slug:
|
|
156
|
+
|
|
157
|
+
<slug>/
|
|
158
|
+
SKILL.md how to use this style
|
|
159
|
+
PROMPT.md the 2KB payload. THIS is what goes in a context window.
|
|
160
|
+
dna.json the full record. NEVER pasted into a prompt.
|
|
161
|
+
reference/ the original, kept forever
|
|
162
|
+
example/ one worked output, the canonical proof
|
|
163
|
+
tools/check.py the automatable tests, exits non-zero on failure
|
|
164
|
+
|
|
165
|
+
PROMPT.md is the file that matters. Order it exactly like this, because
|
|
166
|
+
attention is strongest at the two ends and weakest in the middle:
|
|
167
|
+
|
|
168
|
+
1. The reference image, attached and named first
|
|
169
|
+
2. soul.one_line
|
|
170
|
+
3. The weird move, alone, unmissable
|
|
171
|
+
4. The 3-9 signature moves, as ratios
|
|
172
|
+
5. The bans, as absolutes
|
|
173
|
+
6. Palette and type - roles and coverage only, not a full ramp
|
|
174
|
+
7. Archetype names and when to use each
|
|
175
|
+
8. The self-check, last
|
|
176
|
+
|
|
177
|
+
Nothing else. If it does not change what the output looks like from three metres
|
|
178
|
+
away, it belongs in dna.json, not here. To add a tenth signature you must delete
|
|
179
|
+
one. The cap is the point: it forces you to decide, and an uncapped spec just
|
|
180
|
+
ships your indecision.
|
|
181
|
+
|
|
182
|
+
End PROMPT.md with this line:
|
|
183
|
+
|
|
184
|
+
Before returning any output, run every test in the self-check. Name each test
|
|
185
|
+
and its result. If any fails, repair the output and run them again. Never
|
|
186
|
+
return output with a failing test and a note explaining it away.
|
|
187
|
+
|
|
188
|
+
### STEP 7 - TELL ME WHAT YOU ARE UNSURE ABOUT.
|
|
189
|
+
|
|
190
|
+
List every value you inferred rather than measured, and every rule you are under
|
|
191
|
+
70% confident in. These are where the style will drift first, and I would rather
|
|
192
|
+
know now.
|
|
193
|
+
|
|
194
|
+
## RULES FOR YOU, THE ANALYST
|
|
195
|
+
|
|
196
|
+
- Never invent a value you could measure. If you cannot measure it, say so and
|
|
197
|
+
mark it inferred.
|
|
198
|
+
- Never copy a real logo, wordmark, licensed photograph or proprietary typeface.
|
|
199
|
+
Put them in meta.not_copied and substitute. Reproduce the system, never the
|
|
200
|
+
marks.
|
|
201
|
+
- Descriptive colour names, not systematic ones. "Dusty plum" travels to an
|
|
202
|
+
image model. "accent-500" does not.
|
|
203
|
+
- Every font family needs a fallback. Silent Arial substitution is the most
|
|
204
|
+
common way a reproduction dies quietly.
|
|
205
|
+
- When you are tempted to add a rule because output looks generic, add a ban
|
|
206
|
+
instead. A prohibition steers harder than a permission, and one ban can rule
|
|
207
|
+
out an entire space in a single line.
|
|
208
|
+
- One skill per style. Never merge two identities into one spec. The average of
|
|
209
|
+
two good designs is a bad design.
|
|
210
|
+
|
|
211
|
+
Begin at Step 1. Show your work.
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: design-dna
|
|
3
|
+
description: "Use when a design has won and its look must survive: codify it into a permanent style skill with measured ratios, bans and tests that can fail, then build new pieces in that exact look. Fires on 'turn this into a skill', 'keep the same style', 'my output drifted'. NOT finding the winner (that is `design-loop`), NOT the words (that is `marketing`)."
|
|
4
|
+
tags: [design, style, dna, codify, skill-factory, consistency]
|
|
5
|
+
recommends: [design-loop, design, nextjs, marketing]
|
|
6
|
+
origin: risco
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Design DNA - one beautiful design into a permanent skill
|
|
10
|
+
|
|
11
|
+
*A design loop finds you one beautiful thing. This turns that one thing into a skill you keep forever, so you can make more of it, in any format, without the look drifting.*
|
|
12
|
+
|
|
13
|
+
**Not only about "designs".** The subject is anything that got built: a website, a landing page, a poster, a motion graphic, a carousel, a deck. Same system, same file, same tests. The format is an output, not the subject.
|
|
14
|
+
|
|
15
|
+
## The problem this solves
|
|
16
|
+
|
|
17
|
+
Nobody wrote down **why** the winner was beautiful. Next time you ask for "the same style" you get something close, then something a bit off, then something generic. Every rule you do not write down, the model has to guess, and it does not guess randomly: it guesses the average of everything it has ever seen. That average is what people call slop. Slop is the sound of an unwritten rule.
|
|
18
|
+
|
|
19
|
+
## Two modes
|
|
20
|
+
|
|
21
|
+
| You say | Mode | What happens |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| "codify this", "turn this into a skill", here is the winner | **CAPTURE** | Run the seven steps below. Output: a new style skill folder. |
|
|
24
|
+
| "build X in <style>", "another one like the last", `/<slug>` | **REUSE** | Load that style's `PROMPT.md` only, build, then run its self-check before returning. |
|
|
25
|
+
|
|
26
|
+
If a `dna.json` already exists for the style named, you are in REUSE. Never re-derive a style that has a record.
|
|
27
|
+
|
|
28
|
+
## Hard rules (these are the skill)
|
|
29
|
+
|
|
30
|
+
1. **A specification that cannot fail is not a specification.** If every rule you wrote is one a bad output could still satisfy, you wrote a mood board.
|
|
31
|
+
2. **Compile, do not paste.** Two files, always. `dna.json` is the record, any size, and it **never** enters a prompt. `PROMPT.md` is the payload, **hard cap 2KB**, and it is the only thing that does.
|
|
32
|
+
3. **Always attach the reference image.** Highest-leverage move available and close to free: image conditioning runs on its own pathway, so it does not eat the attention your words are competing for.
|
|
33
|
+
4. **Ratios, not values.** "The headline is 96px" is nearly worthless. "The headline is 8x the body, never under 6x" is the identity.
|
|
34
|
+
5. **Coverage, not just colour.** The same three hex codes at 60/30/10 and at 90/8/2 are two unrelated designs.
|
|
35
|
+
6. **Percentages, not pixels,** in everything spatial. One spec has to drive a 1080x1350 carousel and a 1920x1080 slide with no rewrite.
|
|
36
|
+
7. **When output looks generic, add a ban, not a rule.** A positive instruction is one weak vote against a landslide; "never centre the hero" deletes the landslide from the options. Bans should outnumber positive style rules.
|
|
37
|
+
8. **One skill per style.** Never merge two identities into one spec. The average of two good designs is a bad design.
|
|
38
|
+
9. **Reproduce the system, never the marks.** Real logos, wordmarks, licensed photographs and proprietary typefaces go in `meta.not_copied` with a named substitute.
|
|
39
|
+
10. **Step 5 is not optional.** A spec that has never been used to rebuild its own source has never been tested.
|
|
40
|
+
|
|
41
|
+
## CAPTURE - the seven steps
|
|
42
|
+
|
|
43
|
+
Run `PROMPT.md` as written. It is the operative artefact and it is self-contained; this section is the map, not a second copy of it.
|
|
44
|
+
|
|
45
|
+
| Step | Name | Non-negotiable output |
|
|
46
|
+
|---|---|---|
|
|
47
|
+
| 1 | **Observe** | Flat inventory of literal measurements. Sampled hexes, coverage estimates, type counts, largest-to-smallest ratio, margins as percentages, texture, and **what is absent**. No judgements: interpreting here is how you end up specifying a design that is not the one in front of you. |
|
|
48
|
+
| 2 | **Debate** | Loop A argues exhaustive, Loop B argues nine moves and a wall of refusals, then adjudicate each property with one question: *if I changed this value, would it stop looking like the reference?* Yes is load-bearing, no is trivia, and trivia dilutes attention. Resolve it by splitting documents, not by compromising. |
|
|
49
|
+
| 3 | **Codify** | `dna.json` against `design-dna.schema.json`. Descriptive colour names ("dusty plum", never "accent-500": image and video models cannot read token names). Every family gets a fallback. |
|
|
50
|
+
| 4 | **Tests that can fail** | 8 to 12, binary and measurable, each marked auto or human. |
|
|
51
|
+
| 5 | **Reconstruct and diff** | Close the reference. Rebuild it from `dna.json` alone. Put them side by side and list **every** difference: each one is a field the spec forgot. Fold them in, record them in `reconstruction.gaps_found`, go again. Expect two or three passes, and expect the gaps to be things you were sure were obvious. |
|
|
52
|
+
| 6 | **Emit the skill** | The folder below. |
|
|
53
|
+
| 7 | **Declare uncertainty** | Every value inferred rather than measured, and every rule under 70% confidence, into `meta.confidence_notes`. That is where the style drifts first. |
|
|
54
|
+
|
|
55
|
+
### What gets emitted
|
|
56
|
+
|
|
57
|
+
~/.claude/skills/<slug>/
|
|
58
|
+
SKILL.md how to use this style, and when not to
|
|
59
|
+
PROMPT.md the 2KB payload. THIS is what enters a context window
|
|
60
|
+
dna.json the full record. NEVER pasted into a prompt
|
|
61
|
+
design-dna.schema.json -> validated against the parent copy
|
|
62
|
+
reference/ the original, kept forever
|
|
63
|
+
example/ one worked output, the canonical proof
|
|
64
|
+
scripts/check.py the auto tests, exits non-zero on failure
|
|
65
|
+
|
|
66
|
+
### The record is the harness's design identity
|
|
67
|
+
|
|
68
|
+
The folder above makes the style **reusable**. Writing the record into the harness is what makes it
|
|
69
|
+
**this project's identity** rather than a loose folder in a global directory:
|
|
70
|
+
|
|
71
|
+
- Write the record as an article under `02-DOCS/wiki/brand/`, beside the brand study, and link it
|
|
72
|
+
from `02-DOCS/wiki/index.md` and the root `CLAUDE.md` `## Brand & voice` section — the same
|
|
73
|
+
convention `design` follows, and the same place `marketing`, `presentations`, `brand-voice` and
|
|
74
|
+
`content-engine` already read.
|
|
75
|
+
- **It does not replace the brand study.** The study is the judgement and the direction — why this
|
|
76
|
+
identity, what it refuses. The record is the measurable contract that can fail a test. They share
|
|
77
|
+
only a few fields; each carries what the other cannot.
|
|
78
|
+
- **One harness, one design identity.** If a second appears, name the conflict. The average of two
|
|
79
|
+
good designs is a bad design.
|
|
80
|
+
- A style captured before this convention still works from its folder. To bring it into the harness,
|
|
81
|
+
write its record as the article above; nothing needs re-deriving.
|
|
82
|
+
|
|
83
|
+
`rsc doctor` reports whether this harness has an identity, so the rule is not just prose.
|
|
84
|
+
|
|
85
|
+
Scaffold from `templates/` and validate before you claim it works:
|
|
86
|
+
|
|
87
|
+
python3 ~/.claude/skills/design-dna/scripts/emit.py <slug> # scaffold + validate
|
|
88
|
+
python3 ~/.claude/skills/<slug>/scripts/check.py <output-file> # run the auto tests
|
|
89
|
+
|
|
90
|
+
### PROMPT.md ordering is fixed
|
|
91
|
+
|
|
92
|
+
Attention is strongest at the two ends and weakest in the middle, so the order is a mechanism, not a style choice:
|
|
93
|
+
|
|
94
|
+
1. The reference image, attached and named first
|
|
95
|
+
2. `soul.one_line`
|
|
96
|
+
3. The weird move, alone, unmissable
|
|
97
|
+
4. The 3-9 signature moves, as ratios
|
|
98
|
+
5. The bans, as absolutes
|
|
99
|
+
6. Palette and type: roles and coverage only, never a full ramp
|
|
100
|
+
7. Archetype names and when to use each
|
|
101
|
+
8. The self-check, last
|
|
102
|
+
|
|
103
|
+
Nothing else. If it does not change what the output looks like from three metres away, it belongs in `dna.json`. To add a tenth signature you must delete one.
|
|
104
|
+
|
|
105
|
+
Last line of every `PROMPT.md`, verbatim:
|
|
106
|
+
|
|
107
|
+
> Before returning any output, run every test in the self-check. Name each test and its result. If any fails, repair the output and run them again. Never return output with a failing test and a note explaining it away.
|
|
108
|
+
|
|
109
|
+
## REUSE - building with a captured style
|
|
110
|
+
|
|
111
|
+
1. Load **only** that style's `PROMPT.md`. Attach `reference/`. Do not read `dna.json` into context; read it only to answer a specific measured question or to regenerate the payload.
|
|
112
|
+
2. Pick an archetype by name before writing anything. Structure first: unnamed layouts are why piece 8 does not sit beside piece 1 as a set.
|
|
113
|
+
3. Build. For web, hand the build to `../nextjs/SKILL.md` and the words to `../marketing/SKILL.md`; the identity stays here.
|
|
114
|
+
4. Run the self-check, name each test and its result, repair and re-run on any failure.
|
|
115
|
+
5. If output drifts, do not add a rule. Consult the table below.
|
|
116
|
+
|
|
117
|
+
## When it goes wrong
|
|
118
|
+
|
|
119
|
+
| What you see | Cause | Fix |
|
|
120
|
+
|---|---|---|
|
|
121
|
+
| Matches every value, still looks generic | Signature moves missing, or too many | Cut to 3-9, rewrite each as a ratio |
|
|
122
|
+
| Drifts back to the stock AI look | Not enough bans | Bans should outnumber positive style rules |
|
|
123
|
+
| Piece 1 and piece 8 do not match | No named layouts | Add archetypes |
|
|
124
|
+
| The accent reads as a theme, not an accent | No coverage percentages | Add them |
|
|
125
|
+
| Works on a slide, breaks on a carousel | Pixel values in the spacing | Convert to percentages |
|
|
126
|
+
| Obeys some rules, ignores others, differently each run | Payload over the cap | Cut to 2KB |
|
|
127
|
+
| Your best rule keeps getting ignored | It is buried in the middle | Move it to the top or the bottom |
|
|
128
|
+
| Fine, but forgettable | No weird move | Find the one break in the system |
|
|
129
|
+
| Spec feels complete, output is wrong | You skipped Step 5 | Rebuild the original from the spec. Compare. |
|
|
130
|
+
|
|
131
|
+
## Styles captured so far
|
|
132
|
+
|
|
133
|
+
| Style | Reads as | Weird move |
|
|
134
|
+
|---|---|---|
|
|
135
|
+
| `../cold-press/SKILL.md` | newsprint editorial, serif at 8x, one vermilion | section numeral clipped by the right edge |
|
|
136
|
+
| `../night-shift/SKILL.md` | near-black instrument panel, one phosphor green | status ribbon severed mid-word by the right edge |
|
|
137
|
+
| `../soft-optics/SKILL.md` | warm paper, lowercase display at 6x, one olive | display line crossing a tinted plate's bottom edge |
|
|
138
|
+
|
|
139
|
+
Each is a finished skill: reference, `dna.json`, a capped payload, a worked proof, and tests that exit non-zero. Never merge two of them: the average of two good designs is a bad design.
|
|
140
|
+
|
|
141
|
+
## Hand-offs
|
|
142
|
+
|
|
143
|
+
- **No winner yet, no reference to measure** -> `../design-loop/SKILL.md` first: it takes a real reference and converges on a piece that beats it. Come back with the winner. Capturing an average of several candidates produces the average, which is the thing you are trying to escape.
|
|
144
|
+
- **The words on the page** -> `../marketing/SKILL.md`. `voice` in `dna.json` constrains them; it does not write them.
|
|
145
|
+
- **The build** -> `../nextjs/SKILL.md` (App Router, React 19) or `../react/SKILL.md` (Vite SPA).
|
|
146
|
+
- **SDD gate.** Capturing a style writes a skill, not product code, so it needs no spec. The moment its output becomes a new feature or a non-trivial behaviour change in a real app, `../specify/SKILL.md` runs first.
|
|
147
|
+
|
|
148
|
+
## Files
|
|
149
|
+
|
|
150
|
+
| File | What it is |
|
|
151
|
+
|---|---|
|
|
152
|
+
| `PROMPT.md` | The standalone prompt. Paste anywhere, attach the design, done. |
|
|
153
|
+
| `design-dna.schema.json` | Every field of `dna.json`, explained. |
|
|
154
|
+
| `scripts/emit.py` | Scaffolds and validates an emitted style skill. |
|
|
155
|
+
| `templates/` | `SKILL.md`, `PROMPT.md` and `check.py` skeletons for the emitted skill. |
|
|
156
|
+
| `references/method.md` | The full method and the research each decision traces to. Read once, not per run. |
|
|
157
|
+
|
|
158
|
+
**Why any of this works** is not opinion: lost-in-the-middle recovery, instruction-compliance decay under constraint count, style being formally the correlation between features rather than the features, and decoupled image cross-attention. The citations are in `references/method.md`.
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "Design DNA",
|
|
4
|
+
"description": "The exhaustive record of one visual identity. Written for you and for build tools, never pasted into a prompt. The prompt payload is compiled from this file into PROMPT.md under a 2KB cap.",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["meta", "soul", "palette", "type", "space", "signatures", "weird_move", "bans", "tests", "reconstruction"],
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"properties": {
|
|
9
|
+
"meta": {
|
|
10
|
+
"type": "object",
|
|
11
|
+
"description": "Provenance. What this is, where it came from, and what must never be reproduced.",
|
|
12
|
+
"required": ["name", "slug", "source", "captured", "not_copied", "medium_of_origin"],
|
|
13
|
+
"properties": {
|
|
14
|
+
"name": { "type": "string", "description": "Human name of the style, e.g. 'Cold Press Editorial'." },
|
|
15
|
+
"slug": { "type": "string", "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$", "description": "kebab-case. Becomes the emitted skill folder name and its slash command." },
|
|
16
|
+
"source": { "type": "array", "items": { "type": "string" }, "description": "Paths or URLs of the reference artefacts this was measured from." },
|
|
17
|
+
"captured": { "type": "string", "description": "ISO date the capture was made. Styles age; a dated record tells you when to re-measure." },
|
|
18
|
+
"not_copied": { "type": "array", "items": { "type": "string" }, "description": "Real logos, wordmarks, licensed photographs, proprietary typefaces. Reproduce the SYSTEM, never the MARKS. Name the substitute used for each." },
|
|
19
|
+
"medium_of_origin": { "type": "string", "description": "What the reference actually was: website, poster, carousel, deck, motion graphic. The format is an output, not the subject." },
|
|
20
|
+
"confidence_notes": { "type": "array", "items": { "type": "string" }, "description": "Step 7 output: every value inferred rather than measured, and every rule under 70% confidence. This is where the style drifts first." }
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"soul": {
|
|
24
|
+
"type": "object",
|
|
25
|
+
"description": "The compression key. Read this alone and you are most of the way there.",
|
|
26
|
+
"required": ["one_line", "adjectives", "lineage", "read_distance", "energy"],
|
|
27
|
+
"properties": {
|
|
28
|
+
"one_line": { "type": "string", "maxLength": 160, "description": "Max 160 chars. Concrete nouns only. No marketing words, no 'premium', no 'clean'." },
|
|
29
|
+
"adjectives": { "type": "array", "minItems": 3, "maxItems": 5, "items": { "type": "string" } },
|
|
30
|
+
"lineage": { "type": "string", "description": "The family tree: Swiss editorial, 90s rave flyer, brutalist web, Memphis, ECM sleeve." },
|
|
31
|
+
"read_distance": { "enum": ["thumb", "arms-length", "desk", "room", "street"], "description": "How far away it is read from. This sets the minimum type size, so it is a functional field, not a poetic one." },
|
|
32
|
+
"energy": {
|
|
33
|
+
"type": "object",
|
|
34
|
+
"description": "Each 1-10. A fingerprint that catches drift no single value does.",
|
|
35
|
+
"required": ["density", "variance", "contrast", "warmth"],
|
|
36
|
+
"properties": {
|
|
37
|
+
"density": { "type": "integer", "minimum": 1, "maximum": 10, "description": "How much of the canvas is occupied." },
|
|
38
|
+
"variance": { "type": "integer", "minimum": 1, "maximum": 10, "description": "How much elements differ from each other. Low = systematic, high = collaged." },
|
|
39
|
+
"contrast": { "type": "integer", "minimum": 1, "maximum": 10 },
|
|
40
|
+
"warmth": { "type": "integer", "minimum": 1, "maximum": 10 }
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"palette": {
|
|
46
|
+
"type": "object",
|
|
47
|
+
"description": "Colour AND its proportions. The same three hex codes at 60/30/10 and at 90/8/2 are two unrelated designs.",
|
|
48
|
+
"required": ["colors", "coverage", "banned"],
|
|
49
|
+
"properties": {
|
|
50
|
+
"colors": {
|
|
51
|
+
"type": "array",
|
|
52
|
+
"minItems": 2,
|
|
53
|
+
"items": {
|
|
54
|
+
"type": "object",
|
|
55
|
+
"required": ["role", "hex", "name"],
|
|
56
|
+
"properties": {
|
|
57
|
+
"role": { "type": "string", "description": "ground, ink, accent, secondary, hairline." },
|
|
58
|
+
"hex": { "type": "string", "pattern": "^#[0-9a-fA-F]{6}$", "description": "Sampled, never guessed." },
|
|
59
|
+
"name": { "type": "string", "description": "Descriptive, not systematic. 'dusty plum' travels to an image model; 'accent-500' does not." }
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"coverage": { "type": "object", "description": "Percentage of canvas per role, summing to roughly 100. The most-skipped and most-decisive field in the whole document.", "additionalProperties": { "type": "number" } },
|
|
64
|
+
"mode": { "type": "string", "description": "light, dark, or duotone-on-stock." },
|
|
65
|
+
"banned": { "type": "array", "items": { "type": "string" }, "description": "Colour behaviours forbidden: gradients, two accents in one frame, pure #000000." }
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"type": {
|
|
69
|
+
"type": "object",
|
|
70
|
+
"description": "Families, and above all the ratio between them. 8-to-1 and 2-to-1 are different designs with identical fonts.",
|
|
71
|
+
"required": ["families", "scale", "treatment"],
|
|
72
|
+
"properties": {
|
|
73
|
+
"families": {
|
|
74
|
+
"type": "array",
|
|
75
|
+
"items": {
|
|
76
|
+
"type": "object",
|
|
77
|
+
"required": ["role", "family", "fallback"],
|
|
78
|
+
"properties": {
|
|
79
|
+
"role": { "enum": ["display", "body", "mono", "caption", "ui"] },
|
|
80
|
+
"family": { "type": "string" },
|
|
81
|
+
"fallback": { "type": "string", "description": "REQUIRED. Silent Arial substitution is the most common way a reproduction dies quietly." },
|
|
82
|
+
"weights": { "type": "array", "items": { "type": "integer" } },
|
|
83
|
+
"licence_risk": { "type": "string", "description": "free / webfont-ok / proprietary-substitute-needed." }
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"scale": {
|
|
88
|
+
"type": "object",
|
|
89
|
+
"required": ["display_to_body_ratio", "max_sizes_per_frame"],
|
|
90
|
+
"properties": {
|
|
91
|
+
"display_to_body_ratio": { "type": "number", "description": "The typographic signature. Record it as a floor too ('8x, never under 6x')." },
|
|
92
|
+
"ratio_floor": { "type": "number" },
|
|
93
|
+
"steps": { "type": "array", "items": { "type": "number" }, "description": "Relative steps, not pixels." },
|
|
94
|
+
"max_sizes_per_frame": { "type": "integer", "description": "Usually 2 or 3. A testable ceiling." }
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"treatment": {
|
|
98
|
+
"type": "object",
|
|
99
|
+
"properties": {
|
|
100
|
+
"display_tracking": { "type": "string", "description": "e.g. '-0.03em'." },
|
|
101
|
+
"body_leading": { "type": "string", "description": "As a multiple of size." },
|
|
102
|
+
"case": { "type": "string" },
|
|
103
|
+
"measure": { "type": "string", "description": "Characters per line. Under 65 for body is the usual bound." },
|
|
104
|
+
"numerals": { "type": "string", "description": "lining / oldstyle / tabular." }
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"space": {
|
|
110
|
+
"type": "object",
|
|
111
|
+
"description": "USE PERCENTAGES. One spec must drive a 1080x1350 carousel and a 1920x1080 slide without a rewrite. Pixel values here are the reason a spec works on a slide and breaks on a carousel.",
|
|
112
|
+
"required": ["grid", "margin_pct", "alignment", "negative_space"],
|
|
113
|
+
"properties": {
|
|
114
|
+
"grid": { "type": "string" },
|
|
115
|
+
"margin_pct": { "type": "number" },
|
|
116
|
+
"gutter_pct": { "type": "number" },
|
|
117
|
+
"alignment": { "type": "string", "description": "Where things line up, and what is deliberately never centred." },
|
|
118
|
+
"rhythm": { "type": "string", "description": "The spacing progression, e.g. 'x1.5 geometric off a 8px base'." },
|
|
119
|
+
"negative_space": { "type": "string", "description": "Where the emptiness is and how big. Emptiness is a placed element, not leftover." },
|
|
120
|
+
"safe_area": { "type": "object", "description": "Per platform, in percentages.", "additionalProperties": { "type": "string" } }
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"surface": {
|
|
124
|
+
"type": "object",
|
|
125
|
+
"description": "What the thing is physically made of.",
|
|
126
|
+
"properties": {
|
|
127
|
+
"texture": { "type": "object", "properties": { "kind": { "type": "string" }, "opacity": { "type": "number" }, "scale": { "type": "string" }, "stacking_order": { "type": "string" } } },
|
|
128
|
+
"edges": { "type": "string", "description": "Radii, hairline weights, whether anything bleeds off canvas." },
|
|
129
|
+
"elevation": { "type": "string", "description": "Often the honest answer is 'none'. Record the absence." },
|
|
130
|
+
"imagery": { "type": "string", "description": "Treatment: duotone, grain, crop discipline, subject distance." },
|
|
131
|
+
"iconography": { "type": "string", "description": "Or the absence of it." }
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"signatures": {
|
|
135
|
+
"type": "array",
|
|
136
|
+
"minItems": 3,
|
|
137
|
+
"maxItems": 9,
|
|
138
|
+
"description": "The payload. Carry these and nothing else and it is still recognisable. To add a tenth you must delete one; the cap forces a decision instead of shipping indecision.",
|
|
139
|
+
"items": {
|
|
140
|
+
"type": "object",
|
|
141
|
+
"required": ["move", "how", "when", "never"],
|
|
142
|
+
"properties": {
|
|
143
|
+
"move": { "type": "string", "description": "Name it like a technique, so it can be referred to in one word." },
|
|
144
|
+
"how": { "type": "string", "description": "AS A RATIO OR RELATIONSHIP. Style is formally the correlation between features, not the features." },
|
|
145
|
+
"when": { "type": "string", "description": "Where in a piece or a sequence it appears." },
|
|
146
|
+
"never": { "type": "string", "description": "How it gets used wrong. The failure mode, written down." }
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"weird_move": {
|
|
151
|
+
"type": "object",
|
|
152
|
+
"description": "The single deliberate break in the system. Its own key, deliberately, so it can never get buried in the middle of a document. Highest-information element present and the first thing a mechanical extraction loses.",
|
|
153
|
+
"required": ["what", "how", "why"],
|
|
154
|
+
"properties": {
|
|
155
|
+
"what": { "type": "string" },
|
|
156
|
+
"how": { "type": "string", "description": "Reproducible instruction, as a relationship." },
|
|
157
|
+
"why": { "type": "string" },
|
|
158
|
+
"frequency": { "type": "string", "default": "exactly once per piece" }
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
"archetypes": {
|
|
162
|
+
"type": "array",
|
|
163
|
+
"description": "Named layouts. Without these you get consistent styling and inconsistent structure, which reads as sloppiness: output #8 will not sit beside output #1 as a set.",
|
|
164
|
+
"items": {
|
|
165
|
+
"type": "object",
|
|
166
|
+
"required": ["id", "purpose", "anatomy"],
|
|
167
|
+
"properties": {
|
|
168
|
+
"id": { "type": "string" },
|
|
169
|
+
"purpose": { "type": "string", "description": "Its job in a sequence: opener, proof, quote, closer." },
|
|
170
|
+
"anatomy": { "type": "string", "description": "Slot-by-slot structure in percentages." },
|
|
171
|
+
"content_shape": { "type": "string", "description": "The content budget: max words per slot." }
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
"motion": {
|
|
176
|
+
"type": "object",
|
|
177
|
+
"description": "Omit entirely for static work. Restraint is a signature too, which is why never_moves is required when this key exists.",
|
|
178
|
+
"required": ["never_moves"],
|
|
179
|
+
"properties": {
|
|
180
|
+
"easing": { "type": "string" },
|
|
181
|
+
"durations": { "type": "object", "additionalProperties": { "type": "string" } },
|
|
182
|
+
"entrances": { "type": "string" },
|
|
183
|
+
"never_moves": { "type": "array", "items": { "type": "string" } },
|
|
184
|
+
"reduced_motion": { "type": "string", "description": "The prefers-reduced-motion fallback. Not optional in shipped work." }
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
"voice": {
|
|
188
|
+
"type": "object",
|
|
189
|
+
"description": "Copy is part of the design. Right layout, wrong sentence, broken look.",
|
|
190
|
+
"properties": {
|
|
191
|
+
"register": { "type": "string" },
|
|
192
|
+
"sentence_length": { "type": "string" },
|
|
193
|
+
"headline_shape": { "type": "string" },
|
|
194
|
+
"banned_words": { "type": "array", "items": { "type": "string" } }
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
"bans": {
|
|
198
|
+
"type": "array",
|
|
199
|
+
"minItems": 5,
|
|
200
|
+
"items": { "type": "string" },
|
|
201
|
+
"description": "Written as absolutes, starting with 'Never'. A positive instruction has to out-vote the training average; a ban deletes the landslide from the options. One ban can rule out an entire space in one line. Bans should outnumber positive style rules."
|
|
202
|
+
},
|
|
203
|
+
"tests": {
|
|
204
|
+
"type": "array",
|
|
205
|
+
"minItems": 8,
|
|
206
|
+
"description": "8 to 12. Binary and measurable. If two people could disagree about the answer, it is not a test. A spec with no failing test is a mood board with better formatting.",
|
|
207
|
+
"items": {
|
|
208
|
+
"type": "object",
|
|
209
|
+
"required": ["id", "check", "fail_looks_like", "auto"],
|
|
210
|
+
"properties": {
|
|
211
|
+
"id": { "type": "string" },
|
|
212
|
+
"check": { "type": "string", "description": "Stated so the answer is yes or no, or a number against a bound." },
|
|
213
|
+
"fail_looks_like": { "type": "string" },
|
|
214
|
+
"auto": { "type": "boolean", "description": "True if a script could decide it. Those go into tools/check.py." }
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
"reconstruction": {
|
|
219
|
+
"type": "object",
|
|
220
|
+
"description": "Step 5. A spec that has never been used to rebuild its own source has never been tested at all.",
|
|
221
|
+
"required": ["attempted", "gaps_found", "passes"],
|
|
222
|
+
"properties": {
|
|
223
|
+
"attempted": { "type": "boolean" },
|
|
224
|
+
"passes": { "type": "integer", "description": "Expect 2 or 3." },
|
|
225
|
+
"gaps_found": { "type": "array", "items": { "type": "string" }, "description": "Every difference found between rebuild and original, and the field added to close it. Expect these to be things you were sure were obvious." },
|
|
226
|
+
"stranger_test": { "type": "string", "description": "Whether a stranger could still pick the copy from the original, and how you checked." }
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|