appbuilder-action-scaffolder
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseApp Builder Action Scaffolder
App Builder 动作脚手架生成工具
Full lifecycle skill for Adobe Runtime actions — scaffold, implement, deploy, and debug. Place action code at and register in .
src/<extension-dir>/actions/<action-name>/index.jssrc/<extension-dir>/ext.config.yamlAdobe Runtime动作全生命周期技能——脚手架生成、实施、部署和调试。将动作代码放置在,并在中注册。
src/<extension-dir>/actions/<action-name>/index.jssrc/<extension-dir>/ext.config.yamlPattern Quick-Reference
模式速查
Pick the template that matches the user's intent. Default to for generic actions.
assets/action-boilerplate.js| User wants | Template |
|---|---|
| Simple action / generic starting point | assets/action-boilerplate.js |
| Minimal prototype (bare-bones) | assets/action-scaffold-template.js |
| Database CRUD (durable records, indexes) | assets/database-action-template.js |
| Webhook receiver (I/O Events) | assets/event-webhook-template.js |
| Custom event provider | assets/event-provider-template.js |
| Journaling consumer (replayable events) | assets/journaling-consumer-template.js |
| Large payload response (>1 MB) | assets/large-payload-template.js |
| Action sequence pipeline | assets/action-sequence-template.js |
| Asset Compute worker (AEM renditions) | assets/asset-compute-worker-template.js |
| Debug Runtime action issues | references/debugging.md |
选择与用户需求匹配的模板。通用动作默认使用。
assets/action-boilerplate.js| 用户需求 | 模板 |
|---|---|
| 简单动作/通用起点 | assets/action-boilerplate.js |
| 极简原型(基础结构) | assets/action-scaffold-template.js |
| 数据库CRUD(持久化记录、索引) | assets/database-action-template.js |
| Webhook接收器(I/O Events) | assets/event-webhook-template.js |
| 自定义事件提供者 | assets/event-provider-template.js |
| 日志记录消费者(可重放事件) | assets/journaling-consumer-template.js |
| 大负载响应(>1 MB) | assets/large-payload-template.js |
| 动作序列流水线 | assets/action-sequence-template.js |
| Asset Compute工作器(AEM renditions) | assets/asset-compute-worker-template.js |
| 调试Runtime动作问题 | references/debugging.md |
Fast Path (for clear requests)
快速路径(适用于明确请求)
When the user's request maps unambiguously to a single pattern above — they name a specific pattern, reference a template, or describe a use case that clearly matches one entry — skip straight to scaffolding. Use the matched template and proceed directly.
Examples of fast-path triggers:
- "Add a webhook receiver action" → , scaffold directly
assets/event-webhook-template.js - "Create an Asset Compute worker" → , scaffold directly
assets/asset-compute-worker-template.js - "Add a database CRUD action" → , scaffold directly
assets/database-action-template.js - "Add an action called process-order" (simple, no ambiguity) → , scaffold directly
assets/action-boilerplate.js
If there is any ambiguity — multiple patterns could fit, constraints are unclear, or the user hasn't specified enough to pick a single approach — fall through to the full workflow below.
当用户的请求明确匹配上述单一模式时——他们指定了特定模式、引用了模板,或描述的用例清晰匹配某一项——直接跳至脚手架生成步骤。使用匹配的模板并直接执行。
快速路径触发示例:
- "添加一个Webhook接收器动作" → ,直接生成脚手架
assets/event-webhook-template.js - "创建一个Asset Compute工作器" → ,直接生成脚手架
assets/asset-compute-worker-template.js - "添加一个数据库CRUD动作" → ,直接生成脚手架
assets/database-action-template.js - "添加一个名为process-order的动作"(简单无歧义) → ,直接生成脚手架
assets/action-boilerplate.js
若存在任何歧义——多个模式均适用、约束条件不明确,或用户未提供足够信息以选择单一方案——则进入下方完整工作流程。
Quick Reference
速查指南
- Action entry point: Place action code at . This keeps paths aligned with the generated extension layout.
src/<extension-dir>/actions/<action-name>/index.js - Manifest location: Register actions in . Do not put a root-level
src/<extension-dir>/ext.config.yamlinruntimeManifest; the CLI silently ignores it.app.config.yaml - Extension directory name: The extension directory name varies by project template:
- — Experience Cloud Shell SPA (default)
src/dx-excshell-1/ - — AEM Content Fragment Console extension
src/aem-cf-console-admin-1/ - — Asset Compute worker Use the actual directory name from your project's
src/dx-asset-compute-worker-1/app.config.yamlentries.$include
- Web action response shape: Return for standard web actions; add
{ statusCode, body }only when needed.headers - Key CLI loop: for local iteration (use
aio app devif actions use State SDK, Files SDK, or sequences),aio app runfor direct testing,aio rt action invokefor publishing.aio app deploy - State vs database: State for ephemeral job tracking; database for durable records, indexed queries, or document-style CRUD.
- Events delivery choice: Webhook for push delivery, custom event provider to publish domain events, journaling consumer for replayability or back-pressure.
- Large payload and sequence patterns: Large payload redirect when >1 MB response limit; action sequence for linear multi-action flows.
- Asset Compute worker fit: Use for AEM rendition processing; different SDK and extension layout than standard Runtime actions.
- 动作入口点:将动作代码放置在。此路径与生成的扩展布局保持一致。
src/<extension-dir>/actions/<action-name>/index.js - 清单位置:在中注册动作。请勿在
src/<extension-dir>/ext.config.yaml中添加根层级的app.config.yaml;CLI会静默忽略该配置。runtimeManifest - 扩展目录名称:扩展目录名称因项目模板而异:
- —— Experience Cloud Shell SPA(默认)
src/dx-excshell-1/ - —— AEM内容片段控制台扩展
src/aem-cf-console-admin-1/ - —— Asset Compute工作器 请使用项目
src/dx-asset-compute-worker-1/中app.config.yaml条目里的实际目录名称。$include
- Web动作响应格式:标准Web动作返回;仅在需要时添加
{ statusCode, body }。headers - 核心CLI循环:用于本地迭代(若动作使用State SDK、Files SDK或序列,则使用
aio app dev),aio app run用于直接测试,aio rt action invoke用于发布。aio app deploy - State与数据库对比:State用于临时作业跟踪;数据库用于持久化记录、索引查询或文档式CRUD。
- 事件交付选择:Webhook用于推送交付,自定义事件提供者用于发布领域事件,日志记录消费者用于可重放性或背压处理。
- 大负载与序列模式:响应超过1 MB限制时使用大负载重定向;动作序列用于线性多动作流程。
- Asset Compute工作器适用场景:用于AEM renditions处理;与标准Runtime动作使用不同的SDK和扩展布局。
Full Workflow (for ambiguous or complex requests)
完整工作流程(适用于歧义或复杂请求)
- Confirm target outcome, constraints, and acceptance criteria.
- Collect current implementation context from code, environment, and Adobe configuration.
- Apply the detailed procedure in for this capability.
references/playbook.md - Produce implementation artifacts and validation evidence.
- Run through before final handoff.
references/checklist.md - Summarize decisions, risks, and immediate next actions.
- 确认目标结果、约束条件和验收标准。
- 从代码、环境和Adobe配置中收集当前实施上下文。
- 应用中针对此能力的详细流程。
references/playbook.md - 生成实施工件和验证证据。
- 在最终交付前运行中的检查项。
references/checklist.md - 总结决策、风险和立即执行的下一步动作。
Example User Prompts
用户请求示例
- "Add a new action to my App Builder project that calls the AEM Assets API."
- "My runtime action is timing out after 60 seconds. How do I increase the limit without breaking the app?"
- "Set up a cron action that runs every 5 minutes to sync data from an external API."
- "Create a web action that accepts file uploads and stores them using the Files SDK."
- "Store customer preferences in the App Builder Database."
- "Set up a webhook to receive I/O Events for asset changes."
- "My action response is too large — how do I handle payloads over 1MB?"
- "向我的App Builder项目添加一个调用AEM Assets API的新动作。"
- "我的Runtime动作在60秒后超时。如何在不破坏应用的情况下延长限制?"
- "设置一个每5分钟运行一次的cron动作,从外部API同步数据。"
- "创建一个接受文件上传并使用Files SDK存储文件的Web动作。"
- "将客户偏好存储在App Builder数据库中。"
- "设置一个Webhook以接收资产变更的I/O Events。"
- "我的动作响应过大——如何处理超过1MB的负载?"
Inputs To Request
需要请求的输入信息
- Current repository path and module boundaries
- Target Adobe organization, project, and workspace
- Non-functional constraints: latency, cost, compliance, and support model
- Definition of done with measurable acceptance criteria
- 当前仓库路径和模块边界
- 目标Adobe组织、项目和工作区
- 非功能性约束:延迟、成本、合规性和支持模式
- 包含可衡量验收标准的完成定义
Deliverables
交付物
- Implementation updates for the requested capability
- Validation evidence: tests, checks, or reproducible verification steps
- Handoff summary with explicit tradeoffs and follow-up actions
- 针对请求功能的实施更新
- 验证证据:测试、检查或可复现的验证步骤
- 包含明确权衡和后续动作的交付总结
Quality Bar
质量标准
- Keep decisions explicit and traceable to project constraints
- Prefer deterministic automation for repeatable steps
- Fail safely with actionable diagnostics
- Document tradeoffs and next-step risks in handoff notes
- 保持决策明确且可追溯至项目约束
- 优先使用确定性自动化处理可重复步骤
- 安全失败并提供可操作的诊断信息
- 在交付说明中记录权衡和下一步风险
References
参考资料
- Use for detailed execution guidance.
references/playbook.md - Use for pre-handoff validation.
references/checklist.md - Use for ready-to-use execution prompts.
references/prompt-pack.md - Use for action structure, params, response formats, SDK usage, and CLI operations.
references/runtime-reference.md - Use for AEM Content Fragment API surfaces — decision table, Delivery OpenAPI, Management OpenAPI, GraphQL persisted queries, and the deprecated Assets HTTP API — with auth patterns and action code for each.
references/aem-apis.md - Use for common action patterns, including CRUD API, cron, multi-step processing, database CRUD, webhook intake, custom event providers, journaling consumers, large payload redirects, action sequence composition, and Asset Compute workers.
references/action-patterns.md - Use ,
assets/database-action-template.js,assets/event-webhook-template.js,assets/event-provider-template.js,assets/journaling-consumer-template.js,assets/large-payload-template.js, andassets/action-sequence-template.jswhen the user request maps directly to one of the newer boilerplate patterns.assets/asset-compute-worker-template.js - Use for Adobe service-specific guidance.
../_shared/categories/architecture-runtime.md
- 使用获取详细执行指南。
references/playbook.md - 使用进行交付前验证。
references/checklist.md - 使用获取现成的执行提示。
references/prompt-pack.md - 使用获取动作结构、参数、响应格式、SDK使用和CLI操作相关信息。
references/runtime-reference.md - 使用获取AEM内容片段API相关信息——决策表、Delivery OpenAPI、Management OpenAPI、GraphQL持久化查询以及已弃用的Assets HTTP API——包含每个API的认证模式和动作代码。
references/aem-apis.md - 使用获取常见动作模式,包括CRUD API、cron、多步骤处理、数据库CRUD、Webhook接收、自定义事件提供者、日志记录消费者、大负载重定向、动作序列组合以及Asset Compute工作器。
references/action-patterns.md - 当用户请求直接匹配某一新样板模式时,使用、
assets/database-action-template.js、assets/event-webhook-template.js、assets/event-provider-template.js、assets/journaling-consumer-template.js、assets/large-payload-template.js和assets/action-sequence-template.js。assets/asset-compute-worker-template.js - 使用获取Adobe服务特定指南。
../_shared/categories/architecture-runtime.md
Common Manifest Guardrail
常见清单防护措施
- Keep App Builder action definitions under in
application.runtimeManifest.app.config.yaml - Do not use root-level ; App Builder CLI ignores it for action configuration.
runtimeManifest - Validate manifest structure before deploy: .
python3 ../_shared/scripts/validate_manifest_structure.py <path-to-app.config.yaml> - Use for valid and invalid examples.
../_shared/references/appbuilder-manifest-guardrail.md
- 将App Builder动作定义保存在的
app.config.yaml下。application.runtimeManifest - 请勿使用根层级的;App Builder CLI会忽略该配置用于动作设置。
runtimeManifest - 部署前验证清单结构:。
python3 ../_shared/scripts/validate_manifest_structure.py <path-to-app.config.yaml> - 使用查看有效和无效示例。
../_shared/references/appbuilder-manifest-guardrail.md
Common Issues
常见问题
- Action deployment fails: Most deploy failures come from invalid manifest structure or missing dependencies. Check that actions are nested under (or the extension
application.runtimeManifestpattern), run the manifest validator, runext.config.yaml, then retrynpm install.aio app deploy - Action timeout: Runtime execution defaults to 60 seconds and can be extended to 300 seconds for non-web actions. Reduce work per invocation, move long-running tasks to async/background flows, or raise the timeout in manifest limits when the action type supports it.
- Payload too large: Web actions are limited to 1 MB for both request and response payloads. Trim request bodies, avoid returning large blobs inline, and use external storage or pass URLs instead.
- IMS token not available / auth fails: If an action expects Adobe user context, set , confirm the shell or caller actually provides the token, and verify
annotations.require-adobe-auth: trueplus Adobe project/workspace access for the target APIs.aio auth login - Two-layer auth confusion: Actions can enforce auth at two independent layers — the manifest annotation (gateway-level rejection) and a code-level
require-adobe-auth: trueheader check inside the action. Disabling one layer does not disable the other. During local dev, setAuthorizationand stub the code-level check; otherwise 401 errors persist across redeploy cycles. Seerequire-adobe-auth: false§ "Common Auth Issues" for the full debugging guide.references/runtime-reference.md
- 动作部署失败:大多数部署失败源于无效的清单结构或缺失的依赖项。检查动作是否嵌套在(或扩展
application.runtimeManifest模式)下,运行清单验证工具,执行ext.config.yaml,然后重试npm install。aio app deploy - 动作超时:Runtime执行默认超时为60秒,非Web动作可延长至300秒。减少每次调用的工作量,将长时间运行的任务移至异步/后台流程,或在动作类型支持时在清单限制中提高超时时间。
- 负载过大:Web动作的请求和响应负载均限制为1 MB。精简请求体,避免直接返回大文件,改用外部存储或传递URL。
- IMS令牌不可用/认证失败:若动作需要Adobe用户上下文,设置,确认Shell或调用方实际提供令牌,并验证
annotations.require-adobe-auth: true以及对目标API的Adobe项目/工作区访问权限。aio auth login - 双层认证混淆:动作可在两个独立层级强制认证——清单注解(网关级拒绝)和动作内部的代码级
require-adobe-auth: true头检查。禁用一个层级不会禁用另一个层级。在本地开发期间,需设置Authorization并 stub代码级检查;否则在重新部署周期中会持续出现401错误。查看require-adobe-auth: false中的「常见认证问题」章节获取完整调试指南。references/runtime-reference.md
First-Wave Accelerator Kit
第一波加速工具包
- Use to structure delivery artifacts for this high-frequency capability.
references/implementation-template.md - Run to generate an execution checklist from request context.
scripts/accelerator.py
- 使用为此高频能力构建交付工件结构。
references/implementation-template.md - 运行从请求上下文生成执行检查清单。
scripts/accelerator.py
Asset Templates
资产模板
- — Minimal scaffold for quick prototyping. Use this when you are starting from scratch, want the bare minimum action shape, or need to validate the basic params-in / response-out flow before adding production concerns.
assets/action-scaffold-template.js - — Production-ready template with logging, input validation, error handling, and response formatting. Use this when the action is meant for production use, shared team handoff, or any implementation that should start with observability and defensive defaults already in place.
assets/action-boilerplate.js - — Durable database CRUD starter with collection initialization, indexes, and document-style operations.
assets/database-action-template.js - — Adobe I/O Events webhook receiver with challenge handling, signature verification, and idempotent event processing.
assets/event-webhook-template.js - — Custom event provider starter for bootstrapping provider metadata and publishing domain events.
assets/event-provider-template.js - — Scheduled journaling consumer that polls the journal, stores the cursor, and processes replayable event batches.
assets/journaling-consumer-template.js - — large payload response starter that writes oversized responses to Files storage and returns a redirect URL.
assets/large-payload-template.js - — Starter manifest and action layout for a linear action sequence pipeline.
assets/action-sequence-template.js - — Asset Compute worker scaffold for AEM rendition processing with the Asset Compute SDK.
assets/asset-compute-worker-template.js
- —— 用于快速原型开发的极简脚手架。当从零开始、仅需基础动作结构,或需要在添加生产相关功能前验证基本的参数输入/响应输出流程时使用此模板。
assets/action-scaffold-template.js - —— 具备日志记录、输入验证、错误处理和响应格式化的生产就绪模板。当动作用于生产环境、团队共享交付,或任何需要预先具备可观察性和防御性默认设置的实施场景时使用此模板。
assets/action-boilerplate.js - —— 具备集合初始化、索引和文档式操作的持久化数据库CRUD启动模板。
assets/database-action-template.js - —— 具备挑战处理、签名验证和幂等事件处理的Adobe I/O Events Webhook接收器。
assets/event-webhook-template.js - —— 用于引导提供者元数据和发布领域事件的自定义事件提供者启动模板。
assets/event-provider-template.js - —— 定时日志记录消费者,轮询日志、存储游标并处理可重放事件批次。
assets/journaling-consumer-template.js - —— 大负载响应启动模板,将超大响应写入Files存储并返回重定向URL。
assets/large-payload-template.js - —— 用于线性动作序列流水线的启动清单和动作布局。
assets/action-sequence-template.js - —— 使用Asset Compute SDK处理AEM renditions的Asset Compute工作器脚手架。
assets/asset-compute-worker-template.js
Agent Integration
Agent集成
- The directory stores agent-platform integration metadata that complements the standard skill directories.
agents/ - defines the OpenAI-facing skill configuration, including the display name, short description, and default prompt used to invoke this skill in OpenAI-compatible agent experiences.
agents/openai.yaml - Keep the core skill instructions in ; use
SKILL.mdonly for platform-specific integration details.agents/
- 目录存储补充标准技能目录的Agent平台集成元数据。
agents/ - 定义面向OpenAI的技能配置,包括显示名称、简短描述以及在兼容OpenAI的Agent体验中调用此技能使用的默认提示词。
agents/openai.yaml - 核心技能说明保留在中;仅将平台特定的集成细节放在
SKILL.md目录中。agents/