Beta Skill: This skill is in beta and under active development.
Results should be reviewed carefully before use in production.
Report issues at https://github.com/adobe/skills/issues
AEM as a Cloud Service — Code Assessment
Single skill for detecting and fixing AEM CS code-quality issues, entirely against the local workspace — no external services or network calls. Findings reach the runbook from one of two sources; everything downstream is identical.
Findings sources
| Source |
When |
Target versions (deps) |
| User-named |
the user names files or coordinates |
user-supplied |
| Discover |
the user asks to scan, or names no files |
user-supplied (per the pattern's resolution contract) |
Discovery runs through the deterministic analyzer (scripts/analyze.sh):
it parses the workspace once and runs the enabled detectors, emitting the shared findings shape.
Every ready pattern has an analyzer detector. Patterns without one are planned only — not yet
detectable and not yet built; there is no LLM-scan fallback in this version (see Scope &
limitations) — the scan value on planned rows in references/patterns.md
marks the intended future detection method, not an active code path.
Routing
- User named files / coordinates → run the runbook in
with_findings mode against those paths.
- "Scan my repo" / no files named → run the runbook in
discover mode (per-pattern Discovery, workspace roots only).
Then follow the runbook: references/runbook.md.
Manual Pattern Hints (classification → expert skill)
Route the request to one expert skill. Two pattern families share this skill:
Mechanical fixes (analyzer-driven detection, deterministic edits — follow the runbook flow):
| User said / saw |
Expert skill |
"update aem sdk", "upgrade mockito", stale <version> or ${property} in pom |
outdated-dependencies/ |
"fix @Inject", "modernize Sling Models", javax.inject.Inject on @Model fields |
inject-in-sling-model/ |
"add HTTP timeouts", "outbound/external call has no timeout", HttpClient / HttpClients / OkHttpClient built without a timeout |
outbound-call-timeouts/ |
"bound my query", "unbounded query", "query causing OOM", p.limit=-1, setLimit(-1) |
unbounded-query/ |
"remove deprecated API", "fix deprecated imports", "Cloud Manager deprecated API failure", import org.apache.log4j, import org.apache.commons.lang, import com.adobe.granite.xss, import com.day.cq.xss, commons-lang/collections upgrade, log4j migration, unmodifiable OSGi configs |
remove-deprecated-api/ (apply uses JAR scripts — see recipe.md) |
Architectural migration patterns (guided remediation — full before/after, troubleshooting, modern alternatives; invoked directly or via migration for BPA/CAM-driven discovery):
| User said / saw |
Expert skill |
BPA pattern ID |
org.apache.sling.commons.scheduler.Scheduler or scheduler.schedule( with Runnable |
scheduler/ |
scheduler |
implements ResourceChangeListener, lightweight listener + JobConsumer |
resource-change-listener/ |
resourceChangeListener |
com.day.cq.replication.Replicator, org.apache.sling.replication.*, "publish/preview activation" |
replication/ |
replication |
javax.jcr.observation.EventListener, org.osgi.service.event.EventHandler on non-resource topics (replication, workflow, custom) |
event-migration/ |
eventListener / eventHandler |
com.day.cq.dam.api.AssetManager create/upload/delete APIs, createAssetForBinary, removeAssetForBinary |
asset-manager/ |
assetApi |
HTL build warning data-sly-test: redundant constant value comparison |
references/data-sly-test-redundant-constant.md |
htlLint (reference, no expert skill subdirectory) |
Broad / correctness-review asks ("check my Sling Models are implemented correctly", "review my code", "is my AEM project healthy", "assess this project") are not a single pattern: run the runbook in discover mode with intent report — the analyzer runs every detector and the report covers all built patterns, explicitly noting aspects not yet supported. Only narrow to one pattern when the user targets a specific fix.
If nothing matches, say the issue is not yet supported and offer to file a request for a new expert skill.
Full catalog (built + planned patterns, with severity / detection / fix): references/patterns.md.
Invocation from the migration skill
migration performs BPA/CAM/MCP discovery and handles batching + one-pattern-per-session workflow. After it has identified (pattern, file) pairs from BPA findings, it hands off here for the actual transformation. When invoked with (pattern, file) from migration:
- Skip HA/analyzer discovery (caller already identified the pattern + file)
- Open the pattern's expert skill directly (per the Manual Pattern Hints table above)
- Apply the steps in the expert skill against the named file(s)
- Return the result;
migration continues with the next finding in its batch
The pattern guides themselves are agnostic about who invoked them — they apply identically whether reached from migration (BPA/CAM) or from the runbook in this skill (HA / analyzer).
Runbook
All detection, planning, edits, verification, git/in-place handling, and the run log live in
references/runbook.md. The runbook is the sole owner of repo-environment
detection (edit_mode, git snapshot) — this control plane does not duplicate it.
One pattern per session
Report may span every pattern found; apply touches one pattern per session (atomic revert,
single-story diff). Refuse "fix everything" for the apply phase. Rationale:
references/shared-principles.md.
Critical rules
- Local only — no network calls or external services; operate solely on the workspace.
- Requires a local JDK (Java 11+) for detection — the analyzer compiles/runs in memory; no
install beyond the JDK, no network. If absent, detection stops with a clear message.
- The analyzer is detection — never substitute external tooling. Do not run
mvn versions:display-dependency-updates / mvn versions:display-property-updates,
npm outdated, or Maven Central / registry lookups in place of analyzer discovery. Those answer
"what is the latest on the network" — outside this skill's local-only contract. If the user
explicitly wants a live registry comparison, say it needs network and offer it as a separate step
after delivering the skill report.
- Never commit, push, or open a PR — branch (git) or in-place edits only; the developer reviews and commits.
- Surgical edits — no reformatting / re-serialization.
- Skip with a reason — record un-applicable findings as
skipped with an exact reason; never silently drop.
- One pattern per session for apply.
Full rationale: references/shared-principles.md.
Scope & limitations
Local static detection and remediation only — no external services, no network, no live AEM instance. Issues that require runtime or live-repository state, telemetry, or history across runs are out of scope for this skill.
Detection requires a local JDK (Java 11+); there is no remote or LLM-scan fallback in this version.
A large apply (e.g. an @Inject migration across 100+ files) is processed in resumable batches: the run checkpoints each file to .autofix/last-run.json and pauses at a per-pass cap, so it survives context limits — reply apply <pattern> to continue (see references/git-workflow.md).
Adding a new pattern
Full end-to-end procedure — detector → fixtures/tests → catalog + routing → expert skill → verify:
references/adding-a-pattern.md. The [wiring] test keeps the
detector, catalog row, and expert-skill directory in sync.
Triggering scales without touching the description. The description above is intentionally
broad (intent verbs + AEM domain), so it already fires on "check / review / fix my <AEM thing>";
a new pattern is reached by its Manual Pattern Hints + patterns.md rows, not by editing the
description. Update the description only if the new pattern introduces a domain keyword it does
not already cover (a new subsystem or file type). The [wiring] test keeps the detector, catalog
row, and expert-skill directory in sync.
Related skills
migration — drives BPA/CAM/MCP-based legacy-AEM migration workflow. Discovers findings, batches them, enforces one-pattern-per-session, and hands off (pattern, file) pairs to this skill for transformation. See the "Invocation from the migration skill" section above.
1---2name: code-assessment3description: |4 [BETA] Detect, review, and fix code-quality and correctness issues in an AEM as a Cloud Service5 project — locally, with no external services or network calls. Use whenever a user wants to6 check, review, assess, audit, scan, modernize, upgrade, or fix AEM Java, Sling Models, OSGi,7 or Maven code — for example: "check my Sling Models are implemented correctly", "review my8 @Inject usage", "are my Maven dependencies up to date", "scan this AEM project for issues",9 "modernize my Sling Models", or "fix code-quality problems". Name the files to assess, or ask10 it to scan the repo; it detects issues, plans, and — only when you ask — applies surgical11 edits on a branch or in place, then verifies with mvn compile. It recognises the intent and12 handles each issue type itself, reporting anything it cannot yet fix.13 This skill is in beta. Verify all outputs before applying them to production projects.14metadata:15 source: https://skillmd.com/skills/adobe/code-assessment16 status: beta17license: Apache-2.018---1920> **Beta Skill**: This skill is in beta and under active development.21> Results should be reviewed carefully before use in production.22> Report issues at https://github.com/adobe/skills/issues2324# AEM as a Cloud Service — Code Assessment2526Single skill for detecting and fixing AEM CS code-quality issues, **entirely against the local workspace** — no external services or network calls. Findings reach the runbook from one of two sources; everything downstream is identical.2728## Findings sources2930| Source | When | Target versions (deps) |31|---|---|---|32| **User-named** | the user names files or coordinates | user-supplied |33| **Discover** | the user asks to scan, or names no files | user-supplied (per the pattern's resolution contract) |3435Discovery runs through the deterministic **analyzer** ([`scripts/analyze.sh`](scripts/README.md)):36it parses the workspace once and runs the enabled detectors, emitting the shared findings shape.37Every `ready` pattern has an analyzer detector. Patterns without one are `planned` only — not yet38detectable and not yet built; there is **no LLM-scan fallback** in this version (see Scope &39limitations) — the `scan` value on `planned` rows in [`references/patterns.md`](references/patterns.md)40marks the intended future detection method, not an active code path.4142## Routing43441. **User named files / coordinates** → run the runbook in `with_findings` mode against those paths.452. **"Scan my repo" / no files named** → run the runbook in `discover` mode (per-pattern Discovery, workspace roots only).4647Then follow the runbook: [`references/runbook.md`](references/runbook.md).4849## Manual Pattern Hints (classification → expert skill)5051Route the request to one expert skill. Two pattern families share this skill:5253**Mechanical fixes** (analyzer-driven detection, deterministic edits — follow the runbook flow):5455| User said / saw | Expert skill |56|---|---|57| "update aem sdk", "upgrade mockito", stale `<version>` or `${property}` in pom | [`outdated-dependencies/`](outdated-dependencies/SKILL.md) |58| "fix @Inject", "modernize Sling Models", `javax.inject.Inject` on `@Model` fields | [`inject-in-sling-model/`](inject-in-sling-model/SKILL.md) |59| "add HTTP timeouts", "outbound/external call has no timeout", `HttpClient` / `HttpClients` / `OkHttpClient` built without a timeout | [`outbound-call-timeouts/`](outbound-call-timeouts/SKILL.md) |60| "bound my query", "unbounded query", "query causing OOM", `p.limit=-1`, `setLimit(-1)` | [`unbounded-query/`](unbounded-query/SKILL.md) |61| "remove deprecated API", "fix deprecated imports", "Cloud Manager deprecated API failure", `import org.apache.log4j`, `import org.apache.commons.lang`, `import com.adobe.granite.xss`, `import com.day.cq.xss`, commons-lang/collections upgrade, log4j migration, unmodifiable OSGi configs | [`remove-deprecated-api/`](remove-deprecated-api/SKILL.md) _(apply uses JAR scripts — see recipe.md)_ |6263**Architectural migration patterns** (guided remediation — full before/after, troubleshooting, modern alternatives; invoked directly or via `migration` for BPA/CAM-driven discovery):6465| User said / saw | Expert skill | BPA pattern ID |66|---|---|---|67| `org.apache.sling.commons.scheduler.Scheduler` or `scheduler.schedule(` with `Runnable` | [`scheduler/`](scheduler/SKILL.md) | `scheduler` |68| `implements ResourceChangeListener`, lightweight listener + JobConsumer | [`resource-change-listener/`](resource-change-listener/SKILL.md) | `resourceChangeListener` |69| `com.day.cq.replication.Replicator`, `org.apache.sling.replication.*`, "publish/preview activation" | [`replication/`](replication/SKILL.md) | `replication` |70| `javax.jcr.observation.EventListener`, `org.osgi.service.event.EventHandler` on non-resource topics (replication, workflow, custom) | [`event-migration/`](event-migration/SKILL.md) | `eventListener` / `eventHandler` |71| `com.day.cq.dam.api.AssetManager` create/upload/delete APIs, `createAssetForBinary`, `removeAssetForBinary` | [`asset-manager/`](asset-manager/SKILL.md) | `assetApi` |72| HTL build warning `data-sly-test: redundant constant value comparison` | [`references/data-sly-test-redundant-constant.md`](references/data-sly-test-redundant-constant.md) | `htlLint` (reference, no expert skill subdirectory) |7374**Broad / correctness-review asks** ("check my Sling Models are implemented correctly", "review my code", "is my AEM project healthy", "assess this project") are not a single pattern: run the runbook in `discover` mode with intent `report` — the analyzer runs every detector and the report covers all built patterns, explicitly noting aspects not yet supported. Only narrow to one pattern when the user targets a specific fix.7576If nothing matches, say the issue is not yet supported and offer to file a request for a new expert skill.7778**Full catalog** (built + `planned` patterns, with severity / detection / fix): [`references/patterns.md`](references/patterns.md).7980## Invocation from the `migration` skill8182`migration` performs BPA/CAM/MCP discovery and handles batching + one-pattern-per-session workflow. After it has identified `(pattern, file)` pairs from BPA findings, it hands off here for the actual transformation. When invoked with `(pattern, file)` from `migration`:8384- **Skip** HA/analyzer discovery (caller already identified the pattern + file)85- Open the pattern's expert skill directly (per the Manual Pattern Hints table above)86- Apply the steps in the expert skill against the named file(s)87- Return the result; `migration` continues with the next finding in its batch8889The pattern guides themselves are agnostic about who invoked them — they apply identically whether reached from `migration` (BPA/CAM) or from the runbook in this skill (HA / analyzer).9091## Runbook9293All detection, planning, edits, verification, git/in-place handling, and the run log live in94[`references/runbook.md`](references/runbook.md). The runbook is the **sole owner** of repo-environment95detection (`edit_mode`, git snapshot) — this control plane does not duplicate it.9697## One pattern per session9899Report may span every pattern found; **apply touches one pattern per session** (atomic revert,100single-story diff). Refuse "fix everything" for the apply phase. Rationale:101[`references/shared-principles.md`](references/shared-principles.md#one-pattern-per-session).102103## Critical rules104105- **Local only** — no network calls or external services; operate solely on the workspace.106- **Requires a local JDK** (Java 11+) for detection — the analyzer compiles/runs in memory; no107 install beyond the JDK, no network. If absent, detection stops with a clear message.108- **The analyzer is detection — never substitute external tooling.** Do not run109 `mvn versions:display-dependency-updates` / `mvn versions:display-property-updates`,110 `npm outdated`, or Maven Central / registry lookups in place of analyzer discovery. Those answer111 "what is the latest on the network" — outside this skill's local-only contract. If the user112 explicitly wants a live registry comparison, say it needs network and offer it as a separate step113 **after** delivering the skill report.114- **Never commit, push, or open a PR** — branch (git) or in-place edits only; the developer reviews and commits.115- **Surgical edits** — no reformatting / re-serialization.116- **Skip with a reason** — record un-applicable findings as `skipped` with an exact reason; never silently drop.117- **One pattern per session** for apply.118119Full rationale: [`references/shared-principles.md`](references/shared-principles.md).120121## Scope & limitations122123Local static detection and remediation only — no external services, no network, no live AEM instance. Issues that require runtime or live-repository state, telemetry, or history across runs are out of scope for this skill.124Detection requires a local JDK (Java 11+); there is no remote or LLM-scan fallback in this version.125A large apply (e.g. an `@Inject` migration across 100+ files) is processed in **resumable batches**: the run checkpoints each file to `.autofix/last-run.json` and pauses at a per-pass cap, so it survives context limits — reply **apply `<pattern>`** to continue (see [`references/git-workflow.md`](references/git-workflow.md)).126127## Adding a new pattern128129Full end-to-end procedure — detector → fixtures/tests → catalog + routing → expert skill → verify:130**[`references/adding-a-pattern.md`](references/adding-a-pattern.md)**. The `[wiring]` test keeps the131detector, catalog row, and expert-skill directory in sync.132133**Triggering scales without touching the description.** The `description` above is intentionally134broad (intent verbs + AEM domain), so it already fires on "check / review / fix my <AEM thing>";135a new pattern is reached by its **Manual Pattern Hints + `patterns.md` rows**, not by editing the136description. Update the description **only** if the new pattern introduces a domain keyword it does137not already cover (a new subsystem or file type). The `[wiring]` test keeps the detector, catalog138row, and expert-skill directory in sync.139140## Related skills141142- **`migration`** — drives BPA/CAM/MCP-based legacy-AEM migration workflow. Discovers findings, batches them, enforces one-pattern-per-session, and hands off `(pattern, file)` pairs to this skill for transformation. See the "Invocation from the `migration` skill" section above.