Building Blocks
AEM Edge Deliveryのブロックを新規作成したり、JavaScriptやCSS、コンテンツモデルを大きく変更したりする際に、開発を円滑に進めるためのガイドを提供するSkill。
📜 元の英語説明(参考)
Guide for creating new AEM Edge Delivery blocks or modifying existing blocks. Use this skill whenever you are creating a new block from scratch or making significant changes to existing blocks that involve JavaScript decoration, CSS styling, or content model changes.
🇯🇵 日本人クリエイター向け解説
AEM Edge Deliveryのブロックを新規作成したり、JavaScriptやCSS、コンテンツモデルを大きく変更したりする際に、開発を円滑に進めるためのガイドを提供するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o building-blocks.zip https://jpskill.com/download/9681.zip && unzip -o building-blocks.zip && rm building-blocks.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/9681.zip -OutFile "$d\building-blocks.zip"; Expand-Archive "$d\building-blocks.zip" -DestinationPath $d -Force; ri "$d\building-blocks.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
building-blocks.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
building-blocksフォルダができる - 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 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
構成要素
このスキルは、コンテンツ駆動開発 (CDD) の原則に従って、新しい AEM Edge Delivery ブロックを作成したり、既存のブロックを修正したりする手順を説明します。ブロックは AEM サイトの再利用可能な構成要素であり、それぞれが JavaScript による装飾と CSS スタイルによって、オーサリングされたコンテンツをリッチでインタラクティブな体験へと変換します。このスキルでは、コンテンツモデルの理解、装飾ロジックの実装、スタイルの適用、コード品質基準の維持など、開発プロセス全体を扱います。
関連スキル
- content-driven-development: このスキルを使用する前に必ず実行し、コンテンツとコンテンツモデルの準備が整っていることを確認してください。
- block-collection-and-party: パターンのために類似のブロックを見つけるために使用します。
- testing-blocks: 包括的なテストのために、実装後に自動的に実行されます。
このスキルを使用するタイミング
このスキルは、フェーズ 2 (実装) 中に content-driven-development スキルからのみ呼び出す必要があります。
CDD プロセスにまだ従っていない場合は:
- 停止 - このスキルを続行しないでください
- 最初に content-driven-development スキルを呼び出してください
- CDD スキルは、実装前にテストコンテンツとコンテンツモデルの準備が整っていることを確認します。
このスキルは以下を処理します。
- 新しいブロックファイルと構造の作成
- JavaScript による装飾の実装
- CSS スタイルの追加
- コード品質とテスト
前提条件
このスキルを使用する前に必須:
- ✅ テストコンテンツが存在すること (CMS またはローカルドラフト)
- ✅ コンテンツモデルが定義されていること
- ✅ テストコンテンツの URL が利用可能であること
必要な情報:
- ブロック名: ブロックの名前は何にする必要がありますか?
- コンテンツモデル: オーサーが使用する定義済みの構造
- テストコンテンツ URL: 開発用のテストコンテンツへのパス
プロセスの概要
- 前提条件の確認 (CDD 完了)
- 類似のブロックの検索 (パターンと再利用のため)
- ブロック構造の作成または修正 (ファイルとディレクトリ)
- JavaScript による装飾の実装 (DOM 変換)
- CSS スタイルの追加 (スコープされたレスポンシブスタイル)
- 実装のテスト (ローカルテスト、linting)
- ブロックのドキュメント化 (開発者およびオーサー向けドキュメント)
詳細なプロセス
1. 前提条件の確認
続行する前に、ユーザーに以下を確認してください:
「以下をお持ちですか?
- ✅ 作成されたテストコンテンツ (URL またはパス)?
- ✅ 定義済みのコンテンツモデル?
お持ちでない場合は、最初に content-driven-development スキルを使用する必要があります。」
前提条件が満たされていない場合は、停止して content-driven-development スキルを呼び出します。
前提条件が満たされている場合は、ユーザーからテストコンテンツの URL を取得し、ステップ 2 に進みます。
2. 類似のブロックの検索
新しいブロックまたは大幅な変更の場合:
- 役立つパターンや再利用できるコードを提供する可能性のある類似のブロックについて、コードベースを検索します。
- block-collection-and-party スキルを使用して、関連する参照ブロックを見つけます。
アプローチを知らせるために、類似のブロックの実装パターンを確認してください。
既存のブロックへの軽微な変更の場合: ステップ 3 にスキップします。
3. ブロック構造の作成または修正
新しいブロックの場合:
- ディレクトリを作成:
blocks/{block-name}/ - ファイルを作成:
{block-name}.jsおよび{block-name}.css - ボイラープレート構造を使用します (または、役立つ場合は
resources/の参照テンプレートを使用します)。- JS ファイルは、デフォルトの
decorate(block)関数をエクスポートします (必要に応じて非同期にできます)。 - CSS ファイルは、
.{block-name}クラスをターゲットにします。
- JS ファイルは、デフォルトの
既存のブロックの場合:
blocks/{block-name}/にある既存のブロックディレクトリを見つけます。- 変更を加える前に、現在の実装を確認します。
- 既存の装飾ロジックとスタイルを理解します。
4. JavaScript による装飾の実装
resources/js-guidelines.md のパターンと規則に従ってください。
- DOM API を使用して、初期ブロック HTML 構造を変換します。
- 装飾ロジックを焦点が絞られ、単一目的になるようにします。
- バリアントを適切に処理します (バリアントクラスについては block.classList を確認してください)。
- 類似のブロックからの確立されたパターンに従ってください。
詳細な例、コード標準、およびベストプラクティスについては、resources/js-guidelines.md をお読みください。
5. CSS スタイルの追加
resources/css-guidelines.md のパターンと規則に従ってください。
- すべての CSS セレクターは、ブロックにスコープされている必要があります (
.{block-name}で始まる)。 - ブロックスコープ内で BEM のような命名を使用します。
- テーマ設定には CSS カスタムプロパティを活用します。
- モバイルファーストのレスポンシブスタイルを作成します。
- 具体性を低く保ちます。
- 類似のブロックからの確立されたパターンに従ってください。
詳細な例、コード標準、およびベストプラクティスについては、resources/css-guidelines.md をお読みください。
6. 実装のテスト
実装が完了したら、testing-blocks スキルを呼び出します。
testing-blocks スキルは、以下をガイドします。
- ロジックが重いユーティリティの単体テストの作成
- ブロックの動作を検証するためのブラウザテスト
- 検証と PR ドキュメント用のスクリーンショットの撮影
- linting の実行と問題の修正
- GitHub チェックが合格することの確認
testing-blocks スキルに以下を提供します。
- テスト対象のブロック名
- テストコンテンツ URL (CDD プロセスから)
- テストが必要なバリアント
テストが完了したら、このスキルに戻り、ステップ 7 に進みます。
7. ブロックのドキュメント化
ブロックには、2 種類のドキュメントが必要です。
開発者向けドキュメント
- ほとんどのブロックはシンプルで自己完結型であり、ドキュメントにはコードコメントのみが必要です。
- ブロックが特に複雑な場合 (多くのバリアントがある、または特に複雑なコードがある場合) は、ブロックフォルダーに簡単な README.md を追加することを検討してください。
- README ドキュメントは非常に簡潔にして、一目で理解できるようにしてください。
オーサー向けドキュメント
オーサー向けドキュメントは、コンテンツオーサーが CMS でブロックを使用する方法を理解するのに役立ちます。このドキュメントは通常、コードベースではなく、CMS 自体のドラフト/ライブラリコンテンツとして存在します。
オーサー向けドキュメントが必要な場合:
ほとんどすべてのブロックには、オーサー向けドキュメントが必要です。例外は次のとおりです。
- 非推奨のブロックで、もはや使用すべきではありませんが、まだ削除できません。
- 必要に応じて非常にまれに使用される特殊用途のブロック
- オーサーが直接使用すべきではない自動ブロックされたブロック
メンテナンス
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Building Blocks
This skill guides you through creating new AEM Edge Delivery blocks or modifying existing ones, following Content Driven Development (CDD) principles. Blocks are the reusable building blocks of AEM sites - each transforms authored content into rich, interactive experiences through JavaScript decoration and CSS styling. This skill covers the complete development process: understanding content models, implementing decoration logic, applying styles, and maintaining code quality standards.
Related Skills
- content-driven-development: MUST be invoked before using this skill to ensure content and content models are ready
- block-collection-and-party: Use to find similar blocks for patterns
- testing-blocks: Automatically invoked after implementation for comprehensive testing
When to Use This Skill
This skill should ONLY be invoked from the content-driven-development skill during Phase 2 (Implementation).
If you are not already following the CDD process:
- STOP - Do not proceed with this skill
- Invoke the content-driven-development skill first
- The CDD skill will ensure test content and content models are ready before implementation
This skill handles:
- Creating new block files and structure
- Implementing JavaScript decoration
- Adding CSS styling
- Code quality and testing
Prerequisites
REQUIRED before using this skill:
- ✅ Test content must exist (in CMS or local drafts)
- ✅ Content model must be defined
- ✅ Test content URL must be available
Information needed:
- Block name: What should the block be called?
- Content model: The defined structure authors will use
- Test content URL: Path to test content for development
Process Overview
- Verify Prerequisites (CDD completed)
- Find Similar Blocks (for patterns and reuse)
- Create or Modify Block Structure (files and directories)
- Implement JavaScript Decoration (DOM transformation)
- Add CSS Styling (scoped, responsive styles)
- Test the Implementation (local testing, linting)
- Document Block (developer and author-facing docs)
Detailed Process
1. Verify Prerequisites
Before proceeding, confirm with the user:
"Do you have:
- ✅ Test content created (URL or path)?
- ✅ Content model defined?
If not, we need to use the content-driven-development skill first."
If prerequisites are not met, STOP and invoke the content-driven-development skill.
If prerequisites are met, get the test content URL from the user and proceed to step 2.
2. Find Similar Blocks
For new blocks or major modifications:
- Search the codebase for similar blocks that might provide useful patterns or code we can re-use
- Use the block-collection-and-party skill to find relevant reference blocks
Review the implementation patterns in similar blocks to inform your approach.
For minor modifications to existing blocks: Skip to step 3.
3. Create or Modify Block Structure
For new blocks:
- Create directory:
blocks/{block-name}/ - Create files:
{block-name}.jsand{block-name}.css - Use the boilerplate structure (or reference templates in
resources/if helpful):- JS file exports a default
decorate(block)function (can be async if needed) - CSS file targets the
.{block-name}class
- JS file exports a default
For existing blocks:
- Locate the existing block directory in
blocks/{block-name}/ - Review the current implementation before making changes
- Understand the existing decoration logic and styles
4. Implement JavaScript Decoration
Follow patterns and conventions in resources/js-guidelines.md:
- Use DOM APIs to transform the initial block HTML structure
- Keep decoration logic focused and single-purpose
- Handle variants appropriately (check block.classList for variant classes)
- Follow established patterns from similar blocks
Read resources/js-guidelines.md for detailed examples, code standards, and best practices.
5. Add CSS Styling
Follow patterns and conventions in resources/css-guidelines.md:
- All CSS selectors must be scoped to the block (start with
.{block-name}) - Use BEM-like naming within the block scope
- Leverage CSS custom properties for theming
- Write mobile-first responsive styles
- Keep specificity low
- Follow established patterns from similar blocks
Read resources/css-guidelines.md for detailed examples, code standards, and best practices.
6. Test the Implementation
After implementation is complete, invoke the testing-blocks skill:
The testing-blocks skill will guide you through:
- Writing unit tests for any logic-heavy utilities
- Browser testing to validate block behavior
- Taking screenshots for validation and PR documentation
- Running linting and fixing issues
- Verifying GitHub checks pass
Provide the testing-blocks skill with:
- Block name being tested
- Test content URL (from CDD process)
- Any variants that need testing
Return to this skill after testing is complete to proceed to step 7.
7. Document Block
Blocks require two types of documentation:
Developer Documentation
- Most blocks are simple and self-contained and only need code comments for documentation
- If a block is especially complex (has many variants, or especially complex code) consider adding a brief README.md in the block folder
- Keep any README documentation very brief so it can be consumed at a glance
Author-Facing Documentation
Author-facing documentation helps content authors understand how to use the block in the CMS. This documentation typically exists as draft/library content in the CMS itself, not in the codebase.
When author documentation is needed:
Almost all blocks should have author-facing documentation. The only exceptions are:
- Deprecated blocks that should no longer be used but can't be removed yet
- Special-purpose blocks used very infrequently on a need-to-know basis
- Auto-blocked blocks that shouldn't be used directly by authors
Maintaining author documentation:
Author documentation must be kept in sync with the block implementation:
- Update when variants are added, removed, or modified
- Update when the content structure changes
- Update when block behavior or functionality changes
Where author documentation lives:
Different projects use different approaches for author documentation:
-
Sidekick Library (Google Drive/SharePoint authoring):
- Uses https://github.com/adobe/franklin-sidekick-library
- Check for
/tools/sidekick/library.htmlin the codebase - If present, guide user to add/update block documentation in the library
-
Document Authoring (DA) Library:
- Uses https://docs.da.live/administrators/guides/setup-library
- Different implementation than Sidekick Library
- If in use, guide user to update block documentation in DA library
-
Universal Editor (UE) projects:
- Often skip dedicated author documentation libraries
- May use inline help or other mechanisms
-
Simple documentation pages:
- Some projects maintain documentation under
/draftsor/docs - Pages contain authoring guides and block examples
- Some projects maintain documentation under
What to include in author documentation:
The specific content of author documentation varies by project. As an agent:
- Identify that author documentation needs to be created or updated
- Determine which documentation approach the project uses (check for
/tools/sidekick/library.htmlas a signal) - Guide the user on what aspects of the block should be documented based on the changes made
- Provide specific guidance based on the project's documentation approach
Reference Materials
resources/js-guidelines.mdresources/css-guidelines.md