From dx-core
Deep project scan — discover conventions from actual code, customize rule files with real values, and generate seed data. Interactive. Run after /dx-init + /dx-adapt + /aem-init. Use when setting up a new project or when project structure changes significantly.
npx claudepluginhub easingthemes/dx-aem-flow --plugin dx-coreThis skill uses the workspace's default tool permissions.
Scan the actual codebase to discover conventions, then interactively customize `.claude/rules/` with real values and generate `.ai/project/` seed data files. This is the "teach the AI about YOUR project" step.
Analyzes multi-language projects (Java, Kotlin, TypeScript, Python, Rust, Go) to extract etalon classes, patterns, and layer-based architecture. Generates convention documents and rules in .claude/convention/.
Scans codebase to generate CLAUDE.md project config and .rune/ files including conventions, invariants, and developer guide. Use for new repos or missing context.
Setup wizard — scans codebase, builds confidence per data point, only asks what it can't figure out, generates SDLC files. Use for first-time setup or re-running setup.
Share bugs, ideas, or general feedback.
Scan the actual codebase to discover conventions, then interactively customize .claude/rules/ with real values and generate .ai/project/ seed data files. This is the "teach the AI about YOUR project" step.
Before this skill: /dx-init scaffolds config, /dx-adapt detects type/toolchain, /aem-init sets up AEM. After those, rules still have generic placeholders and seed data is empty.
After this skill: Rules contain real CSS variables, actual component patterns, discovered naming conventions. Seed data describes the architecture, features, and file patterns. Every AI skill benefits from this context.
.ai/config.yaml must exist (run /dx-init first)project.type must be set (run /dx-adapt first)aem: section must exist (run /aem-init first)If any prerequisite is missing, print which skill to run and STOP.
Optional phase selector:
phase1 — frontend conventions onlyphase2 — backend conventions onlyphase3 — seed data onlyall or no argument — run all phasesdigraph dx_scan {
"Check prerequisites" [shape=box];
"Prerequisites OK?" [shape=diamond];
"Read config + detect scope" [shape=box];
"Phase 1: Frontend conventions" [shape=box];
"Phase 2: Backend conventions" [shape=box];
"Phase 3: Seed data" [shape=box];
"Summary" [shape=doublecircle];
"STOP — missing prereqs" [shape=doublecircle];
"Check prerequisites" -> "Prerequisites OK?";
"Prerequisites OK?" -> "STOP — missing prereqs" [label="no"];
"Prerequisites OK?" -> "Read config + detect scope" [label="yes"];
"Read config + detect scope" -> "Phase 1: Frontend conventions";
"Phase 1: Frontend conventions" -> "Phase 2: Backend conventions";
"Phase 2: Backend conventions" -> "Phase 3: Seed data";
"Phase 3: Seed data" -> "Summary";
}
Read .ai/config.yaml. Verify:
project.type is setaem-: verify aem: section existsFrom .ai/config.yaml read:
project.type — determines which phases applyproject.role — frontend, backend, fullstack, configaem.component-path, aem.frontend-dir, aem.component-prefix — for AEM scanningtoolchain.* — build tool, CSS compiler, template enginebuild.* — build commandsDetermine scope:
frontend OR role is fullstack OR aem.frontend-dir existsfullstack OR role is backend OR aem.component-path existsaem-Print: Project: <name> | Type: <type> | Role: <role> | FE: yes/no | BE: yes/no | AEM: yes/no
Skip if project has no frontend. Print: Phase 1: Scanning frontend conventions...
Scan for:
*.scss and *.css files for $ variables and -- custom properties. Group by category (colors, spacing, breakpoints, typography, z-index).@media queries, $bp- or $breakpoint- variables, or breakpoint maps.Present discoveries to user:
I found these CSS conventions:
**Breakpoints:**
$bp-mobile: 768px
$bp-tablet: 1024px
$bp-desktop: 1200px
**Color tokens:** 12 variables (e.g., $color-primary: #1a1a1a, $color-accent: #0066cc)
**Spacing:** $spacing-xs through $spacing-xl (4px–48px scale)
**Naming:** BEM pattern detected (block__element--modifier)
Is this accurate? Anything to add or correct?
Wait for user confirmation. Then update .claude/rules/fe-styles.md with the confirmed values, replacing generic placeholders.
Scan for:
import/export (ESM), require (CJS), or define (AMD)customElements.define, React.createElement, component class patterns*.hbs), HTL (*.html with data-sly-*), JSX, etc.Present discoveries, wait for confirmation. Update .claude/rules/fe-javascript.md and .claude/rules/fe-components.md.
If AEM project, scan for:
*.content.xml under clientlibs for categoriesembed property in clientlib definitionsPresent discoveries, wait for confirmation. Update .claude/rules/fe-clientlibs.md.
Skip if project has no backend. Print: Phase 2: Scanning backend conventions...
Scan for:
@Model, @Inject, @ValueMapValue, @ChildResource, @ScriptVariable@Exporter, exporter name, selector@Default, @Optional, nullable patternsPresent 2-3 example models with discovered patterns. Wait for confirmation. Update .claude/rules/be-sling-models.md.
Scan for:
.content.xml files under component-path. Extract componentGroup, resourceSuperType, decoration patterns_cq_dialog/.content.xml files. Identify tab patterns, multifield usage, custom widgets*.html files for data-sly-use, data-sly-template, data-sly-call patternsPresent discoveries, wait for confirmation. Update .claude/rules/be-components.md, .claude/rules/be-dialog.md, .claude/rules/be-htl.md.
Scan for:
src/test/java/ structure*Test.java, *IT.java, *Spec.javaPresent discoveries, wait for confirmation. Update .claude/rules/be-testing.md.
Scan for:
src/main/java/ tree, identify top-level packages@Component, @Service, @Reference (OSGi) or Spring annotationsPresent discoveries, wait for confirmation. Update relevant rule files.
Print: Phase 3: Generating seed data...
Scan the project to build architecture.md:
Present the architecture summary. Wait for user to confirm or enrich with details the code can't reveal (e.g., "We also use a custom CDN layer" or "The FE components talk to a BFF service").
Write to .ai/project/architecture.md.
Scan the codebase to identify features:
Present feature list grouped by layer. Ask user to confirm and add any domain-specific features.
Write to .ai/project/features.md.
Generate file-patterns.yaml — how to find all source files for a given component:
# Auto-generated by /dx-scan — maps component name to file locations
# <name> is replaced with the component name at runtime
patterns:
dialog: "<apps-path>/<name>/_cq_dialog/.content.xml"
component-xml: "<apps-path>/<name>/.content.xml"
htl: "<apps-path>/<name>/<name>.html"
sling-model: "<java-src>/**/models/<Name>Model.java"
exporter: "<java-src>/**/models/<Name>Exporter.java"
test: "<java-test>/**/models/<Name>ModelTest.java"
scss: "<frontend-dir>/src/**/components/<name>/**/*.scss"
js: "<frontend-dir>/src/**/components/<name>/**/*.js"
template: "<frontend-dir>/src/**/components/<name>/**/*.hbs"
Discover actual paths from the codebase (don't assume — verify with Glob). Present to user, wait for confirmation.
Write to .ai/project/file-patterns.yaml.
If AEM and aem.content-paths is set in config, use those. Otherwise:
jcr_root/content/ directories in the projectmcp__plugin_dx-aem_AEM__fetchSites to discover live content treesPresent to user. Write to .ai/project/content-paths.yaml.
Check if .ai/project/component-index.md already exists (created by /aem-init).
Component index already exists (created by /aem-init). Skipping./aem-initDo NOT regenerate if it already exists.
Print a summary of everything created/updated:
## /dx-scan Complete
### Rules Updated
| File | What Changed |
|------|-------------|
| fe-styles.md | Added 12 CSS variables, 3 breakpoints, BEM naming |
| fe-javascript.md | ESM imports, BaseComponent class, CustomElements |
| ... | ... |
### Seed Data Created
| File | Content |
|------|---------|
| architecture.md | 4 modules, HTL→Model→Exporter pipeline |
| features.md | 23 components, 8 services, 12 FE features |
| file-patterns.yaml | 9 pattern templates |
| content-paths.yaml | 3 content roots, 2 brands |
### Next Steps
1. Review generated files in `.ai/project/`
2. Run `/dx-help` to test if AI can answer project questions
3. Run `/dx-req <ticket-id>` — AI will now use your project context
Every discovery is presented to the user before writing. The format:
If the user says "skip" for any phase, skip it entirely. If they say "auto" or "just do it", proceed without confirmation for remaining items in that phase.
/dx-scan — Full interactive scan. Discovers FE conventions (SCSS variables, JS patterns), BE conventions (Sling Model patterns, dialog structure), and generates all seed data files. Each discovery is confirmed interactively.
/dx-scan phase1 — Frontend conventions only. Scans CSS/SCSS, JavaScript, clientlibs. Updates fe-styles.md, fe-javascript.md, fe-components.md, fe-clientlibs.md.
/dx-scan phase3 — Seed data only. Generates architecture.md, features.md, file-patterns.yaml, content-paths.yaml. Skips rule customization.