Using the Block Collection and Block Party by adobe/helix-website
npx skills add https://github.com/adobe/helix-website --skill 'Using the Block Collection and Block Party'此技能帮助您从两个关键的 AEM Edge Delivery 资源中查找参考实现、代码示例和模式:
使用提供的搜索脚本来发现相关示例,然后查看代码以指导您的实现方法。
在以下情况下使用此技能:
在以下情况下请勿使用此技能:
docs-search)区块集合(首选,如果可用)
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
区块派对(用于特殊需求)
何时首选哪个:
确定您要查找的内容并确定相关的搜索词。考虑功能的相似或替代名称。
示例:
好的搜索词:
差的搜索词:
重要提示: 为获得全面结果,请并行运行两个搜索脚本:
# 并行运行两个搜索(首选方法)
node .claude/skills/block-collection-and-party/scripts/search-block-collection-github.js <搜索词> & \
node .claude/skills/block-collection-and-party/scripts/search-block-collection.js <搜索词> & \
wait
为什么使用两个脚本:
search-block-collection-github.js - 通过 GitHub API 搜索实际仓库文件夹(最全面)search-block-collection.js - 搜索导航页面(提供显示名称并捕获边缘情况)示例:
# 搜索手风琴/FAQ 区块(两个脚本)
node .claude/skills/block-collection-and-party/scripts/search-block-collection-github.js accordion & \
node .claude/skills/block-collection-and-party/scripts/search-block-collection.js accordion & \
wait
# 搜索嵌入区块(两个脚本)
node .claude/skills/block-collection-and-party/scripts/search-block-collection-github.js embed & \
node .claude/skills/block-collection-and-party/scripts/search-block-collection.js embed & \
wait
# 如果同时运行有问题,优先使用 GitHub API 版本
node .claude/skills/block-collection-and-party/scripts/search-block-collection-github.js carousel
从项目根目录执行区块派对搜索脚本:
node .claude/skills/block-collection-and-party/scripts/search-block-party.js [--category <类别>] <搜索词> [附加词...]
选项:
--category <类别>:按特定类别筛选(区块、Sidekick 插件、DA 插件、代码片段、构建工具等)--category:搜索所有类别示例:
# 搜索面包屑区块
node .claude/skills/block-collection-and-party/scripts/search-block-party.js breadcrumb
# 搜索 Sass 集成示例
node .claude/skills/block-collection-and-party/scripts/search-block-party.js sass
# 仅搜索构建工具
node .claude/skills/block-collection-and-party/scripts/search-block-party.js --category "Build Tooling" webpack
# 多词搜索
node .claude/skills/block-collection-and-party/scripts/search-block-party.js adobe target integration
区块集合结果(类型:"block"):
{
"query": "accordion",
"source": "Adobe AEM Block Collection",
"totalItems": 26,
"matchCount": 1,
"results": [
{
"name": "accordion",
"displayName": "Accordion",
"type": "block",
"liveExampleUrl": "https://main--aem-block-collection--adobe.aem.live/block-collection/accordion",
"jsUrl": "https://github.com/adobe/aem-block-collection/blob/main/blocks/accordion/accordion.js",
"cssUrl": "https://github.com/adobe/aem-block-collection/blob/main/blocks/accordion/accordion.css"
}
]
}
区块集合结果(类型:"default-content"):
{
"query": "breadcrumb",
"source": "Adobe AEM Block Collection",
"totalItems": 26,
"matchCount": 1,
"results": [
{
"name": "breadcrumbs",
"displayName": "Breadcrumbs",
"type": "default-content",
"liveExampleUrl": "https://main--aem-block-collection--adobe.aem.live/block-collection/breadcrumbs",
"note": "这是默认内容文档,不是独立的区块。代码可能是其他区块的一部分(例如,面包屑在 header 区块中)。请访问 https://www.aem.live/developer/block-collection 和实时示例 URL 以获取实施指导。",
"documentationUrl": "https://www.aem.live/developer/block-collection"
}
]
}
区块派对结果:
{
"query": "breadcrumb",
"category": "All categories",
"source": "AEM Block Party (Approved Only)",
"totalEntries": 90,
"approvedEntries": 62,
"matchCount": 1,
"results": [
{
"title": "Breadcrumbs",
"category": "Block",
"description": "一个面包屑导航组件...",
"githubUrl": "https://github.com/...",
"showcaseUrl": "https://...",
"githubProfile": "https://github.com/..."
}
]
}
重要提示: 在为区块编写任何 HTML 之前,务必先获取预装饰结构示例。
node .claude/skills/block-collection-and-party/scripts/get-block-structure.js <区块名称>
为什么这很关键:
示例:
# 获取手风琴结构
node .claude/skills/block-collection-and-party/scripts/get-block-structure.js accordion
# 获取卡片结构(将显示多个变体)
node .claude/skills/block-collection-and-party/scripts/get-block-structure.js cards
# 获取标签页结构
node .claude/skills/block-collection-and-party/scripts/get-block-structure.js tabs
输出包括:
何时使用:
此步骤可防止最常见的错误: 编写与区块 JavaScript 装饰期望不匹配的错误 HTML 结构。
使用提供的 URL 查看实现:
对于 type: "block" 的区块集合结果:
对于 type: "default-content" 的区块集合结果:
documentationUrl (https://www.aem.live/developer/block-collection) 以查找实施细节liveExampleUrl 以查看示例并了解如何创作内容对于区块派对条目:
使用参考实现来指导您的方法:
用户请求: "我需要构建一个带有可展开问题的 FAQ 部分"
好方法:
认识到 FAQ 通常使用手风琴模式
使用两个脚本搜索区块集合:
node .claude/skills/block-collection-and-party/scripts/search-block-collection-github.js accordion & \
node .claude/skills/block-collection-and-party/scripts/search-block-collection.js accordion & \
wait
查看两个搜索的结果(它们应该一致,但运行两者可确保没有遗漏)
找到带有 JS、CSS 和实时示例 URL 的手风琴区块
查看实现方法
调整模式以适应您特定的 FAQ 需求
为什么这有效:
用户请求: "向站点添加面包屑导航"
好方法:
首先使用两个脚本搜索区块集合:
node .claude/skills/block-collection-and-party/scripts/search-block-collection-github.js breadcrumb & \
node .claude/skills/block-collection-and-party/scripts/search-block-collection.js breadcrumb & \
wait
发现面包屑是 "default-content"(不是独立区块)
搜索区块派对:node .claude/skills/block-collection-and-party/scripts/search-block-party.js breadcrumb
在区块派对中找到面包屑区块
查看实现,注意它是社区贡献的
评估它是否满足您的需求或需要调整
为什么这有效:
用户请求: "我们能否使用 Sass 代替纯 CSS 来编写样式?"
好方法:
node .claude/skills/block-collection-and-party/scripts/search-block-party.js --category "Build Tooling" sass为什么这有效:
用户请求: "为产品图片构建一个轮播图"
场景: 区块集合和区块派对都有轮播图实现
好方法:
使用两个脚本搜索区块集合:
node .claude/skills/block-collection-and-party/scripts/search-block-collection-github.js carousel & \
node .claude/skills/block-collection-and-party/scripts/search-block-collection.js carousel & \
wait
从两个搜索结果中找到区块集合的轮播图
同时搜索区块派对:node .claude/skills/block-collection-and-party/scripts/search-block-party.js carousel
找到多个区块派对轮播图
首选区块集合以遵循最佳实践
查看区块派对版本,看它们是否有值得考虑的创新功能
根据需求做出明智决定
为什么这有效:
| 需求 | 区块集合搜索 | 区块派对搜索 |
|---|---|---|
| FAQ 部分 | accordion | faq, accordion |
| 图片库 | carousel | gallery, carousel, slideshow |
| 标签页内容 | tabs | tabs, tabbed |
| 导航 | header | navigation, menu, header |
| 页脚 | footer | footer |
| 产品卡片 | cards | cards, product |
| 视频嵌入 | video, embed | video, embed, youtube |
| 构建工具 | N/A | 使用 --category "Build Tooling" |
| Sidekick 插件 | N/A | 使用 --category "Sidekick Plugin" |
| 集成 | N/A | 搜索服务名称(例如 target, analytics) |
两个区块集合脚本都没有结果:
https://github.com/adobe/aem-block-collection/tree/main/blocksbuilding-blocks 技能的指导从头开始构建两个脚本的结果不同:
重要提示 - 当搜索没有结果但区块很可能存在时:
区块派对结果太多:
--category 进行筛选找到代码但似乎过时:
docs-search 技能查看官方文档多个实现,不确定使用哪个:
每周安装
0
仓库
GitHub 星标
40
首次出现
1970年1月1日
安全审计
This skill helps you find reference implementations, code examples, and patterns from two key AEM Edge Delivery resources:
Use the provided search scripts to discover relevant examples, then review the code to inform your implementation approach.
Use this skill when:
Do NOT use this skill when:
docs-search instead)Block Collection (Prefer this when available)
Block Party (Use for specialized needs)
When to prefer which:
Determine what you're looking for and identify relevant search terms. Think about similar or alternative names for the functionality.
Examples:
Good search terms:
Poor search terms:
IMPORTANT: Run BOTH search scripts in parallel for comprehensive results:
# Run both searches in parallel (preferred approach)
node .claude/skills/block-collection-and-party/scripts/search-block-collection-github.js <search-term> & \
node .claude/skills/block-collection-and-party/scripts/search-block-collection.js <search-term> & \
wait
Why use both scripts:
search-block-collection-github.js - Searches actual repository folders via GitHub API (most comprehensive)search-block-collection.js - Searches navigation page (provides display names and catches edge cases)Examples:
# Search for accordion/FAQ blocks (both scripts)
node .claude/skills/block-collection-and-party/scripts/search-block-collection-github.js accordion & \
node .claude/skills/block-collection-and-party/scripts/search-block-collection.js accordion & \
wait
# Search for embed block (both scripts)
node .claude/skills/block-collection-and-party/scripts/search-block-collection-github.js embed & \
node .claude/skills/block-collection-and-party/scripts/search-block-collection.js embed & \
wait
# If running both is problematic, prioritize the GitHub API version
node .claude/skills/block-collection-and-party/scripts/search-block-collection-github.js carousel
Execute the Block Party search script from the project root:
node .claude/skills/block-collection-and-party/scripts/search-block-party.js [--category <category>] <search-term> [additional-terms...]
Options:
--category <category>: Filter by specific category (Block, Sidekick Plugin, DA Plugin, Code Snippet, Build Tooling, etc.)--category: Searches all categoriesExamples:
# Search for breadcrumb blocks
node .claude/skills/block-collection-and-party/scripts/search-block-party.js breadcrumb
# Search for Sass integration examples
node .claude/skills/block-collection-and-party/scripts/search-block-party.js sass
# Search only for build tooling
node .claude/skills/block-collection-and-party/scripts/search-block-party.js --category "Build Tooling" webpack
# Multi-word search
node .claude/skills/block-collection-and-party/scripts/search-block-party.js adobe target integration
Block Collection Results (type: "block"):
{
"query": "accordion",
"source": "Adobe AEM Block Collection",
"totalItems": 26,
"matchCount": 1,
"results": [
{
"name": "accordion",
"displayName": "Accordion",
"type": "block",
"liveExampleUrl": "https://main--aem-block-collection--adobe.aem.live/block-collection/accordion",
"jsUrl": "https://github.com/adobe/aem-block-collection/blob/main/blocks/accordion/accordion.js",
"cssUrl": "https://github.com/adobe/aem-block-collection/blob/main/blocks/accordion/accordion.css"
}
]
}
Block Collection Results (type: "default-content"):
{
"query": "breadcrumb",
"source": "Adobe AEM Block Collection",
"totalItems": 26,
"matchCount": 1,
"results": [
{
"name": "breadcrumbs",
"displayName": "Breadcrumbs",
"type": "default-content",
"liveExampleUrl": "https://main--aem-block-collection--adobe.aem.live/block-collection/breadcrumbs",
"note": "This is default content documentation, not a standalone block. Code may be part of other blocks (e.g., breadcrumbs are in the header block). Visit https://www.aem.live/developer/block-collection and the live example URL for implementation guidance.",
"documentationUrl": "https://www.aem.live/developer/block-collection"
}
]
}
Block Party Results:
{
"query": "breadcrumb",
"category": "All categories",
"source": "AEM Block Party (Approved Only)",
"totalEntries": 90,
"approvedEntries": 62,
"matchCount": 1,
"results": [
{
"title": "Breadcrumbs",
"category": "Block",
"description": "A breadcrumb navigation component...",
"githubUrl": "https://github.com/...",
"showcaseUrl": "https://...",
"githubProfile": "https://github.com/..."
}
]
}
IMPORTANT: Before writing any HTML for a block, ALWAYS fetch the pre-decoration structure examples first.
node .claude/skills/block-collection-and-party/scripts/get-block-structure.js <block-name>
Why this is critical:
Examples:
# Get accordion structure
node .claude/skills/block-collection-and-party/scripts/get-block-structure.js accordion
# Get cards structure (will show multiple variants)
node .claude/skills/block-collection-and-party/scripts/get-block-structure.js cards
# Get tabs structure
node .claude/skills/block-collection-and-party/scripts/get-block-structure.js tabs
Output includes:
When to use:
This step prevents the most common mistake: Writing incorrect HTML structure that doesn't match what the block's JavaScript decoration expects.
Use the provided URLs to review the implementation:
For Block Collection results withtype: "block":
For Block Collection results withtype: "default-content":
documentationUrl (https://www.aem.live/developer/block-collection) to find implementation detailsliveExampleUrl to see examples and understand how to author the contentFor Block Party entries:
Use the reference implementations to inform your approach:
User Request: "I need to build an FAQ section with expandable questions"
Good Approach:
Recognize FAQ often uses accordion pattern
Search Block Collection with both scripts:
node .claude/skills/block-collection-and-party/scripts/search-block-collection-github.js accordion & \
node .claude/skills/block-collection-and-party/scripts/search-block-collection.js accordion & \
wait
Review results from both searches (they should align, but running both ensures nothing is missed)
Find the accordion block with JS, CSS, and live example URLs
Review the implementation approach
Adapt the pattern to your specific FAQ needs
Why this works:
User Request: "Add breadcrumb navigation to the site"
Good Approach:
Search Block Collection first with both scripts:
node .claude/skills/block-collection-and-party/scripts/search-block-collection-github.js breadcrumb & \
node .claude/skills/block-collection-and-party/scripts/search-block-collection.js breadcrumb & \
wait
Find that breadcrumbs is "default-content" (not a standalone block)
Search Block Party: node .claude/skills/block-collection-and-party/scripts/search-block-party.js breadcrumb
Find breadcrumb block in Block Party
Review the implementation, noting it's community-contributed
Evaluate if it meets your needs or needs adaptation
Why this works:
User Request: "Can we use Sass for our styles instead of plain CSS?"
Good Approach:
node .claude/skills/block-collection-and-party/scripts/search-block-party.js --category "Build Tooling" sassWhy this works:
User Request: "Build a carousel for product images"
Scenario: Both Block Collection and Block Party have carousel implementations
Good Approach:
Search Block Collection with both scripts:
node .claude/skills/block-collection-and-party/scripts/search-block-collection-github.js carousel & \
node .claude/skills/block-collection-and-party/scripts/search-block-collection.js carousel & \
wait
Find Block Collection carousel from both search results
Also search Block Party: node .claude/skills/block-collection-and-party/scripts/search-block-party.js carousel
Find multiple Block Party carousels
Prefer Block Collection for best practices
Review Block Party versions to see if they have innovative features worth considering
Make informed decision based on requirements
Why this works:
| Need | Block Collection Search | Block Party Search |
|---|---|---|
| FAQ section | accordion | faq, accordion |
| Image gallery | carousel | gallery, carousel, slideshow |
| Tabbed content | tabs |
No results from both Block Collection scripts:
https://github.com/adobe/aem-block-collection/tree/main/blocksbuilding-blocks skillDifferent results between the two scripts:
IMPORTANT - When search returns no results but block likely exists:
Too many results in Block Party:
--category to filterFound code but seems outdated:
docs-search skillMultiple implementations, unsure which to use:
Weekly Installs
0
Repository
GitHub Stars
40
First Seen
Jan 1, 1970
Security Audits
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
107,800 周安装
Azure Functions 最佳实践指南:独立工作进程、Node.js/Python 编程模型与反模式详解
359 周安装
股票技术分析专家 - 实时分析A股/港股/美股走势,提供MACD、KDJ、RSI、布林带指标解读
361 周安装
Directus 后端架构指南:API扩展、钩子、性能优化与TypeScript开发
save-thread技能:会话保存与交接摘要工具(兼容性说明)
359 周安装
计划撰写技能:高效任务分解与项目管理框架,提升开发效率
362 周安装
Nx Cloud CI 监控与自愈修复工具 - monitor-ci 自动化流水线协调器
361 周安装
tabs, tabbed |
| Navigation | header | navigation, menu, header |
| Footer | footer | footer |
| Product cards | cards | cards, product |
| Video embed | video, embed | video, embed, youtube |
| Build tools | N/A | Use --category "Build Tooling" |
| Sidekick plugins | N/A | Use --category "Sidekick Plugin" |
| Integrations | N/A | Search for service name (e.g., target, analytics) |