mosaic-headless 1.37.0 → 1.38.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.
- package/README.ja.md +178 -242
- package/README.ko.md +173 -231
- package/README.md +178 -310
- package/README.zh-TW.md +174 -252
- package/SKILL.md +6 -6
- package/assets/templates/platforms/claude-ai.json +1 -1
- package/assets/templates/platforms/claude-code.json +1 -1
- package/assets/templates/platforms/codex-cli.json +1 -1
- package/assets/templates/platforms/copilot.json +1 -1
- package/assets/templates/platforms/gemini-cli.json +1 -1
- package/data/custom-fields-verification.csv +11 -11
- package/data/design-audit.csv +26 -26
- package/data/dynamic-variables.csv +3 -2
- package/data/menu-verification.csv +1 -1
- package/data/pending.csv +4 -2
- package/data/pluggables.csv +20 -0
- package/data/rwd-verification.csv +733 -733
- package/data/terms-zh.csv +62 -60
- package/package.json +1 -1
- package/references/data-files.md +2 -2
- package/references/upgrading.md +45 -0
- package/tools/check_numbers.py +138 -18
- package/tools/extract_node_types.py +3 -1
- package/tools/test_mosaic.py +66 -1
package/README.md
CHANGED
|
@@ -1,356 +1,224 @@
|
|
|
1
|
-
|
|
1
|
+
<h1 align="center">Mosaic Headless</h1>
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<h3 align="center">Mosaic Pro 無編輯器建站工具</h3>
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
<p align="center">
|
|
6
|
+
<strong>Measured data model · Guarded page builder · Delivered-page verifiers</strong>
|
|
7
|
+
</p>
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
<p align="center">
|
|
10
|
+
<img src="https://img.shields.io/badge/python-3-blue?style=flat-square&logo=python&logoColor=white" alt="Python 3">
|
|
11
|
+
<img src="https://img.shields.io/badge/node-18_or_later-green?style=flat-square&logo=node.js&logoColor=white" alt="Node.js 18 or later">
|
|
12
|
+
<img src="https://img.shields.io/badge/playwright-browser_verifiers-blueviolet?style=flat-square" alt="Playwright for the browser verifiers">
|
|
13
|
+
<img src="https://img.shields.io/badge/WP--CLI-server_scripts-blue?style=flat-square&logo=wordpress&logoColor=white" alt="WP-CLI for the server scripts">
|
|
14
|
+
</p>
|
|
10
15
|
|
|
11
|
-
|
|
16
|
+
<p align="center">
|
|
17
|
+
<img src="https://img.shields.io/badge/node_types-134-success?style=flat-square" alt="134 node types">
|
|
18
|
+
<img src="https://img.shields.io/badge/node_properties-120-success?style=flat-square" alt="120 node properties">
|
|
19
|
+
<img src="https://img.shields.io/badge/style_properties-101-success?style=flat-square" alt="101 style properties">
|
|
20
|
+
<img src="https://img.shields.io/badge/responsive_checks-733-blueviolet?style=flat-square" alt="733 responsive checks">
|
|
21
|
+
<img src="https://img.shields.io/badge/self--tests-42-blueviolet?style=flat-square" alt="42 self-tests">
|
|
22
|
+
</p>
|
|
12
23
|
|
|
13
|
-
|
|
24
|
+
<p align="center">
|
|
25
|
+
<a href="https://www.npmjs.com/package/mosaic-headless"><img src="https://img.shields.io/npm/v/mosaic-headless?style=flat-square&logo=npm" alt="npm version"></a>
|
|
26
|
+
<a href="https://www.npmjs.com/package/mosaic-headless"><img src="https://img.shields.io/npm/dt/mosaic-headless?style=flat-square&label=downloads&color=cb3837" alt="npm downloads"></a>
|
|
27
|
+
<a href="LICENSE"><img src="https://img.shields.io/github/license/Moksa1123/mosaic-headless?style=flat-square" alt="License"></a>
|
|
28
|
+
</p>
|
|
29
|
+
|
|
30
|
+
<p align="center"><strong>English</strong> · <a href="README.zh-TW.md">正體中文</a> · <a href="README.ja.md">日本語</a> · <a href="README.ko.md">한국어</a></p>
|
|
31
|
+
|
|
32
|
+
> This is an unofficial community project. It is not made by, endorsed by, or affiliated with Nextend, the maker of Mosaic Pro. Mosaic Pro is licensed third-party software and is not included here.
|
|
33
|
+
|
|
34
|
+
## What it does
|
|
35
|
+
|
|
36
|
+
Mosaic keeps a page in its own database tables, one row per element, not in `post_content`. This skill is a measured map of that model plus the tools to write through it, extracted from Mosaic Pro 1.0.13 and swept on a live site.
|
|
37
|
+
|
|
38
|
+
| Area | What you get |
|
|
39
|
+
|---|---|
|
|
40
|
+
| Lookup | `tools/mo.py`: 134 node types, 120 node properties, 101 style properties and 60 style states, each answered with its measured verdict; Chinese and colloquial words work (`mo.py css 內距`) |
|
|
41
|
+
| Build | `build_page.py` / `build_site.py` commit a page spec through Mosaic's REST write path and refuse what is measured to break the page |
|
|
42
|
+
| Verify | Chromium reads the delivered page: responsive rules, computed styles, menus, dialogs, sliders, forms |
|
|
43
|
+
| Move | whole themes exported and imported, Mosaic's data upgrades driven from outside wp-admin |
|
|
44
|
+
| Convert | Elementor pages turned into Mosaic specs, every unconverted element named |
|
|
45
|
+
|
|
46
|
+
### Look it up before writing
|
|
14
47
|
|
|
15
48
|
```bash
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
npx mosaic-headless --list # all eight platforms
|
|
49
|
+
python tools/mo.py type accordion-content # one type, joined to every live sweep
|
|
50
|
+
python tools/mo.py css 內距 # Chinese works: padding-top/right/bottom/left
|
|
51
|
+
python tools/mo.py facts section padding # measured front-end behaviour
|
|
20
52
|
```
|
|
21
53
|
|
|
22
|
-
|
|
23
|
-
|---|---|---|
|
|
24
|
-
| Claude Code | full skill: SKILL.md + references/ + tools/ + data/ + sites/ | `~/.claude/skills/` or `./.claude/skills/` |
|
|
25
|
-
| Codex CLI | full skill | `~/.codex/` |
|
|
26
|
-
| Gemini CLI | full skill | `~/.gemini/` |
|
|
27
|
-
| GitHub Copilot | full skill, plus a section appended to `copilot-instructions.md` | `./.github/` |
|
|
28
|
-
| Cursor | one `.mdc` rule with the references embedded | `~/.cursor/rules/` |
|
|
29
|
-
| Windsurf | one rule file with the references embedded | `./.devin/` |
|
|
30
|
-
| Continue | one rule file with the references embedded | `~/.continue/` |
|
|
31
|
-
| Claude.ai | a zip to upload as a project skill | wherever you save it |
|
|
54
|
+
### Build through the guard
|
|
32
55
|
|
|
33
|
-
|
|
34
|
-
tools
|
|
35
|
-
|
|
56
|
+
```bash
|
|
57
|
+
python tools/mo.py skeleton > page.json
|
|
58
|
+
python tools/build_page.py --spec page.json # refuses unsafe types, bad placement, out-of-enum values
|
|
59
|
+
```
|
|
36
60
|
|
|
37
|
-
|
|
38
|
-
the folder your agent loads; re-run the installer with `--force` (without it, it
|
|
39
|
-
refuses to overwrite a SKILL.md you may have edited):
|
|
61
|
+
### Check what visitors get
|
|
40
62
|
|
|
41
63
|
```bash
|
|
42
|
-
|
|
64
|
+
python tools/verify_rwd.py --site page.json # every _t/_m declaration in the served stylesheet
|
|
65
|
+
python tools/verify_browser.py --site page.json # what Chromium computes, plus a design audit
|
|
43
66
|
```
|
|
44
67
|
|
|
68
|
+
## When to use
|
|
69
|
+
|
|
70
|
+
Use it when the site runs Mosaic Pro and you want to build or change pages, templates, components, design tokens, popups, menus or interactions without opening the editor, or need to know exactly what a Mosaic setting does.
|
|
71
|
+
|
|
72
|
+
| Request | Go to |
|
|
73
|
+
|---|---|
|
|
74
|
+
| Elementor pages | `elementor-headless` |
|
|
75
|
+
| Block-editor (Gutenberg) pages | `gutenberg-headless` |
|
|
76
|
+
| SEO articles, Rank Math scores | `rankmath-seo-wp` |
|
|
77
|
+
| Site health checks, plugin updates, security | out of scope |
|
|
78
|
+
|
|
79
|
+
## Install
|
|
80
|
+
|
|
81
|
+
### Step 1: Pick an install method
|
|
82
|
+
|
|
83
|
+
Claude plugin (Claude Code; also from the Claude directory once listed):
|
|
45
84
|
|
|
46
|
-
|
|
85
|
+
```
|
|
86
|
+
/plugin install mosaic-headless --marketplace Moksa1123/mosaic-headless
|
|
87
|
+
```
|
|
47
88
|
|
|
48
|
-
|
|
49
|
-
the root `SKILL.md` loads as its one skill. Once the plugin is listed in the Claude
|
|
50
|
-
directory, install it from there. Until then, Claude Code can load a clone directly:
|
|
89
|
+
npx, for Claude Code and other AI coding tools:
|
|
51
90
|
|
|
52
91
|
```bash
|
|
53
|
-
|
|
54
|
-
|
|
92
|
+
npx mosaic-headless@latest claude-code --global --force
|
|
93
|
+
npx mosaic-headless --list
|
|
55
94
|
```
|
|
56
95
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
The plugin has no hooks, no MCP servers and no background processes. Everything
|
|
63
|
-
below runs only when Claude follows `SKILL.md` and you approve the command:
|
|
64
|
-
|
|
65
|
-
- **`tools/mo.py`** reads the CSV tables in `data/` and prints answers. It writes
|
|
66
|
-
nothing and contacts nothing.
|
|
67
|
-
- **`tools/*.php`** run inside your own WordPress through `wp eval-file`. They read
|
|
68
|
-
and write Mosaic's own tables and theme data on that site.
|
|
69
|
-
- **`tools/mint_session.php`** creates a logged-in WordPress session and a matching
|
|
70
|
-
REST nonce for an account on *your* site. They are printed to your terminal and
|
|
71
|
-
sent nowhere else. **Nothing here goes looking for a credential on your machine** -
|
|
72
|
-
you supply the session, one of two ways:
|
|
73
|
-
- installed as a plugin, Claude Code prompts for `Mosaic site URL`,
|
|
74
|
-
`WordPress logged-in cookie` and `wp_rest nonce`. The two credentials are
|
|
75
|
-
declared `sensitive`, so they are masked on entry and kept in your platform's
|
|
76
|
-
credential store, not in `settings.json`. Export them for a tool run as
|
|
77
|
-
`MOSAIC_SITE_URL`, `MOSAIC_REST_COOKIE` and `MOSAIC_REST_NONCE`
|
|
78
|
-
- or put them in a JSON file of your own and pass `--config <file>`, which is what
|
|
79
|
-
the examples in the skill show
|
|
80
|
-
The environment wins over the file, and with the environment set no credential
|
|
81
|
-
needs to be written to disk at all.
|
|
82
|
-
- **`tools/build_site.py`, `data_upgrade.py`, `theme_zip.py`, `probe_accordion.py` and the `sweep_*.py`
|
|
83
|
-
tools** call Mosaic's REST routes on the site in that config file, with that
|
|
84
|
-
session, to read and write pages, components and themes. They contact only that
|
|
85
|
-
site.
|
|
86
|
-
- **`tools/verify_*.py`** open pages of that same site with Playwright (Chromium) or
|
|
87
|
-
`urllib` and compare what was delivered with what was written.
|
|
88
|
-
- **`sites/`** holds the worked example (the author's own site) as readable Python
|
|
89
|
-
modules. `python sites/_moksa.py` generates `sites/moksa.json` from them; the
|
|
90
|
-
generated file is not shipped. The design loads Google Fonts, so pages built from
|
|
91
|
-
it make visitors' browsers fetch fonts from Google, as any page using Google Fonts
|
|
92
|
-
does.
|
|
93
|
-
|
|
94
|
-
The tools need Python 3 and Playwright. Nothing is downloaded at install time, and no
|
|
95
|
-
data is sent to the author or any third party.
|
|
96
|
-
|
|
97
|
-
## What this is
|
|
98
|
-
|
|
99
|
-
Mosaic keeps a page in **23 custom database tables**, not in `post_content` and not
|
|
100
|
-
in `postmeta`. One row per element, the tree carried by a `parentID` column, sibling
|
|
101
|
-
order by a fractional-index string. The editor is one client of that model. It is not
|
|
102
|
-
the format, and you do not need it.
|
|
103
|
-
|
|
104
|
-
This skill is the map of that model — measured against a live install rather than
|
|
105
|
-
read off the source — plus the tools to write through it, check what came out, and
|
|
106
|
-
bring pages in from Elementor.
|
|
107
|
-
|
|
108
|
-
## How the pieces fit
|
|
109
|
-
|
|
110
|
-
```mermaid
|
|
111
|
-
flowchart LR
|
|
112
|
-
subgraph measure["measured once, against a live install"]
|
|
113
|
-
SRC[plugin source] -->|extract_*.py| D[(data/*.csv)]
|
|
114
|
-
SW[sweep_*.py / probe_*.py] -->|commit, render, assert| D
|
|
115
|
-
end
|
|
116
|
-
|
|
117
|
-
subgraph write["every page you build"]
|
|
118
|
-
Q[mo.py] -->|one answer, verdict first| SPEC[page spec]
|
|
119
|
-
EL[Elementor _elementor_data] -->|from_elementor.py| SPEC
|
|
120
|
-
SPEC -->|build_page.py refuses what breaks| REST[Mosaic REST: checkout, check, commit]
|
|
121
|
-
REST --> DB[(23 tables)]
|
|
122
|
-
DB --> PAGE[served page]
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
subgraph verify["never trust the commit"]
|
|
126
|
-
PAGE --> V1[verify_rwd.py]
|
|
127
|
-
PAGE --> V2[verify_browser.py + design audit]
|
|
128
|
-
PAGE --> V3[verify_intro.py / verify_loop.py]
|
|
129
|
-
PAGE --> V4[verify_conversion.py]
|
|
130
|
-
V1 & V2 & V3 & V4 --> CSV[(verification CSVs)]
|
|
131
|
-
CSV --> GATE[check-release.mjs]
|
|
132
|
-
end
|
|
133
|
-
|
|
134
|
-
D --> Q
|
|
135
|
-
D --> SPEC
|
|
96
|
+
Manual copy:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
git clone https://github.com/Moksa1123/mosaic-headless.git
|
|
100
|
+
cp -r mosaic-headless ~/.claude/skills/mosaic-headless
|
|
136
101
|
```
|
|
137
102
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
103
|
+
| Platform | What is installed | Where |
|
|
104
|
+
|---|---|---|
|
|
105
|
+
| Claude Code | full skill: SKILL.md, references, tools, data, sites, evals, scripts | `~/.claude/skills/` or `./.claude/skills/` |
|
|
106
|
+
| Codex CLI | full skill | `~/.codex/skills/` |
|
|
107
|
+
| Gemini CLI | full skill | `~/.gemini/skills/` |
|
|
108
|
+
| GitHub Copilot | full skill | `./.github/skills/` |
|
|
109
|
+
| Cursor | one `.mdc` rule with the references embedded | `~/.cursor/rules/` |
|
|
110
|
+
| Windsurf | one rule file with the references embedded | `./.devin/rules/` |
|
|
111
|
+
| Continue | one rule file with the references embedded | `~/.continue/rules/` |
|
|
112
|
+
| Claude.ai | a zip to upload (SKILL.md, references, data, sites; no tools) | wherever you save it |
|
|
142
113
|
|
|
143
|
-
|
|
114
|
+
Requirements: Python 3 (lookup, build and self-test use the standard library only); Playwright for the browser verifiers (`requirements.txt`); WP-CLI on the server for the `.php` tools; Node.js 18 or later only for the npx installer. Works on Windows, macOS and Linux. A new npm version changes nothing until you re-run the installer with `--force`.
|
|
144
115
|
|
|
145
|
-
|
|
146
|
-
from memory. Look it up in `data/`.**
|
|
116
|
+
## Quick start
|
|
147
117
|
|
|
148
|
-
|
|
149
|
-
not answer the question you have. Ask grep about `accordion-content` and it confirms
|
|
150
|
-
the type exists. The sweep says BROKE_PAGE: place one and the whole public page
|
|
151
|
-
becomes a 54-byte error string. Both true, both the wrong answer — the note beside
|
|
152
|
-
the row says that string names a missing parent, and that nested under
|
|
153
|
-
`accordion > accordion-item` the type commits, renders, and hands you a
|
|
154
|
-
keyboard-operable disclosure. `mo.py type` shows all three at once.
|
|
118
|
+
### Step 2: Query the data
|
|
155
119
|
|
|
156
120
|
```bash
|
|
157
|
-
python tools/mo.py
|
|
158
|
-
python tools/mo.py check div text button # exits 1 on an unsafe or unknown type
|
|
159
|
-
python tools/mo.py params text # everything settable on one type
|
|
160
|
-
python tools/mo.py style --grouped # the 20 that are inert set on their own
|
|
161
|
-
python tools/mo.py states --verified # the states measured to compile
|
|
162
|
-
python tools/mo.py css grid-column # which Mosaic key drives this CSS
|
|
121
|
+
python tools/mo.py check div text accordion-content
|
|
163
122
|
```
|
|
164
123
|
|
|
165
|
-
Then check the page. Mosaic has **eight** failure modes and only three of them change
|
|
166
|
-
the HTTP status code:
|
|
167
|
-
|
|
168
124
|
```
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
public page becomes a 54-byte error string
|
|
173
|
-
wrong value SHAPE HTTP 200, stored, and the CSS rule is simply absent
|
|
174
|
-
right rule, wrong result HTTP 200, in the stylesheet, correct, and the BROWSER
|
|
175
|
-
computes something else
|
|
176
|
-
no template for the URL HTTP 406 with an EMPTY BODY for anyone not logged in
|
|
177
|
-
render-time fatal from HTTP 500 - the commit went through, the page dies when
|
|
178
|
-
CONTENT Mosaic parses it. A `code` node's content is a template:
|
|
179
|
-
`@media(` as every minifier writes it is read as a
|
|
180
|
-
function call. `@media (` renders. build_page refuses
|
|
181
|
-
the former.
|
|
182
|
-
plugin upgrade renamed HTTP 200, page intact, rows migrated - and CSS you wrote
|
|
183
|
-
what the page emits against an emitted class matches nothing. 1.0.8 turned
|
|
184
|
-
`M_EL4 M_EL_Div` into `m-div _e`, state classes with it,
|
|
185
|
-
`customStyles` into `customDeclarations`. The example's
|
|
186
|
-
tap-to-enlarge stopped opening; verify_loop.py said so.
|
|
125
|
+
type outcome why
|
|
126
|
+
----------------- ---------- -----------------------------------------------
|
|
127
|
+
accordion-content BROKE_PAGE AccordionItemElementMResource instance required
|
|
187
128
|
```
|
|
188
129
|
|
|
189
|
-
|
|
190
|
-
stylesheet. Every tool here fetches the page afterwards — and treats a 5xx as an
|
|
191
|
-
empty page, because WordPress's "critical error" screen is 2,697 bytes and larger
|
|
192
|
-
than any naive healthy-page floor.
|
|
130
|
+
It exits 1: placed bare, that type commits and then turns the whole public page into an error string. `python tools/mo.py type accordion-content` says where it has to go instead.
|
|
193
131
|
|
|
194
|
-
|
|
132
|
+
### Step 3: Ask the assistant
|
|
195
133
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
134
|
+
- "Build a landing section on my Mosaic site: an H1, a paragraph and a button to /contact/."
|
|
135
|
+
- "Can I put an accordion-content directly inside a div in Mosaic?"
|
|
136
|
+
- "Add a popover tour with three steps that advances when each step closes."
|
|
199
137
|
|
|
200
|
-
|
|
201
|
-
|---|---|
|
|
202
|
-
| **node types** | 129 / 129 swept one per document, committed → rendered → asserted → deleted: 77 RENDERED, 25 COMMITTED, 15 COMMIT_5xx, 12 BROKE_PAGE. Re-swept on 1.0.8: five types that used to commit silently now kill the page unparented. The non-rendering rows that are artefacts of committing without the required parent say so beside the row |
|
|
203
|
-
| **style properties** | 101 / 101 written to a live page and checked against the compiled CSS: 61 COMPILED, 18 ABSENT, 21 SKIPPED |
|
|
204
|
-
| **node properties** | 191 / 191 re-probed with a value shaped by each property's own validator chain: 39 APPLIED, 45 NO_EFFECT, 55 NO_HOST, 48 SKIPPED |
|
|
205
|
-
| **responsive** | 733 `_t`/`_m` declarations across two sites asserted against the stylesheet the site actually served — all verified |
|
|
206
|
-
| **browser** | 4,132 computed-style readings on two delivered pages in Chromium at three viewports: 2,929 compared and agreed, 912 not-comparable and labelled, **0 overridden** |
|
|
207
|
-
| **design audit** | contrast, font fallback, CJK tracking, overflow, clipped text, line measure — run in the browser, **26 findings, every one ruled on in writing** — an acknowledgement without a reason is refused by the release gate |
|
|
208
|
-
| **components** | the component system driven end to end, **8 of 8**: created under a category, document healed, tree filled through the writable instance, the read-only one refused the same write as a negative control, two instances on a page rendering one definition twice |
|
|
209
|
-
| **style states** | 52 of the 53 states written to a live page and matched against the selector the table promises: **36 compiled exactly**, 13 NO_HOST, 3 SKIPPED, 0 BROKE_PAGE. Pseudo-classes are emitted UPPERCASE (`.M_EL9:HOVER`) |
|
|
210
|
-
| **interactions** | the JS animation path probed with negative controls and the row read back: `propertyMetas` **is** accepted and stored; the property values still do not bind, and the boundary is now exact |
|
|
211
|
-
| **accordion** | `accordion-item` and `accordion-content` sit in the sweep table as BROKE_PAGE; nested as their factory requires they commit and render, **7 of 7** |
|
|
212
|
-
| **entrance animation** | the page-load sequence sampled at fifteen timestamps on a monotonic clock and asserted on eight counts. Costs one late frame over a page with no animation at all, because it waits for the document's first layout |
|
|
213
|
-
| **perpetual animation** | a corner plate that keeps printing itself and opens to full size when tapped, **28 checks**: periodicity by scrubbing a paused timeline, occlusion of text *and* controls at five widths and twenty-five scroll stops with "never readable" as the failing condition, opened by pointer and by Enter, still under reduced motion |
|
|
214
|
-
| **Elementor conversion** | every Elementor page of a production site — 19 pages, 3,292 elements — converted, built and checked against its source: **19 of 19**, 3,281 elements carried, 11 declared. Then the converted page through rwd, browser and the audit, with every finding classified inherited-or-introduced: **0 introduced** |
|
|
215
|
-
| **theme export/import** | two paths, both round-tripped. `theme_export.php` moves rows as JSON over WP-CLI, ids intact. `theme_zip.py` drives Mosaic's **own** ZIP export/import — import lands in test mode unless told `--activate`, because the default is to switch the live site — and **22 checks** hold the copy against the source tree for tree |
|
|
216
|
-
| **the skill itself** | `claude plugin eval .` — five cases a user would ask, three runs each, with and without the skill loaded, three LLM judges a run. **With: 1.00 on all five. Without: 0.00 on all five.** The baseline's best answer was to refuse |
|
|
217
|
-
| **measured live** | 115 REST routes, 157 variants, 59 condition subjects, 23 tables / 210 columns |
|
|
218
|
-
| **1.0.9 features** | the modal (`<dialog>`), OpenStreetMap, the exit-intent and scroll-depth triggers, run rules, memory actions and the modal shorthand, each built on a live page and exercised in a real browser: 19 of 19. An exit-intent popup that fires once a session is one object, no wiring |
|
|
219
|
-
| **1.0.10 features** | the popover - Mosaic's first non-blocking dialog - built eight ways on a lab page and driven in Chromium: 37 of 37. A page-load notice that leaves the page scrollable and clickable, anchored menus and cards, the nine screen cells, the keepInView flip and its style state, a three-step tour on `afterClose`. Plus the modal's move onto the Popover API: top layer, `requestClose()`, and `display` on its host no longer pinning it open |
|
|
220
|
-
| **slider** | the whole family nested as its factories require and driven in a browser, 19 of 19: advances on its own delay, arrows and bullets and the keyboard move it, holds still under `prefers-reduced-motion`. The bullet turns out to be a template repeated per slide - same id on every copy |
|
|
221
|
-
| **a real site** | the nineteen converted Elementor pages assembled into one site with a real menu and a modal per page: 46 of 46 navigation checks, 19 of 19 modals, six distinct trigger / run-rule / memory / dismissal configurations |
|
|
222
|
-
| **custom fields** | ACF and Meta Box, forty fields on a page, read back through `@VAR` / `@LOOP` off the delivered HTML: 59 of 62 resolve, 3 empties explained; loops over multi-value fields rendered exactly the field's rows. `tools/list_fields.php` prints the names Mosaic actually registers |
|
|
223
|
-
| **upgraded live** | 1.0.7 -> 1.0.8 over the plugin's own milestone route, from outside wp-admin: 6 milestones, four tables renamed, every emitted class name changed, every `customStyles` rewritten - then every sweep above re-run on the result |
|
|
224
|
-
|
|
225
|
-
`SKIPPED`, `NO_HOST` and `INCONCLUSIVE` are never folded into a pass rate. A sweep
|
|
226
|
-
that scores its own blind spots as successes is the thing this skill argues against.
|
|
227
|
-
|
|
228
|
-
## What it costs to consult
|
|
229
|
-
|
|
230
|
-
Three ways an agent can learn what a Mosaic node type or style key actually takes,
|
|
231
|
-
priced on the same six tasks with tiktoken (`tools/benchmark_tokens.py`; run it
|
|
232
|
-
yourself):
|
|
233
|
-
|
|
234
|
-
| task | read the source | load every table | `mo.py` query |
|
|
235
|
-
|---|---:|---:|---:|
|
|
236
|
-
| place a heading, a paragraph and a linked button | 10,005 | 259,539 | **961** |
|
|
237
|
-
| set padding, a border and a radius, responsively | 3,490 | 259,539 | **396** |
|
|
238
|
-
| decide whether the accordion is usable, and how to nest it | 15,615 | 259,539 | **397** |
|
|
239
|
-
| find which hover/focus states actually compile | 3,619 | 259,539 | **1,054** |
|
|
240
|
-
| find which Mosaic key drives one CSS property | 1,862 | 259,539 | **51** |
|
|
241
|
-
| know what is unsafe before committing anything | 63,172 | 259,539 | **288** |
|
|
242
|
-
|
|
243
|
-
**71–99.5% fewer tokens than reading the source, 99.6%+ fewer than loading the
|
|
244
|
-
tables** — and the source could not have answered four of the six at all, because
|
|
245
|
-
"declared" and "compiles" are different questions and only the sweeps asked the
|
|
246
|
-
second one. The tables total 259,539 tokens; never load them. `mo.py` is the query.
|
|
247
|
-
|
|
248
|
-
### Results worth knowing before you write anything
|
|
249
|
-
|
|
250
|
-
**A property that belongs to a `group` is inert when set on its own.** Exact in both
|
|
251
|
-
directions: 78 ungrouped properties gave 58 COMPILED and 0 ABSENT; all 20 grouped
|
|
252
|
-
ones gave 0 COMPILED. So `borderLeftWidth`, `outlineColor` and `gridColumnStart` are
|
|
253
|
-
three instances of one rule, not three oddities. Use the grouped shape — `border`
|
|
254
|
-
takes `{width, style, color}` — or `customDeclarations`.
|
|
255
|
-
|
|
256
|
-
**A breakpoint override can CHANGE a property but never REMOVE one.** Narrow-screen
|
|
257
|
-
`customDeclarations` that merely omits a border leaves the wide-screen border standing.
|
|
258
|
-
Say `border-left:0` out loud.
|
|
259
|
-
|
|
260
|
-
**Only four types take a `url`**: `button`, `menu-link`, `wysiwyg-link`,
|
|
261
|
-
`dropdown-toggle`. On a `text` or an `image` it is accepted, stored, and emits no
|
|
262
|
-
anchor. Wrap the thing in a `menu-link` instead — it takes any children and becomes
|
|
263
|
-
a real `<a href>`.
|
|
264
|
-
|
|
265
|
-
**An image's attachment-protocol path is relative to the uploads directory.**
|
|
266
|
-
`wp-attachment://image/<id>/full/2026/09/pic.png` resolves and carries the
|
|
267
|
-
attachment's width and height. Give it the full `wp-content/uploads/...` path — the
|
|
268
|
-
obvious guess — and Mosaic prefixes the uploads base a second time, silently.
|
|
269
|
-
|
|
270
|
-
## Elementor → Mosaic
|
|
138
|
+
## Trigger phrases
|
|
271
139
|
|
|
272
|
-
|
|
273
|
-
wp post meta get 2360 _elementor_data > page.json
|
|
274
|
-
python tools/from_elementor.py --data page.json --out spec.json --report conv.csv \
|
|
275
|
-
--uploads-base https://site/wp-content/uploads --slug works --post 208
|
|
276
|
-
python tools/build_site.py --config c.json --site spec.json
|
|
277
|
-
python tools/verify_conversion.py --data page.json --url https://site/works/ --report conv.csv
|
|
278
|
-
```
|
|
140
|
+
English: Mosaic Pro, Nextend, build a Mosaic page without the editor, Mosaic padding / hover / breakpoint, Mosaic popup, popover, modal, Mosaic interaction, move a Mosaic theme, Mosaic upgrade, Elementor to Mosaic.
|
|
279
141
|
|
|
280
|
-
|
|
281
|
-
container / heading / text-editor / button / html / icon-list / divider / image are
|
|
282
|
-
99.6% of every element present. The long tail — loop grids, forms, countdowns,
|
|
283
|
-
third-party addons — is dynamic and has no node to become; each is reported by
|
|
284
|
-
name and reason, never dropped, and `--strict` refuses to write a lossy spec.
|
|
142
|
+
中文:Mosaic、Nextend、不開編輯器做頁面、內距、外距、圓角、懸停、斷點、RWD、彈出視窗、浮動框、摺疊面板、頁籤、輪播、互動、動畫、搬佈景、Mosaic 升級、Elementor 轉 Mosaic。
|
|
285
143
|
|
|
286
|
-
|
|
287
|
-
breakpoints (`_tablet`/`_mobile` → `_t`/`_m`). What does not: entrance animations
|
|
288
|
-
(Mosaic's interaction binding is unsolved), shape dividers, gradient overlays. The
|
|
289
|
-
verifier then holds the built page against the source — every string, image, link
|
|
290
|
-
and heading level — and it earned its place at once: it caught the converter losing
|
|
291
|
-
19 of 21 links by writing `url` onto nodes that ignore it.
|
|
144
|
+
## What it runs and connects to
|
|
292
145
|
|
|
293
|
-
|
|
146
|
+
- **Nothing runs on its own.** The plugin has no hooks, no MCP servers and no background processes. Tools run only when Claude follows `SKILL.md` and you approve the command.
|
|
147
|
+
- **Offline, local only**: `tools/mo.py` reads the CSV files in `data/` and prints answers. `tools/test_mosaic.py` and `tools/check_numbers.py` read the repository. They write nothing and contact nothing.
|
|
148
|
+
- **Your WordPress site, over its REST API**: `build_page.py`, `build_site.py`, `data_upgrade.py`, `theme_zip.py`, the `sweep_*.py` and `probe*.py` tools call Mosaic's REST routes on the one site you configure, to read and write pages, components, templates and themes. They contact only that site.
|
|
149
|
+
- **Your WordPress site, through WP-CLI**: the `tools/*.php` scripts run inside your WordPress with `wp eval-file`, on the server (usually over your own SSH). They read and write Mosaic's tables and theme data on that site. `theme_delete.php` and `prune_unbound.php` delete data and run as a dry run unless told `--apply`.
|
|
150
|
+
- **Reading your public pages**: `tools/verify_*.py` and `audit_mobile.py` open pages of that same site with Playwright (Chromium) or `urllib` and compare what was delivered with what was written.
|
|
151
|
+
- **Credentials**: a site URL, a WordPress logged-in cookie and the matching `wp_rest` nonce, for an administrator on your own site. `tools/mint_session.php` prints them on the server. Installed as a plugin, Claude Code asks for them as `userConfig` values; the cookie and nonce are marked sensitive and kept in the platform's credential store. They can also come from environment variables (`MOSAIC_SITE_URL`, `MOSAIC_REST_COOKIE`, `MOSAIC_REST_NONCE`) or a JSON file you pass with `--config`. **No tool looks for credentials on your machine.**
|
|
152
|
+
- **Third parties**: the worked example in `sites/` loads Google Fonts, so pages built from it make visitors' browsers fetch fonts from Google.
|
|
153
|
+
- Nothing is downloaded at install time, and no data is sent to the author or anyone else.
|
|
294
154
|
|
|
295
|
-
|
|
|
296
|
-
|
|
297
|
-
| `mo.py` | query the measured surface
|
|
298
|
-
| `build_page.py` / `build_site.py` | commit a spec through the guarded write path
|
|
299
|
-
| `from_elementor.py` / `verify_conversion.py` | Elementor
|
|
300
|
-
| `verify_browser.py` |
|
|
301
|
-
| `
|
|
302
|
-
| `
|
|
303
|
-
| `
|
|
304
|
-
| `
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
|
311
|
-
|
|
312
|
-
| `
|
|
313
|
-
| `
|
|
314
|
-
| `
|
|
315
|
-
| `
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
`
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
155
|
+
| Tool | Does | Touches |
|
|
156
|
+
|---|---|---|
|
|
157
|
+
| `mo.py` | query the measured surface, the front door | local `data/` only |
|
|
158
|
+
| `build_page.py` / `build_site.py` | commit a spec through the guarded write path | your site (REST) |
|
|
159
|
+
| `from_elementor.py` / `verify_conversion.py` | Elementor to Mosaic, and proof the content arrived | local file / your site |
|
|
160
|
+
| `verify_rwd.py`, `verify_browser.py`, `verify_*.py` | read the delivered page in Chromium | your site (read) |
|
|
161
|
+
| `theme_zip.py`, `theme_export.php` / `theme_import.php` | move a whole theme | your site (REST / WP-CLI) |
|
|
162
|
+
| `data_upgrade.py` | run Mosaic's data migration after a plugin update | your site (REST) |
|
|
163
|
+
| `scan_inline_tags.py` / `fix_inline_tags.py` | find and fix text that prints HTML tags on 1.0.11+ | your site (REST) |
|
|
164
|
+
| `test_mosaic.py`, `check_numbers.py` | self-test and number check | this repository |
|
|
165
|
+
|
|
166
|
+
## How it's verified
|
|
167
|
+
|
|
168
|
+
Node types, node properties, style properties and style states are extracted from the plugin source (`tools/check_tables.py` re-extracts and diffs them), then written one at a time to a live install and asserted on the delivered HTML and compiled CSS. Each table below is in `data/`; the row count is checked by `tools/check_numbers.py`.
|
|
169
|
+
|
|
170
|
+
| Table | Rows | What was checked |
|
|
171
|
+
|---|---:|---|
|
|
172
|
+
| `data/node-verification.csv` | 134 | every node type committed alone and read back from the public page |
|
|
173
|
+
| `data/style-verification.csv` | 101 | every style property against the compiled CSS |
|
|
174
|
+
| `data/node-property-verification.csv` | 191 | each node property probed with a value its own validator accepts |
|
|
175
|
+
| `data/style-state-verification.csv` | 59 | each state matched against the selector it promises |
|
|
176
|
+
| `data/rwd-verification.csv` | 733 | every `_t` / `_m` declaration against the served stylesheet |
|
|
177
|
+
| `data/browser-verification/` | 4,132 | computed styles in Chromium at three viewports |
|
|
178
|
+
| `data/popover-verification.csv` | 37 | the popover: placement, closing, flip, chained tours |
|
|
179
|
+
| `data/menu-verification.csv` | 34 | hover dropdowns and phone menus with mouse, keyboard and touch |
|
|
180
|
+
| `data/form-surface-verification.csv` | 23 | every form field, including the buildable Select |
|
|
181
|
+
| `data/custom-fields-verification.csv` | 62 | ACF and Meta Box fields read through `@VAR` / `@LOOP` |
|
|
182
|
+
| `data/theme-zip-verification.csv` | 22 | Mosaic's own theme ZIP round-tripped and compared |
|
|
183
|
+
| `data/conversion-batch.csv` | 19 | every Elementor page of a site converted, built and checked |
|
|
184
|
+
|
|
185
|
+
- Self-test: `python tools/test_mosaic.py`, 42 offline tests (lookups, Chinese terms, the build output's shape and refusals, the public build interface, this repository's numbers and privacy).
|
|
186
|
+
- Evals: 16 questions about Mosaic 1.0.10 to 1.0.12 behaviour; with the skill 16/16, without it 0/16. Results: [evals/RESULTS.md](evals/RESULTS.md).
|
|
187
|
+
- Every number in `SKILL.md`, these READMEs and their badges is checked against the data by `tools/check_numbers.py`. Detail: [verification-record.md](references/verification-record.md).
|
|
188
|
+
|
|
189
|
+
What a lookup costs, priced with tiktoken on the same six tasks (`data/token-benchmark.csv`, measured when the tables were built; `tools/benchmark_tokens.py` reproduces it). Never load the tables; query them.
|
|
190
|
+
|
|
191
|
+
| `mo.py` commands | Read the source | Load every table | Query |
|
|
192
|
+
|---|---:|---:|---:|
|
|
193
|
+
| `params text ; params button ; prop url` | 10,005 | 259,539 | **961** |
|
|
194
|
+
| `style --grouped ; css border-left-width ; css border-radius` | 3,490 | 259,539 | **396** |
|
|
195
|
+
| `type accordion-content ; placement accordion-item` | 15,615 | 259,539 | **397** |
|
|
196
|
+
| `states --verified` | 3,619 | 259,539 | **1,054** |
|
|
197
|
+
| `css grid-column` | 1,862 | 259,539 | **51** |
|
|
198
|
+
| `stats ; check div text button accordion-content` | 63,172 | 259,539 | **288** |
|
|
337
199
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
200
|
+
## Limits
|
|
201
|
+
|
|
202
|
+
- Measured against Mosaic Pro up to 1.0.13. Features that live only in the 1.0.13 editor (new style-variable types, List classes, pageLoad delay and others) are not measured yet and are not written by the tools.
|
|
203
|
+
- Grid child placement properties emit nothing when written headlessly; some interaction shapes are still unmeasured.
|
|
204
|
+
- The browser verifiers need Playwright and a site you can write to; they are not part of the offline self-test.
|
|
205
|
+
- Open questions: [data/pending.csv](data/pending.csv). The long guide (failure modes, the Elementor converter, the worked example): [docs/guide.md](docs/guide.md).
|
|
342
206
|
|
|
343
|
-
|
|
344
|
-
wrong: the version numbers agree, every `files` glob matches, every verification
|
|
345
|
-
CSV still has the row count SKILL.md and the four READMEs quote, no design-audit
|
|
346
|
-
finding is unreviewed, the eval suite is present, and **the tarball itself is
|
|
347
|
-
inspected** — npm's `files` allowlist overrides `.gitignore`, and once put a real
|
|
348
|
-
client's site into a package that was about to publish.
|
|
207
|
+
## Repo layout
|
|
349
208
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
209
|
+
```
|
|
210
|
+
SKILL.md what the assistant loads: sources, routing, tasks, verify
|
|
211
|
+
data/ measured tables (CSV), Chinese terms, pending list
|
|
212
|
+
references/ topic guides: data model, styling, dialogs, upgrades ...
|
|
213
|
+
tools/ mo.py, build and verify tools, WP-CLI scripts, self-test
|
|
214
|
+
sites/ the worked example as readable Python modules
|
|
215
|
+
evals/ graded questions and results
|
|
216
|
+
scripts/ installer and release gate
|
|
217
|
+
assets/ per-platform install templates
|
|
218
|
+
docs/ the long guide
|
|
219
|
+
.claude-plugin/ plugin and marketplace manifests
|
|
220
|
+
```
|
|
353
221
|
|
|
354
|
-
##
|
|
222
|
+
## License & author
|
|
355
223
|
|
|
356
|
-
MIT.
|
|
224
|
+
MIT License. Made by Moksa ([moksaweb.com](https://moksaweb.com)). Issues: [GitHub](https://github.com/Moksa1123/mosaic-headless/issues).
|