haac-aikit 0.14.0 → 0.14.1
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.
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
Codify the project's visual language as a marker-bounded `DESIGN.md` and render an interactive HTML showroom, using the `design` skill.
|
|
2
|
+
|
|
3
|
+
## Usage
|
|
4
|
+
|
|
5
|
+
`/design $ARGUMENTS`
|
|
6
|
+
|
|
7
|
+
- **No args** → bootstrap mode. Look at the conversation context for input: a pasted screenshot, an HTML paste, a URL, or a verbal brief. If multiple input modes are present, ask which to use. Creates `DESIGN.md` at the project root and the showroom at `docs/design/index.html`.
|
|
8
|
+
- **`refine "<change>"`** → surgical edit mode. Identify which of the five sections (`atmosphere`, `colors`, `typography`, `components`, `layout`) the change belongs to, then update only that section via the marker engine. Examples:
|
|
9
|
+
- `/design refine "muted accent, like #C2664D"` → updates `colors`
|
|
10
|
+
- `/design refine "switch headlines to a slab serif"` → updates `typography`
|
|
11
|
+
- `/design refine "tighter 600px content column"` → updates `layout`
|
|
12
|
+
|
|
13
|
+
## Steps
|
|
14
|
+
|
|
15
|
+
1. **Detect mode.** If args start with `refine`, route to refine. Otherwise bootstrap.
|
|
16
|
+
2. **Invoke the `design` skill** — it owns the voice rules, section structure, and marker engine wiring.
|
|
17
|
+
3. **For bootstrap:**
|
|
18
|
+
- Confirm input mode (screenshot, HTML, URL, brief) before writing.
|
|
19
|
+
- Copy `.aikit/templates/design/starter-DESIGN.md` to `DESIGN.md` at project root.
|
|
20
|
+
- Fill each of the five sections via `writeSection` from `src/render/markers.ts`, respecting voice rules (hex codes in `code` ticks; descriptive language; no Tailwind jargon).
|
|
21
|
+
- Copy `.aikit/templates/design/template.html` to `docs/design/index.html`.
|
|
22
|
+
- Report both paths.
|
|
23
|
+
4. **For refine:**
|
|
24
|
+
- Read the targeted section with `readSection(content, "<id>", "DESIGN.md")`.
|
|
25
|
+
- Synthesize the new body; apply voice rules.
|
|
26
|
+
- Write back with `writeSection`. Do not touch the other four sections.
|
|
27
|
+
- Confirm which section changed; report the diff.
|
|
28
|
+
5. **Refuse cleanly** if `DESIGN.md` exists but has no markers (offer to re-bootstrap with `AskUserQuestion`), or if refine is called and no `DESIGN.md` exists yet.
|
|
29
|
+
|
|
30
|
+
## Fallback
|
|
31
|
+
|
|
32
|
+
If `.aikit/templates/design/` is missing (project synced before this kit version), run `aikit add design` to install companion artifacts, or `aikit sync` if the skill is already opted in.
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: design
|
|
3
|
+
description: Use when the user types "/design", asks to "codify the design system", "build a DESIGN.md", "set up the visual language", or pastes a screenshot/HTML/URL asking the AI to extract a design contract. Bootstraps a project-root `DESIGN.md` with five marker-bounded sections (atmosphere, colors, typography, components, layout) and renders an interactive HTML showroom for review and in-browser tweaking. Subcommand `/design refine "<change>"` updates one section without touching the rest.
|
|
4
|
+
version: "1.0.0"
|
|
5
|
+
source: haac-aikit
|
|
6
|
+
license: MIT
|
|
7
|
+
allowed-tools:
|
|
8
|
+
- Read
|
|
9
|
+
- Edit
|
|
10
|
+
- Write
|
|
11
|
+
- AskUserQuestion
|
|
12
|
+
- WebFetch
|
|
13
|
+
- Bash(date:*)
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## When to use
|
|
17
|
+
|
|
18
|
+
- User runs `/design` explicitly to bootstrap a design contract for the project.
|
|
19
|
+
- User pastes a screenshot, HTML, or URL and asks the AI to "extract the design language" or "match this style."
|
|
20
|
+
- User runs `/design refine "<change>"` to update one section of an existing `DESIGN.md` without disturbing the rest.
|
|
21
|
+
- The project's UI surface is being established or revamped and you want every AI tool reading the same source of truth.
|
|
22
|
+
|
|
23
|
+
Do **not** use for:
|
|
24
|
+
|
|
25
|
+
- Pure backend / CLI / data projects with no visual surface — `/design` is opt-in for a reason. Suggest the user skip it.
|
|
26
|
+
- Asking the AI to *implement* a redesign — that's a follow-up step. `/design` codifies; building from the contract is a separate task.
|
|
27
|
+
|
|
28
|
+
## What the skill produces
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
DESIGN.md ← marker-bounded contract (the source of truth)
|
|
32
|
+
docs/design/index.html ← interactive showroom (renders DESIGN.md visually)
|
|
33
|
+
.aikit/templates/design/ ← installed by aikit add design (the starter + showroom template)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`DESIGN.md` sits at the project root so every AI tool — Claude Code, Cursor, Copilot, etc. — picks it up alongside `AGENTS.md`.
|
|
37
|
+
|
|
38
|
+
## The five sections (do not rename)
|
|
39
|
+
|
|
40
|
+
Each section is wrapped in `<!-- BEGIN:haac-aikit:section:<id> --> … <!-- END:haac-aikit:section:<id> -->` markers. **The section IDs are stable across edits** — they are what `readSection` / `writeSection` use to surgically replace one block without touching the others.
|
|
41
|
+
|
|
42
|
+
| Section ID | Contents |
|
|
43
|
+
|---|---|
|
|
44
|
+
| `atmosphere` | One paragraph capturing the overall mood. Adjectives, not jargon. "Quiet, ivory, serif headlines, hand-set." |
|
|
45
|
+
| `colors` | Palette as a Markdown table or list with **hex codes in inline `code` ticks**. Each color labeled by role (background, ink, accent, etc.) and described in plain language. |
|
|
46
|
+
| `typography` | Typefaces, weights, scale. Mention the font stacks explicitly. Note when something is intentionally serif/mono. |
|
|
47
|
+
| `components` | Key UI primitives (buttons, cards, inputs, etc.) — describe shape, border weight, hover/active states. |
|
|
48
|
+
| `layout` | Spacing rhythm, container widths, grid columns, breakpoints. |
|
|
49
|
+
|
|
50
|
+
## Voice rules (the load-bearing part)
|
|
51
|
+
|
|
52
|
+
These rules exist because tools that *read* `DESIGN.md` need unambiguous instructions. Tailwind class names, design-token aliases, and framework jargon all leak abstraction the reader cannot resolve.
|
|
53
|
+
|
|
54
|
+
### YOU MUST
|
|
55
|
+
|
|
56
|
+
- **Quote every color as a hex code in inline `code` ticks.** Example: `the accent is \`#D97757\` — a warm terracotta clay`. The showroom uses these hex codes to bind color pickers; framework token names will not be detected.
|
|
57
|
+
- **Use descriptive language alongside hex.** Not just `#D97757`, but `#D97757 — a warm terracotta clay`. A reader without the showroom open should be able to picture the color.
|
|
58
|
+
- **Name typefaces explicitly with their full font stack.** `ui-serif, Georgia, "Times New Roman", serif` — not just "serif" or "default."
|
|
59
|
+
- **Describe layout numerically.** `672px content column with 24px gutters`, not "comfortable reading width."
|
|
60
|
+
|
|
61
|
+
### YOU MUST NOT
|
|
62
|
+
|
|
63
|
+
- **Use Tailwind class names in the reading path.** Never write `bg-clay-500`, `text-slate-700`, `rounded-lg`. The contract reads like a design *document*, not implementation. (Mentioning Tailwind tokens *inside fenced code blocks as implementation examples* is fine — just not as the canonical description.)
|
|
64
|
+
- **Use design-token aliases as the source of truth.** `--color-primary-500` and `$accent-clay` are downstream artifacts. The hex code is the source.
|
|
65
|
+
- **Hand-wave with "modern", "clean", "minimalist".** These adjectives describe a category, not this project. Replace with specifics: "ivory background, no shadows, hairline borders."
|
|
66
|
+
- **Reference outside design systems.** "Like Stripe" or "iOS-style cards" leaks an obligation to keep up with someone else's evolution. State the rule directly.
|
|
67
|
+
|
|
68
|
+
## Bootstrap flow
|
|
69
|
+
|
|
70
|
+
When the user invokes `/design` without arguments, or asks to set up a design system from scratch, drive this sequence:
|
|
71
|
+
|
|
72
|
+
1. **Detect input mode.** Look for:
|
|
73
|
+
- A screenshot pasted in the conversation → image input
|
|
74
|
+
- A URL → fetch and inspect HTML/CSS
|
|
75
|
+
- HTML pasted directly → parse for color, font, layout cues
|
|
76
|
+
- Pure brief ("warm, serif, ivory-and-terracotta") → synthesize from words
|
|
77
|
+
|
|
78
|
+
2. **Confirm gaps before writing.** If the input only specifies colors and atmosphere, ask the user about typography and components before guessing. Use `AskUserQuestion`. Don't invent five sections of opinion from a single sentence.
|
|
79
|
+
|
|
80
|
+
3. **Copy `starter-DESIGN.md` from `.aikit/templates/design/` to project root** as `DESIGN.md`. The starter has all five marker-bounded sections with placeholder content the AI then fills.
|
|
81
|
+
|
|
82
|
+
4. **Fill each section with `writeSection` from `src/render/markers.ts`**. This preserves the markers and lets future `/design refine` commands work surgically.
|
|
83
|
+
|
|
84
|
+
5. **Render the showroom.** Copy `template.html` from `.aikit/templates/design/` to `docs/design/index.html`. The template's JavaScript reads `DESIGN.md` data attributes and binds the live color pickers / font dropdowns.
|
|
85
|
+
|
|
86
|
+
6. **Report what shipped.** Show the path to both files and the install command if any companion artifacts need re-syncing.
|
|
87
|
+
|
|
88
|
+
## Refine subcommand
|
|
89
|
+
|
|
90
|
+
`/design refine "<change>"` is the surgical edit path. Examples:
|
|
91
|
+
|
|
92
|
+
- `/design refine "make the accent more muted, like #C2664D"` → updates only the `colors` section
|
|
93
|
+
- `/design refine "switch the headline typeface to a slab serif"` → updates only the `typography` section
|
|
94
|
+
- `/design refine "tighten the layout — 600px column"` → updates only the `layout` section
|
|
95
|
+
|
|
96
|
+
Implementation:
|
|
97
|
+
|
|
98
|
+
1. Read current `DESIGN.md` from project root with `readSection(content, "<id>", filePath)`.
|
|
99
|
+
2. Synthesize the new body for the targeted section, applying voice rules.
|
|
100
|
+
3. Write back with `writeSection(content, "<id>", newBody, filePath)`.
|
|
101
|
+
4. Confirm to the user which section changed; do not touch the others.
|
|
102
|
+
|
|
103
|
+
**Refine never re-runs bootstrap.** If the user asks for a refine but no `DESIGN.md` exists, abort and suggest `/design` (no arguments) to bootstrap first.
|
|
104
|
+
|
|
105
|
+
## Showroom template behaviors
|
|
106
|
+
|
|
107
|
+
The HTML showroom (`docs/design/index.html`) is **self-contained** — no CDN, no build step, no dependencies. Level-2 interactivity:
|
|
108
|
+
|
|
109
|
+
- **Color pickers** — every hex code in `code` ticks inside the `colors` section gets a sibling `<input type="color">` bound to a CSS custom property on a `.preview-stage` element. Changing the picker live-updates a sample of components rendered with that palette.
|
|
110
|
+
- **Font dropdowns** — the `typography` section's fonts are switchable via dropdowns whose options come from a curated specimen list. Each swap re-renders a sample paragraph live.
|
|
111
|
+
- **Copy Markdown** — a button at the top serializes the current showroom state back into a Markdown fragment the user can paste into `/design refine "..."`. This closes the loop: visual tweaks become specifications.
|
|
112
|
+
- **Light/dark toggle** — flips the `.preview-stage` between two CSS custom-property sets so designers can audit both modes without leaving the page.
|
|
113
|
+
- **No CDN, no build.** All JS inline. All CSS inline. The file opens off disk and works offline.
|
|
114
|
+
|
|
115
|
+
## Failure modes
|
|
116
|
+
|
|
117
|
+
- **DESIGN.md exists but has no markers.** Refuse to refine — the marker engine requires them. Offer to overwrite with the marker-bounded starter (`AskUserQuestion`).
|
|
118
|
+
- **Two sections share the same ID.** `validateSectionId` will reject this at write time. Repair by reading the content, choosing which copy is canonical, deleting duplicates manually.
|
|
119
|
+
- **Showroom template missing from `.aikit/templates/design/`.** Run `aikit add design` to install companion artifacts.
|
|
120
|
+
|
|
121
|
+
## Why this skill is opt-in (tier2)
|
|
122
|
+
|
|
123
|
+
Not every project has a visual surface. Backend services, CLI tools, and pipelines have no design language to codify, and shipping `/design` as tier1 would mean every user pays its context cost regardless of fit. Tier2 means a single `aikit add design` for projects that want it; the rest never load the skill.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# DESIGN
|
|
2
|
+
|
|
3
|
+
The visual contract for this project. Every AI tool reads this file alongside `AGENTS.md`. Edit a single section with `/design refine "<change>"` — the marker engine preserves the rest.
|
|
4
|
+
|
|
5
|
+
<!-- BEGIN:haac-aikit:section:atmosphere -->
|
|
6
|
+
## Atmosphere
|
|
7
|
+
|
|
8
|
+
One paragraph capturing the overall mood. Adjectives, not jargon. State the project's design *temperament* — quiet or loud, formal or playful, sparse or dense. Reference texture (grain, hairlines, drop shadows) and movement (still, hover-only, animated).
|
|
9
|
+
|
|
10
|
+
*Placeholder — replace via `/design` bootstrap with input from screenshot, HTML, URL, or design brief.*
|
|
11
|
+
<!-- END:haac-aikit:section:atmosphere -->
|
|
12
|
+
|
|
13
|
+
<!-- BEGIN:haac-aikit:section:colors -->
|
|
14
|
+
## Colors
|
|
15
|
+
|
|
16
|
+
Every color is described by **hex code in inline `code` ticks** plus a plain-language description. The showroom binds color pickers to these hex codes — framework token names will not be detected.
|
|
17
|
+
|
|
18
|
+
| Role | Hex | Description |
|
|
19
|
+
|---|---|---|
|
|
20
|
+
| Background | `#FAFAFA` | A near-white off-tone. Less clinical than pure white. |
|
|
21
|
+
| Ink | `#1A1A1A` | Off-black for body text. |
|
|
22
|
+
| Accent | `#D97757` | A warm terracotta clay — use sparingly for emphasis and links. |
|
|
23
|
+
| Muted | `#787878` | Mid-gray for secondary copy and metadata. |
|
|
24
|
+
| Surface | `#FFFFFF` | Pure white for cards and inputs sitting on the background. |
|
|
25
|
+
| Hairline | `#E5E5E5` | Subtle border between regions. |
|
|
26
|
+
|
|
27
|
+
Dark mode (when applicable): invert ink ↔ background, soften the accent to `#E08C70`, lift hairlines to `#2A2A2A`.
|
|
28
|
+
|
|
29
|
+
*Placeholder palette — replace via `/design` bootstrap.*
|
|
30
|
+
<!-- END:haac-aikit:section:colors -->
|
|
31
|
+
|
|
32
|
+
<!-- BEGIN:haac-aikit:section:typography -->
|
|
33
|
+
## Typography
|
|
34
|
+
|
|
35
|
+
Quote font stacks in full so they survive the absence of any single typeface.
|
|
36
|
+
|
|
37
|
+
- **Headlines:** `ui-serif, Georgia, "Times New Roman", serif` — used for h1/h2. Weight 600. Tight tracking: `letter-spacing: -0.01em`.
|
|
38
|
+
- **Body:** `system-ui, -apple-system, "Segoe UI", Roboto, sans-serif`. Weight 400. `line-height: 1.55`.
|
|
39
|
+
- **Mono:** `ui-monospace, "SF Mono", "Fira Code", "JetBrains Mono", monospace`. Used for inline `code` and command examples.
|
|
40
|
+
|
|
41
|
+
Scale (modular, 1.25 ratio):
|
|
42
|
+
|
|
43
|
+
| Element | Size |
|
|
44
|
+
|---|---|
|
|
45
|
+
| h1 | 36px |
|
|
46
|
+
| h2 | 24px |
|
|
47
|
+
| h3 | 18px |
|
|
48
|
+
| Body | 16px |
|
|
49
|
+
| Small | 13px |
|
|
50
|
+
|
|
51
|
+
*Placeholder type stack — replace via `/design` bootstrap.*
|
|
52
|
+
<!-- END:haac-aikit:section:typography -->
|
|
53
|
+
|
|
54
|
+
<!-- BEGIN:haac-aikit:section:components -->
|
|
55
|
+
## Components
|
|
56
|
+
|
|
57
|
+
Key primitives. Each component is described by shape, border, and states.
|
|
58
|
+
|
|
59
|
+
### Buttons
|
|
60
|
+
|
|
61
|
+
- **Primary:** background `#1A1A1A`, ink `#FAFAFA`, border-radius `6px`, padding `8px 16px`. Hover: background `#2D2D2D`. No drop shadow.
|
|
62
|
+
- **Secondary:** background transparent, ink `#1A1A1A`, border `1px solid #E5E5E5`. Hover: border `#1A1A1A`.
|
|
63
|
+
|
|
64
|
+
### Cards
|
|
65
|
+
|
|
66
|
+
- Background `#FFFFFF`, border `1px solid #E5E5E5`, border-radius `10px`, padding `18px 20px`.
|
|
67
|
+
- Hover: border shifts to accent (`#D97757`), no shadow.
|
|
68
|
+
|
|
69
|
+
### Inputs
|
|
70
|
+
|
|
71
|
+
- Background `#FFFFFF`, border `1px solid #E5E5E5`, border-radius `6px`, padding `8px 12px`.
|
|
72
|
+
- Focus: border `1px solid #D97757`, no outline ring.
|
|
73
|
+
|
|
74
|
+
*Placeholder components — replace via `/design` bootstrap.*
|
|
75
|
+
<!-- END:haac-aikit:section:components -->
|
|
76
|
+
|
|
77
|
+
<!-- BEGIN:haac-aikit:section:layout -->
|
|
78
|
+
## Layout
|
|
79
|
+
|
|
80
|
+
Numerical, not adjectival. Quote pixel widths and breakpoints.
|
|
81
|
+
|
|
82
|
+
- **Content column:** `720px` max-width, centered. Padding `64px 24px 96px` (top, sides, bottom).
|
|
83
|
+
- **Gutters:** `24px` horizontal padding inside the column.
|
|
84
|
+
- **Section rhythm:** `64px` vertical space between major sections.
|
|
85
|
+
- **Card grid:** 2 columns at full width with `12px` gap. Drops to 1 column under `600px`.
|
|
86
|
+
- **Breakpoints:** mobile <`600px`, tablet `600px–960px`, desktop >`960px`.
|
|
87
|
+
|
|
88
|
+
*Placeholder layout — replace via `/design` bootstrap.*
|
|
89
|
+
<!-- END:haac-aikit:section:layout -->
|