@blockbite/agent-context 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/examples/README.md +23 -0
  2. package/examples/dynamic-template-reference/fields.yaml +61 -0
  3. package/examples/dynamic-template-reference/manifest.json +8 -0
  4. package/examples/dynamic-template-reference/module.ts +12 -0
  5. package/examples/dynamic-template-reference/recipe.json +5 -0
  6. package/examples/dynamic-template-reference/seeds.json +44 -0
  7. package/examples/dynamic-template-reference/style.css +156 -0
  8. package/examples/dynamic-template-reference/template.liquid +59 -0
  9. package/index.json +239 -0
  10. package/mcp-tools.json +222 -0
  11. package/package.json +24 -0
  12. package/references/block-dsl.md +257 -0
  13. package/references/islands.md +111 -0
  14. package/references/tailwind-utilities.md +108 -0
  15. package/skills/analyze-template/SKILL.md +20 -0
  16. package/skills/block-style/SKILL.md +101 -0
  17. package/skills/connect/SKILL.md +25 -0
  18. package/skills/connection-status/SKILL.md +38 -0
  19. package/skills/create-template-draft/SKILL.md +55 -0
  20. package/skills/design-tokens/SKILL.md +54 -0
  21. package/skills/document-blueprint/SKILL.md +166 -0
  22. package/skills/figma-design-to-code/SKILL.md +126 -0
  23. package/skills/figma-site-builder/SKILL.md +209 -0
  24. package/skills/frame-draft-link/SKILL.md +77 -0
  25. package/skills/islands-list/SKILL.md +24 -0
  26. package/skills/project-select/SKILL.md +19 -0
  27. package/skills/projects-list/SKILL.md +17 -0
  28. package/skills/render-preview/SKILL.md +20 -0
  29. package/skills/sandbox-status/SKILL.md +18 -0
  30. package/skills/site-motion-pass/SKILL.md +88 -0
  31. package/skills/site-reviewer/SKILL.md +107 -0
  32. package/skills/sync-plan/SKILL.md +20 -0
  33. package/skills/template-figma/SKILL.md +123 -0
  34. package/skills/template-new/SKILL.md +221 -0
  35. package/skills/template-preview/SKILL.md +115 -0
  36. package/skills/template-refine/SKILL.md +135 -0
  37. package/skills/update-template-draft/SKILL.md +36 -0
package/mcp-tools.json ADDED
@@ -0,0 +1,222 @@
1
+ {
2
+ "version": "0.1.0",
3
+ "tools": {
4
+ "blockbite-connection-status": {
5
+ "mcp": "blockbite-connection-status",
6
+ "mode": "project-selection",
7
+ "purpose": "Check Platform authentication, selected project, and Studio reachability.",
8
+ "localFallback": null,
9
+ "readOnly": true
10
+ },
11
+ "blockbite-projects-list": {
12
+ "mcp": "blockbite-projects-list",
13
+ "mode": "project-selection",
14
+ "purpose": "List BlockBite Platform projects available to the connected account.",
15
+ "localFallback": null,
16
+ "readOnly": true
17
+ },
18
+ "blockbite-project-select": {
19
+ "mcp": "blockbite-project-select",
20
+ "mode": "project-selection",
21
+ "purpose": "Select the active BlockBite Platform project for subsequent Studio tool calls.",
22
+ "localFallback": null,
23
+ "readOnly": false
24
+ },
25
+ "blockbite-islands-list": {
26
+ "mcp": "blockbite-islands-list",
27
+ "mode": "read",
28
+ "purpose": "List published BlockBite islands on the selected WordPress site.",
29
+ "localFallback": "Use the WordPress admin or supported local CLI for island inventory; do not read public REST island endpoints.",
30
+ "readOnly": true
31
+ },
32
+ "blockbite-agent-onboarding": {
33
+ "mcp": "blockbite/agent-onboarding",
34
+ "mode": "read",
35
+ "plane": "workspace",
36
+ "scope": "agent:onboarding",
37
+ "purpose": "Return workspace layout, sandbox rules, preview URLs, readiness, and recommended tool order.",
38
+ "localFallback": "wp bb learn --format=codex",
39
+ "readOnly": true
40
+ },
41
+ "blockbite-workspace-status": {
42
+ "mcp": "blockbite/workspace-status",
43
+ "mode": "read",
44
+ "plane": "workspace",
45
+ "scope": "workspace:read",
46
+ "purpose": "Inspect workspace root, source mode, directories, counts, and build state.",
47
+ "localFallback": "wp bb learn",
48
+ "readOnly": true
49
+ },
50
+ "blockbite-workspace-list": {
51
+ "mcp": "blockbite/workspace-list",
52
+ "mode": "read",
53
+ "plane": "workspace",
54
+ "scope": "workspace:read",
55
+ "purpose": "List files below the BlockBite workspace using safe relative paths.",
56
+ "localFallback": "List files under the resolved BlockBite workspace root after running wp bb learn.",
57
+ "readOnly": true
58
+ },
59
+ "blockbite-workspace-read": {
60
+ "mcp": "blockbite/workspace-read",
61
+ "mode": "read",
62
+ "plane": "workspace",
63
+ "scope": "workspace:read",
64
+ "purpose": "Read an allowed text file from the BlockBite workspace.",
65
+ "localFallback": "Read the workspace file after resolving the workspace root with wp bb learn.",
66
+ "readOnly": true
67
+ },
68
+ "blockbite-workspace-search": {
69
+ "mcp": "blockbite/workspace-search",
70
+ "mode": "read",
71
+ "plane": "workspace",
72
+ "scope": "workspace:search",
73
+ "purpose": "Search allowed workspace text files and return matching paths and excerpts.",
74
+ "localFallback": "Use rg within the resolved BlockBite workspace.",
75
+ "readOnly": true
76
+ },
77
+ "blockbite-template-analyze": {
78
+ "mcp": "blockbite/template-analyze",
79
+ "mode": "read",
80
+ "plane": "workspace-with-db-overlay",
81
+ "scope": "workspace:read",
82
+ "purpose": "Analyze a dynamic-template package, fields, seeds, records, and styling validation.",
83
+ "localFallback": "Inspect templates/<slug>/ files and run wp bb validate before editing.",
84
+ "readOnly": true
85
+ },
86
+ "blockbite-template-render-preview": {
87
+ "mcp": "blockbite/template-render-preview",
88
+ "mode": "preview",
89
+ "plane": "workspace",
90
+ "scope": "preview:render",
91
+ "purpose": "Render a seed-backed dynamic-template preview without touching live posts.",
92
+ "localFallback": "Open /?blockbite_preview=1&template=true&slug=<slug> or the matching file-backed preview URL.",
93
+ "readOnly": true
94
+ },
95
+ "blockbite-validate-workspace": {
96
+ "mcp": "blockbite/validate-workspace",
97
+ "mode": "read",
98
+ "plane": "workspace",
99
+ "scope": "workspace:validate",
100
+ "purpose": "Validate workspace package files without mutating content.",
101
+ "localFallback": "wp bb validate",
102
+ "readOnly": true
103
+ },
104
+ "blockbite-build-status": {
105
+ "mcp": "blockbite/build-status",
106
+ "mode": "build",
107
+ "plane": "workspace",
108
+ "scope": "workspace:read",
109
+ "purpose": "Read auto-build mode and dirty bundle status for production or sandbox output.",
110
+ "localFallback": "wp bb learn, then use wp bb autobuild only in auto-build mode.",
111
+ "readOnly": true
112
+ },
113
+ "blockbite-build-run": {
114
+ "mcp": "blockbite/build-run",
115
+ "mode": "build",
116
+ "plane": "build",
117
+ "scope": "build:assets",
118
+ "purpose": "Start a signed auto-build run for dirty bundles.",
119
+ "localFallback": "wp bb autobuild",
120
+ "readOnly": false
121
+ },
122
+ "blockbite-sync-plan-create": {
123
+ "mcp": "blockbite/sync-plan-create",
124
+ "mode": "read",
125
+ "plane": "workspace-with-db-overlay",
126
+ "scope": "sync-plan:create",
127
+ "purpose": "Create a draft sync plan comparing template files with database records.",
128
+ "localFallback": "Use local package inspection and wp bb dynamic-template/dynamic-content commands only after reviewing the target package.",
129
+ "readOnly": true
130
+ },
131
+ "blockbite-sync-plan-diff": {
132
+ "mcp": "blockbite/sync-plan-diff",
133
+ "mode": "read",
134
+ "plane": "workspace-with-db-overlay",
135
+ "scope": "sync-plan:diff",
136
+ "purpose": "Return explicit current-state comparisons for a draft sync plan.",
137
+ "localFallback": "Compare local package files and registered dynamic-template/dynamic-content state before syncing.",
138
+ "readOnly": true
139
+ },
140
+ "blockbite-template-update-draft": {
141
+ "mcp": "blockbite/template-update-draft",
142
+ "mode": "read",
143
+ "plane": "sandbox",
144
+ "scope": "template:update-draft",
145
+ "purpose": "Plan sandbox edits for an existing template and return suggested tools and preview guidance.",
146
+ "localFallback": "Read templates/<slug>/, edit local files, then run wp bb validate and the appropriate update/sync commands.",
147
+ "readOnly": true
148
+ },
149
+ "blockbite-sandbox-status": {
150
+ "mcp": "blockbite/sandbox-status",
151
+ "mode": "read",
152
+ "plane": "sandbox",
153
+ "scope": "sandbox:status",
154
+ "purpose": "Show sandbox readiness and pending change ledger.",
155
+ "localFallback": "Use the WordPress MCP connection screen or wp bb sandbox commands when available.",
156
+ "readOnly": true
157
+ },
158
+ "blockbite-workspace-write": {
159
+ "mcp": "blockbite/workspace-write",
160
+ "mode": "sandbox-write",
161
+ "plane": "sandbox",
162
+ "scope": "workspace:write",
163
+ "purpose": "Write one allowed text file to the sandbox workspace.",
164
+ "localFallback": "Write files in the resolved local workspace after reading the relevant skill and references.",
165
+ "readOnly": false
166
+ },
167
+ "blockbite-workspace-patch": {
168
+ "mcp": "blockbite/workspace-patch",
169
+ "mode": "sandbox-write",
170
+ "plane": "sandbox",
171
+ "scope": "workspace:patch",
172
+ "purpose": "Apply a search-and-replace patch to a sandbox workspace file.",
173
+ "localFallback": "Patch local workspace files with a focused diff after reading the file.",
174
+ "readOnly": false
175
+ },
176
+ "blockbite-template-scaffold": {
177
+ "mcp": "blockbite/template-scaffold",
178
+ "mode": "sandbox-write",
179
+ "plane": "sandbox",
180
+ "scope": "template:scaffold",
181
+ "purpose": "Scaffold a full template package in the sandbox.",
182
+ "localFallback": "wp bb template scaffold --slug=<slug> --type=<type> --variant=<variant>",
183
+ "readOnly": false
184
+ },
185
+ "blockbite-template-create-draft": {
186
+ "mcp": "blockbite/template-create-draft",
187
+ "mode": "sandbox-write",
188
+ "plane": "sandbox",
189
+ "scope": "template:create-draft",
190
+ "purpose": "Create a new template draft in the sandbox, analyze it, and return preview/approval URLs.",
191
+ "localFallback": "wp bb template scaffold --slug=<slug> --type=<type>, then wp bb validate and preview with seed data.",
192
+ "readOnly": false
193
+ },
194
+ "blockbite-build-assets": {
195
+ "mcp": "blockbite/build-assets",
196
+ "mode": "build",
197
+ "plane": "sandbox",
198
+ "scope": "build:assets",
199
+ "purpose": "Ensure sandbox upload build directories exist.",
200
+ "localFallback": "wp bb autobuild prepares local build outputs in auto-build mode.",
201
+ "readOnly": false
202
+ },
203
+ "blockbite-design-token-write": {
204
+ "mcp": "blockbite/design-token-write",
205
+ "mode": "sandbox-write",
206
+ "plane": "sandbox-with-db",
207
+ "scope": "design-token:write",
208
+ "purpose": "Write Tailwind v4 design token CSS to the sandbox design-token row.",
209
+ "localFallback": "Edit dev/css/design-tokens.css and run wp bb design-tokens local-to-db.",
210
+ "readOnly": false
211
+ },
212
+ "blockbite-asset-import": {
213
+ "mcp": "blockbite/asset-import",
214
+ "mode": "sandbox-write",
215
+ "plane": "sandbox-with-assets",
216
+ "scope": "asset:import",
217
+ "purpose": "Import Figma MCP asset URLs into sandbox uploads and return local media seed metadata.",
218
+ "localFallback": "Download/import assets into WordPress media or the workspace asset convention before using them in seeds.",
219
+ "readOnly": false
220
+ }
221
+ }
222
+ }
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "@blockbite/agent-context",
3
+ "version": "0.1.0",
4
+ "description": "BlockBite agent skills, MCP tool index, local fallbacks, references, and examples.",
5
+ "type": "module",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "files": [
10
+ "skills",
11
+ "references",
12
+ "examples",
13
+ "index.json",
14
+ "mcp-tools.json"
15
+ ],
16
+ "exports": {
17
+ "./skills/*": "./skills/*",
18
+ "./references/*": "./references/*",
19
+ "./examples/*": "./examples/*",
20
+ "./index.json": "./index.json",
21
+ "./mcp-tools.json": "./mcp-tools.json",
22
+ "./package.json": "./package.json"
23
+ }
24
+ }
@@ -0,0 +1,257 @@
1
+ # Block DSL
2
+
3
+ BlockBite dynamic templates can use HTML-like UI DSL tags inside
4
+ `template.liquid`. This is the compact agent reference for the atom block DSL.
5
+ It summarizes the docs in `packages/docs/src/06-atom-blocks`.
6
+
7
+ ## Core Rules
8
+
9
+ - Use lowercase kebab-case tags: `<bb-button>`, `<bb-group>`,
10
+ `<core-paragraph>`.
11
+ - A block name maps to a tag by replacing `/` with `-`: `bb/button` becomes
12
+ `<bb-button>`, `core/paragraph` becomes `<core-paragraph>`.
13
+ - Attribute names are lowercase kebab-case. The compiler maps attributes such
14
+ as `link-url` and `content-tag` to internal camelCase props such as `linkUrl`
15
+ and `contentTag`.
16
+ - Use `class` for Tailwind classes. Authored DSL classes are preserved by
17
+ default; use an explicit `{{ '...' | tw_merge }}` expression only when you
18
+ deliberately want Tailwind conflict resolution.
19
+ - Token-backed Tailwind classes should be checked against the CSS-first source
20
+ at `<workspace>/dev/css/design-tokens.css`; use `wp bb design-tokens local-to-db`
21
+ after editing it or `wp bb design-tokens db-to-local` to refresh from DB content.
22
+ - Attribute values can be literals, Liquid expressions such as
23
+ `{{ props.fields.title }}`, or Liquid block syntax for conditional values such
24
+ as `class="{% if item.featured %}border-black{% endif %}"`.
25
+ - Keep Liquid block syntax inside attributes compact or use whitespace-trimmed
26
+ tags (`{%- ... -%}`), especially for `class` values.
27
+ - Container tags can wrap child DSL tags. Media-style tags are normally
28
+ self-closing.
29
+ - Use `field="{{ props.fields.some_object }}"` when a block supports a grouped
30
+ field object.
31
+
32
+ ## Example
33
+
34
+ ```liquid
35
+ <bb-group class="grid gap-4">
36
+ <core-heading
37
+ level="2"
38
+ content="{{ props.fields.heading }}"
39
+ class="text-3xl font-semibold"
40
+ />
41
+ <core-paragraph
42
+ content="{{ props.fields.body }}"
43
+ class="text-base text-neutral-700"
44
+ />
45
+ <bb-button
46
+ link-url="{{ props.fields.cta.linkUrl }}"
47
+ link-title="{{ props.fields.cta.linkTitle }}"
48
+ link-target="{{ props.fields.cta.linkTarget }}"
49
+ class="inline-flex items-center rounded px-4 py-2"
50
+ />
51
+ </bb-group>
52
+ ```
53
+
54
+ ## BlockBite Tags
55
+
56
+ | Tag | Block | Common attrs |
57
+ | --------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
58
+ | `<bb-button>` | `bb/button` | `class`, `bb-style`, `field`, `link-url`, `link-title`, `link-target`, `text`, `content`, `label`, `role`, `id`, `tabindex`, `data`, `aria` |
59
+ | `<bb-fill>` | `bb/fill` | `type`, `class`, `field`, `url`, `src`, `alt`, `autoplay`, `loop`, `hover`, `playOnScroll`, `direction`, `parentHover` |
60
+ | `<bb-fills>` | `bb/fills` | `class`, child `<bb-fill>` layers |
61
+ | `<bb-frame>` | `bb/frame` | `class`, child content |
62
+ | `<bb-group>` | `bb/group` | `class`, `tag`, `link-url`, `link-title`, `link-target`, child content |
63
+ | `<bb-icon>` | `bb/icon` | `class`, `field`, `svg-url`, `svg-id`, `url`, `src`, `link-url`, `link-title`, `link-target`, `role`, `id`, `tabindex`, `data`, `aria` |
64
+ | `<bb-image>` | `bb/image` | `class`, `url`, `src`, `field`, `alt`, `role`, `id`, `title`, `loading`, `decoding`, `data`, `aria` |
65
+ | `<bb-richtext>` | `bb/richtext` | `class`, `content`, `content-tag`, `content-string`, `text-align`, child fallback content |
66
+ | `<bb-richtext-group>` | `bb/richtext-group` | `class`, `content`, `content-tag`, child content |
67
+ | `<bb-shape>` | `bb/shape` | `class`, `svg-url`, `url`, `src`, child content |
68
+
69
+ ## Core Tags
70
+
71
+ | Tag | Block | Common attrs |
72
+ | ------------------ | ---------------- | ------------------------------------------------------------------------------------------------------- |
73
+ | `<core-heading>` | `core/heading` | `class`, `content`, `field`, `level`, `role`, `id`, `data`, `aria` |
74
+ | `<core-paragraph>` | `core/paragraph` | `class`, `content`, `field` |
75
+ | `<core-button>` | `core/button` | `class`, `url`, `link-url`, `text`, `title`, `link-title`, `link-target`, `rel`, `field`, child content |
76
+ | `<core-buttons>` | `core/buttons` | `class`, child content |
77
+ | `<core-image>` | `core/image` | `class`, `url`, `src`, `field`, `alt` |
78
+ | `<core-video>` | `core/video` | `class`, `field`, `src`, `url`, `poster`, `embed-url`, `title`, `provider-name-slug`, `media-class` |
79
+ | `<core-group>` | `core/group` | `class`, child content |
80
+ | `<core-row>` | `core/row` | `class`, child content |
81
+ | `<core-columns>` | `core/columns` | `class`, `columns`, child content |
82
+
83
+ Other core tags are available from the selected version's `core` folder, such
84
+ as `core-html`, `core-list`, `core-quote`, `core-separator`, `core-shortcode`,
85
+ and `core-video`.
86
+
87
+ ## Dynamic Template Pattern
88
+
89
+ Choose the source type before writing bindings:
90
+
91
+ - `block_instance`: the inserted template block instance owns `props.fields` and
92
+ `props.subcollections`.
93
+ - `post_type`: the current CPT/single post source owns `props.fields` and
94
+ `props.subcollections`.
95
+ - `block_instance` plus `post_relation`: the inserted instance owns a relation field;
96
+ with `include_source: true`, selected post source fields are nested under
97
+ that relation item, such as `props.fields.work.source.work.client`.
98
+
99
+ Do not use relation-nested paths for templates that should render the current
100
+ CPT item. Use `post_type` and direct field paths.
101
+
102
+ Use the standard runtime prelude before DSL or HTML:
103
+
104
+ ```liquid
105
+ {% assign seed_data = 'seeds.json' | bb_seed %}
106
+ {% assign data = item | bb_source %}
107
+ {% assign props = live | ternary: data, seed_data %}
108
+ ```
109
+
110
+ Then bind fields through `props`:
111
+
112
+ ```liquid
113
+ <core-heading content="{{ props.fields.title }}" />
114
+
115
+ {% for item in props.subcollections.cards %}
116
+ <bb-group class="rounded border p-6">
117
+ <core-heading content="{{ item.heading }}" />
118
+ <bb-richtext content="{{ item.text }}" content-tag="div" />
119
+ </bb-group>
120
+ {% endfor %}
121
+ ```
122
+
123
+ ## Fill Layers
124
+
125
+ Use `bb-fills` and `bb-fill` for visual layers inside a dynamic template. This
126
+ is the canonical API for hero backgrounds, image overlays, solid color layers,
127
+ and gradients. Do not pass fills as props on `bb-group`; keep them as child
128
+ layers inside the element that owns the sizing.
129
+
130
+ ```liquid
131
+ <bb-group tag="section" class="relative isolate min-h-[720px] overflow-hidden">
132
+ <bb-fills>
133
+ <bb-fill
134
+ type="image"
135
+ field="{{ props.fields.hero_artwork }}"
136
+ class="opacity-70 sepia contrast-125"
137
+ />
138
+ <bb-fill
139
+ type="gradient"
140
+ class="bg-gradient-to-b from-brand-a/35 via-brand-a/15 to-brand-a/80"
141
+ />
142
+ </bb-fills>
143
+
144
+ <bb-richtext content="{{ props.fields.title }}" content-tag="h1" class="relative z-10" />
145
+ </bb-group>
146
+ ```
147
+
148
+ Supported fill types:
149
+
150
+ - `image`: accepts `field`, `url`, or `src`; `alt` falls back to the media
151
+ field alt text. The `class` value is applied to `.b_media`.
152
+ - `video`: accepts `url` or `src`. The `class` value is applied to `.b_fill`.
153
+ - `lottie`: accepts `url` or `src`, plus `autoplay`, `loop`, `hover`,
154
+ `playOnScroll`, `direction`, and `parentHover`. The `class` value is applied
155
+ to `.b_fill`.
156
+ - `solid` and `gradient`: render non-media `.b_fill` layers. Use Tailwind
157
+ background classes for the visual style.
158
+
159
+ Use `bb-image` or `core-image` for content images that belong in the layout.
160
+ When an image is only a background/fill layer, use `bb-fill type="image"` so the
161
+ editor inline preview and media editing paths treat it like a fill instead of a
162
+ normal-flow image.
163
+
164
+ ## Component Selection
165
+
166
+ - Use `core-heading` and `core-paragraph` for simple text atoms.
167
+ - Use `bb-richtext` when authored copy may contain inline formatting or HTML.
168
+ - Use `bb-button` or `core-button` for links/actions; prefer grouped link
169
+ fields when possible.
170
+ - When a template needs a reusable visual variant, especially buttons, check
171
+ `<workspace>/blocks/<namespace>/<block>` first and create/update a shared
172
+ block style instead of repeating long Tailwind classes inline.
173
+ - Use `bb-image` or `core-image` for content media fields that should
174
+ participate in layout.
175
+ - Use `core-video` for content videos. It supports uploaded/media-library video
176
+ via `field`, `src`, `url`, and `poster`, and YouTube embeds via `embed-url`
177
+ with `provider-name-slug="youtube"`. For YouTube, bind the actual URL to
178
+ `embed-url`; do not hand-roll raw iframes or `data-youtube-src` hydration in
179
+ templates.
180
+ - Use `bb-group` for generic layout wrappers, repeated card bodies, and linked
181
+ media/card wrappers. When `link-url` is present it renders an anchor and
182
+ overrides `tag`.
183
+ - Use `bb-fills` with child `bb-fill` layers for section backgrounds, overlays,
184
+ and editor-editable fill images.
185
+ - Use `bb-frame` for framed or constrained section structures.
186
+ - Use `bb-icon` and `bb-shape` for SVG fields/assets.
187
+
188
+ ## Shared Block Styles
189
+
190
+ Block styles are authored with the same DSL in:
191
+
192
+ ```text
193
+ <workspace>/blocks/<namespace>/<block>/styles/<style-slug>.template.liquid
194
+ ```
195
+
196
+ They compile to:
197
+
198
+ ```text
199
+ <workspace>/autobuild/css/block-styles.css
200
+ ```
201
+
202
+ Never edit `autobuild/css/block-styles.css` by hand. Regenerate it after editing style
203
+ templates:
204
+
205
+ ```bash
206
+ wp bb autobuild
207
+ ```
208
+
209
+ For example, a `bb/button` style can define the wrapper, rich text, and icon
210
+ atoms in one shared variant:
211
+
212
+ ```liquid
213
+ <bb-button class="inline-flex items-center rounded-full bg-brand-a-900 px-4 py-2 text-neutral-50">
214
+ <bb-richtext content-tag="span" class="font-body text-lg font-medium leading-[1.4]" />
215
+ <bb-icon class="size-4 shrink-0" />
216
+ </bb-button>
217
+ ```
218
+
219
+ If the block folder does not exist in the workspace, scaffold it first:
220
+
221
+ ```bash
222
+ wp bb offload bb/button --workspace
223
+ ```
224
+
225
+ ## Design Token Context
226
+
227
+ Design tokens are authored locally as Tailwind v4 `@theme` CSS. The workspace
228
+ file lives at:
229
+
230
+ ```text
231
+ <workspace>/dev/css/design-tokens.css
232
+ ```
233
+
234
+ Refresh it from Studio with:
235
+
236
+ ```bash
237
+ wp bb design-tokens db-to-local
238
+ ```
239
+
240
+ After manual edits, update Studio and rebuild the derived database token index with:
241
+
242
+ ```bash
243
+ wp bb design-tokens local-to-db
244
+ ```
245
+
246
+ Use configured tokens to choose classes such as `font-body`,
247
+ `text-neutral-100`, `bg-neutral-100`, and `border-neutral-100`.
248
+
249
+ ## Validation Notes
250
+
251
+ - Use `wp bb props [namespace/block]` when prop names are unclear.
252
+ - Use `wp bb autobuild` after editing block style templates to regenerate generated
253
+ CSS and queue all frontend bundles.
254
+ - Keep field handles stable. Dynamic-content field ids live in the database,
255
+ not in `fields.yaml`.
256
+ - Keep generated DSL readable. Remove noisy wrappers when plain HTML or a
257
+ smaller DSL tree is clearer.
@@ -0,0 +1,111 @@
1
+ # BlockBite Island Architecture
2
+
3
+ Use this reference when cloning or recreating a page as a set of BlockBite dynamic-template islands.
4
+
5
+ For syncing islands to Blockbite Platform (export bundles, preview snapshots, dashboard), see [[Island Platform Sync|Island-Platform-Sync]].
6
+
7
+ For local island bundle export/import between WordPress projects ([#1946](https://github.com/block-bite/blockbite/issues/1946)), see [[Island Sync|Island-Sync]].
8
+
9
+ ## Start With Global Sweep Research
10
+
11
+ Before implementing any island, inspect the original page from top to bottom:
12
+
13
+ - Map the full page structure: nav, hero, sections, repeated patterns, footer, overlays, and sticky elements.
14
+ - Capture responsive behavior across mobile, tablet, and desktop.
15
+ - Identify assets: images, video, SVGs, fonts, icons, masks, gradients, and externally loaded media.
16
+ - Inspect DOM, CSS, and JavaScript for the original site before coding each island.
17
+ - Classify motion as CSS keyframes, GSAP/Webflow JavaScript, Alpine, or static.
18
+ - Note repeated spacing, typography, color, border, and container rules so islands feel like one page.
19
+
20
+ Do not start by coding the visible first section only. The global sweep determines island boundaries, shared styling, asset needs, and homepage assembly order.
21
+
22
+ ## Island Order
23
+
24
+ Create independent islands in page order:
25
+
26
+ 1. Nav island.
27
+ 2. One island per homepage section, top to bottom.
28
+ 3. Footer island.
29
+
30
+ Each island should be independently previewable before homepage assembly. For
31
+ multi-section review, follow the `render-preview` workflow and create an
32
+ aggregate preview package such as `templates/preview-home/template.liquid` rather
33
+ than creating a temporary WordPress page.
34
+
35
+ For file-backed previews, use:
36
+
37
+ ```text
38
+ /?blockbite_preview=1&template=true&view=templates/<slug>/template.liquid
39
+ ```
40
+
41
+ For registered templates, use:
42
+
43
+ ```text
44
+ /?blockbite_preview=1&template=true&slug=<slug>
45
+ ```
46
+
47
+ For aggregate previews, render child views with the `bb_template_preview` filter
48
+ so each child template uses its own `seeds.json`:
49
+
50
+ ```liquid
51
+ <main data-bb-preview="home">
52
+ {{ 'templates/nav/template.liquid' | bb_template_preview | raw }}
53
+ {{ 'templates/home-hero/template.liquid' | bb_template_preview | raw }}
54
+ {{ 'templates/footer/template.liquid' | bb_template_preview | raw }}
55
+ </main>
56
+ ```
57
+
58
+ Avoid plain `{% render 'child/template.liquid' %}` for standard dynamic-template
59
+ packages in aggregate previews; it can inherit the parent preview seed context.
60
+
61
+ ## Template And Style Split
62
+
63
+ Prefer Tailwind classes in `template.liquid` for layout, spacing, typography, color, and straightforward responsive behavior.
64
+
65
+ Keep `style.css` for:
66
+
67
+ - CSS keyframes.
68
+ - Pseudo-elements.
69
+ - Carousel or marquee mechanics.
70
+ - Complex selectors.
71
+ - Browser-specific fixes.
72
+ - Behavior Tailwind cannot express cleanly.
73
+
74
+ Keep island JavaScript close to the island that owns the behavior, usually in `module.ts`, and avoid global scripts unless the interaction is truly shared.
75
+
76
+ ## Cloned Or Reference Sites
77
+
78
+ For cloned/reference sites, inspect the original DOM, CSS, and JS before coding each island:
79
+
80
+ - Check computed styles, not only visible screenshots.
81
+ - Look for Webflow/GSAP timelines, scroll triggers, Alpine directives, CSS animations, and transition delays.
82
+ - Decide whether the exact motion matters or whether a simpler static or CSS-only version is sufficient.
83
+ - Reuse assets intentionally; do not approximate inspection-critical images with generic placeholders.
84
+
85
+ ## Homepage Assembly
86
+
87
+ After the aggregate preview is accepted, assemble the homepage with one
88
+ `bb/dynamic-template` block per island in page content:
89
+
90
+ ```html
91
+ <!-- wp:bb/dynamic-template {"contentId":"...","templateId":"...","sourceType":"block_instance","dataMode":"seed","engine":"liquid","tag":"section","align":"full","metadata":{"name":"Section name"}} /-->
92
+ ```
93
+
94
+ Use clear metadata names for each island so the editor remains understandable.
95
+
96
+ ## Validation Flow
97
+
98
+ Before registering or assembling:
99
+
100
+ ```bash
101
+ ddev wp bb validate
102
+ ```
103
+
104
+ After editing frontend templates, styles, scripts, or block styles:
105
+
106
+ ```bash
107
+ ddev wp bb autobuild
108
+ ```
109
+
110
+ If Node.js is unavailable, open the signed browser fallback URL printed by
111
+ `wp bb autobuild` and wait for success.