ui-style-guide
Guessimate Angular UI のフロントエンド開発におけるコーディング規約、コンポーネントパターン、デザインシステムを参照し、コード作成やレビューの品質と一貫性を高めるSkill。
📜 元の英語説明(参考)
Frontend coding standards, component patterns, and design system for the Guessimate Angular UI. Reference when writing or reviewing frontend code.
🇯🇵 日本人クリエイター向け解説
Guessimate Angular UI のフロントエンド開発におけるコーディング規約、コンポーネントパターン、デザインシステムを参照し、コード作成やレビューの品質と一貫性を高めるSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o ui-style-guide.zip https://jpskill.com/download/18331.zip && unzip -o ui-style-guide.zip && rm ui-style-guide.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/18331.zip -OutFile "$d\ui-style-guide.zip"; Expand-Archive "$d\ui-style-guide.zip" -DestinationPath $d -Force; ri "$d\ui-style-guide.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
ui-style-guide.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
ui-style-guideフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
フロントエンドスタイルガイドとコーディング規約
このドキュメントでは、Guessimate Angular フロントエンドのコーディング標準、アーキテクチャパターン、およびデザインシステムを定義します。
1. 技術スタック
- フレームワーク: Angular 20+
- スタイリング: Tailwind CSS 4
- 状態管理: Angular Signals & RxJS
- ビルドシステム: Angular CLI (Esbuild)
2. プロジェクト構造
フィーチャーベースのディレクトリ構造に従います。コードは、技術的な種類ではなく、ドメインフィーチャーによって整理されます。
src/app/
├── core/ # グローバルシングルトン (Guards, Interceptors, Global Services)
├── layout/ # レイアウトコンポーネント (Navigation, Footer, Shell)
├── features/ # フィーチャーモジュール (ドメインロジック)
│ ├── home/
│ ├── session/
│ │ ├── components/ # ダム/プレゼンテーションコンポーネント
│ │ ├── pages/ # スマート/コンテナコンポーネント (ルーティング)
│ │ ├── services/ # フィーチャー固有の状態/ロジック
│ │ └── models/ # フィーチャー固有の型
│ └── ...
├── websocket/ # WebSocket インフラストラクチャ
└── shared/ # 共有ユーティリティ (Pipes, Directives, Generic UI)
命名規則
- ファイル: Kebab-case (例:
session-page.component.ts,auth.service.ts)。 - クラス: PascalCase (例:
SessionPageComponent,AuthService)。 - セレクター:
app-プレフィックス、kebab-case (例:app-user-profile)。 - シグナル: サフィックスなし、説明的な名詞/動詞 (例:
user(),isLoading())。 - Observable:
$サフィックス (例:user$)。
3. コンポーネント標準
定義
- スタンドアロンコンポーネントを使用します (
standalone: trueは v19+ でのデフォルトです)。 - ロジックとビューを同じ場所に保持するために、ほとんどのコンポーネントでインラインテンプレートを優先します。
- 外部 CSS ファイルは避け、テンプレートで直接 Tailwind CSS ユーティリティクラスを使用します。
@Component({
selector: 'app-example',
imports: [CommonModule, RouterLink], // 明示的なインポート
template: `
<div class="p-4 bg-surface-100 rounded-lg">
<h1 class="text-2xl font-bold text-gray-900">{{ title() }}</h1>
</div>
`
})
export class ExampleComponent {
title = signal('Hello World');
}
制御フロー
新しい組み込みの Angular 制御フロー構文を使用します。
<!-- Good -->
@if (isLoading()) {
<app-spinner/>
} @else {
@for (item of items(); track item.id) {
<app-item [data]="item"/>
}
}
依存性注入
より良い型推論とよりクリーンなコードのために、コンストラクタインジェクションよりも inject() 関数を優先します。
// Good
private readonly
route = inject(ActivatedRoute);
private readonly
store = inject(SessionStore);
// Avoid if possible
constructor(private
route: ActivatedRoute
)
{
}
4. 状態管理
- ローカル状態: プリミティブな状態には
signal()を使用します。 - 共有状態: 適切なレベル (ルートまたはコンポーネント) で提供される Signal Stores (Signals を使用するサービス) を使用します。
- リアクティブデータ: 派生状態には
computed()を使用し、副作用にはeffect()を控えめに使用します。
@Injectable()
export class SessionStore {
// State
private readonly _state = signal<SessionState>(initialState);
// Selectors
readonly lobby = computed(() => this._state().lobby);
readonly connection = computed(() => this._state().connection);
// Actions
setLobby(lobby: Lobby) {
this._state.update(s => ({...s, lobby}));
}
}
5. スタイリングとデザインシステム
styles.css で定義されたセマンティックカラーパレットを持つ Tailwind CSS 4 を使用します。
使用規則
- ユーティリティファースト: HTML で直接クラスを記述します。
- マジックナンバーなし: テーマ値を使用します (例:
p-4、p-[16px]ではない)。 - ダークモード: すべてのカラー関連クラスに
dark:修飾子を使用します。
カラーパレット
アプリケーションは、Tailwind の色にマッピングされたセマンティックな命名規則を使用します。
コアカラー
| カテゴリ | セマンティック名 | ライトモード | ダークモード | 使用法 |
|---|---|---|---|---|
| 背景 | background |
gray-50 |
gray-950 |
メインアプリケーションの背景 |
| サーフェス | surface |
white |
gray-900 |
カード、モーダル、セクション |
| サーフェス代替 | surface-alt |
gray-100 |
gray-800 |
セカンダリ背景、入力フィールド |
| プライマリ | brand |
blue-600 |
blue-600 |
プライマリアクション、ボタン、ハイライト |
| プライマリミュート | brand-muted |
blue-50 |
blue-900/30 |
選択された状態、ライトハイライト |
| 成功 | success |
emerald-500 |
emerald-600 |
成功状態、確認 |
| 成功ミュート | success-muted |
emerald-50 |
emerald-900/30 |
成功背景 |
| 危険 | danger |
red-600 |
red-600 |
エラー、破壊的なアクション |
| 危険ミュート | danger-muted |
red-50 |
red-900/30 |
エラー背景 |
| 警告 | warning |
amber-500 |
amber-600 |
警告、保留状態 |
| 警告ミュート | warning-muted |
amber-50 |
amber-900/30 |
警告背景 |
タイポグラフィとボーダー
| カテゴリ | ライトモード | ダークモード | 使用法 |
|---|---|---|---|
| プライマリ | gray-900 |
white |
メインの見出しと本文 |
| セカンダリ | gray-500 |
gray-400 |
サブタイトル、ラベル、セカンダリ情報 |
| ミュート | gray-400 |
gray-500 |
無効なテキスト、プレースホルダー |
| ボーダー | gray-200 |
gray-800 |
標準の区切り線とカードの境界線 |
styles.css での実装
色は、@theme ブロックの CSS 変数を使用して定義されます。
@theme {
--color-brand-600: var(--color-blue-600);
--color-surface-100: var(--color-stone-100);
/* ... */
}
(原文がここで切り詰められています) 📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Frontend Style Guide & Coding Conventions
This document defines the coding standards, architectural patterns, and design system for the Guessimate Angular frontend.
1. Technology Stack
- Framework: Angular 20+
- Styling: Tailwind CSS 4
- State Management: Angular Signals & RxJS
- Build System: Angular CLI (Esbuild)
2. Project Structure
We follow a Feature-Based directory structure. Code is organized by domain feature rather than technical type.
src/app/
├── core/ # Global singletons (Guards, Interceptors, Global Services)
├── layout/ # Layout components (Navigation, Footer, Shell)
├── features/ # Feature modules (Domain logic)
│ ├── home/
│ ├── session/
│ │ ├── components/ # Dumb/Presentational components
│ │ ├── pages/ # Smart/Container components (Routed)
│ │ ├── services/ # Feature-specific state/logic
│ │ └── models/ # Feature-specific types
│ └── ...
├── websocket/ # WebSocket infrastructure
└── shared/ # Shared utilities (Pipes, Directives, Generic UI)
Naming Conventions
- Files: Kebab-case (e.g.,
session-page.component.ts,auth.service.ts). - Classes: PascalCase (e.g.,
SessionPageComponent,AuthService). - Selectors:
app-prefix, kebab-case (e.g.,app-user-profile). - Signals: No suffix, descriptive noun/verb (e.g.,
user(),isLoading()). - Observables:
$suffix (e.g.,user$).
3. Component Standards
Definition
- Use Standalone Components (
standalone: trueis default in v19+). - Prefer Inline Templates for most components to keep logic and view co-located.
- Avoid external CSS files; use Tailwind CSS utility classes directly in the template.
@Component({
selector: 'app-example',
imports: [CommonModule, RouterLink], // Explicit imports
template: `
<div class="p-4 bg-surface-100 rounded-lg">
<h1 class="text-2xl font-bold text-gray-900">{{ title() }}</h1>
</div>
`
})
export class ExampleComponent {
title = signal('Hello World');
}
Control Flow
Use the new built-in Angular Control Flow syntax.
<!-- Good -->
@if (isLoading()) {
<app-spinner/>
} @else {
@for (item of items(); track item.id) {
<app-item [data]="item"/>
}
}
Dependency Injection
Prefer the inject() function over constructor injection for better type inference and cleaner code.
// Good
private readonly
route = inject(ActivatedRoute);
private readonly
store = inject(SessionStore);
// Avoid if possible
constructor(private
route: ActivatedRoute
)
{
}
4. State Management
- Local State: Use
signal()for primitive state. - Shared State: Use Signal Stores (Services using Signals) provided at the appropriate level (Root or Component).
- Reactive Data: Use
computed()for derived state andeffect()sparingly for side effects.
@Injectable()
export class SessionStore {
// State
private readonly _state = signal<SessionState>(initialState);
// Selectors
readonly lobby = computed(() => this._state().lobby);
readonly connection = computed(() => this._state().connection);
// Actions
setLobby(lobby: Lobby) {
this._state.update(s => ({...s, lobby}));
}
}
5. Styling & Design System
We use Tailwind CSS 4 with a semantic color palette defined in styles.css.
Usage Rules
- Utility-First: Write classes directly in HTML.
- No Magic Numbers: Use theme values (e.g.,
p-4notp-[16px]). - Dark Mode: Use the
dark:modifier for all color-related classes.
Color Palette
The application uses a semantic naming convention mapped to Tailwind colors.
Core Colors
| Category | Semantic Name | Light Mode | Dark Mode | Usage |
|---|---|---|---|---|
| Background | background |
gray-50 |
gray-950 |
Main application background |
| Surface | surface |
white |
gray-900 |
Cards, modals, sections |
| Surface Alt | surface-alt |
gray-100 |
gray-800 |
Secondary backgrounds, input fields |
| Primary | brand |
blue-600 |
blue-600 |
Primary actions, buttons, highlights |
| Primary Muted | brand-muted |
blue-50 |
blue-900/30 |
Selected states, light highlights |
| Success | success |
emerald-500 |
emerald-600 |
Success states, confirmation |
| Success Muted | success-muted |
emerald-50 |
emerald-900/30 |
Success backgrounds |
| Danger | danger |
red-600 |
red-600 |
Errors, destructive actions |
| Danger Muted | danger-muted |
red-50 |
red-900/30 |
Error backgrounds |
| Warning | warning |
amber-500 |
amber-600 |
Warnings, pending states |
| Warning Muted | warning-muted |
amber-50 |
amber-900/30 |
Warning backgrounds |
Typography & Borders
| Category | Light Mode | Dark Mode | Usage |
|---|---|---|---|
| Primary | gray-900 |
white |
Main headings and body text |
| Secondary | gray-500 |
gray-400 |
Subtitles, labels, secondary info |
| Muted | gray-400 |
gray-500 |
Disabled text, placeholders |
| Border | gray-200 |
gray-800 |
Standard dividers and card borders |
Implementation in styles.css
Colors are defined using CSS variables in the @theme block:
@theme {
--color-brand-600: var(--color-blue-600);
--color-surface-100: var(--color-stone-100);
/* ... */
}
6. Common Component Patterns
Cards & Containers
Standard styling for content containers (like estimation cards, lists):
<div class="flex flex-col bg-surface-100/60 border border-surface-200 dark:bg-gray-900/40 dark:border-gray-800/60 rounded-md shadow-sm">
<!-- Content -->
</div>
- Background:
bg-surface-100/60(Light) /dark:bg-gray-900/40(Dark) - Border:
border border-surface-200(Light) /dark:border-gray-800/60(Dark) - Rounding:
rounded-md(Standard) - Dividers:
divide-y divide-surface-300 dark:divide-gray-800
Typography Headers
<div class="flex flex-col gap-1">
<h2 class="text-2xl font-semibold leading-none text-gray-900 dark:text-white">Title</h2>
<span class="text-sm font-normal text-gray-600 dark:text-gray-400">Subtitle description</span>
</div>