Japanese UI design contracts for AI builders.
DESIGN.mdtemplates, CSS recipes, and validation rules for Japanese interfaces.
jp-ui-contracts は、日本語UI向けの design contract kit です。
公開サイトの見た目を収集する「見本集」ではなく、AIエージェントやコード生成ツールが 日本語本文・見出し・和欧混植・改行・フォーム密度 を壊しにくくするための、契約テンプレート / CSS recipe / review rule をまとめたリポジトリです。
- 日本語UI向け
DESIGN.mdテンプレートを提供する - 用途別の profile を提供する
basemediasaasdocsdashboard
- 日本語組版向けの CSS recipe を提供する
- AI生成UIを見直す validator を提供する
DESIGN.mdと preview を往復しやすくするサンプルを提供する
- 公開サイトの完全模写
- ブランド見本帳の拡張
- 日本語組版の唯一絶対ルールの断定
- プロンプトだけで画面品質を保証すること
日本語UIは、色・角丸・余白だけでは品質が出ません。
問題になりやすいのは、むしろ次の層です。
- 和文フォントの fallback が曖昧
- 和欧混植時の違和感
- 本文と見出しで分けるべき line-height の未分離
- 本文への過剰な letter-spacing
word-break: break-allの乱用- URL や英単語のはみ出し
- 表やフォームが本文ルールをそのまま引きずること
このrepoは、それらを「感覚」ではなく、AIが読める契約として扱います。
毎回のプロンプトで見た目を説明するのではなく、プロジェクト側に契約を置きます。
日本語UIは一枚岩ではありません。
記事メディア、SaaS、技術文書、ダッシュボードでは、密度も行間も改行戦略も変わります。
日本語だけ、英語だけではなく、日本語と英語が混ざった状態で成立することを重視します。
新しいCSS機能は活かしつつ、未対応環境で壊れない設計を優先します。
スクリーンショットがきれいでも終わりません。
実際に読む、詰める、入力する、折り返す、を確認してから採用します。
| Profile | 向いているもの | 重点 |
|---|---|---|
base |
最小共通契約 | locale / typography / validation の基礎 |
media |
note、ブログ、オウンドメディア | 段落の呼吸、記事のリズム |
saas |
管理画面、設定画面、B2Bツール | 密度、ラベル、フォーム安定 |
docs |
技術文書、ヘルプ、ナレッジ | 本文とコードの両立 |
dashboard |
KPI画面、監視画面、分析UI | 走査性、表、数値、カード密度 |
jp-ui-contracts/
├─ README.md
├─ LICENSE
├─ CONTRIBUTING.md
├─ docs/
├─ templates/
├─ recipes/
├─ validators/
├─ schema/
└─ examples/
templates/: 複製して使うDESIGN.mdrecipes/: 日本語UI向け CSS 断片validators/: AI生成UIの見直しルールdocs/: 設計思想と使い分けschema/: 将来の機械検証向けスキーマexamples/: サンプルDESIGN.mdとpreview.html
最初は次のどれかを複製します。
templates/base/DESIGN.mdtemplates/media/DESIGN.mdtemplates/saas/DESIGN.mdtemplates/docs/DESIGN.mdtemplates/dashboard/DESIGN.md
- 色
- フォント
- 余白
- コンポーネント方針
- 禁止事項
- validation target
を埋めます。
recipes/ の CSS を必要なものだけ導入します。
validators/ のチェックリストと lint ルールで見直します。
契約だけで終わらせず、最小の preview.html を作って確認します。
DESIGN.mdを書く- AIにUIを生成させる
- preview を見る
- validator で差分を記録する
- 契約へ戻して修正する
- 再生成する
このrepoは、1回で当てるためのものではありません。
契約 → 生成 → 目視 → 契約修正 のループを速くするためのものです。
- 記事メディアなら
templates/media/DESIGN.md - 管理画面なら
templates/saas/DESIGN.md - 技術文書なら
templates/docs/DESIGN.md - 高密度BI画面なら
templates/dashboard/DESIGN.md
サンプルは examples/ に入っています。
ブラウザで直接 preview.html を開くか、ローカルサーバーを立てて確認してください。
python -m http.server 8000その後、http://localhost:8000/examples/sample-media/preview.html のように開けます。
design-contract.schema.jsonの拡充- preview サンプルの増加
- validator の半自動化
- mixed-script review の強化
- mobile / desktop の別基準追加
- 日本語フォームUI、表UI、ナビゲーションUIの細分化
jp-ui-contracts is not just a template collection.
The next step is to make the contract more testable, more comparable, and easier to improve from real-world failures.
In the short term, this repository will evolve in four directions:
-
Stronger contract structure
MakeDESIGN.mdeasier to lint and compare by clarifying required fields, validation targets, and profile-specific overlays. -
Validation-first workflow
Treat generated UI as reviewable output. The goal is not one-shot perfection, but a stable loop of contract → generation → review → contract update. -
Reusable fixtures
Build a shared set of failure-prone Japanese UI cases such as long paragraphs, mixed-script headings, long URLs, tables, forms, and mobile wrapping. -
Community feedback intake
Convert stars and reactions into actionable issue reports and profile gap requests.
This repository uses a two-layer validation model.
Check whether the contract itself is sufficiently specified.
Examples:
- Is the locale explicit?
- Is the profile selected?
- Is Japanese font fallback declared?
- Is
word-break: break-allavoided as a global default? - Are validation targets written down?
Check whether the generated UI still respects the contract once rendered.
Examples:
- Long Japanese paragraphs remain readable
- Mixed Japanese-English headings do not break awkwardly
- Long URLs do not destroy paragraph rhythm
- Tables and forms do not inherit article spacing blindly
- Mobile width remains stable
We score validation results using three levels.
- PASS: acceptable for current profile
- WARN: usable, but contract or implementation should be tightened
- FAIL: violates contract or breaks readability / usability
See validators/scorecard.md for the detailed review sheet.
The repository will grow around reusable fixtures rather than brand imitation.
Initial fixture families:
- long paragraphs
- mixed-script headings
- long URL overflow
- forms with helper and error text
- dense tables
- mobile wrapping
- docs-style prose + code coexistence
See fixtures/fixture-matrix.md.
To keep improvements grounded in real use cases, issue intake is split into two tracks.
-
Broken output report
For cases where the current contract produced unstable or poor Japanese UI. -
Profile gap request
For cases where an existing profile is too weak or a new profile / overlay is needed.
Issue forms live in .github/ISSUE_TEMPLATE/.
- Add Issue Forms and config
- Add validator scorecard
- Add fixture matrix
- Add
profile-selector.md - Add real fixture samples
- Start collecting broken outputs from users
MIT
まずは templates/base/DESIGN.md をコピーし、
Locale / Profile / Typography / Validation Targets を埋めてください。