@milesroxas/design-hub 0.2.0 → 0.4.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.
Files changed (71) hide show
  1. package/README.md +1 -1
  2. package/core/catalog.test.ts +10 -1
  3. package/core/catalog.ts +11 -0
  4. package/core/cms.test.ts +103 -0
  5. package/core/cms.ts +178 -0
  6. package/core/export.test.ts +127 -0
  7. package/core/export.ts +120 -0
  8. package/core/formats.ts +60 -0
  9. package/core/project.test.ts +71 -0
  10. package/core/project.ts +147 -0
  11. package/dist/core/catalog.d.ts +5 -0
  12. package/dist/core/catalog.js +10 -0
  13. package/dist/core/cms.d.ts +40 -0
  14. package/dist/core/cms.js +141 -0
  15. package/dist/core/export.d.ts +52 -0
  16. package/dist/core/export.js +84 -0
  17. package/dist/core/formats.d.ts +90 -0
  18. package/dist/core/formats.js +39 -0
  19. package/dist/core/project.d.ts +56 -0
  20. package/dist/core/project.js +121 -0
  21. package/dist/scripts/bootstrap.d.ts +1 -1
  22. package/dist/scripts/bootstrap.js +38 -6
  23. package/dist/scripts/cli.js +8 -0
  24. package/dist/scripts/commands.js +8 -0
  25. package/dist/scripts/export.d.ts +42 -0
  26. package/dist/scripts/export.js +192 -0
  27. package/dist/scripts/fixtures-pull.d.ts +31 -19
  28. package/dist/scripts/fixtures-pull.js +102 -62
  29. package/dist/scripts/lib/cdp.d.ts +11 -0
  30. package/dist/scripts/lib/cdp.js +110 -0
  31. package/dist/scripts/lib/deploy.d.ts +76 -0
  32. package/dist/scripts/lib/deploy.js +94 -0
  33. package/dist/scripts/lib/vercel.d.ts +5 -0
  34. package/dist/scripts/lib/vercel.js +24 -0
  35. package/dist/scripts/new.d.ts +13 -1
  36. package/dist/scripts/new.js +43 -4
  37. package/dist/scripts/share.d.ts +63 -0
  38. package/dist/scripts/share.js +181 -0
  39. package/dist/scripts/signin.d.ts +31 -0
  40. package/dist/scripts/signin.js +119 -0
  41. package/dist/scripts/tracks.d.ts +40 -0
  42. package/dist/scripts/tracks.js +93 -0
  43. package/dist/server/paths.d.ts +2 -0
  44. package/dist/server/paths.js +2 -0
  45. package/dist/server/project.d.ts +7 -0
  46. package/dist/server/project.js +29 -0
  47. package/kit/Artboard.tsx +160 -0
  48. package/kit/artboard.css +47 -0
  49. package/kit/dials.tsx +2 -1
  50. package/package.json +1 -1
  51. package/shell/Index.tsx +49 -4
  52. package/shell/main.tsx +6 -2
  53. package/shell/shell.css +7 -3
  54. package/skills/miles-brand/SKILL.md +52 -0
  55. package/skills/miles-deploy/SKILL.md +26 -19
  56. package/skills/miles-design-hub/SKILL.md +77 -25
  57. package/skills/miles-get-hostile/SKILL.md +7 -5
  58. package/skills/miles-new-feature/SKILL.md +8 -7
  59. package/skills/miles-port/SKILL.md +14 -2
  60. package/skills/miles-port/references/emdash.md +43 -0
  61. package/skills/miles-port/references/payload.md +31 -0
  62. package/skills/miles-port/references/wordpress.md +31 -0
  63. package/skills/miles-prototype/SKILL.md +2 -2
  64. package/templates/app/README.md +1 -0
  65. package/templates/brand/README.md +48 -0
  66. package/templates/brand/index.tsx +16 -0
  67. package/templates/brand/styles.css +5 -0
  68. package/templates/site/README.md +42 -0
  69. package/templates/site/index.tsx +22 -0
  70. package/templates/site/styles.css +6 -0
  71. package/templates/space/README.md +1 -0
package/shell/shell.css CHANGED
@@ -10,7 +10,7 @@
10
10
  is not a row carries that 12px itself. */
11
11
  .index { width: min(744px, 100% - 8px); margin: 0 auto; padding: 96px 0 128px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; column-gap: 20px; align-content: start; }
12
12
  .index > * { grid-column: 1 / -1; }
13
- .index-head, .index-filter, .index-section, .index-subsection, .index-empty, .index-none, .index-foot { padding-inline: 12px; }
13
+ .index-head, .index-tracks, .index-filter, .index-section, .index-subsection, .index-empty, .index-none, .index-foot { padding-inline: 12px; }
14
14
 
15
15
  .index-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 40px; }
16
16
  .index-head h1 { font-size: 18px; line-height: 28px; font-weight: 600; text-wrap: balance; }
@@ -18,6 +18,10 @@
18
18
  .index code { font: 13px/20px var(--sys-font-mono); color: var(--text-secondary); }
19
19
 
20
20
  .index-filter { margin-bottom: 24px; }
21
+ .index-tracks { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 16px; border: 0; min-width: 0; }
22
+ .index-tracks button { height: 32px; padding: 0 12px; border: 1px solid var(--border-secondary); border-radius: var(--radius-md); background: var(--bg-primary); color: var(--text-secondary); font: inherit; font-weight: 500; cursor: pointer; transition: background-color var(--dur-hover) var(--ease-hover), color var(--dur-hover) var(--ease-hover); }
23
+ .index-tracks button[aria-pressed="true"] { background: var(--bg-active); border-color: var(--border-primary); color: var(--text-primary); }
24
+ @media (hover: hover) { .index-tracks button:hover { color: var(--text-primary); } }
21
25
  .index-filter input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border-primary); border-radius: var(--radius-md); background: var(--bg-primary); box-shadow: var(--shadow-xs); font-size: 16px; transition: border-color var(--dur-hover) var(--ease-hover); }
22
26
  .index-filter input::placeholder { color: var(--text-placeholder); }
23
27
  .index-filter input:focus-visible { border-color: var(--border-brand); }
@@ -136,9 +140,9 @@
136
140
  prototype, and the chosen row holds, so the eye keeps what it picked.
137
141
  The browser paints this page until the next one is ready, so the fade
138
142
  fills a wait that was blank. */
139
- .index-head, .index-filter, .index-section, .index-subsection, .index-alternates-label, .index-foot { transition: opacity var(--dur-dialog-out) var(--ease-in); }
143
+ .index-head, .index-tracks, .index-filter, .index-section, .index-subsection, .index-alternates-label, .index-foot { transition: opacity var(--dur-dialog-out) var(--ease-in); }
140
144
  .index.is-leaving .index-alternates::before { opacity: 0; transition: opacity var(--dur-dialog-out) var(--ease-in); }
141
- .index.is-leaving :is(.index-head, .index-filter, .index-section, .index-subsection, .index-alternates-label, .index-foot, .index-row:not([data-chosen]), .index-card:not([data-chosen])) { opacity: 0; }
145
+ .index.is-leaving :is(.index-head, .index-tracks, .index-filter, .index-section, .index-subsection, .index-alternates-label, .index-foot, .index-row:not([data-chosen]), .index-card:not([data-chosen])) { opacity: 0; }
142
146
  .index.is-leaving :is(.index-row, .index-card) { pointer-events: none; }
143
147
 
144
148
  :root[data-motion="reduce"] .index-rise { animation-name: index-fade; animation-duration: 120ms; animation-timing-function: linear; }
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: miles-brand
3
+ description: "Brand collateral as prototypes: social post templates, stories, link previews, banners, slides and print, drawn on artboards at real pixel size from the project's tokens and DESIGN.md, Brand, with copy and layout on dials, and written to PNG and PDF with pnpm export. Load when the work is the brand track, or when the user asks for a post, a story, a deck, a slide, a one-pager, a flyer, a banner, an export or a template. Triggers on: brand, collateral, social post, Instagram, LinkedIn, story, carousel, link preview, banner, slide, deck, presentation, one-pager, flyer, print, A4, letter, artboard, export, PNG, PDF, template."
4
+ ---
5
+
6
+ # Brand collateral
7
+
8
+ A piece of collateral here is a template, not a picture: one component that holds every post the team will write, drawn at the size it ships, with its copy and layout on dials. Files come out of it with `pnpm export`, so the next post is a dial change, not a redraw.
9
+
10
+ ## Before the first artboard
11
+
12
+ 1. **Read `DESIGN.md`, Brand.** Logo, imagery, collateral type, formats and voice. Where it is empty, ask for the one answer you need, write it there, then build. Why: collateral repeats; a guess on the first post becomes the brand on the tenth.
13
+ 2. **Read `prototypes/sample-social/`** when the project kept it. It is the worked example and wins over any description here.
14
+ 3. **Scaffold** with `pnpm new <slug> --track brand --feature <feature>` (`--sprint` for the feature's primary). The README's Formats table lists each artboard, its format and where it runs, before any code.
15
+
16
+ ## Drawing
17
+
18
+ - **Real pixels.** An artboard is its format's size (`post-square` is 1080 × 1080, `slide` 1920 × 1080, `a4` 794 × 1123). Write type, spacing and radii at that size: a feed headline is 64 to 104px, never the 32px a web page would use. The Board scales the view; the values never change. Why: export writes the values in the code, so a value tuned on a scaled preview ships at the wrong size.
19
+ - **Position inside the frame.** The artboard is `position: relative` with fixed size: lay out with an absolutely filled root (`position: absolute; inset: 0`) and flex or grid inside it. Nothing scrolls, nothing depends on the viewport.
20
+ - **Tokens only.** Colours, fonts and radii come from `kit/tokens.css`; a new brand colour is a token first, then used. The logo is `<Icon name={BRAND.glyph}>` or the file DESIGN.md names, never redrawn.
21
+ - **Safe areas.** A story keeps type, buttons and the logo out of its top and bottom 250px; the Board shades them (Controls → Board → Guides). Other formats keep a margin of at least 64px at 1080 wide.
22
+ - **One template, many formats.** Draw the content once as a component and place it in one `<Artboard>` per format, adjusting per format with `[data-format="story"] .x { … }` in CSS. Never a second copy of the markup per format.
23
+
24
+ ## Dials are the template's slots
25
+
26
+ Every slot an editor will change is a dial or a fixture, never a hard-coded string:
27
+
28
+ | Slot | How |
29
+ | --- | --- |
30
+ | Copy (kicker, headline, subhead, call to action) | `fixtures.json`, one item per post; `text` names headline and subhead so `longest` stresses them |
31
+ | Which post | A `post` select over the set |
32
+ | Layout (photo, type only, quote) | A `layout` select; each option a state in the README |
33
+ | Tone (brand, light, inverse) | A `tone` select |
34
+
35
+ The README's States table lists every combination a reviewer must see: each fixture set, each layout, each tone. `empty` and `missing` are real states here too: a post with no image is the one that runs on a busy day.
36
+
37
+ ## Export
38
+
39
+ ```bash
40
+ pnpm export <slug> # every artboard at its format's default
41
+ pnpm export <slug> --dials '{"Review":{"layout":"type"}}' # a chosen state, by panel and dial name
42
+ pnpm export <slug> --as pdf # everything as PDF
43
+ pnpm export <slug> --scale 2 # PNGs at twice the pixels
44
+ ```
45
+
46
+ PNG for posts, stories, link previews and banners, at the exact size platforms ask for; one PDF per format for slides and print, each page at the format's size. Files land in `exports/<slug>/` (gitignored), named `<slug>-<artboard name>.png`. It needs Chrome, Chromium or Edge on the machine (`CHROME_PATH` for another location).
47
+
48
+ Export the state the README's Decision names. When the user asks for "the posts", export each post in the set: one `--dials` per post, `--out exports/<slug>/post-<n>`.
49
+
50
+ ## Done
51
+
52
+ The definition of done in `AGENTS.md`, plus: every artboard exports without an error, the exported files are opened and look like the board, and nothing sits in a story's safe bands.
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  name: miles-deploy
3
- description: "Deploy the prototypes to Vercel behind the password gate and hand out the share link: the pre-flight (pnpm preflight), the GATE_* env, the review store for comments, the handover message. Load when the user asks to deploy, share, send a link, set or rotate the password, turn on comments, or check the work before any of those. Triggers on: deploy, share, share link, send to the client, Vercel, password, gate, GATE_PASSWORD, production, preview URL, pre-flight, preflight, ready to send, turn on comments, review store."
3
+ description: "Deploy the prototypes to Vercel behind the password gate and hand out the share link: the pre-flight (pnpm preflight), the GATE_* env, the review store for comments, the handover message. Load when the user asks to deploy, share, send a link, set or rotate the password, turn on comments, or check the work before any of those. Triggers on: deploy, share, share link, send to the client, send it to the team, put it online, publish, go live, update the link, push the latest, Vercel, sign in to Vercel, vercel login, password, gate, GATE_PASSWORD, production, preview URL, pre-flight, preflight, ready to send, turn on comments, review store, invite someone."
4
4
  ---
5
5
 
6
6
  # Deploy
7
7
 
8
- Pushing `main` deploys the project to the linked Vercel project. Every path sits behind the gate in `proxy.ts`: the shared password opens it to view, and an invite link opens it to one named person who can comment. The mechanics are scripts; this skill decides when they run and what the user is told.
8
+ `pnpm share` deploys the project to the linked Vercel project and checks the live link; the user never types a command. Every path sits behind the gate in `proxy.ts`: the shared password opens it to view, and an invite link opens it to one named person who can comment. The mechanics are scripts; this skill decides when they run and what the user is told.
9
9
 
10
10
  ## Before every link goes out
11
11
 
12
- Run from the project root:
12
+ `pnpm share` runs this first and stops on a failure; run it alone to check without deploying:
13
13
 
14
14
  ```bash
15
15
  pnpm preflight
@@ -29,30 +29,37 @@ step failed?
29
29
 
30
30
  Never send the link with a failed step, and never skip one with `--skip` without the user's word. Why: the link is what the client signs off on, and every step guards something they would see (a private phone number, a state nobody listed, a page that will not load).
31
31
 
32
+ ## Signing in
33
+
34
+ Every Vercel step needs the CLI signed in. The user never opens a terminal for it:
35
+
36
+ ```bash
37
+ pnpm signin
38
+ ```
39
+
40
+ Signed in, it prints `signedIn: true` and the account. Signed out, it starts the sign-in in the background and prints a `url` at once. Send the user that link to open and approve, then run `pnpm signin --wait 300`, which returns when they have. Why a link: `vercel login` is a device sign-in that waits for a browser click, so a terminal adds nothing but a step the user can get wrong. Any command below that answers "not signed in" gets the same treatment.
41
+
32
42
  ## First deploy
33
43
 
34
- 1. The user signs in once, in their own terminal: `vercel login`. It is interactive; never run it for them.
35
- 2. From the project root:
44
+ 1. `pnpm signin` (above).
45
+ 2. Ask which Vercel team the project goes in when `vercel teams ls` lists more than one. Then, from the project root:
36
46
  ```bash
37
- pnpm bootstrap --vercel <project-name> --team <team-slug>
47
+ pnpm bootstrap --vercel <project-name> --team <team-slug> [--review]
38
48
  ```
39
- `--team` is the Vercel team the project is created in (`vercel teams ls` lists them); without it the CLI's current team wins, which is often not the one the user means. It links the project, writes `GATE_PASSWORD` (12 readable characters, or `--gate-password <word>`) and a fresh `GATE_SECRET` to `.env` and to Production and Preview, and prints the password in `share.password`. A second run keeps what is set.
40
- 3. `pnpm preflight`, then push `main` (or `vercel --prod` from the project root).
41
- 4. On a Pro team Vercel turns Vercel Authentication on for every new project, which sends each visitor to a Vercel login before the gate. Turn it off for Production once: Project Settings, Deployment Protection, Vercel Authentication, set to Only Preview Deployments or Disabled. The hub's gate is the protection. Test by opening the production URL in a private window: the password page must appear, not vercel.com.
42
- 5. The handover message, in one message: the URL, the password, which prototype to open (the sprint's slug), the walkthrough at `/guide/<feature>/`, and that Controls is the round button at the top of the page. A reviewer who is not told about Controls reviews one state. Never send `GATE_SECRET`.
49
+ `--team` is the team the project is created in; without it the CLI's current team wins, which is often not the one the user means. It links the project, connects it to the GitHub repo (`vercel.git`: `connected`, `kept`, or `none` with a warning), turns Vercel Authentication off (the hub's gate is the protection), writes `GATE_PASSWORD` (12 readable characters, or `--gate-password <word>`) and a fresh `GATE_SECRET` to `.env` and to Production and Preview, and prints the password in `share.password`. `--review` also adds the comment store (see Comments). A second run keeps what is set.
50
+ 3. Deploy:
51
+ ```bash
52
+ pnpm share
53
+ ```
54
+ It runs the pre-flight, deploys, waits for the build, and requests the production URL signed out, which must answer with the password page. Connected to the repo and on a clean `main`, it pushes and follows the build for that commit; otherwise it uploads the folder with the Vercel CLI. It refuses uncommitted changes rather than deploy something other than the commit: ask the user before committing. `ok: false` names the `stage` (`preflight`, `deploy` or `gate`) and the fix; a failed pre-flight step is walked as above, and nothing deploys until it passes.
55
+ 4. The handover message, from the JSON's `share`, in one message: the `url`, the `password`, which prototype to open (`share.open`: its path and its walkthrough), and that Controls is the round button at the top of the page. A reviewer who is not told about Controls reviews one state. Never send `GATE_SECRET`.
43
56
 
44
57
  ## Comments
45
58
 
46
- Ask the user once whether reviewers should comment on the link. If yes:
47
-
48
- ```bash
49
- pnpm bootstrap --vercel <project> --review [--typesafe-key <key>]
50
- ```
51
-
52
- It adds Upstash Redis to the project through the Vercel Marketplace and copies the store's credentials into `.env`. If it stops on the Marketplace terms, the user runs `vercel integration add upstash/upstash-kv` once in their terminal, then you rerun. With TypeSafe on, comments are sorted by kind and state as they arrive. Redeploy so the env reaches the site, then invite the first editor:
59
+ Ask the user once whether reviewers should comment on the link; ask before the first deploy, so one `bootstrap` carries `--review`. If yes, `--review [--typesafe-key <key>]` adds Upstash Redis to the project through the Vercel Marketplace and copies the store's credentials into `.env`. The first time on a team it can stop on the Marketplace terms: send the user the link in its `fix` to accept, then rerun. With TypeSafe on, comments are sorted by kind and state as they arrive. `pnpm share` after it, so the env reaches the site, then invite the first editor:
53
60
 
54
61
  ```bash
55
- pnpm people invite --name "<user>" --team "<studio>" --role editor --site https://<deployment>
62
+ pnpm people invite --name "<user>" --team "<studio>" --role editor --site <share.url>
56
63
  ```
57
64
 
58
65
  Send them the link; from then on, editors invite reviewers from the People tab. `miles-review` owns working from the comments.
@@ -60,7 +67,7 @@ Send them the link; from then on, editors invite reviewers from the People tab.
60
67
  ## Rotating access
61
68
 
62
69
  - **A reviewer leaves:** revoke them in the People tab, or `pnpm people revoke <id>`. Their sessions end on their next page load.
63
- - **The shared password leaked:** `pnpm bootstrap --vercel <project> --gate-password <new>`, then redeploy. Every password visitor signs in again; invited people are not affected.
70
+ - **The shared password leaked:** `pnpm bootstrap --vercel <project> --gate-password <new>`, then `pnpm share`. Every password visitor signs in again; invited people are not affected.
64
71
 
65
72
  ## Security, never weakened for a prototype
66
73
 
@@ -9,38 +9,70 @@ The entry point. The user never starts in a terminal: they ask for a new project
9
9
 
10
10
  Someone who does not use Claude Code gets the same result from the setup app: `Design Hub.command` in the Design Hub repo opens a page that asks the name, the place and GitHub, then runs the same two commands. Point a non-technical user there instead of this skill when they ask how to start without Claude.
11
11
 
12
- ## 1. Ask, all at once, before anything runs
12
+ ## 1. Check the machine first
13
13
 
14
- Ask these in one message and wait for every answer. Defaults in brackets.
15
-
16
- 1. **Where should the project live?** An absolute path; its folder name becomes the repo name. [`~/SITES/<name>`]
17
- 2. **Which GitHub account or org owns the repo, private or public, or no GitHub repo?** [the account `gh` is signed in as, private]
18
- 3. **Start from a Paper comp or from the sample prototype?** [sample]
19
- 4. **If Paper: the link to the Paper frame or page.**
20
- 5. **Does the design include a shell? Which frames hold it?** A product shell is sidebar, top bar and content; a website shell is header and footer, plus a pre-footer when the design treats it as a global. [no shell: prototypes stand in the Space]
21
- 6. **Install the `miles-*` skills globally or for this project only?** [project only; the clone already has them]
22
- 7. **Turn on TypeSafe checks? If yes, the TypeSafe API key.** [off] Why opt-in: a template anyone can use cannot require a paid account.
23
- 8. **Will the project run in Conductor workspaces? If yes, the branch they land on.** [no]
24
-
25
- Comments and the share link come later, with `miles-deploy`, because they need a Vercel project.
26
-
27
- ## 2. Check the machine
14
+ These are read-only, and their answers become the choices in step 2, so run them before asking anything.
28
15
 
29
16
  ```bash
30
- node --version # 22.18 or newer; else install the current LTS
31
- pnpm --version # else: corepack enable
32
- gh auth status # only with a GitHub repo; else ask the user to run gh auth login
17
+ node --version # 22.18 or newer; else install the current LTS
18
+ pnpm --version # else: corepack enable
19
+ gh auth status # the signed-in account; none means "No GitHub repo" is the only working choice until gh auth login
20
+ gh api user/orgs --jq '.[].login' # the orgs that can own the repo
33
21
  ```
34
22
 
35
23
  The skills these lean on, installed globally: `emil-prototype`, `emil-writing-skills`, `impeccable`. Check `~/.claude/skills/` and install any that is missing with `npx skills add <source> -g -y`; say which were added.
36
24
 
25
+ A cloud container (no `~/SITES`, a home such as `/home/user`, a fresh VM per session) loses anything installed under `~` when the session ends. There, default the location to the working directory and skip the Conductor question: Conductor runs on the user's own machine.
26
+
27
+ ## 2. Ask before anything is created
28
+
29
+ Ask with the host's question tool (`AskUserQuestion` in Claude Code), never as a numbered list in chat. Why: each answer is one click, the recommended choice is already marked, and nothing gets skipped in a wall of text. The tool takes at most 4 questions per call and 2 to 4 options per question, and it always adds "Other" for a typed answer. Put the recommended option first with "(Recommended)" at the end of its label. Take the project name from the request; ask for it in chat only when the request has none.
30
+
31
+ **Round 1: the project.**
32
+
33
+ | Header | Question | Options |
34
+ |---|---|---|
35
+ | Location | Where should `<name>` live? Its folder name becomes the repo name. | `~/SITES/<name>` (Recommended) · `~/Design/<name>`; in a cloud container, `<working dir>/<name>` (Recommended). "Other" takes any absolute path. |
36
+ | GitHub | Who owns the repo, and who can see it? | `<gh login>`, private (Recommended) · `<gh login>`, public · `<org>`, private for the first org from step 1 · No GitHub repo. "Other" takes another owner. |
37
+ | Tracks | What is this engagement? Pick every one that applies. (`multiSelect: true`) | Product: app screens, handed to the client's engineers as a spec · Website: pages on a CMS · Brand collateral: social posts, slides, print. A full-service project picks all three. |
38
+ | Start | Start from a Paper comp or from the samples? | The samples (Recommended) · Paper comp |
39
+
40
+ The tracks decide everything a shell question used to: product draws `AppShell`, website draws `SiteShell`, brand draws fixed-size artboards with no shell. Never ask about a shell separately.
41
+
42
+ **Round 2: the setup.** Ask Platform only with the website track; leave Conductor out in a cloud container.
43
+
44
+ | Header | Question | Options |
45
+ |---|---|---|
46
+ | Platform | Where is the website built? | Webflow · Payload · WordPress · EmDash: Astro, deployed on Cloudflare. "Other": not decided yet, which leaves the platform unset until the port asks. |
47
+ | Skills | Install the `miles-*` skills for this project only, or globally? | Project only: the project already has them (Recommended) · Globally |
48
+ | TypeSafe | Turn on TypeSafe's Jev checks? | Off (Recommended) · On: I have an API key. Why opt-in: a template anyone can use cannot require a paid account. |
49
+ | Conductor | Will the project run in Conductor workspaces? | No (Recommended) · Yes, landing on `main` · Yes, on another branch (they type it in "Other") |
50
+
51
+ **Round 3: the share link, and the front end.** Ask Front end only for Payload or WordPress: Webflow renders its own pages and EmDash is always Astro.
52
+
53
+ | Header | Question | Options |
54
+ |---|---|---|
55
+ | Share | Put the prototypes on a password-protected link now? | Yes, with comments (Recommended) · Yes, view only · Later. Why now: everything it needs is answered in one sitting, and the first link proves the deploy works before there is client work on it. |
56
+ | Front end | Which front end will the site use? | Astro (Recommended) · Next.js |
57
+
58
+ **Round 4: typed answers, one short chat message each, only for what was chosen.**
59
+
60
+ - Paper: the link to the Paper frame or page, and which frames hold the shell of each track: the sidebar and top bar for product, the header, footer and any pre-footer for website.
61
+ - TypeSafe on: the API key. If the host has a secret field (such as `request_secret`), use it instead of chat, because a key typed in chat stays in the transcript.
62
+ - Always, last: "Anything about the product for `PRODUCT.md`? Reply 'skip' to leave it empty."
63
+
64
+ Without a question tool (another agent, or a host that lacks one), ask everything in one message with defaults in brackets, and wait for every answer. Nothing in steps 3 to 6 runs until every round is answered.
65
+
66
+ With Share answered Later, comments and the share link come later, with `miles-deploy`.
67
+
37
68
  ## 3. Create the project
38
69
 
39
70
  ```bash
40
- npm create @milesroxas/design-hub@latest -- --path <path> --visibility private|public|none [--owner <owner>]
71
+ npm create @milesroxas/design-hub@latest -- --path <path> --visibility private|public|none [--owner <owner>] \
72
+ --track <track> [--track <track> ...] [--platform webflow|payload|wordpress|emdash] [--frontend astro|next]
41
73
  ```
42
74
 
43
- It copies the template, pins the `@milesroxas/design-hub` package, installs, puts the `miles-*` skills in `.claude/skills/`, makes the first commit, and with `private` or `public` creates the GitHub repo and pushes. It prints one JSON object; `ok: false` names the fix. A second run finds the project and changes nothing, so rerun it after a fix instead of finishing by hand.
75
+ One `--track` per track picked. It copies the template, pins the `@milesroxas/design-hub` package, installs, puts the `miles-*` skills in `.claude/skills/`, records the tracks and platform in `.design-hub/project.json`, keeps only the picked tracks' samples, makes the first commit, and with `private` or `public` creates the GitHub repo and pushes. It prints one JSON object; `ok: false` names the fix. A second run finds the project and changes nothing, so rerun it after a fix instead of finishing by hand.
44
76
 
45
77
  ## 4. Run the setup
46
78
 
@@ -48,15 +80,35 @@ It copies the template, pins the `@milesroxas/design-hub` package, installs, put
48
80
  pnpm --dir <path> bootstrap [--typesafe-key <key>] [--conductor --branch <branch>]
49
81
  ```
50
82
 
51
- It picks a port nothing holds and no other project claims, writes it to `.env` and `.claude/launch.json`, and applies the flags. Read the JSON's `warnings`. With question 6 answered globally: `npx skills add milesroxas/design-hub -g -y`.
83
+ It picks a port nothing holds and no other project claims, writes it to `.env` and `.claude/launch.json`, and applies the flags. Read the JSON's `warnings`. With the skills answered globally: `npx skills add milesroxas/design-hub -g -y`.
84
+
85
+ ## 4b. Put it on a link, when Share was a yes
86
+
87
+ The user does nothing in a terminal here; each step that needs them is one link to click.
88
+
89
+ 1. `pnpm --dir <path> signin`. Signed out, it prints a `url`: send it to the user to approve, then `pnpm --dir <path> signin --wait 300`.
90
+ 2. `vercel teams ls`; with more than one team, ask which with the question tool (personal account first when it is listed).
91
+ 3. `pnpm --dir <path> bootstrap --vercel <name> --team <team-slug>`, plus `--review` for comments. It links the project, connects the GitHub repo, sets the password and turns Vercel's own login off. A first `--review` on a team can stop on the Marketplace terms: send the user the link in `fix`, then rerun.
92
+ 4. `pnpm --dir <path> share --cli`. `--cli` uploads the folder, since the setup may have left files uncommitted; later deploys push `main`. On `ok: false`, follow `stage` and `fix` (the pre-flight steps are in `miles-deploy`).
93
+ 5. With comments: `pnpm --dir <path> people invite --name "<user>" --role editor --site <share.url>`.
94
+
95
+ Give the user `share.url`, `share.password` and the invite link in the closing message, and say the link shows the samples until the first feature replaces them.
52
96
 
53
97
  ## 5. Record what was answered
54
98
 
55
- Write the shell answer under `DESIGN.md`, Shell (kind, the Paper frames, or "none"), so it is built once and every later session reads it instead of asking. Fill `PRODUCT.md` from what the user said about the product; leave a section empty only when they said nothing about it, and say so.
99
+ Write the shell of each track under `DESIGN.md`, Shell: product is `AppShell`, website is `SiteShell`, brand has none; add the Paper frames that hold each, or "from the sample" without Paper. It is built once and every later session reads it instead of asking. The tracks themselves live in `.design-hub/project.json`; never copy them into prose that could drift from it. Fill `PRODUCT.md` from what the user said about the product; leave a section empty only when they said nothing about it, and say so.
56
100
 
57
101
  ## 6. Hand off
58
102
 
59
- - **Paper start:** open the Paper link and load `miles-paper-to-prototype`. It reads the fonts and tokens first, then the shell frames, then the feature frame, and leaves `sample-list/` in place as the reference until the first feature exists.
60
- - **Sample start:** `pnpm dev` and open `http://localhost:<port>/sample-list/`; point the user at `/guide/sample/` for the walkthrough. The next step is `miles-new-feature`.
103
+ - **Paper start:** open the Paper link and load `miles-paper-to-prototype`. It reads the fonts and tokens first, then the shell frames, then the feature frame, and leaves the samples in place as the reference until the first feature exists.
104
+ - **Sample start:** `pnpm dev`, then open each kept track's sample and point the user at its walkthrough:
105
+
106
+ | Track | Sample | Walkthrough |
107
+ |---|---|---|
108
+ | product | `/sample-list/` | `/guide/sample/` |
109
+ | website | `/sample-page/` | `/guide/sample-site/` |
110
+ | brand | `/sample-social/` | `/guide/sample-brand/` |
111
+
112
+ The next step is `miles-new-feature`.
61
113
 
62
- Close with the path, the port, the repo URL when there is one, whether TypeSafe is on, and the one command that starts the server. Nothing is committed unless the user asks.
114
+ Close with the path, the port, the repo URL when there is one, the share link, password and invite when Share was a yes, the tracks and the website platform, whether TypeSafe is on, and the one command that starts the server. Nothing is committed unless the user asks.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: miles-get-hostile
3
- description: "Hostile fixtures for a prototype: fixtures.json with real data from the CMS or the comp, the missing set by hand, and the strategy and design answers for the edge cases (longest, empty, maximum count, missing media). Load when writing or changing fixtures.json, when a reviewer asks what happens with no items or a long name, or when a state needs data to reach it. Triggers on: fixtures, fixture set, hostile, edge case, worst content, longest, empty state, max count, missing image, real data, CMS pull, collection items, fixtures-pull, Webflow token."
3
+ description: "Hostile fixtures for a prototype: fixtures.json with real data from the CMS or the comp, the missing set by hand, and the strategy and design answers for the edge cases (longest, empty, maximum count, missing media). Load when writing or changing fixtures.json, when a reviewer asks what happens with no items or a long name, or when a state needs data to reach it. Triggers on: fixtures, fixture set, hostile, edge case, worst content, longest, empty state, max count, missing image, real data, CMS pull, collection items, fixtures-pull, Webflow token, Payload, WordPress, EmDash."
4
4
  ---
5
5
 
6
6
  # Get hostile
@@ -23,10 +23,12 @@ Pretty placeholder data hides the decision. Every prototype carries five sets, s
23
23
 
24
24
  ## Where `real` comes from, cheapest first
25
25
 
26
- 1. **A Webflow project with `WEBFLOW_TOKEN` in `.env`.** Run `pnpm fixtures-pull <slug> --collection <id>` once with no `--map`: it lists the collection's fields. Then pull with one `--map key=field.path` per field the component renders (`--map cover=thumbnail.url`). It pages through any `--limit` and keeps every other key in `fixtures.json`. Why a script: it costs no tokens per item, so a pull of 200 items costs the same as 20.
27
- 2. **A Webflow project without a token.** One call to the Webflow MCP's CMS tool for the collection behind the design, `limit` 20 or fewer. Keep only the fields the component renders. Never a full-collection pull: every field of every item spends tokens on nothing the component shows.
28
- 3. **No CMS.** Write `real` from the content in the Paper comp, word for word. Eight items minimum, because a list of three never shows its rhythm.
29
- 4. **A different CMS.** One read of up to 20 items with the same field cut. Say which tool was used in the README's Fixtures section.
26
+ 1. **The project's CMS, by script.** `pnpm fixtures-pull <slug>` reads the platform in `.design-hub/project.json`: Webflow (`WEBFLOW_TOKEN`), Payload (`PAYLOAD_URL`, `PAYLOAD_API_KEY`) or WordPress (`WORDPRESS_URL`), each in `.env`; a missing key comes back with the fix. Run it once with `--collection <id or slug>` and no `--map`: it lists the field paths with a sample of each. Then pull with one `--map key=path` per field the component renders (`--map cover=thumbnail.url`, `--map title=title.rendered`). It pages through any `--limit`, keeps every other key in `fixtures.json`, and turns WordPress's rendered HTML into plain text. Why a script: it costs no tokens per item, so a pull of 200 items costs the same as 20.
27
+ 2. **EmDash, or any CMS with a JSON export.** Write the items to a file (EmDash: `npx emdash content list <collection> --json > items.json`), then `pnpm fixtures-pull <slug> --from items.json`, first without `--map` to list the paths, then with it. Delete the file after: it is a copy of client content.
28
+ 3. **A Webflow project without a token.** One call to the Webflow MCP's CMS tool for the collection behind the design, `limit` 20 or fewer. Keep only the fields the component renders. Never a full-collection pull: every field of every item spends tokens on nothing the component shows.
29
+ 4. **No CMS.** Write `real` from the content in the Paper comp, word for word. Eight items minimum, because a list of three never shows its rhythm.
30
+
31
+ Say where `real` came from in the README's Fixtures section: the platform and the collection.
30
32
 
31
33
  Strip anything that identifies a private person before writing it down: a phone number, a personal email, a home address. `pnpm preflight` stops on every email and phone number until each is replaced or confirmed as a business contact.
32
34
 
@@ -14,22 +14,23 @@ One feature is one slug used in two places: `docs/sprints/<slug>/` and the `feat
14
14
  - The feature's main prototype, the one its walkthrough opens → `--sprint`. One per feature; `pnpm new` refuses a second.
15
15
  - Another full take on the same flow, to compare against the primary → `--alternate`. Refused until the primary exists.
16
16
  - A side question about one part (a menu's motion, a loading state) → exploration, the default.
17
- 3. **Where does it stand?** `--app` when the question is about the feature in context (the shell from `DESIGN.md`, Shell); nothing when it is one thing alone in the Space.
18
- 4. **Scaffold.** From the project root:
17
+ 3. **Which track?** Read `.design-hub/project.json` (or `pnpm tracks`). A project with one track uses it. A project with several needs `--track product|website|brand`: product is app screens, website is CMS pages, brand is collateral (social posts, slides, print). `pnpm new` refuses a track the project does not have, because the track decides the shell, the sample to read, and how `miles-port` hands it off.
18
+ 4. **Where does it stand?** `--app` when the question is about the feature in context: the track's shell, `AppShell` for product and `SiteShell` for website, as `DESIGN.md`, Shell, describes. Nothing when it is one thing alone in the Space. Brand is always a `Board` of artboards, whatever the flags; `miles-brand` takes over from step 6.
19
+ 5. **Scaffold.** From the project root:
19
20
  ```bash
20
- pnpm new <slug> --app --sprint --feature <feature> --title "Title"
21
+ pnpm new <slug> --app --sprint --feature <feature> --track website --title "Title"
21
22
  pnpm guide <feature> # once per feature, for the sprint
22
23
  ```
23
- The scaffolder fills the frontmatter and refuses a bad slug, a second sprint, or an alternate without a primary. Never create the folder by hand: a folder without the README's frontmatter is invisible to the index.
24
- 5. **Write the README before any code**, top to bottom:
24
+ The scaffolder fills the frontmatter, `track` included, and refuses a bad slug, a second sprint, an alternate without a primary, or a track the project lacks. Never create the folder by hand: a folder without the README's frontmatter is invisible to the index.
25
+ 6. **Write the README before any code**, top to bottom:
25
26
  - **Problem.** What is wrong or unknown today, and for whom. Two sentences.
26
27
  - **Question.** The one decision the prototype exists to make. One sentence, a question mark. If there are two questions, there are two prototypes.
27
28
  - **Flows** (app) or **Directions** (space). A table: each flow with where it starts and its edge cases; each direction with its name and the axis it varies on.
28
29
  - **States.** Every state the prototype will hold and how to reach it. Start with the five fixture sets (`miles-get-hostile`); add the feature's own (selected, editing, a run in progress). The guard and `miles-port` read this table.
29
30
  - **Fixtures.** Where `real` comes from and the design's maximum count.
30
31
  - **Decision.** Empty.
31
- 6. **Design doc.** `docs/sprints/<slug>/design-doc.md` holds what the prototype tests: the context, the proposal, the open decisions. Write it when the feature has more than one flow; a single exploration needs only its README.
32
- 7. **Then build**, under `miles-prototype`.
32
+ 7. **Design doc.** `docs/sprints/<slug>/design-doc.md` holds what the prototype tests: the context, the proposal, the open decisions. Write it when the feature has more than one flow; a single exploration needs only its README.
33
+ 8. **Then build**, under `miles-prototype`.
33
34
 
34
35
  ## The walkthrough
35
36
 
@@ -19,7 +19,18 @@ Read `prototypes/<slug>/`, never the running prototype. Refuse to start, naming
19
19
 
20
20
  ## Branch: where is it going?
21
21
 
22
- Ask one question first: Webflow, or a codebase (the path to its repo)? Then walk one branch. Both follow three rules:
22
+ The prototype's `track:` and `.design-hub/project.json` answer this before anyone is asked:
23
+
24
+ | Track | Where it goes |
25
+ | --- | --- |
26
+ | `product` | The client's engineers build it; this studio does not touch their codebase. The port is the report alone: the state map, tokens and components by name, the fixtures as their test data. Skip both build branches below. |
27
+ | `website`, platform `webflow` | The Webflow branch. |
28
+ | `website`, platform `payload`, `wordpress` or `emdash` | The codebase branch, on the site's front end (`website.frontend`: Astro or Next; EmDash is always Astro, deployed to Cloudflare). Ask only for the path to the site's repo. |
29
+ | `website` without a platform | Stop and ask where the site is built, then record it: `pnpm tracks set --track <every track> --platform <platform> [--frontend astro|next]`. |
30
+ | `brand` | The export is the hand-off: `pnpm export <slug>` with the Decision's dial state (`miles-brand`). When the client wants the template itself in Figma, Canva or Keynote, the report lists each slot, format and value to rebuild there. Skip both build branches below. |
31
+ | no `track:` (a project made before tracks) | Ask one question: Webflow, or a codebase (the path to its repo)? |
32
+
33
+ Then walk one branch. Both follow three rules:
23
34
 
24
35
  - **The target's conventions win.** Where a token or component has no match in the target, list it in the port report. Never invent one in the target.
25
36
  - **Dials become fixed values.** DialKit never ships. Each dial's committed default is the value; the README's Decision is the source.
@@ -44,7 +55,7 @@ Ask one question first: Webflow, or a codebase (the path to its repo)? Then walk
44
55
  3. **Fixtures travel.** Each fixture set becomes a test fixture or a story in the target's own convention, and each README state a test or a story. Why: the hostile sets are where QA catches the edge cases, so they go with the feature.
45
56
  4. **A new branch**, never the target's main. Name it after the feature slug.
46
57
 
47
- Read the reference for the target's stack before step 2, when there is one: `references/next.md` for Next.js, `references/astro.md` for Astro. The target's own `AGENTS.md` still wins over both. For any other stack, the target's docs are the reference.
58
+ Read the references for the target's stack before step 2: the front end's (`references/next.md` for Next.js, `references/astro.md` for Astro) and the CMS's (`references/payload.md`, `references/wordpress.md`, `references/emdash.md`). The target's own `AGENTS.md` still wins over both. For any other stack, the target's docs are the reference. The CMS (Payload, WordPress, EmDash) owns the content model: map each fixture key to a field of the collection the page reads, and list a key with no field in the report instead of adding one to the CMS unasked.
48
59
 
49
60
  ## Output: the port report
50
61
 
@@ -54,6 +65,7 @@ Read the reference for the target's stack before step 2, when there is one: `ref
54
65
  - **Mapped.** Tokens and components with their target names.
55
66
  - **Not mapped.** Tokens with no target, states with no mechanism, and what the user has to decide for each.
56
67
  - **Webflow build spec** (Webflow branch): the structure, classes, variables and interactions a person builds in the Designer, in build order.
68
+ - **Engineering hand-off** (product track): the states, values and fixtures an engineer needs without opening the prototype, in the order they would build them.
57
69
  - **Where it is.** The branch, the collection, the draft items.
58
70
 
59
71
  The report is the review surface. Nothing goes live until the user has read it.
@@ -0,0 +1,43 @@
1
+ # Porting into EmDash
2
+
3
+ EmDash is a CMS that runs inside an Astro site, deployed on Cloudflare (Workers, with D1 for content and R2 for media). The front end is that Astro site, so read `astro.md` for components, islands, states and tests; this file covers EmDash's content model and how pages read it. Read the target's `astro.config.mjs`, `src/live.config.ts` and its pages first; where they decide something, they win.
4
+
5
+ ## Where each piece goes
6
+
7
+ | Prototype | EmDash |
8
+ | --- | --- |
9
+ | `fixtures.json` `real` | A collection. Collections live in the database, not in code: made in the admin's schema builder (`/_emdash/admin`) or with the CLI (`npx emdash schema list`, `schema get <collection>`, `schema add-field`). `pages` and `posts` exist from the start. |
10
+ | A fixture key | A field of the type its value needs: `string`, `text`, `url`, `number`, `integer`, `boolean`, `datetime`, `select`, `multiSelect`, `portableText` (formatted copy), `image`, `file`, `reference` (another collection's entry), `json`, `slug`, `repeater` (a repeated group), `blocks`. |
11
+ | A page made of sections | A `blocks` or `repeater` field, one front-end component per block type. |
12
+ | A hostile set | Field validation and the page's handling of each case. The sets stay test fixtures, never site content. |
13
+
14
+ ## Content model rules
15
+
16
+ - **Add, never rename.** Each collection is a real SQL table; renaming or retyping a field of a live collection risks its content. List any rename in the report for the user.
17
+ - After a schema change, `npx emdash types` regenerates the types the pages read.
18
+
19
+ ## Content in
20
+
21
+ The `real` items go in as drafts, through the site's MCP server or the `npx emdash content` commands (`npx emdash content --help` lists them on the installed version), against the local dev site first (`--url http://localhost:4321`). Never publish, and never write to the deployed site or run `npm run deploy` without the user's word.
22
+
23
+ ## Pages read
24
+
25
+ Pages query at request time through Astro's live collections:
26
+
27
+ ```astro
28
+ ---
29
+ import { getEmDashCollection, getEmDashEntry } from 'emdash';
30
+ import { Image, PortableText } from 'emdash/ui';
31
+ const { entries: posts } = await getEmDashCollection('posts', { status: 'published', limit: 12 });
32
+ ---
33
+ ```
34
+
35
+ Fields are on `entry.data` (`post.data.title`); `entry.id` is the slug for links. Formatted copy renders with `<PortableText value={post.data.content} />`, images with `Image`. Each README state maps to a query: empty is `entries.length === 0`, missing is an entry with empty fields, and an unknown slug returns no `entry`.
36
+
37
+ ## Real fixtures back out
38
+
39
+ `npx emdash content list <collection> --json > items.json`, then `pnpm fixtures-pull <slug> --from items.json --map key=path` (with no `--map` it lists the paths).
40
+
41
+ ## Report
42
+
43
+ Under Mapped: each collection, block and field with its type. Under Not mapped: fixture keys with no field, and schema changes left for the user.
@@ -0,0 +1,31 @@
1
+ # Porting into Payload
2
+
3
+ Payload is the CMS; the site's pages are the front end in `website.frontend` (Astro or Next). Read `astro.md` or `next.md` for the page side; this file covers the content model and how content gets in. Read the target's `payload.config.ts` and `src/collections/` first; where they already decide something, they win.
4
+
5
+ ## Where each piece goes
6
+
7
+ | Prototype | Payload |
8
+ | --- | --- |
9
+ | `fixtures.json` `real`, one item's keys | A collection's `fields` (`src/collections/<Name>.ts`, a `CollectionConfig`), when the content is a list (posts, people, products). A global when there is exactly one (a footer, site settings). |
10
+ | A page made of sections | A `blocks` field on the pages collection: one block config per prototype section, one front-end component per block, matched by `blockType`. |
11
+ | A fixture key's value | The field type by what it holds: `text` or `textarea` for strings, `richText` (Lexical) for formatted copy, `upload` for an image, `relationship` for another collection's item, `select` for a fixed set, `date`, `number`, `checkbox`, `array` for a repeated group. |
12
+ | A hostile set (`longest`, `missing`) | Field `validation`, `maxLength` and `required` decided from it: `missing` says which fields may be empty, `longest` what the front end must survive. The sets stay test fixtures, never CMS content. |
13
+ | The README's Decision | `admin.description` on each field that carries a rule an editor must follow (an image ratio, a character limit). |
14
+
15
+ ## Content model rules
16
+
17
+ - **Add, never rename.** A new field is additive; renaming or retyping a live field loses content. List any rename the design wants in the report and leave it for the user.
18
+ - **Drafts first.** Collections an editor publishes get `versions: { drafts: true }` when the target uses drafts elsewhere. Never turn drafts on for one feature only.
19
+ - **Migrations.** On a SQL adapter (Postgres, SQLite), a schema change needs `payload migrate:create`; commit the migration with the code. Then `payload generate:types` so the front end reads typed data.
20
+
21
+ ## Content in
22
+
23
+ The `real` items go in as drafts: `_status: 'draft'` through the target's seed script, the Local API (`payload.create({ collection, data, draft: true })`) or the admin. Never publish, and never seed a production database: content on a live site is the user's call.
24
+
25
+ ## Front end reads
26
+
27
+ Astro reads with the REST API (`GET /api/<collection>?where[...]&depth=1`) or the Local API when the front end shares the Payload app (Next). `depth` decides how far relationships and uploads expand; set it to what the components render and no deeper. Each README state maps to a query result: empty is zero docs, missing is a doc with empty fields.
28
+
29
+ ## Report
30
+
31
+ Under Mapped: each collection, block and field with its type. Under Not mapped: any fixture key with no field, and any field the design needs that would rename or retype a live one.
@@ -0,0 +1,31 @@
1
+ # Porting into WordPress
2
+
3
+ WordPress is the CMS, headless: the site's pages are the front end in `website.frontend` (Astro or Next), which reads WordPress over its REST API. Read `astro.md` or `next.md` for the page side; this file covers the content model and how content gets in. Read the target's theme or plugin code, its registered post types and its field plugin (ACF or another) first; where they decide something, they win.
4
+
5
+ ## Where each piece goes
6
+
7
+ | Prototype | WordPress |
8
+ | --- | --- |
9
+ | `fixtures.json` `real` | Posts or pages when the content is the site's articles or pages; a custom post type (`register_post_type` with `show_in_rest: true`) when it is anything else (case studies, team, events). |
10
+ | A fixture key | A core field when one fits (`title`, `excerpt`, `date`, the featured image); a custom field otherwise, exposed in REST (ACF with "Show in REST API" on puts it under `acf`). |
11
+ | A category or tag key | A taxonomy (`register_taxonomy` with `show_in_rest: true`), never a free-text field. |
12
+ | A page made of sections | The target's convention: ACF flexible content, or Gutenberg blocks. Follow what the site already uses; never introduce the other one for one feature. |
13
+ | A hostile set | Field rules (required, character limits in the field's instructions), and the front end's handling of each case. The sets stay test fixtures, never site content. |
14
+
15
+ ## Content model rules
16
+
17
+ - **Fields over HTML.** Content the design styles per part (a title, a date, a quote) is a field, so the front end owns the markup. Body copy stays `content`, rendered from `content.rendered` with the core block styles the front end already ships.
18
+ - **Add, never rename.** A field or post type rename orphans existing content. List it in the report for the user.
19
+ - Field groups live in code when the target keeps them in code (ACF JSON or PHP); never only in the database of one environment.
20
+
21
+ ## Content in
22
+
23
+ The `real` items go in as drafts (`status: draft`) through WP-CLI, the REST API with an application password, or the admin. Never publish, never on production without the user's word.
24
+
25
+ ## Front end reads
26
+
27
+ `GET /wp-json/wp/v2/<rest base>?_embed=1` returns the items with their featured media and terms embedded; `_fields=` trims a response to what the page renders. `title.rendered` and `excerpt.rendered` are HTML: strip or render them as the design says. Each README state maps to a response: empty is `[]`, missing is an item with empty fields or no `_embedded` media.
28
+
29
+ ## Report
30
+
31
+ Under Mapped: each post type, taxonomy and field with its REST path. Under Not mapped: fixture keys with no field, and anything that would need a plugin the site does not have.
@@ -5,13 +5,13 @@ description: "The rules for writing or changing any prototype code under prototy
5
5
 
6
6
  # Prototype
7
7
 
8
- A prototype here answers one written question with the least code that can answer it, in the project's real materials, with every state reachable from a dial. This skill holds the ceiling. `AGENTS.md` holds the stack and the layout; `prototypes/sample-list/` is the worked example and wins over any description of it here.
8
+ A prototype here answers one written question with the least code that can answer it, in the project's real materials, with every state reachable from a dial. This skill holds the ceiling. `AGENTS.md` holds the stack and the layout; the sample of the prototype's track (`prototypes/sample-list/` for product, `prototypes/sample-page/` for website, `prototypes/sample-social/` for brand, where `miles-brand` adds the collateral rules) is the worked example and wins over any description of it here.
9
9
 
10
10
  ## Before the first line
11
11
 
12
12
  1. Read the feature's `README.md`. If it has no Problem, Question and States, stop and write them with `miles-new-feature`. Code written before the question is code that answers a different question.
13
13
  2. Decide where it stands: `AppShell` or `SiteShell` when the question is about the feature in context, `Space` when it is about one thing alone. Never both in one prototype.
14
- 3. Read `prototypes/sample-list/index.tsx` once per session. It is the reference for every pattern below.
14
+ 3. Read the `index.tsx` of the track's sample once per session (`sample-list` for product, `sample-page` for website, `sample-social` for brand, whichever the project kept). It is the reference for every pattern below.
15
15
 
16
16
  ## The fidelity ceiling
17
17
 
@@ -2,6 +2,7 @@
2
2
  title: {{title}}
3
3
  summary: One line on what this explores.
4
4
  context: app
5
+ track: {{track}}
5
6
  status: exploring
6
7
  kind: {{kind}}
7
8
  feature: {{feature}}
@@ -0,0 +1,48 @@
1
+ ---
2
+ title: {{title}}
3
+ summary: One line on what this piece is for.
4
+ context: board
5
+ track: {{track}}
6
+ status: exploring
7
+ kind: {{kind}}
8
+ feature: {{feature}}
9
+ created: {{created}}
10
+ ---
11
+
12
+ # {{title}}
13
+
14
+ ## Problem
15
+
16
+ What the piece has to do, where it appears, and for whom. Write this before any artboard.
17
+
18
+ ## Question
19
+
20
+ The one decision this board exists to make.
21
+
22
+ ## Formats
23
+
24
+ | Artboard | Format | Where it runs |
25
+ | --- | --- | --- |
26
+ | | | |
27
+
28
+ Formats come from `@kit/Artboard` (`post-square`, `post-portrait`, `story`, `link-preview`, `banner`, `slide`, `a4`, `letter`). Each artboard is drawn at its real pixel size; a story keeps type and logos out of its top and bottom 250px.
29
+
30
+ ## States
31
+
32
+ Every state the board holds, one row each: each fixture set, each layout and each tone a dial reaches. `miles-port` and the export read this table.
33
+
34
+ | State | How to reach it |
35
+ | --- | --- |
36
+ | | |
37
+
38
+ ## Fixtures
39
+
40
+ `fixtures.json` holds `real` (the copy and images this piece runs with) and `missing` (no image, no subhead). `@kit/fixtures` derives `longest`, `empty` and `max`. Say where `real` came from.
41
+
42
+ ## Export
43
+
44
+ `pnpm export {{slug}}` writes PNGs for posts and a PDF for slides and print into `exports/{{slug}}/`. Name the dial state that ships in the Decision, and export with it (`--dials`).
45
+
46
+ ## Decision
47
+
48
+ Empty until picked. What was chosen, its values, and what was rejected and why.