haac-aikit 0.12.0 → 0.13.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 +15 -0
- package/catalog/commands/design.md +44 -0
- package/catalog/skills/tier2/design.md +108 -0
- package/catalog/templates/design/starter-DESIGN.md +77 -0
- package/catalog/templates/design/template.html +633 -0
- package/dist/cli.mjs +37 -1
- package/dist/cli.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,9 +27,24 @@ aikit add --html
|
|
|
27
27
|
| **`/decide`** | Picking between 2-4 technical options | `docs/decisions/<date>-<slug>.html` |
|
|
28
28
|
| **`/directions`** | Exploring visual design variants | `docs/directions/<date>-<slug>.html` |
|
|
29
29
|
| **`/roadmap`** | Handing an implementation plan to an implementer | `docs/roadmaps/<date>-<slug>.html` |
|
|
30
|
+
| **`/design`** *(opt-in: `aikit add design`)* | Codifying the project's design language as a contract | `DESIGN.md` + `docs/design/index.html` |
|
|
30
31
|
|
|
31
32
|
Each command writes one self-contained HTML file — no build step, no CDN, commit and share the link. Built on [Thariq Shihipar's "Unreasonable Effectiveness of HTML for Claude Code"](https://thariqs.github.io/html-effectiveness/).
|
|
32
33
|
|
|
34
|
+
### Does `/design` actually help?
|
|
35
|
+
|
|
36
|
+
We ran the same four prompts twice — once with the skill installed, once freestyle. Same model, same inputs.
|
|
37
|
+
|
|
38
|
+
| The ask | With `/design` | Without |
|
|
39
|
+
|---|---|---|
|
|
40
|
+
| "Read my homepage HTML, build a DESIGN.md" | **86%** | 71% |
|
|
41
|
+
| "Just synthesize one — here's the vibe" | **86%** | 43% |
|
|
42
|
+
| "Tweak the primary color, leave the rest alone" | 100% | 100% |
|
|
43
|
+
| "Build it from this screenshot" | **100%** | 57% |
|
|
44
|
+
| **Average across all four** | **93%** | 68% |
|
|
45
|
+
|
|
46
|
+
**+25 points on average.** The freestyle AI usually misses three things: marker-bounded sections (so `/design refine` can't surgically update later), hex codes inside backticks (the showroom's color pickers can't bind to them), and parts of the brief — "no gray" turned into five shades of gray. `/design` bakes all three in.
|
|
47
|
+
|
|
33
48
|
## What else you get
|
|
34
49
|
|
|
35
50
|
- **Cross-tool fan-out.** Skills, agents, hooks, and MCP servers fan out per selected tool in its native format. Pick `--tools=cursor` and get `.cursor/rules/` + `.cursor/hooks.json` + `.cursor/mcp.json`. Pick `--tools=codex` and get `.codex/agents/*.toml` + `.codex/config.toml` with MCP servers.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
Codify the project's visual language as a `DESIGN.md` contract + interactive HTML showroom using the `design` skill.
|
|
2
|
+
|
|
3
|
+
## Usage
|
|
4
|
+
|
|
5
|
+
`/design` — bootstrap `DESIGN.md` at the project root (asks for screenshot / HTML / URL / brief).
|
|
6
|
+
`/design refine <change>` — update one marker-bounded section without touching the rest.
|
|
7
|
+
|
|
8
|
+
Example:
|
|
9
|
+
- `/design` → AI asks for input, then writes `DESIGN.md` + `docs/design/index.html`.
|
|
10
|
+
- `/design refine make primary brighter, around #FF8800` → AI touches only the `colors` section.
|
|
11
|
+
|
|
12
|
+
## Steps — bootstrap (`/design`)
|
|
13
|
+
|
|
14
|
+
1. **Ask which input the user has.** Screenshot, HTML paste/path, live URL, or pure design brief. Wait for an answer.
|
|
15
|
+
|
|
16
|
+
2. **Read the starter** at `.aikit/templates/design/starter-DESIGN.md`. It already has the 5 marker-bounded sections in the right shape.
|
|
17
|
+
|
|
18
|
+
3. **Fill each section** from the user's input. Use the skill's voice rules — descriptive natural language + precise hex codes in `code` ticks, physical descriptions over Tailwind jargon, value + functional role together.
|
|
19
|
+
|
|
20
|
+
4. **Confirm before writing.** One sentence in chat: *"I'll write `DESIGN.md` at the project root and render the showroom at `docs/design/index.html`. Okay?"* Wait for explicit yes.
|
|
21
|
+
|
|
22
|
+
5. **Write `DESIGN.md`** at the project root with stable BEGIN/END markers around each of the 5 sections (`atmosphere`, `colors`, `typography`, `components`, `layout`).
|
|
23
|
+
|
|
24
|
+
6. **Render the showroom.** Read `.aikit/templates/design/template.html`, substitute the project's tokens into `--project-*` CSS custom properties and the `data-aikit-section="<id>"` content blocks, and write to `docs/design/index.html`.
|
|
25
|
+
|
|
26
|
+
7. **Report.** Print both file paths. Suggest `open docs/design/index.html` (macOS) / `xdg-open` (Linux).
|
|
27
|
+
|
|
28
|
+
## Steps — refine (`/design refine <change>`)
|
|
29
|
+
|
|
30
|
+
1. **Pick exactly one section.** From `<change>`, identify which of the 5 section IDs it affects. If it spans more than one, ask which to start with.
|
|
31
|
+
|
|
32
|
+
2. **Read only that section** via `readSection(content, "<id>", "DESIGN.md")` from `src/render/markers` — never load the whole file.
|
|
33
|
+
|
|
34
|
+
3. **Propose the rewrite** in chat: show the new section body. Wait for yes.
|
|
35
|
+
|
|
36
|
+
4. **Write through the marker engine.** `writeSection(content, "<id>", newBody, "DESIGN.md")`. Anything outside the markers is preserved verbatim.
|
|
37
|
+
|
|
38
|
+
5. **Regenerate the showroom** from the updated `DESIGN.md`.
|
|
39
|
+
|
|
40
|
+
6. **Report.** Print the section ID that changed and the two file paths.
|
|
41
|
+
|
|
42
|
+
## Fallback
|
|
43
|
+
|
|
44
|
+
If `.aikit/templates/design/template.html` or `.aikit/templates/design/starter-DESIGN.md` is missing, run `aikit add design` first. The skill refuses to scaffold without the template.
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: design
|
|
3
|
+
description: Use when the user wants to codify the project's visual language as a single Markdown contract every AI tool can read. Generates a project-root `DESIGN.md` (5 marker-bounded sections — atmosphere, colors, typography, components, layout) plus a self-contained interactive HTML showroom at `docs/design/index.html`. Opt-in only — invoke on `/design`, `/design refine`, or explicit user request. Inputs accepted: screenshot, HTML paste, live URL, or pure design brief.
|
|
4
|
+
version: "1.0.0"
|
|
5
|
+
source: haac-aikit
|
|
6
|
+
license: MIT
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
Explicit invocation only:
|
|
12
|
+
|
|
13
|
+
- `/design` — bootstrap `DESIGN.md` from an input (screenshot/HTML/URL/brief).
|
|
14
|
+
- `/design refine "<change>"` — update one section without touching the rest.
|
|
15
|
+
- User explicitly says *"build me a DESIGN.md"*, *"lock in the design language"*, *"so every AI build matches the homepage"*.
|
|
16
|
+
|
|
17
|
+
Do **not** invoke proactively. Generating a design contract silently creates a high-leverage file (every future AI request will read it) — the user must own the moment.
|
|
18
|
+
|
|
19
|
+
## What this skill produces
|
|
20
|
+
|
|
21
|
+
Two files, every time:
|
|
22
|
+
|
|
23
|
+
| Path | Role | Read by |
|
|
24
|
+
|---|---|---|
|
|
25
|
+
| `DESIGN.md` *(project root)* | Source of truth. Five marker-bounded sections. | AI tools, humans, git diff |
|
|
26
|
+
| `docs/design/index.html` | Showroom. Live swatches, type specimens, button mockups. In-browser tweak + Copy Markdown. | Humans only |
|
|
27
|
+
|
|
28
|
+
The Markdown is the contract; the HTML is a renderer. The browser never writes to disk — edits flow back through `/design refine` (or a manual paste).
|
|
29
|
+
|
|
30
|
+
## Inputs accepted
|
|
31
|
+
|
|
32
|
+
Ask the user which they have, then proceed with one of these:
|
|
33
|
+
|
|
34
|
+
1. **Screenshot** — extract palette via visual inspection, infer typography from font characteristics, name colors descriptively ("Deep Muted Teal" not "blue").
|
|
35
|
+
2. **HTML paste / file path** — parse Tailwind classes, custom CSS, `:root` variables. Pull exact hex codes. Derive components from repeated patterns.
|
|
36
|
+
3. **Live URL** — use `WebFetch` to read the page, then proceed as in #2.
|
|
37
|
+
4. **Design brief only** — text description ("warm, hand-drawn, modern indie"). Synthesize a plausible palette and typography, mark it as "starting point — refine after first screen lands."
|
|
38
|
+
|
|
39
|
+
## The five sections
|
|
40
|
+
|
|
41
|
+
Each section is wrapped in `<!-- BEGIN:haac-aikit:section:<id> -->` / `<!-- END:haac-aikit:section:<id> -->` so `/design refine` can touch one at a time via the marker engine.
|
|
42
|
+
|
|
43
|
+
| ID | What it captures | Driven by |
|
|
44
|
+
|---|---|---|
|
|
45
|
+
| `atmosphere` | Mood, density, aesthetic philosophy | 1–2 evocative sentences |
|
|
46
|
+
| `colors` | Each color: descriptive name + hex + role | Bullet list — hex in `code` ticks |
|
|
47
|
+
| `typography` | Font families, weights, character | Display / body / mono triple |
|
|
48
|
+
| `components` | Shape + behaviour of buttons, cards, inputs, chips | Physical descriptions, not Tailwind classes |
|
|
49
|
+
| `layout` | Spacing scale, section gaps, max widths, crowding rules | Concrete numbers + one rule about when *not* to crowd |
|
|
50
|
+
|
|
51
|
+
## Bootstrap protocol — follow exactly
|
|
52
|
+
|
|
53
|
+
1. **Confirm inputs.** Ask: *"Got a screenshot, HTML, URL, or want me to synthesize from a brief?"* Wait for an answer.
|
|
54
|
+
|
|
55
|
+
2. **Read the starter.** Copy `.aikit/templates/design/starter-DESIGN.md` (placeholder content + the 5 marker-bounded sections, already in the right shape) as the working draft.
|
|
56
|
+
|
|
57
|
+
3. **Fill each section** based on the user's input. Replace `{{PROJECT_NAME}}` in the title. Use the voice rules below — descriptive, hex-grounded, no Tailwind jargon in the reading path.
|
|
58
|
+
|
|
59
|
+
4. **Propose before writing.** One sentence in chat: *"I'll write `DESIGN.md` at the project root and render the showroom at `docs/design/index.html`. Okay?"* Wait for explicit yes.
|
|
60
|
+
|
|
61
|
+
5. **Write `DESIGN.md`** at the project root with the filled-in content. Use the marker engine — every section has stable BEGIN/END markers so `/design refine` works later.
|
|
62
|
+
|
|
63
|
+
6. **Render the showroom.** Read `.aikit/templates/design/template.html`. Substitute the project's tokens into the CSS custom properties block (`--project-primary`, `--project-bg`, …) and the `data-aikit-section="<id>"` content blocks. Write to `docs/design/index.html`.
|
|
64
|
+
|
|
65
|
+
7. **Report.** Print both file paths. Suggest `open docs/design/index.html` (macOS) / `xdg-open` (Linux).
|
|
66
|
+
|
|
67
|
+
## Refine protocol — follow exactly
|
|
68
|
+
|
|
69
|
+
When the user runs `/design refine "<change>"`:
|
|
70
|
+
|
|
71
|
+
1. **Identify the section.** From the change description, pick exactly one section ID. If the change spans multiple sections, ask which to start with.
|
|
72
|
+
|
|
73
|
+
2. **Read only that section.** `readSection(content, "<id>", "DESIGN.md")` — never load the whole file.
|
|
74
|
+
|
|
75
|
+
3. **Propose the rewrite** in chat. Show the new section body. Wait for yes.
|
|
76
|
+
|
|
77
|
+
4. **Write through the marker engine.** `writeSection(content, "<id>", newBody, "DESIGN.md")`. Anything outside the markers is preserved.
|
|
78
|
+
|
|
79
|
+
5. **Regenerate the showroom.** Re-read `DESIGN.md` and re-render `docs/design/index.html` from the template so the showroom reflects the change.
|
|
80
|
+
|
|
81
|
+
6. **Report.** Show the modified section ID and the two file paths. Suggest reopening the showroom.
|
|
82
|
+
|
|
83
|
+
## Voice rules
|
|
84
|
+
|
|
85
|
+
These shape every DESIGN.md the skill produces. Apply them when filling in any section.
|
|
86
|
+
|
|
87
|
+
- Use descriptive natural language + a precise hex code in `code` ticks. "Carrot Orange `#FF7A3D` — primary CTAs", never "rounded-xl orange".
|
|
88
|
+
- Translate technical values into physical descriptions: `border-radius: 9999px` becomes *pill-shaped*; `box-shadow: 0 1px 3px` becomes *a whisper-soft drop shadow*.
|
|
89
|
+
- Always pair a value with its functional role. Not just "this color" — "this color, used for X."
|
|
90
|
+
- Avoid framework jargon (Tailwind classes, CSS variable names) in the reading path. Put it in `code` chips if needed.
|
|
91
|
+
- Prefer one specific rule over many generic ones. "Never two primary CTAs side-by-side" beats "be thoughtful about hierarchy."
|
|
92
|
+
|
|
93
|
+
## Fallback
|
|
94
|
+
|
|
95
|
+
If `.aikit/templates/design/template.html` or `.aikit/templates/design/starter-DESIGN.md` is missing (project synced before this kit version, or installed without the design pack), run:
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
aikit add design
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Then retry. The skill refuses to scaffold without the template — it would have to invent the showroom shape from scratch, and inventing risks drift.
|
|
102
|
+
|
|
103
|
+
## Don't
|
|
104
|
+
|
|
105
|
+
- Don't auto-invoke. The user picks the moment.
|
|
106
|
+
- Don't write `DESIGN.md` to a subfolder (`docs/DESIGN.md`, `.aikit/DESIGN.md`). It belongs at the project root — alongside `AGENTS.md` — so every tool finds it without configuration.
|
|
107
|
+
- Don't include screenshots in `DESIGN.md`. They rot the moment a class name changes; descriptive language ages better.
|
|
108
|
+
- Don't add a section the marker engine doesn't know about. The 5 sections are fixed; if a project needs more, raise it in chat first.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Design System: {{PROJECT_NAME}}
|
|
2
|
+
|
|
3
|
+
> Source of truth for this project's visual language. Every AI coding tool in
|
|
4
|
+
> the repo (Claude Code, Cursor, Copilot, Windsurf, Aider, Gemini, Codex) reads
|
|
5
|
+
> this file before generating new screens. Keep it short, concrete, and current.
|
|
6
|
+
>
|
|
7
|
+
> Edit by hand, or run `/design refine "<change>"` to let the AI update one
|
|
8
|
+
> marker-bounded section without touching the rest. After edits, re-open
|
|
9
|
+
> `docs/design/index.html` to see the change rendered live.
|
|
10
|
+
|
|
11
|
+
<!-- BEGIN:haac-aikit:section:atmosphere -->
|
|
12
|
+
## 1. Atmosphere
|
|
13
|
+
|
|
14
|
+
One or two sentences capturing the overall mood, density, and aesthetic
|
|
15
|
+
philosophy. Use evocative adjectives a non-designer would understand.
|
|
16
|
+
|
|
17
|
+
> Example: *Warm and grounded. Generous whitespace, hand-drawn warmth meeting
|
|
18
|
+
> clean tech. Reads more like a printed catalog than a SaaS dashboard.*
|
|
19
|
+
<!-- END:haac-aikit:section:atmosphere -->
|
|
20
|
+
|
|
21
|
+
<!-- BEGIN:haac-aikit:section:colors -->
|
|
22
|
+
## 2. Colors
|
|
23
|
+
|
|
24
|
+
For each color: a descriptive name, the hex code in `code`, and its functional
|
|
25
|
+
role. Hex codes drive the showroom's color pickers — keep them in `code` ticks.
|
|
26
|
+
|
|
27
|
+
- **Carrot Orange** `#FF7A3D` — primary CTAs, links on hover, active states
|
|
28
|
+
- **Burrow Cream** `#FFF7EC` — page background, card backgrounds
|
|
29
|
+
- **Midnight Lettuce** `#1F3329` — body text, primary headings
|
|
30
|
+
- **Pebble Gray** `#D6D2C9` — dividers, disabled borders, secondary outlines
|
|
31
|
+
<!-- END:haac-aikit:section:colors -->
|
|
32
|
+
|
|
33
|
+
<!-- BEGIN:haac-aikit:section:typography -->
|
|
34
|
+
## 3. Typography
|
|
35
|
+
|
|
36
|
+
State the font family, the weights you use for headers vs body, and the
|
|
37
|
+
character of the type (tight/loose, italic accents, line-height feel).
|
|
38
|
+
|
|
39
|
+
- **Display:** `Fraunces`, italic, weight 600. Used for h1, h2, and brand
|
|
40
|
+
moments. Tight letter-spacing.
|
|
41
|
+
- **Body:** `Inter`, weight 400, line-height 1.6. Used for paragraphs, buttons,
|
|
42
|
+
inputs. Comfortable, never crowded.
|
|
43
|
+
- **Mono:** `JetBrains Mono`, weight 400. Used for code, version chips, hex
|
|
44
|
+
values.
|
|
45
|
+
<!-- END:haac-aikit:section:typography -->
|
|
46
|
+
|
|
47
|
+
<!-- BEGIN:haac-aikit:section:components -->
|
|
48
|
+
## 4. Components
|
|
49
|
+
|
|
50
|
+
Describe the shape and behaviour of the recurring pieces. Translate technical
|
|
51
|
+
values (rounded-xl, shadow-md) into physical descriptions a 14-year-old could
|
|
52
|
+
draw.
|
|
53
|
+
|
|
54
|
+
- **Buttons:** Pill-shaped, 16px vertical padding. Carrot on Cream for primary;
|
|
55
|
+
a 2px Cream-on-Carrot inverse for secondary. Subtle press depression on
|
|
56
|
+
active; no hover lift on touch devices.
|
|
57
|
+
- **Cards:** Gently rounded corners (12px), 1px Lettuce border at 10% opacity,
|
|
58
|
+
no shadow. Internal padding is generous (24px+).
|
|
59
|
+
- **Inputs:** 1px Pebble Gray border that thickens to Lettuce on focus. No
|
|
60
|
+
fill. 8px corners — softer than sharp, less round than the cards.
|
|
61
|
+
- **Chips:** Pill-shaped to echo buttons. Pebble Gray fill, Midnight Lettuce
|
|
62
|
+
text. Used for tags, version markers, and inline metadata.
|
|
63
|
+
<!-- END:haac-aikit:section:components -->
|
|
64
|
+
|
|
65
|
+
<!-- BEGIN:haac-aikit:section:layout -->
|
|
66
|
+
## 5. Layout
|
|
67
|
+
|
|
68
|
+
Describe whitespace strategy, the spacing grid, max widths, and any rules
|
|
69
|
+
about when *not* to crowd elements.
|
|
70
|
+
|
|
71
|
+
- **Spacing scale:** 8-point grid. All margins and paddings are multiples of 8.
|
|
72
|
+
- **Section gaps:** Never less than 32px between distinct sections; 64px for
|
|
73
|
+
major surface transitions.
|
|
74
|
+
- **Reading width:** Max 720px on prose surfaces; 1200px on dashboards.
|
|
75
|
+
- **Crowding rule:** Never two primary CTAs side-by-side. Demote one to
|
|
76
|
+
secondary or stack vertically with breathing room.
|
|
77
|
+
<!-- END:haac-aikit:section:layout -->
|