plugins/aem/cloud-service/skills/ensure-agents-md/SKILL.md
**Run FIRST (before any other skill or task)** when workspace root has no AGENTS.md and the repo is an AEM Cloud Service project. Creates AGENTS.md and CLAUDE.md (tailored via pom.xml). Applies on every user request until AGENTS.md exists — not only the first chat. Never overwrites existing files.
npx skillsauth add adobe/skills ensure-agents-mdInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Before any other work — including dispatcher, create-component, code edits, MCP, or answers — the agent MUST:
AGENTS.md exists at the workspace (repository) root.AGENTS.md and CLAUDE.md if missing), then fulfill the user’s original request.This applies to every user message and any intent (bugs, features, questions, dispatcher, etc.) until AGENTS.md is present. Do not defer bootstrap to “after” the main task.
It creates AGENTS.md and CLAUDE.md at the repository root so every AI coding agent (Claude Code, Cursor, etc.) gets project guidance, optionally tailored using the module catalog and add-on detection.
AGENTS.md at the workspace root. If it exists → skip, move on.pom.xml exists and references
com.adobe.aem:aem-sdk-api or aem-project-archetype or contains <modules> with
typical AEM module names (core, ui.apps, dispatcher, etc.).
If not an AEM project → skip.Check in order:
pom.xml → <name> element (preferred, usually human-readable).pom.xml → <artifactId>, then humanize: strip leading aem-, replace - with spaces,
title-case (e.g. aem-guides-wknd → WKND, my-site → My Site)."AEM Cloud Service Project".Read root pom.xml <modules> section. For each <module>, confirm the directory actually exists.
Build a list of present modules.
Scan the project for:
| Signal | Add-on / variant |
|---|---|
| pom.xml depends on cif-connector or aem-core-cif-components | CIF (Commerce) |
| ui.frontend/package.json contains react or @adobe/aem-react-editable-components | React SPA |
| ui.frontend/package.json contains @angular/core or @adobe/aem-angular-editable-components | Angular SPA |
| ui.frontend has no clientlib.config.js and pom.xml references frontend-maven-plugin but outputs no clientlibs | Decoupled frontend |
| pom.xml depends on aem-forms-* or forms.core | AEM Forms |
| Module ui.frontend.react.forms.af exists | Headless Forms |
| pom.xml uses precompiled-scripts-provider | Precompiled Scripts |
If none of these are detected, treat as General Webpack frontend (the default archetype).
Read the template at references/AGENTS.md.template. Apply the following adaptations:
Replace {{PROJECT_NAME}} with the resolved project name.
If any add-ons were detected (CIF, Forms, Headless Forms, Precompiled Scripts), insert an "Add-ons and extensions" section after the intro paragraph. Use descriptions from the references/module-catalog.md add-ons table. If none detected, omit the section entirely.
Only include modules that actually exist in the project. For each module, use the matching description from the module catalog. Pay attention to:
ui.frontend — use the variant that matches the detected frontend type (General, React, Angular, Decoupled).dispatcher — only include if the dispatcher directory exists.it.tests / ui.tests — only include if they exist.npm run build, npm start) only if ui.frontend exists.dispatcher module exists.npm start requires AEM running.Always include the base resources from the template. Additionally:
If CLAUDE.md does not exist at the workspace root, create it with exactly this content (so Claude/Cursor picks up project guidance):
@AGENTS.md
Do not overwrite an existing CLAUDE.md.
Briefly tell the user:
"I created
AGENTS.mdandCLAUDE.mdin your project root with guidance tailored to your project structure. These help AI coding agents understand your project."
Then continue with the user's original request.
| File | Purpose |
|---|---|
| references/AGENTS.md.template | Base template with {{PROJECT_NAME}} placeholder and all default sections |
| references/module-catalog.md | Module descriptions, add-on descriptions, conditional resources — the source of truth for adapting the template |
AGENTS.md or CLAUDE.md. Only create when missing.experienceleague.adobe.com/en/docs/experience-manager-cloud-service/...
(Cloud Service URLs), never to AEM 6.5 URLs.tools
Use the run-workflow MCP to discover, compose, execute, publish, and save Adobe Firefly workflows. TRIGGER when: user asks what actions are available, what the MCP can do, how to process images/video/3D via workflow, wants to build/run/save/publish a workflow, OR pastes any workflow/batch/execution ID. BARE ID (UUID/workflowId/batchId) = INSPECT ONLY — call inspect_run, NEVER run_workflow_submit. ALWAYS call list_actions first for capability/discovery questions. DO NOT TRIGGER for direct Firefly API calls without MCP (use firefly-api-specs).
tools
Run predefined featured workflows via run-workflow MCP. TRIGGER when user names a featured workflow (retargeting, banners at scale, localization, packaging, banner advertising, etc.) or asks to run a known marketing/production workflow. Requires run-workflow MCP. ALWAYS call get_featured_workflow before compose_workflow. DO NOT TRIGGER for custom one-off workflows with no named template — use run-workflow skill.
tools
Migrate an Adobe Commerce App Builder project from the Integration Starter Kit or Checkout Starter Kit to the new App Management approach. Run from the root of the App Builder project to be migrated. Pass --auto to skip confirmation prompts (suitable for CI or batch use) — auto mode prints a summary of all Q&A questions answered with their defaults. Pass --doc-scan-only to scan README.md and env.dist for outdated content without modifying any files. Use when the user wants to migrate an App Builder project from the Integration Starter Kit or Checkout Starter Kit to the App Management approach, or mentions upgrading their Adobe Commerce extension architecture.
development
Add or modify webhook interceptors in an Adobe Commerce app. Use when the user wants to intercept Commerce operations to validate input, append data, or modify behavior — before or after execution. Requires a base app initialized with commerce-app-init.