mosaic-headless 1.38.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 +126 -25
- package/README.ko.md +126 -25
- package/README.md +126 -25
- package/README.zh-TW.md +126 -25
- package/SKILL.md +1 -1
- 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/package.json +1 -1
- package/tools/check_numbers.py +59 -2
- package/tools/test_mosaic.py +13 -0
package/README.ja.md
CHANGED
|
@@ -1,39 +1,92 @@
|
|
|
1
|
-
|
|
1
|
+
<h1 align="center">Mosaic Headless</h1>
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<h3 align="center">Mosaic Pro 無編輯器建站工具</h3>
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
<p align="center">
|
|
6
|
+
<strong>計測済みデータモデル · ガード付きページビルダー · 配信ページの検証</strong>
|
|
7
|
+
</p>
|
|
7
8
|
|
|
8
|
-
|
|
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 以上">
|
|
12
|
+
<img src="https://img.shields.io/badge/playwright-browser_verifiers-blueviolet?style=flat-square" alt="ブラウザー検証に Playwright">
|
|
13
|
+
<img src="https://img.shields.io/badge/WP--CLI-server_scripts-blue?style=flat-square&logo=wordpress&logoColor=white" alt="サーバースクリプトに WP-CLI">
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<img src="https://img.shields.io/badge/node_types-134-success?style=flat-square" alt="134 個の node type">
|
|
18
|
+
<img src="https://img.shields.io/badge/node_properties-120-success?style=flat-square" alt="120 個の node プロパティ">
|
|
19
|
+
<img src="https://img.shields.io/badge/style_properties-101-success?style=flat-square" alt="101 個のスタイルプロパティ">
|
|
20
|
+
<img src="https://img.shields.io/badge/responsive_checks-733-blueviolet?style=flat-square" alt="733 件のレスポンシブ検査">
|
|
21
|
+
<img src="https://img.shields.io/badge/self--tests-42-blueviolet?style=flat-square" alt="42 項目のセルフテスト">
|
|
22
|
+
</p>
|
|
23
|
+
|
|
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 バージョン"></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 ダウンロード数"></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"><a href="README.md">English</a> · <a href="README.zh-TW.md">正體中文</a> · <strong>日本語</strong> · <a href="README.ko.md">한국어</a></p>
|
|
9
31
|
|
|
10
32
|
> これは非公式のコミュニティプロジェクトです。Mosaic Pro の開発元 Nextend が作成・承認したものではなく、Nextend とは関係ありません。Mosaic Pro はライセンスが必要なサードパーティ製ソフトウェアで、本プロジェクトには含まれていません。
|
|
11
33
|
|
|
12
34
|
## 機能
|
|
13
35
|
|
|
14
|
-
Mosaic はページを独自のデータベーステーブルに、要素 1 つにつき 1 行で保存します(`post_content` ではありません)。この skill
|
|
36
|
+
Mosaic はページを独自のデータベーステーブルに、要素 1 つにつき 1 行で保存します(`post_content` ではありません)。この skill はそのデータモデルの計測済みマップと、それを通して書き込むツールです。データは Mosaic Pro 1.0.13 から抽出し、実サイトで 1 つずつ計測しています。
|
|
37
|
+
|
|
38
|
+
| 分野 | 内容 |
|
|
39
|
+
|---|---|
|
|
40
|
+
| 検索 | `tools/mo.py`:134 個の node type、120 個の node プロパティ、101 個のスタイルプロパティ、60 個のスタイル状態。それぞれ計測結果付きで答えます。中国語や口語でも引けます(`mo.py css 內距`) |
|
|
41
|
+
| 構築 | `build_page.py`/`build_site.py` は Mosaic の REST 書き込み手順でページ仕様をコミットし、ページを壊すと計測された書き方は拒否します |
|
|
42
|
+
| 検証 | 配信されたページを Chromium で読みます:レスポンシブ規則、計算後のスタイル、メニュー、ダイアログ、スライダー、フォーム |
|
|
43
|
+
| 移行 | テーマ全体のエクスポートとインポート、wp-admin の外からの Mosaic データアップグレード |
|
|
44
|
+
| 変換 | Elementor ページを Mosaic の仕様に変換し、変換できない要素はすべて名前を挙げます |
|
|
45
|
+
|
|
46
|
+
### 書く前に調べる
|
|
47
|
+
|
|
48
|
+
```bash
|
|
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
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### ガードを通して構築する
|
|
55
|
+
|
|
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
|
+
```
|
|
60
|
+
|
|
61
|
+
### 訪問者が受け取るページを確認する
|
|
15
62
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- **移行と変換**:テーマ全体のエクスポートとインポート、Mosaic のデータアップグレードの実行、Elementor ページから Mosaic への変換。
|
|
63
|
+
```bash
|
|
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
|
|
66
|
+
```
|
|
21
67
|
|
|
22
68
|
## 使う場面
|
|
23
69
|
|
|
24
70
|
サイトが Mosaic Pro で動いていて、エディターを開かずにページ、テンプレート、コンポーネント、デザイントークン、ポップアップ、メニュー、インタラクションを作成・変更したいとき、または Mosaic の設定が実際に何をするかを正確に知りたいときに使います。
|
|
25
71
|
|
|
26
|
-
|
|
72
|
+
| 依頼 | 担当 |
|
|
73
|
+
|---|---|
|
|
74
|
+
| Elementor ページ | `elementor-headless` |
|
|
75
|
+
| ブロックエディター(Gutenberg)のページ | `gutenberg-headless` |
|
|
76
|
+
| SEO 記事、Rank Math のスコア | `rankmath-seo-wp` |
|
|
77
|
+
| サイト健全性チェック、プラグイン更新、セキュリティ | 対象外 |
|
|
27
78
|
|
|
28
79
|
## インストール
|
|
29
80
|
|
|
81
|
+
### Step 1: インストール方法を選ぶ
|
|
82
|
+
|
|
30
83
|
Claude plugin(Claude Code。Claude 公式ディレクトリに掲載された後はそこからも):
|
|
31
84
|
|
|
32
85
|
```
|
|
33
86
|
/plugin install mosaic-headless --marketplace Moksa1123/mosaic-headless
|
|
34
87
|
```
|
|
35
88
|
|
|
36
|
-
npx(Claude Code とほかの AI
|
|
89
|
+
npx(Claude Code とほかの AI コーディングツール):
|
|
37
90
|
|
|
38
91
|
```bash
|
|
39
92
|
npx mosaic-headless@latest claude-code --global --force
|
|
@@ -47,17 +100,22 @@ git clone https://github.com/Moksa1123/mosaic-headless.git
|
|
|
47
100
|
cp -r mosaic-headless ~/.claude/skills/mosaic-headless
|
|
48
101
|
```
|
|
49
102
|
|
|
50
|
-
|
|
103
|
+
| プラットフォーム | インストール内容 | 場所 |
|
|
104
|
+
|---|---|---|
|
|
105
|
+
| Claude Code | skill 一式:SKILL.md、references、tools、data、sites、evals、scripts | `~/.claude/skills/` または `./.claude/skills/` |
|
|
106
|
+
| Codex CLI | skill 一式 | `~/.codex/skills/` |
|
|
107
|
+
| Gemini CLI | skill 一式 | `~/.gemini/skills/` |
|
|
108
|
+
| GitHub Copilot | skill 一式 | `./.github/skills/` |
|
|
109
|
+
| Cursor | references を埋め込んだ `.mdc` ルール 1 つ | `~/.cursor/rules/` |
|
|
110
|
+
| Windsurf | references を埋め込んだルールファイル 1 つ | `./.devin/rules/` |
|
|
111
|
+
| Continue | references を埋め込んだルールファイル 1 つ | `~/.continue/rules/` |
|
|
112
|
+
| Claude.ai | アップロード用 zip(SKILL.md、references、data、sites。ツールなし) | 保存した場所 |
|
|
51
113
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
アシスタントへの依頼の例:
|
|
114
|
+
動作要件:Python 3(検索・構築・セルフテストは標準ライブラリのみ)。ブラウザー検証ツールには Playwright(`requirements.txt`)。`.php` ツールにはサーバー上の WP-CLI。npx インストーラーにのみ Node.js 18 以上が必要です。Windows、macOS、Linux で動作します。npm の新しいバージョンは、`--force` を付けてインストーラーを再実行するまで反映されません。
|
|
55
115
|
|
|
56
|
-
|
|
57
|
-
- 「Mosaic の accordion-content は div の中に直接置ける?」
|
|
58
|
-
- 「各ステップを閉じると次へ進む、3 ステップのポップオーバーツアーを追加して。」
|
|
116
|
+
## クイックスタート
|
|
59
117
|
|
|
60
|
-
|
|
118
|
+
### Step 2: データを引く
|
|
61
119
|
|
|
62
120
|
```bash
|
|
63
121
|
python tools/mo.py check div text accordion-content
|
|
@@ -71,6 +129,12 @@ accordion-content BROKE_PAGE AccordionItemElementMResource instance required
|
|
|
71
129
|
|
|
72
130
|
終了コードは 1 です。この type を単独で置くとコミットは成功しますが、公開ページ全体がエラー文字列になります。置くべき場所は `python tools/mo.py type accordion-content` が示します。
|
|
73
131
|
|
|
132
|
+
### Step 3: アシスタントに頼む
|
|
133
|
+
|
|
134
|
+
- 「Mosaic サイトにランディングセクションを作って:H1、段落、/contact/ へのボタン。」
|
|
135
|
+
- 「Mosaic の accordion-content は div の中に直接置ける?」
|
|
136
|
+
- 「各ステップを閉じると次へ進む、3 ステップのポップオーバーツアーを追加して。」
|
|
137
|
+
|
|
74
138
|
## トリガーフレーズ
|
|
75
139
|
|
|
76
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.
|
|
@@ -88,20 +152,57 @@ English: Mosaic Pro, Nextend, build a Mosaic page without the editor, Mosaic pad
|
|
|
88
152
|
- **第三者**:`sites/` の作例は Google Fonts を読み込むため、それで作ったページでは訪問者のブラウザーが Google からフォントを取得します。
|
|
89
153
|
- インストール時に何もダウンロードせず、作者や第三者にデータを送りません。
|
|
90
154
|
|
|
155
|
+
| ツール | 役割 | 触れる場所 |
|
|
156
|
+
|---|---|---|
|
|
157
|
+
| `mo.py` | 計測データの検索。入口 | ローカルの `data/` のみ |
|
|
158
|
+
| `build_page.py` / `build_site.py` | ガード付きの書き込み手順で仕様をコミット | あなたのサイト(REST) |
|
|
159
|
+
| `from_elementor.py` / `verify_conversion.py` | Elementor から Mosaic へ変換し、内容が届いたことを確認 | ローカルファイル/あなたのサイト |
|
|
160
|
+
| `verify_rwd.py`、`verify_browser.py`、`verify_*.py` | 配信ページを Chromium で読む | あなたのサイト(読み取り) |
|
|
161
|
+
| `theme_zip.py`、`theme_export.php` / `theme_import.php` | テーマ全体の移行 | あなたのサイト(REST/WP-CLI) |
|
|
162
|
+
| `data_upgrade.py` | プラグイン更新後に Mosaic のデータ移行を実行 | あなたのサイト(REST) |
|
|
163
|
+
| `scan_inline_tags.py` / `fix_inline_tags.py` | 1.0.11+ で HTML タグがそのまま表示されるテキストを検出・修正 | あなたのサイト(REST) |
|
|
164
|
+
| `test_mosaic.py`、`check_numbers.py` | セルフテストと数値チェック | このリポジトリ |
|
|
165
|
+
|
|
91
166
|
## 検証方法
|
|
92
167
|
|
|
93
|
-
|
|
94
|
-
|
|
168
|
+
node type、node プロパティ、スタイルプロパティ、スタイル状態はプラグインのソースから抽出し(`tools/check_tables.py` が再抽出して差分を確認)、実サイトに 1 つずつ書き込んで、配信された HTML とコンパイル後の CSS で確認しています。下の表はすべて `data/` にあり、行数は `tools/check_numbers.py` が照合します。
|
|
169
|
+
|
|
170
|
+
| テーブル | 行数 | 確認内容 |
|
|
171
|
+
|---|---:|---|
|
|
172
|
+
| `data/node-verification.csv` | 134 | すべての node type を単独でコミットし、公開ページから読み戻す |
|
|
173
|
+
| `data/style-verification.csv` | 101 | すべてのスタイルプロパティをコンパイル後の CSS と照合 |
|
|
174
|
+
| `data/node-property-verification.csv` | 191 | 各 node プロパティを、そのバリデーターが受け付ける値で検査 |
|
|
175
|
+
| `data/style-state-verification.csv` | 59 | 各状態を、それが生成するはずのセレクターと照合 |
|
|
176
|
+
| `data/rwd-verification.csv` | 733 | すべての `_t` / `_m` 宣言を実際に配信されたスタイルシートと照合 |
|
|
177
|
+
| `data/browser-verification/` | 4,132 | 3 つの画面幅での Chromium の計算後スタイル |
|
|
178
|
+
| `data/popover-verification.csv` | 37 | ポップオーバー:配置、閉じ方、反転、連鎖するツアー |
|
|
179
|
+
| `data/menu-verification.csv` | 34 | ホバーのドロップダウンとスマホ用メニューをマウス・キーボード・タッチで操作 |
|
|
180
|
+
| `data/form-surface-verification.csv` | 23 | すべてのフォーム項目(組み立て式の Select を含む) |
|
|
181
|
+
| `data/custom-fields-verification.csv` | 62 | ACF と Meta Box のフィールドを `@VAR` / `@LOOP` で読み出す |
|
|
182
|
+
| `data/theme-zip-verification.csv` | 22 | Mosaic 自身のテーマ ZIP を往復させて比較 |
|
|
183
|
+
| `data/conversion-batch.csv` | 19 | あるサイトのすべての Elementor ページを変換・構築・検査 |
|
|
184
|
+
|
|
95
185
|
- セルフテスト:`python tools/test_mosaic.py`、オフラインの 42 項目(検索、中国語の用語、構築結果の形と拒否ルール、公開されている構築インターフェース、このリポジトリの数値とプライバシー)。
|
|
96
186
|
- evals:Mosaic 1.0.10〜1.0.12 の挙動に関する 16 問。skill ありで 16/16、なしで 0/16。結果:[evals/RESULTS.md](evals/RESULTS.md)。
|
|
97
|
-
- `SKILL.md
|
|
187
|
+
- `SKILL.md`、これらの README、バッジの数値は、`tools/check_numbers.py` がデータと照合しています。詳細:[verification-record.md](references/verification-record.md)。
|
|
188
|
+
|
|
189
|
+
1 回の検索にかかるトークン:同じ 6 つのタスクを tiktoken で計測(`data/token-benchmark.csv`、テーブル作成時に計測。`tools/benchmark_tokens.py` で再現できます)。テーブルを丸ごと読み込まず、検索してください。
|
|
190
|
+
|
|
191
|
+
| `mo.py` コマンド | ソースを読む | 全テーブルを読む | 検索 |
|
|
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** |
|
|
98
199
|
|
|
99
200
|
## 制限
|
|
100
201
|
|
|
101
202
|
- Mosaic Pro 1.0.13 まで計測済みです。1.0.13 のエディターにしかない機能(新しいスタイル変数の種類、List のクラス、pageLoad の遅延など)はまだ計測しておらず、ツールも書き込みません。
|
|
102
203
|
- グリッド子要素の配置プロパティは headless で書き込んでも出力されません。一部のインタラクションの形はまだ計測していません。
|
|
103
204
|
- ブラウザー検証ツールには Playwright と書き込み可能なサイトが必要で、オフラインのセルフテストには含まれません。
|
|
104
|
-
- 未解決の項目:[data/pending.csv](data/pending.csv)
|
|
205
|
+
- 未解決の項目:[data/pending.csv](data/pending.csv)。詳しいガイド(失敗モード、Elementor 変換、作例):[docs/guide.md](docs/guide.md)(英語)。
|
|
105
206
|
|
|
106
207
|
## リポジトリ構成
|
|
107
208
|
|
package/README.ko.md
CHANGED
|
@@ -1,39 +1,92 @@
|
|
|
1
|
-
|
|
1
|
+
<h1 align="center">Mosaic Headless</h1>
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<h3 align="center">Mosaic Pro 無編輯器建站工具</h3>
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
<p align="center">
|
|
6
|
+
<strong>측정된 데이터 모델 · 보호 장치가 있는 페이지 빌더 · 전달된 페이지 검증</strong>
|
|
7
|
+
</p>
|
|
7
8
|
|
|
8
|
-
|
|
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 이상">
|
|
12
|
+
<img src="https://img.shields.io/badge/playwright-browser_verifiers-blueviolet?style=flat-square" alt="브라우저 검증에 Playwright">
|
|
13
|
+
<img src="https://img.shields.io/badge/WP--CLI-server_scripts-blue?style=flat-square&logo=wordpress&logoColor=white" alt="서버 스크립트에 WP-CLI">
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<img src="https://img.shields.io/badge/node_types-134-success?style=flat-square" alt="134개 node type">
|
|
18
|
+
<img src="https://img.shields.io/badge/node_properties-120-success?style=flat-square" alt="120개 node 속성">
|
|
19
|
+
<img src="https://img.shields.io/badge/style_properties-101-success?style=flat-square" alt="101개 스타일 속성">
|
|
20
|
+
<img src="https://img.shields.io/badge/responsive_checks-733-blueviolet?style=flat-square" alt="733개 반응형 검사">
|
|
21
|
+
<img src="https://img.shields.io/badge/self--tests-42-blueviolet?style=flat-square" alt="42개 자체 테스트">
|
|
22
|
+
</p>
|
|
23
|
+
|
|
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 버전"></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 다운로드 수"></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"><a href="README.md">English</a> · <a href="README.zh-TW.md">正體中文</a> · <a href="README.ja.md">日本語</a> · <strong>한국어</strong></p>
|
|
9
31
|
|
|
10
32
|
> 비공식 커뮤니티 프로젝트입니다. Mosaic Pro 개발사 Nextend가 만들거나 보증한 것이 아니며 Nextend와 관련이 없습니다. Mosaic Pro는 라이선스가 필요한 서드파티 소프트웨어로, 이 프로젝트에 포함되어 있지 않습니다.
|
|
11
33
|
|
|
12
34
|
## 기능
|
|
13
35
|
|
|
14
|
-
Mosaic는 페이지를 자체 데이터베이스 테이블에 요소 하나당 한 행으로 저장합니다(`post_content`가 아닙니다). 이 skill은 그 데이터 모델의 측정된 지도와, 그것을 통해 기록하는 도구입니다.
|
|
36
|
+
Mosaic는 페이지를 자체 데이터베이스 테이블에 요소 하나당 한 행으로 저장합니다(`post_content`가 아닙니다). 이 skill은 그 데이터 모델의 측정된 지도와, 그것을 통해 기록하는 도구입니다. 데이터는 Mosaic Pro 1.0.13에서 추출해 실제 사이트에서 하나씩 측정했습니다.
|
|
37
|
+
|
|
38
|
+
| 분야 | 내용 |
|
|
39
|
+
|---|---|
|
|
40
|
+
| 조회 | `tools/mo.py`: 134개 node type, 120개 node 속성, 101개 스타일 속성, 60개 스타일 상태. 각각 측정 결과와 함께 답합니다. 중국어와 구어로도 조회할 수 있습니다(`mo.py css 內距`) |
|
|
41
|
+
| 구축 | `build_page.py`/`build_site.py`는 Mosaic REST 쓰기 절차로 페이지 사양을 커밋하며, 페이지를 망가뜨리는 것으로 측정된 작성 방식은 거부합니다 |
|
|
42
|
+
| 검증 | 전달된 페이지를 Chromium으로 읽습니다: 반응형 규칙, 계산된 스타일, 메뉴, 대화상자, 슬라이더, 폼 |
|
|
43
|
+
| 이전 | 테마 전체 내보내기/가져오기, wp-admin 밖에서 Mosaic 데이터 업그레이드 실행 |
|
|
44
|
+
| 변환 | Elementor 페이지를 Mosaic 사양으로 변환하고, 변환하지 못한 요소는 모두 이름을 밝힙니다 |
|
|
45
|
+
|
|
46
|
+
### 쓰기 전에 조회
|
|
47
|
+
|
|
48
|
+
```bash
|
|
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
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 보호 장치를 거쳐 구축
|
|
55
|
+
|
|
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
|
+
```
|
|
60
|
+
|
|
61
|
+
### 방문자가 받는 페이지 확인
|
|
15
62
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- **이전과 변환**: 테마 전체 내보내기/가져오기, Mosaic 데이터 업그레이드 실행, Elementor 페이지를 Mosaic로 변환.
|
|
63
|
+
```bash
|
|
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
|
|
66
|
+
```
|
|
21
67
|
|
|
22
68
|
## 사용 시점
|
|
23
69
|
|
|
24
70
|
사이트가 Mosaic Pro로 운영되고, 에디터를 열지 않고 페이지, 템플릿, 컴포넌트, 디자인 토큰, 팝업, 메뉴, 인터랙션을 만들거나 바꾸고 싶을 때, 또는 Mosaic 설정이 실제로 무엇을 하는지 정확히 알고 싶을 때 사용합니다.
|
|
25
71
|
|
|
26
|
-
|
|
72
|
+
| 요청 | 담당 |
|
|
73
|
+
|---|---|
|
|
74
|
+
| Elementor 페이지 | `elementor-headless` |
|
|
75
|
+
| 블록 에디터(Gutenberg) 페이지 | `gutenberg-headless` |
|
|
76
|
+
| SEO 글, Rank Math 점수 | `rankmath-seo-wp` |
|
|
77
|
+
| 사이트 상태 점검, 플러그인 업데이트, 보안 | 범위 밖 |
|
|
27
78
|
|
|
28
79
|
## 설치
|
|
29
80
|
|
|
81
|
+
### Step 1: 설치 방법 선택
|
|
82
|
+
|
|
30
83
|
Claude plugin(Claude Code. Claude 공식 디렉터리에 등록된 뒤에는 거기서도):
|
|
31
84
|
|
|
32
85
|
```
|
|
33
86
|
/plugin install mosaic-headless --marketplace Moksa1123/mosaic-headless
|
|
34
87
|
```
|
|
35
88
|
|
|
36
|
-
npx(Claude Code와 다른 AI 코딩
|
|
89
|
+
npx(Claude Code와 다른 AI 코딩 도구):
|
|
37
90
|
|
|
38
91
|
```bash
|
|
39
92
|
npx mosaic-headless@latest claude-code --global --force
|
|
@@ -47,17 +100,22 @@ git clone https://github.com/Moksa1123/mosaic-headless.git
|
|
|
47
100
|
cp -r mosaic-headless ~/.claude/skills/mosaic-headless
|
|
48
101
|
```
|
|
49
102
|
|
|
50
|
-
|
|
103
|
+
| 플랫폼 | 설치 내용 | 위치 |
|
|
104
|
+
|---|---|---|
|
|
105
|
+
| Claude Code | skill 전체: SKILL.md, references, tools, data, sites, evals, scripts | `~/.claude/skills/` 또는 `./.claude/skills/` |
|
|
106
|
+
| Codex CLI | skill 전체 | `~/.codex/skills/` |
|
|
107
|
+
| Gemini CLI | skill 전체 | `~/.gemini/skills/` |
|
|
108
|
+
| GitHub Copilot | skill 전체 | `./.github/skills/` |
|
|
109
|
+
| Cursor | references를 포함한 `.mdc` 규칙 1개 | `~/.cursor/rules/` |
|
|
110
|
+
| Windsurf | references를 포함한 규칙 파일 1개 | `./.devin/rules/` |
|
|
111
|
+
| Continue | references를 포함한 규칙 파일 1개 | `~/.continue/rules/` |
|
|
112
|
+
| Claude.ai | 업로드용 zip(SKILL.md, references, data, sites. 도구 없음) | 저장한 위치 |
|
|
51
113
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
어시스턴트에게 이렇게 요청해 보세요:
|
|
114
|
+
요구 사항: Python 3(조회, 구축, 자체 테스트는 표준 라이브러리만 사용). 브라우저 검증 도구에는 Playwright(`requirements.txt`). `.php` 도구에는 서버의 WP-CLI. npx 설치 프로그램에만 Node.js 18 이상이 필요합니다. Windows, macOS, Linux에서 동작합니다. npm 새 버전은 `--force`로 설치 프로그램을 다시 실행해야 반영됩니다.
|
|
55
115
|
|
|
56
|
-
|
|
57
|
-
- "Mosaic의 accordion-content를 div 안에 바로 넣어도 돼?"
|
|
58
|
-
- "각 단계를 닫으면 다음으로 넘어가는 3단계 팝오버 투어를 추가해 줘."
|
|
116
|
+
## 빠른 시작
|
|
59
117
|
|
|
60
|
-
|
|
118
|
+
### Step 2: 데이터 조회
|
|
61
119
|
|
|
62
120
|
```bash
|
|
63
121
|
python tools/mo.py check div text accordion-content
|
|
@@ -71,6 +129,12 @@ accordion-content BROKE_PAGE AccordionItemElementMResource instance required
|
|
|
71
129
|
|
|
72
130
|
종료 코드는 1입니다. 이 type을 단독으로 두면 커밋은 성공하지만 공개 페이지 전체가 오류 문자열로 바뀝니다. 어디에 넣어야 하는지는 `python tools/mo.py type accordion-content`가 알려 줍니다.
|
|
73
131
|
|
|
132
|
+
### Step 3: 어시스턴트에게 요청
|
|
133
|
+
|
|
134
|
+
- "내 Mosaic 사이트에 랜딩 섹션을 만들어 줘: H1, 문단, /contact/로 가는 버튼."
|
|
135
|
+
- "Mosaic의 accordion-content를 div 안에 바로 넣어도 돼?"
|
|
136
|
+
- "각 단계를 닫으면 다음으로 넘어가는 3단계 팝오버 투어를 추가해 줘."
|
|
137
|
+
|
|
74
138
|
## 트리거 문구
|
|
75
139
|
|
|
76
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.
|
|
@@ -88,20 +152,57 @@ English: Mosaic Pro, Nextend, build a Mosaic page without the editor, Mosaic pad
|
|
|
88
152
|
- **제3자**: `sites/`의 예제는 Google Fonts를 불러오므로, 그것으로 만든 페이지에서는 방문자의 브라우저가 Google에서 글꼴을 받아 옵니다.
|
|
89
153
|
- 설치할 때 아무것도 내려받지 않으며, 작성자나 다른 누구에게도 데이터를 보내지 않습니다.
|
|
90
154
|
|
|
155
|
+
| 도구 | 하는 일 | 접근 대상 |
|
|
156
|
+
|---|---|---|
|
|
157
|
+
| `mo.py` | 측정 데이터 조회, 진입점 | 로컬 `data/`만 |
|
|
158
|
+
| `build_page.py` / `build_site.py` | 보호 장치가 있는 쓰기 절차로 사양 커밋 | 사용자의 사이트(REST) |
|
|
159
|
+
| `from_elementor.py` / `verify_conversion.py` | Elementor를 Mosaic로 변환하고 내용이 옮겨졌는지 확인 | 로컬 파일/사용자의 사이트 |
|
|
160
|
+
| `verify_rwd.py`, `verify_browser.py`, `verify_*.py` | 전달된 페이지를 Chromium으로 읽기 | 사용자의 사이트(읽기) |
|
|
161
|
+
| `theme_zip.py`, `theme_export.php` / `theme_import.php` | 테마 전체 이전 | 사용자의 사이트(REST/WP-CLI) |
|
|
162
|
+
| `data_upgrade.py` | 플러그인 업데이트 후 Mosaic 데이터 마이그레이션 실행 | 사용자의 사이트(REST) |
|
|
163
|
+
| `scan_inline_tags.py` / `fix_inline_tags.py` | 1.0.11+에서 HTML 태그가 그대로 보이는 텍스트를 찾아 수정 | 사용자의 사이트(REST) |
|
|
164
|
+
| `test_mosaic.py`, `check_numbers.py` | 자체 테스트와 숫자 검사 | 이 저장소 |
|
|
165
|
+
|
|
91
166
|
## 검증 방법
|
|
92
167
|
|
|
93
|
-
|
|
94
|
-
|
|
168
|
+
node type, node 속성, 스타일 속성, 스타일 상태는 플러그인 소스에서 추출하고(`tools/check_tables.py`가 다시 추출해 비교), 실제 사이트에 하나씩 기록해 전달된 HTML과 컴파일된 CSS로 확인합니다. 아래 표는 모두 `data/`에 있으며, 행 수는 `tools/check_numbers.py`가 대조합니다.
|
|
169
|
+
|
|
170
|
+
| 테이블 | 행 수 | 확인한 내용 |
|
|
171
|
+
|---|---:|---|
|
|
172
|
+
| `data/node-verification.csv` | 134 | 모든 node type을 단독으로 커밋하고 공개 페이지에서 다시 읽기 |
|
|
173
|
+
| `data/style-verification.csv` | 101 | 모든 스타일 속성을 컴파일된 CSS와 대조 |
|
|
174
|
+
| `data/node-property-verification.csv` | 191 | 각 node 속성을 해당 검증기가 받아들이는 값으로 검사 |
|
|
175
|
+
| `data/style-state-verification.csv` | 59 | 각 상태를 생성해야 할 선택자와 대조 |
|
|
176
|
+
| `data/rwd-verification.csv` | 733 | 모든 `_t` / `_m` 선언을 실제 전달된 스타일시트와 대조 |
|
|
177
|
+
| `data/browser-verification/` | 4,132 | 세 가지 화면 폭에서 Chromium이 계산한 스타일 |
|
|
178
|
+
| `data/popover-verification.csv` | 37 | 팝오버: 배치, 닫기, 뒤집기, 연결된 투어 |
|
|
179
|
+
| `data/menu-verification.csv` | 34 | 호버 드롭다운과 모바일 메뉴를 마우스, 키보드, 터치로 조작 |
|
|
180
|
+
| `data/form-surface-verification.csv` | 23 | 모든 폼 필드(조립식 Select 포함) |
|
|
181
|
+
| `data/custom-fields-verification.csv` | 62 | ACF와 Meta Box 필드를 `@VAR` / `@LOOP`로 읽기 |
|
|
182
|
+
| `data/theme-zip-verification.csv` | 22 | Mosaic 자체 테마 ZIP을 왕복시켜 비교 |
|
|
183
|
+
| `data/conversion-batch.csv` | 19 | 한 사이트의 모든 Elementor 페이지를 변환, 구축, 검사 |
|
|
184
|
+
|
|
95
185
|
- 자체 테스트: `python tools/test_mosaic.py`, 오프라인 테스트 42개(조회, 중국어 용어, 구축 결과의 형태와 거부 규칙, 공개된 구축 인터페이스, 이 저장소의 숫자와 개인정보).
|
|
96
186
|
- evals: Mosaic 1.0.10~1.0.12 동작에 관한 16문항. skill 사용 시 16/16, 미사용 시 0/16. 결과: [evals/RESULTS.md](evals/RESULTS.md).
|
|
97
|
-
- `SKILL.md
|
|
187
|
+
- `SKILL.md`, 이 README들, 배지의 숫자는 `tools/check_numbers.py`가 데이터와 대조합니다. 자세한 내용: [verification-record.md](references/verification-record.md).
|
|
188
|
+
|
|
189
|
+
조회 1회에 드는 토큰: 같은 6가지 작업을 tiktoken으로 계산(`data/token-benchmark.csv`, 테이블을 만들 때 측정. `tools/benchmark_tokens.py`로 재현 가능). 테이블을 통째로 읽지 말고 조회하세요.
|
|
190
|
+
|
|
191
|
+
| `mo.py` 명령 | 소스 읽기 | 전체 테이블 읽기 | 조회 |
|
|
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** |
|
|
98
199
|
|
|
99
200
|
## 제한 사항
|
|
100
201
|
|
|
101
202
|
- Mosaic Pro 1.0.13까지 측정했습니다. 1.0.13 에디터에만 있는 기능(새 스타일 변수 유형, List 클래스, pageLoad 지연 등)은 아직 측정하지 않았고 도구도 기록하지 않습니다.
|
|
102
203
|
- 그리드 자식 배치 속성은 headless로 기록하면 출력되지 않습니다. 일부 인터랙션 형태는 아직 측정하지 않았습니다.
|
|
103
204
|
- 브라우저 검증 도구에는 Playwright와 기록 가능한 사이트가 필요하며, 오프라인 자체 테스트에는 포함되지 않습니다.
|
|
104
|
-
- 미해결 항목: [data/pending.csv](data/pending.csv). 상세 가이드(실패 모드,
|
|
205
|
+
- 미해결 항목: [data/pending.csv](data/pending.csv). 상세 가이드(실패 모드, Elementor 변환기, 예제): [docs/guide.md](docs/guide.md)(영어).
|
|
105
206
|
|
|
106
207
|
## 저장소 구조
|
|
107
208
|
|
package/README.md
CHANGED
|
@@ -1,39 +1,92 @@
|
|
|
1
|
-
|
|
1
|
+
<h1 align="center">Mosaic Headless</h1>
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<h3 align="center">Mosaic Pro 無編輯器建站工具</h3>
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
<p align="center">
|
|
6
|
+
<strong>Measured data model · Guarded page builder · Delivered-page verifiers</strong>
|
|
7
|
+
</p>
|
|
7
8
|
|
|
8
|
-
|
|
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>
|
|
15
|
+
|
|
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>
|
|
23
|
+
|
|
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>
|
|
9
31
|
|
|
10
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.
|
|
11
33
|
|
|
12
34
|
## What it does
|
|
13
35
|
|
|
14
|
-
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.
|
|
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
|
|
47
|
+
|
|
48
|
+
```bash
|
|
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
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Build through the guard
|
|
55
|
+
|
|
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
|
+
```
|
|
60
|
+
|
|
61
|
+
### Check what visitors get
|
|
15
62
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- **Move and convert**: export and import whole themes, drive Mosaic's data upgrades, and convert Elementor pages into Mosaic.
|
|
63
|
+
```bash
|
|
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
|
|
66
|
+
```
|
|
21
67
|
|
|
22
68
|
## When to use
|
|
23
69
|
|
|
24
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.
|
|
25
71
|
|
|
26
|
-
|
|
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 |
|
|
27
78
|
|
|
28
79
|
## Install
|
|
29
80
|
|
|
81
|
+
### Step 1: Pick an install method
|
|
82
|
+
|
|
30
83
|
Claude plugin (Claude Code; also from the Claude directory once listed):
|
|
31
84
|
|
|
32
85
|
```
|
|
33
86
|
/plugin install mosaic-headless --marketplace Moksa1123/mosaic-headless
|
|
34
87
|
```
|
|
35
88
|
|
|
36
|
-
npx, for Claude Code and other AI coding tools
|
|
89
|
+
npx, for Claude Code and other AI coding tools:
|
|
37
90
|
|
|
38
91
|
```bash
|
|
39
92
|
npx mosaic-headless@latest claude-code --global --force
|
|
@@ -47,17 +100,22 @@ git clone https://github.com/Moksa1123/mosaic-headless.git
|
|
|
47
100
|
cp -r mosaic-headless ~/.claude/skills/mosaic-headless
|
|
48
101
|
```
|
|
49
102
|
|
|
50
|
-
|
|
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 |
|
|
51
113
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
Ask the assistant, for example:
|
|
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`.
|
|
55
115
|
|
|
56
|
-
|
|
57
|
-
- "Can I put an accordion-content directly inside a div in Mosaic?"
|
|
58
|
-
- "Add a popover tour with three steps that advances when each step closes."
|
|
116
|
+
## Quick start
|
|
59
117
|
|
|
60
|
-
|
|
118
|
+
### Step 2: Query the data
|
|
61
119
|
|
|
62
120
|
```bash
|
|
63
121
|
python tools/mo.py check div text accordion-content
|
|
@@ -71,6 +129,12 @@ accordion-content BROKE_PAGE AccordionItemElementMResource instance required
|
|
|
71
129
|
|
|
72
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.
|
|
73
131
|
|
|
132
|
+
### Step 3: Ask the assistant
|
|
133
|
+
|
|
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."
|
|
137
|
+
|
|
74
138
|
## Trigger phrases
|
|
75
139
|
|
|
76
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.
|
|
@@ -88,20 +152,57 @@ English: Mosaic Pro, Nextend, build a Mosaic page without the editor, Mosaic pad
|
|
|
88
152
|
- **Third parties**: the worked example in `sites/` loads Google Fonts, so pages built from it make visitors' browsers fetch fonts from Google.
|
|
89
153
|
- Nothing is downloaded at install time, and no data is sent to the author or anyone else.
|
|
90
154
|
|
|
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
|
+
|
|
91
166
|
## How it's verified
|
|
92
167
|
|
|
93
|
-
|
|
94
|
-
|
|
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
|
+
|
|
95
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).
|
|
96
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).
|
|
97
|
-
- Every number in `SKILL.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** |
|
|
98
199
|
|
|
99
200
|
## Limits
|
|
100
201
|
|
|
101
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.
|
|
102
203
|
- Grid child placement properties emit nothing when written headlessly; some interaction shapes are still unmeasured.
|
|
103
204
|
- The browser verifiers need Playwright and a site you can write to; they are not part of the offline self-test.
|
|
104
|
-
- Open questions: [data/pending.csv](data/pending.csv). The long guide (failure modes,
|
|
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).
|
|
105
206
|
|
|
106
207
|
## Repo layout
|
|
107
208
|
|
package/README.zh-TW.md
CHANGED
|
@@ -1,39 +1,92 @@
|
|
|
1
|
-
|
|
1
|
+
<h1 align="center">Mosaic Headless</h1>
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<h3 align="center">Mosaic Pro 無編輯器建站工具</h3>
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
<p align="center">
|
|
6
|
+
<strong>實測資料模型 · 有防護的建頁工具 · 驗證實際送出的頁面</strong>
|
|
7
|
+
</p>
|
|
7
8
|
|
|
8
|
-
|
|
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 以上">
|
|
12
|
+
<img src="https://img.shields.io/badge/playwright-browser_verifiers-blueviolet?style=flat-square" alt="瀏覽器驗證器用 Playwright">
|
|
13
|
+
<img src="https://img.shields.io/badge/WP--CLI-server_scripts-blue?style=flat-square&logo=wordpress&logoColor=white" alt="伺服器腳本用 WP-CLI">
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<img src="https://img.shields.io/badge/node_types-134-success?style=flat-square" alt="134 種 node type">
|
|
18
|
+
<img src="https://img.shields.io/badge/node_properties-120-success?style=flat-square" alt="120 個 node 屬性">
|
|
19
|
+
<img src="https://img.shields.io/badge/style_properties-101-success?style=flat-square" alt="101 個樣式屬性">
|
|
20
|
+
<img src="https://img.shields.io/badge/responsive_checks-733-blueviolet?style=flat-square" alt="733 條 RWD 檢查">
|
|
21
|
+
<img src="https://img.shields.io/badge/self--tests-42-blueviolet?style=flat-square" alt="42 項自我測試">
|
|
22
|
+
</p>
|
|
23
|
+
|
|
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 版本"></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 下載數"></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"><a href="README.md">English</a> · <strong>正體中文</strong> · <a href="README.ja.md">日本語</a> · <a href="README.ko.md">한국어</a></p>
|
|
9
31
|
|
|
10
32
|
> 這是非官方的社群專案,不是 Mosaic Pro 的開發商 Nextend 製作或背書,也和 Nextend 沒有關係。Mosaic Pro 是需授權的第三方軟體,本專案不包含它。
|
|
11
33
|
|
|
12
34
|
## 功能
|
|
13
35
|
|
|
14
|
-
Mosaic 把頁面存在自己的資料表裡,一個元素一列,不在 `post_content`。這個 skill
|
|
36
|
+
Mosaic 把頁面存在自己的資料表裡,一個元素一列,不在 `post_content`。這個 skill 是那套資料模型的實測地圖,加上透過它寫入的工具;資料從 Mosaic Pro 1.0.13 抽出,並在正式網站上逐一實測。
|
|
37
|
+
|
|
38
|
+
| 類別 | 內容 |
|
|
39
|
+
|---|---|
|
|
40
|
+
| 查詢 | `tools/mo.py`:134 種 node type、120 個 node 屬性、101 個樣式屬性、60 個樣式狀態,每項都附實測結論;中文和口語也查得到(`mo.py css 內距`) |
|
|
41
|
+
| 建頁 | `build_page.py`/`build_site.py` 透過 Mosaic 的 REST 寫入流程提交頁面規格,實測會弄壞頁面的寫法直接拒絕 |
|
|
42
|
+
| 驗證 | 用 Chromium 讀實際送出的頁面:RWD 規則、計算後樣式、選單、彈出視窗、輪播、表單 |
|
|
43
|
+
| 搬移 | 整個佈景匯出匯入;在 wp-admin 之外執行 Mosaic 的資料升級 |
|
|
44
|
+
| 轉換 | Elementor 頁面轉成 Mosaic 規格,轉不了的元素逐一列名 |
|
|
45
|
+
|
|
46
|
+
### 先查再寫
|
|
47
|
+
|
|
48
|
+
```bash
|
|
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
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 透過防護建頁
|
|
55
|
+
|
|
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
|
+
```
|
|
60
|
+
|
|
61
|
+
### 檢查訪客實際拿到的頁面
|
|
15
62
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- **搬移與轉換**:匯出匯入整個佈景、執行 Mosaic 的資料升級、把 Elementor 頁面轉成 Mosaic。
|
|
63
|
+
```bash
|
|
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
|
|
66
|
+
```
|
|
21
67
|
|
|
22
68
|
## 適用情境
|
|
23
69
|
|
|
24
70
|
網站用的是 Mosaic Pro,想不開編輯器就建立或修改頁面、範本、元件、設計變數、彈出視窗、選單或互動,或想確切知道某個 Mosaic 設定的效果時使用。
|
|
25
71
|
|
|
26
|
-
|
|
72
|
+
| 需求 | 交給 |
|
|
73
|
+
|---|---|
|
|
74
|
+
| Elementor 頁面 | `elementor-headless` |
|
|
75
|
+
| 區塊編輯器(Gutenberg)頁面 | `gutenberg-headless` |
|
|
76
|
+
| SEO 文章、Rank Math 分數 | `rankmath-seo-wp` |
|
|
77
|
+
| 網站健康檢查、外掛更新、資安 | 不在範圍內 |
|
|
27
78
|
|
|
28
79
|
## 安裝
|
|
29
80
|
|
|
81
|
+
### Step 1: 選一種安裝方式
|
|
82
|
+
|
|
30
83
|
Claude plugin(Claude Code;上架 Claude 官方目錄後也可以從目錄安裝):
|
|
31
84
|
|
|
32
85
|
```
|
|
33
86
|
/plugin install mosaic-headless --marketplace Moksa1123/mosaic-headless
|
|
34
87
|
```
|
|
35
88
|
|
|
36
|
-
npx,適用 Claude Code 和其他 AI
|
|
89
|
+
npx,適用 Claude Code 和其他 AI 開發工具:
|
|
37
90
|
|
|
38
91
|
```bash
|
|
39
92
|
npx mosaic-headless@latest claude-code --global --force
|
|
@@ -47,17 +100,22 @@ git clone https://github.com/Moksa1123/mosaic-headless.git
|
|
|
47
100
|
cp -r mosaic-headless ~/.claude/skills/mosaic-headless
|
|
48
101
|
```
|
|
49
102
|
|
|
50
|
-
|
|
103
|
+
| 平台 | 安裝內容 | 位置 |
|
|
104
|
+
|---|---|---|
|
|
105
|
+
| Claude Code | 完整 skill:SKILL.md、references、tools、data、sites、evals、scripts | `~/.claude/skills/` 或 `./.claude/skills/` |
|
|
106
|
+
| Codex CLI | 完整 skill | `~/.codex/skills/` |
|
|
107
|
+
| Gemini CLI | 完整 skill | `~/.gemini/skills/` |
|
|
108
|
+
| GitHub Copilot | 完整 skill | `./.github/skills/` |
|
|
109
|
+
| Cursor | 一個內嵌 references 的 `.mdc` 規則檔 | `~/.cursor/rules/` |
|
|
110
|
+
| Windsurf | 一個內嵌 references 的規則檔 | `./.devin/rules/` |
|
|
111
|
+
| Continue | 一個內嵌 references 的規則檔 | `~/.continue/rules/` |
|
|
112
|
+
| Claude.ai | 上傳用 zip(SKILL.md、references、data、sites;不含工具) | 你存放的位置 |
|
|
51
113
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
可以這樣跟 Claude 說:
|
|
114
|
+
系統需求:Python 3(查詢、建頁、自我測試只用標準函式庫);瀏覽器驗證器需要 Playwright(見 `requirements.txt`);`.php` 工具要在伺服器上有 WP-CLI;只有 npx 安裝程式需要 Node.js 18 以上。Windows、macOS、Linux 都能用。npm 出新版後,要用 `--force` 重跑安裝程式才會更新。
|
|
55
115
|
|
|
56
|
-
|
|
57
|
-
- 「Mosaic 的 accordion-content 可以直接放在 div 裡嗎?」
|
|
58
|
-
- 「加一個三步驟的浮動框導覽,每一步關閉時進到下一步。」
|
|
116
|
+
## 快速開始
|
|
59
117
|
|
|
60
|
-
|
|
118
|
+
### Step 2: 查資料
|
|
61
119
|
|
|
62
120
|
```bash
|
|
63
121
|
python tools/mo.py check div text accordion-content
|
|
@@ -71,6 +129,12 @@ accordion-content BROKE_PAGE AccordionItemElementMResource instance required
|
|
|
71
129
|
|
|
72
130
|
它會以 exit code 1 結束:這個 type 單獨放進去,提交會成功,但整個公開頁面會變成一行錯誤字串。`python tools/mo.py type accordion-content` 會告訴你它該放在哪裡。
|
|
73
131
|
|
|
132
|
+
### Step 3: 跟 Claude 說
|
|
133
|
+
|
|
134
|
+
- 「在我的 Mosaic 網站做一個首屏區塊:一個 H1、一段文字、一個連到 /contact/ 的按鈕。」
|
|
135
|
+
- 「Mosaic 的 accordion-content 可以直接放在 div 裡嗎?」
|
|
136
|
+
- 「加一個三步驟的浮動框導覽,每一步關閉時進到下一步。」
|
|
137
|
+
|
|
74
138
|
## 觸發詞
|
|
75
139
|
|
|
76
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.
|
|
@@ -88,20 +152,57 @@ English: Mosaic Pro, Nextend, build a Mosaic page without the editor, Mosaic pad
|
|
|
88
152
|
- **第三方**:`sites/` 裡的示範範例會載入 Google Fonts,所以用它建出來的頁面,訪客的瀏覽器會向 Google 取字型。
|
|
89
153
|
- 安裝時不下載任何東西,也不會把資料傳給作者或任何人。
|
|
90
154
|
|
|
155
|
+
| 工具 | 做什麼 | 碰到哪裡 |
|
|
156
|
+
|---|---|---|
|
|
157
|
+
| `mo.py` | 查詢實測資料,唯一入口 | 只讀本機 `data/` |
|
|
158
|
+
| `build_page.py` / `build_site.py` | 透過有防護的寫入流程提交規格 | 你的網站(REST) |
|
|
159
|
+
| `from_elementor.py` / `verify_conversion.py` | Elementor 轉 Mosaic,並證明內容都搬過來 | 本機檔案/你的網站 |
|
|
160
|
+
| `verify_rwd.py`、`verify_browser.py`、`verify_*.py` | 用 Chromium 讀實際送出的頁面 | 你的網站(唯讀) |
|
|
161
|
+
| `theme_zip.py`、`theme_export.php` / `theme_import.php` | 搬整個佈景 | 你的網站(REST/WP-CLI) |
|
|
162
|
+
| `data_upgrade.py` | 外掛更新後執行 Mosaic 的資料遷移 | 你的網站(REST) |
|
|
163
|
+
| `scan_inline_tags.py` / `fix_inline_tags.py` | 找出並修正 1.0.11+ 會把 HTML 標籤印出來的文字 | 你的網站(REST) |
|
|
164
|
+
| `test_mosaic.py`、`check_numbers.py` | 自我測試、數字核對 | 這個 repo |
|
|
165
|
+
|
|
91
166
|
## 驗證方式
|
|
92
167
|
|
|
93
|
-
|
|
94
|
-
|
|
168
|
+
node type、node 屬性、樣式屬性、樣式狀態從外掛原始碼抽出(`tools/check_tables.py` 會重新抽取並比對),再逐一寫進正式網站,檢查實際送出的 HTML 和編譯後的 CSS。下表每張資料表都在 `data/`,列數由 `tools/check_numbers.py` 核對。
|
|
169
|
+
|
|
170
|
+
| 資料表 | 列數 | 檢查了什麼 |
|
|
171
|
+
|---|---:|---|
|
|
172
|
+
| `data/node-verification.csv` | 134 | 每種 node type 單獨提交,再從公開頁面讀回 |
|
|
173
|
+
| `data/style-verification.csv` | 101 | 每個樣式屬性對照編譯後的 CSS |
|
|
174
|
+
| `data/node-property-verification.csv` | 191 | 每個 node 屬性用它自己的驗證器接受的值測試 |
|
|
175
|
+
| `data/style-state-verification.csv` | 59 | 每個狀態對照它應該產生的選擇器 |
|
|
176
|
+
| `data/rwd-verification.csv` | 733 | 每條 `_t` / `_m` 宣告對照網站實際送出的樣式表 |
|
|
177
|
+
| `data/browser-verification/` | 4,132 | Chromium 在三種寬度下的計算後樣式 |
|
|
178
|
+
| `data/popover-verification.csv` | 37 | 浮動框:定位、關閉、翻轉、串連導覽 |
|
|
179
|
+
| `data/menu-verification.csv` | 34 | 懸停下拉選單和手機選單,用滑鼠、鍵盤、觸控操作 |
|
|
180
|
+
| `data/form-surface-verification.csv` | 23 | 每種表單欄位,包括可組裝的 Select |
|
|
181
|
+
| `data/custom-fields-verification.csv` | 62 | ACF 和 Meta Box 欄位透過 `@VAR` / `@LOOP` 讀出 |
|
|
182
|
+
| `data/theme-zip-verification.csv` | 22 | Mosaic 自己的佈景 ZIP 匯出再匯入並比對 |
|
|
183
|
+
| `data/conversion-batch.csv` | 19 | 一個網站的每個 Elementor 頁面都轉換、建置並檢查 |
|
|
184
|
+
|
|
95
185
|
- 自我測試:`python tools/test_mosaic.py`,42 項離線測試(查詢、中文用語、建頁產出的結構與拒收規則、對外的建頁介面、本 repo 的數字與隱私)。
|
|
96
186
|
- evals:16 題 Mosaic 1.0.10 到 1.0.12 的行為題;有 skill 16/16,沒有 skill 0/16。結果見 [evals/RESULTS.md](evals/RESULTS.md)。
|
|
97
|
-
- `SKILL.md
|
|
187
|
+
- `SKILL.md`、這幾份 README 和徽章上的數字,都由 `tools/check_numbers.py` 對照資料核對。細節見 [verification-record.md](references/verification-record.md)。
|
|
188
|
+
|
|
189
|
+
查一次要花多少 token:同樣 6 項任務用 tiktoken 計算(`data/token-benchmark.csv`,建表當時量的;`tools/benchmark_tokens.py` 可重現)。不要把資料表整個讀進來,用查的。
|
|
190
|
+
|
|
191
|
+
| `mo.py` 指令 | 讀原始碼 | 讀全部資料表 | 查詢 |
|
|
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** |
|
|
98
199
|
|
|
99
200
|
## 限制
|
|
100
201
|
|
|
101
202
|
- 實測到 Mosaic Pro 1.0.13。只存在於 1.0.13 編輯器裡的功能(新的樣式變數類型、List 的 class、pageLoad 延遲等)還沒實測,工具也不會寫。
|
|
102
203
|
- 用 headless 方式寫入格線子項位置的屬性不會有輸出;部分互動形狀還沒實測。
|
|
103
204
|
- 瀏覽器驗證器需要 Playwright 和一個可以寫入的網站,不在離線自我測試裡。
|
|
104
|
-
- 待補問題:[data/pending.csv](data/pending.csv)。完整說明(失敗模式、
|
|
205
|
+
- 待補問題:[data/pending.csv](data/pending.csv)。完整說明(失敗模式、Elementor 轉換器、示範範例):[docs/guide.md](docs/guide.md)(英文)。
|
|
105
206
|
|
|
106
207
|
## 目錄結構
|
|
107
208
|
|
package/SKILL.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mosaic-headless",
|
|
3
|
-
"version": "1.38.
|
|
3
|
+
"version": "1.38.1",
|
|
4
4
|
"description": "AI-agent skill: build Mosaic Pro (Nextend) WordPress sites by writing the underlying data model directly - 23 custom tables, no visual editor, no DOM. Every node type, style property and node property swept against a live install and asserted on the delivered HTML and compiled CSS. Installs into Claude Code, Cursor, Codex CLI, Gemini CLI, Copilot, Continue, Windsurf and Claude.ai.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"wordpress",
|
package/tools/check_numbers.py
CHANGED
|
@@ -141,6 +141,35 @@ def _readme_facts() -> dict:
|
|
|
141
141
|
return f
|
|
142
142
|
|
|
143
143
|
|
|
144
|
+
def _table_rows(rel: str) -> int:
|
|
145
|
+
"""Row count of a data table; a directory counts every CSV in it."""
|
|
146
|
+
p = ROOT / rel
|
|
147
|
+
files = sorted(p.glob("*.csv")) if p.is_dir() else [p]
|
|
148
|
+
return sum(len(_rows_path(x)) for x in files)
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
def _benchmark() -> dict:
|
|
152
|
+
"""data/token-benchmark.csv keyed by its commands with the `mo.py ` prefixes dropped."""
|
|
153
|
+
out = {}
|
|
154
|
+
for r in _rows_path(ROOT / "data" / "token-benchmark.csv"):
|
|
155
|
+
out[r["commands"].replace("mo.py ", "").strip()] = r
|
|
156
|
+
return out
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def _special(kind: str, m: re.Match) -> list[tuple[tuple[int, int], str]]:
|
|
160
|
+
"""(span, wanted) pairs for the table rules, which check several cells per match."""
|
|
161
|
+
if kind == "csvrows":
|
|
162
|
+
return [(m.span("num"), f"{_table_rows(m.group('key')):,}")]
|
|
163
|
+
if kind == "tokens":
|
|
164
|
+
row = _benchmark().get(m.group("key"))
|
|
165
|
+
if row is None:
|
|
166
|
+
return [(m.span("key"), "<no such row in data/token-benchmark.csv>")]
|
|
167
|
+
return [(m.span("src"), f"{int(row['tokens_read_source']):,}"),
|
|
168
|
+
(m.span("tab"), f"{int(row['tokens_load_tables']):,}"),
|
|
169
|
+
(m.span("q"), f"{int(row['tokens_query']):,}")]
|
|
170
|
+
raise ValueError(kind)
|
|
171
|
+
|
|
172
|
+
|
|
144
173
|
def _rows_path(p) -> list[dict]:
|
|
145
174
|
with open(p, encoding="utf-8", newline="") as fh:
|
|
146
175
|
return list(csv.DictReader(fh))
|
|
@@ -164,7 +193,26 @@ README_RULES: list[tuple[str, str, str]] = [
|
|
|
164
193
|
(r"Python 3", "fixed", "runtime requirement"),
|
|
165
194
|
(r"\bH1\b", "fixed", "an HTML heading level in an example prompt"),
|
|
166
195
|
(r"exits 1|exit code 1|終了コードは 1|종료 코드는 1", "fixed", "mo.py check's exit code (shown by running it)"),
|
|
167
|
-
(r"3 ステップ|3단계|1 つずつ|1 つにつき 1 行|1 つのサイト|3 つの画面幅|제3
|
|
196
|
+
(r"3 ステップ|3단계|1 つずつ|1 つにつき 1 行|1 つのサイト|3 つの画面幅|제3자|ルール 1 つ|ルールファイル 1 つ|1 回の検索|규칙 파일 1개|규칙 1개|조회 1회",
|
|
197
|
+
"fixed", "wording, not a measurement"),
|
|
198
|
+
# ---- badges (shields /badge/ URLs are not masked, so their numbers are checked) ----
|
|
199
|
+
(r"/badge/node_types-(\d+)-", "fact", "node_types"),
|
|
200
|
+
(r"/badge/node_properties-(\d+)-", "fact", "prop_names"),
|
|
201
|
+
(r"/badge/style_properties-(\d+)-", "fact", "style_props"),
|
|
202
|
+
(r"/badge/responsive_checks-(\d+)-", "fact", "rwd"),
|
|
203
|
+
(r"(\d+) ?(?:responsive checks|條 RWD 檢查|件のレスポンシブ検査|개 반응형 검사)", "fact", "rwd"),
|
|
204
|
+
(r"/badge/self--tests-(\d+)-", "fact", "tests"),
|
|
205
|
+
(r"(\d+) ?(?:self-tests|項自我測試|項目のセルフテスト|개 자체 테스트)", "fact", "tests"),
|
|
206
|
+
(r"/badge/python-3-|/badge/node-18_or_later-|Node\.js 18 (?:or later|以上|이상)", "fixed",
|
|
207
|
+
"runtime requirements (package.json engines: node >=18)"),
|
|
208
|
+
(r"</?h[13]\b", "fixed", "HTML heading tags of the centred title block"),
|
|
209
|
+
(r"Step [123]\b", "fixed", "step numbering in Install / Quick start"),
|
|
210
|
+
(r"1\.0\.11\+", "fixed", "version that escapes text-run markup (facts.md)"),
|
|
211
|
+
# ---- the restored tables ----
|
|
212
|
+
(r"\| `(?P<key>data/[^`]+)` \| (?P<num>\d{1,3}(?:,\d{3})*) \|", "csvrows", ""),
|
|
213
|
+
(r"\| `(?P<key>[^`]+)` \| (?P<src>[\d,]+) \| (?P<tab>[\d,]+) \| \*\*(?P<q>[\d,]+)\*\* \|", "tokens", ""),
|
|
214
|
+
(r"(?:six tasks|6 項任務|6 つのタスク|6가지 작업)", "fixed", "number of rows in data/token-benchmark.csv's task list"),
|
|
215
|
+
(r"(?:three viewports|三種寬度|3 つの画面幅|세 가지 화면 폭)", "fixed", "the verifier's viewport count"),
|
|
168
216
|
]
|
|
169
217
|
|
|
170
218
|
|
|
@@ -176,7 +224,8 @@ _MASKS = [
|
|
|
176
224
|
re.compile(r"^```.*?^```", re.S | re.M), # code blocks
|
|
177
225
|
re.compile(r"`[^`\n]+`"), # inline code
|
|
178
226
|
re.compile(r"\]\([^)\n]*\)"), # markdown link targets
|
|
179
|
-
|
|
227
|
+
# URLs, except shields /badge/ ones: a badge's number must be claimed like any other
|
|
228
|
+
re.compile(r"https?://(?!img\.shields\.io/badge/)[^\s))(,、|\"]+"),
|
|
180
229
|
]
|
|
181
230
|
|
|
182
231
|
|
|
@@ -208,6 +257,14 @@ def check(path: Path = SKILL_MD, fix: bool = False, rules=None, facts=None,
|
|
|
208
257
|
problems.append(f"rule unused ({path.name} wording changed?): {pattern}")
|
|
209
258
|
continue
|
|
210
259
|
for m in found:
|
|
260
|
+
if kind in ("csvrows", "tokens"):
|
|
261
|
+
covered.update(range(*m.span()))
|
|
262
|
+
for (a, b), want in _special(kind, m):
|
|
263
|
+
got = text[a:b]
|
|
264
|
+
if got != want:
|
|
265
|
+
problems.append(f"{kind} {m.group('key')}: {path.name} says {got}, data says {want}")
|
|
266
|
+
edits.append((a, b, want))
|
|
267
|
+
continue
|
|
211
268
|
# the claimed number is the first group that matched (alternatives per language)
|
|
212
269
|
gi = next((i for i in range(1, (m.re.groups or 0) + 1) if m.group(i) is not None), 0)
|
|
213
270
|
span = m.span(gi) if gi else m.span()
|
package/tools/test_mosaic.py
CHANGED
|
@@ -365,6 +365,19 @@ class SkillDoc(unittest.TestCase):
|
|
|
365
365
|
self.assertEqual(found, heads[name], name)
|
|
366
366
|
self.assertLessEqual(text.count("\n"), 250, name)
|
|
367
367
|
self.assertIn("Nextend", text, name)
|
|
368
|
+
# the visual template (總機/README範本-taiwan原版.md): centred h1 + h3, three badge
|
|
369
|
+
# rows, and the tables restored from the pre-v1.38 README
|
|
370
|
+
self.assertTrue(text.startswith('<h1 align="center">'), name)
|
|
371
|
+
self.assertIn('<h3 align="center">', text, name)
|
|
372
|
+
self.assertGreaterEqual(text.count("img.shields.io"), 12, name)
|
|
373
|
+
for badge in ("/badge/node_types-", "/badge/style_properties-", "/badge/self--tests-",
|
|
374
|
+
"/npm/v/mosaic-headless", "/npm/dt/mosaic-headless"):
|
|
375
|
+
self.assertIn(badge, text, name)
|
|
376
|
+
tables = len(re.findall(r"^\|[-:| ]+\|$", text, re.M))
|
|
377
|
+
self.assertGreaterEqual(tables, 6, "%s has %d tables" % (name, tables))
|
|
378
|
+
for row in ("| Claude.ai |", "`data/rwd-verification.csv`", "`css grid-column`",
|
|
379
|
+
"`theme_zip.py`"):
|
|
380
|
+
self.assertIn(row, text, name)
|
|
368
381
|
|
|
369
382
|
def test_links_resolve(self):
|
|
370
383
|
text = read("SKILL.md")
|