[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6H418180PPWH4RY60HD403D":3,"skill-same:01M6H418180PPWH4RY60HD403D":76},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":44,"linkOnly":45,"markdownContent":46,"markdownBody":47,"frontMatter":48,"refName":54,"commitSha":55,"skillDirectory":56,"forksCount":57,"repositoryHtmlUrl":58,"repositoryHomepageUrl":6,"ownerHtmlUrl":59,"ownerBlogUrl":60,"ownerDescription":61,"updatedAt":62,"install":63,"resources":75},"01M6H418180PPWH4RY60HD403D","dx-adapt",null,"Auto-detect project type, structure, build commands, and AEM values. Updates .ai\u002Fconfig.yaml with project profile and substitutes real values into installed .claude\u002Frules\u002F. Run after \u002Fdx-init and \u002Faem-init. Re-run anytime to refresh detected values.","easingthemes\u002Fdx-aem-flow","easingthemes","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F2750284?v=4","01M6H3XYGJY8QCX9ES36P2WF4H","Dragan Filipović","01M6H3XYMN1XVSGKN7N79SW3RH",7,"MIT","https:\u002F\u002Fgithub.com\u002Feasingthemes\u002Fdx-aem-flow\u002Fblob\u002Fmain\u002Fplugins\u002Fdx-core\u002Fskills\u002Fdx-adapt\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000009","前端开发","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"dx adapt","adapt","dx","auto","updates","re","detecting","commands","project","structure","frontend","edit","write","read","search","update","run","config","init","project structure","2026-11-10 10:12:30",false,"---\nname: dx-adapt\ndescription: Auto-detect project type, structure, build commands, and AEM values. Updates .ai\u002Fconfig.yaml with project profile and substitutes real values into installed .claude\u002Frules\u002F. Run after \u002Fdx-init and \u002Faem-init. Re-run anytime to refresh detected values.\nwhen_to_use: \"Use when auto-detecting project structure and build commands, when refreshing detected values after restructuring, when the user says 'detect project type', 'update config from project', or 'adapt to this codebase'.\"\nargument-hint: \"[aem-fullstack|aem-frontend|frontend] (optional — auto-detects if omitted)\"\ndisable-model-invocation: true\nallowed-tools: [\"read\", \"edit\", \"search\", \"write\", \"agent\"]\n---\n\nYou detect the project's technical profile from source files and update `.ai\u002Fconfig.yaml` with the `project:`, `toolchain:`, and additional `build:` fields. Then you substitute the detected values into `.claude\u002Frules\u002F` files (replacing generic placeholders with real project values).\n\nUse ultrathink — project detection requires reading multiple source files and making accurate inferences.\n\n## 0. Check Prerequisites\n\nRead `.ai\u002Fconfig.yaml`. If it doesn't exist: \"Run `\u002Fdx-init` first.\" STOP.\n\nCheck if `.ai\u002Fconfig.yaml` already has a `project:` section with `type` field:\n- **If no `project:` section:** Go directly to Phase 1. (This is normal on first run or when called from `dx-init`.)\n- **If `project:` section exists:** Display the current values and ask: **(A) Keep as-is**, **(B) Re-detect** (re-reads source files), **(C) Edit** (re-confirm with current values pre-loaded). If A: skip to Phase 4 (rule substitution only).\n\n## Phase 1: Detect Project Type\n\n### 1a. Auto-detect (or use argument)\n\nIf the user provided an argument (`aem-fullstack`, `aem-frontend`, `frontend`), use it. Otherwise detect:\n\n| Check | Type |\n|---|---|\n| `pom.xml` exists AND contains `com.adobe.cq` or AEM `uber-jar` dependency | `aem-fullstack` |\n| `pom.xml` exists AND contains `content-package-maven-plugin` AND no Java source in `src\u002Fmain\u002Fjava\u002F` | `aem-frontend` |\n| `package.json` exists AND contains `aem-clientlib-generator` or `clientlib.config.js` exists | `aem-frontend` |\n| `package.json` exists AND no AEM indicators | `frontend` |\n| Only `pom.xml` (no AEM) | `java` |\n\n### 1b. Extract details per project type\n\n**For `aem-fullstack`:**\n\n```bash\n# Find Java package root\nfind . -path \"*\u002Fsrc\u002Fmain\u002Fjava\u002F*.java\" | head -1\n# → extract package from first line of that file\n\n# Find component namespace from filter.xml or .content.xml\ngrep -r \"componentGroup\" --include=\"*.xml\" -l | head -5\n\n# Find base branch\ngit symbolic-ref refs\u002Fremotes\u002Forigin\u002FHEAD 2>\u002Fdev\u002Fnull | sed 's|refs\u002Fremotes\u002Forigin\u002F||'\n\n# Find Maven modules\nfind . -maxdepth 3 -name \"pom.xml\" | grep -v \"^.\u002Fpom.xml\"\n```\n\nRead 2-3 `.content.xml` files with `componentGroup` to extract:\n- `componentGroup` — the group name string (e.g., `\"MyProject General\"`)\n- `componentPath` — derive from the file path (e.g., `\u002Fapps\u002Fmyproject\u002Fcomponents`)\n- `componentSelector` — from `@Exporter` annotation in any Java `@Model` class\n- `serviceVendor` — from `@Component(property = \"service.vendor=...\")` in any Java class\n- `dialogPropertyPrefix` — check if dialog XML uses `.\u002Fdata\u002F` nesting or `.\u002F` directly\n- `rteInheritancePath` — search for `sling:resourceSuperType` containing `rteConfigs`\n- `authorPort` — from `pom.xml` properties (default 4502)\n\nExtract build commands from `pom.xml` and `package.json` (if frontend submodule exists):\n- `build.full` — `mvn clean install -PautoInstallPackage` (with correct `-pl` if multi-module)\n- `build.deploy` — `mvn clean install -PautoInstallPackage -DskipTests` (quick deploy, no tests)\n- `build.compile` — frontend compile if `package.json` submodule exists\n- `build.test` — `mvn test -pl \u003Ccore-module>`\n- `build.testSingle` — `mvn test -pl \u003Ccore-module> -Dtest={className}`\n- `build.lint` — from `package.json` scripts if frontend submodule exists\n\nExtract modules list from child `pom.xml` files:\n```bash\nfind . -maxdepth 3 -name \"pom.xml\" ! -path \".\u002Fpom.xml\" \\\n  -exec grep -l \"packaging\" {} \\; | sort\n```\nFor each, read packaging type: `bundle`, `content-package`, `jar`.\n\nExtract `sourceRoots`, `testRoots`, `componentPaths` from the module paths found.\n\n**For `aem-frontend`:**\n\nRead `package.json` scripts to extract build, lint, test commands.\nRead webpack\u002Fclientlib config to find component output paths.\nNo Java extraction needed — omit `aem.javaPackage`, `aem.componentSelector`, etc.\n\n**For `frontend`:**\n\nRead `package.json` for framework, scripts (build, test, lint, dev).\nRead `tsconfig.json` if present for TypeScript confirmation.\nRead directory structure (`src\u002F`, `app\u002F`, `pages\u002F`, `components\u002F`) for source roots.\n\n### 1c. Git and SCM details\n\n```bash\n# Base branch\ngit symbolic-ref refs\u002Fremotes\u002Forigin\u002FHEAD 2>\u002Fdev\u002Fnull | sed 's|refs\u002Fremotes\u002Forigin\u002F||'\n\n# Branch prefix from recent branches\ngit branch -r | grep -E \"feature\u002F|bugfix\u002F\" | head -5\n```\n\nRead `scm.base-branch` from `.ai\u002Fconfig.yaml` as fallback.\n\n## Phase 2: Confirm with User\n\nPrint all detected values as a table. Ask: **\"Correct? Type 'yes' or correct any values.\"**\n\n```markdown\n## Detected: \u003Cproject type>\n\n| Property | Value |\n|---|---|\n| Project Type | \u003Ctype> |\n| Name | \u003Cname from config.yaml> |\n| Build (full) | `\u003Ccommand>` |\n| Build (compile) | `\u003Ccommand or \"—\">` |\n| Test | `\u003Ccommand>` |\n| Test (single) | `\u003Cpattern>` |\n| Lint | `\u003Ccommand or \"none\">` |\n| Base Branch | \u003Cbranch> |\n| Source Roots | \u003Clist> |\n| Test Roots | \u003Clist> |\n| Component Paths | \u003Clist> |\n\u003CAEM-only rows:>\n| Java Package | \u003Cpackage> |\n| Component Path | \u003Cpath> |\n| Component Group | \u003Cgroup> |\n| Selector | \u003Cselector or \"—\"> |\n| Service Vendor | \u003Cvendor or \"—\"> |\n| Dialog Property Prefix | \u003Cprefix> |\n| AEM Author Port | \u003Cport> |\n```\n\n## Phase 3: Update .ai\u002Fconfig.yaml with project profile\n\n### 3a. Derive project role\n\nDerive `project.role` from `project.type`:\n\n| project.type | project.role |\n|---|---|\n| aem-fullstack | fullstack |\n| aem-frontend | frontend |\n| frontend | frontend |\n| java | backend |\n| (other) | Ask user to confirm |\n\nConfirm with user: \"Detected project role: **{role}**. Is this correct?\"\n\n### 3b. Read existing config.yaml\n\nRead `.ai\u002Fconfig.yaml` in full. You will append\u002Fupdate sections — never overwrite the entire file.\n\n### 3c. Update config.yaml sections\n\nAdd or update the following sections in `.ai\u002Fconfig.yaml`. Preserve all existing sections (`dx:`, `scm:`, `build:`, `aem:`, etc.) — only add\u002Fupdate the fields listed below.\n\n**Add `project:` section** (add after `dx:` section, or update if it already exists):\n\n```yaml\nproject:\n  type: \"{{type}}\"           # aem-fullstack | aem-frontend | frontend | java\n  role: \"{{role}}\"           # fullstack | frontend | backend (derived above)\n```\n\n**Add `toolchain:` section** (add after `project:` section):\n\n```yaml\ntoolchain:\n  node-version: \"{{version}}\"          # detected from .nvmrc, .node-version, or package.json engines\n  build-tool: \"{{tool}}\"               # webpack | vite | maven | gradle | etc.\n  css-compiler: \"{{compiler}}\"         # sass | less | postcss | none\n  component-base-class: \"{{class}}\"    # e.g. \"com.adobe.cq.export.json.ComponentExporter\" (AEM only, omit if N\u002FA)\n```\n\nOnly include fields that were actually detected. Omit fields with no detected value.\n\n**Update `build:` section** — append these granular fields to the existing `build:` section if detected:\n\n```yaml\nbuild:\n  # ... existing fields (command, test, etc.) stay as-is ...\n  serve: \"{{command}}\"        # dev server command (e.g. \"npm run dev\")\n  lint-js: \"{{command}}\"      # JS\u002FTS linting (e.g. \"npm run lint:js\")\n  lint-scss: \"{{command}}\"    # SCSS\u002FCSS linting (e.g. \"npm run lint:scss\")\n  lint-fix: \"{{command}}\"     # auto-fix linting (e.g. \"npm run lint:fix\")\n```\n\nOnly add fields that were detected from `package.json` scripts or build configs. Do not add fields with empty values.\n\n**Update `aem:` section** — if project type is `aem-fullstack` or `aem-frontend` and the `aem:` section already exists, add\u002Fupdate `component-prefix` if a prefix was detected (e.g., from component group or path convention). Do NOT duplicate fields that already exist in the `aem:` section (`java-package`, `component-path`, `component-group` are already managed by `\u002Faem-init`).\n\n**Fields NOT written** (derivable from filesystem, dropped per spec): `modules`, `sourceRoots`, `testRoots`, `componentPaths`, `source`, `output`, `component.registration`.\n\nPrint: `Updated .ai\u002Fconfig.yaml with project profile`\n\n## Phase 4: Update Template-Seeded Files\n\nRe-generate files seeded from plugin templates. These are the plugin's responsibility (not user-customized), so they always reflect the latest template.\n\n### 4a. Regenerate agent.index.md\n\nRead `templates\u002FINDEX.md.template` from the plugin directory. Replace `{{PROJECT_NAME}}` with `dx.project-name` from `.ai\u002Fconfig.yaml`. Write to `agent.index.md` (project root). Always overwrite.\n\n### 4b. Regenerate .ai\u002FREADME.md\n\nRead `templates\u002FREADME.md.template` from the plugin directory. Replace `{{PROJECT_NAME}}` with the project name. Write to `.ai\u002FREADME.md`. Always overwrite.\n\n### 4c. Re-run scaffold for new static files\n\nRun scaffold.sh to pick up any new rule templates or utilities added since last init:\n\n```bash\nbash skills\u002Fdx-init\u002Fscripts\u002Fscaffold.sh\n```\n\nEach file is skipped if it already exists — only newly added templates are installed.\n\n## Phase 5: Filter and Verify .claude\u002Frules\u002F\n\n### 5a. Filter rules by project type\n\nRead `project.type` from `.ai\u002Fconfig.yaml`.\n\n| project.type | Action |\n|---|---|\n| `aem-fullstack` | Keep all rules. No deletions. |\n| `aem-frontend` | Delete all `be-*.md` rules in `.claude\u002Frules\u002F`. Keep `fe-*.md`, `accessibility.md`, `naming.md`. |\n| `frontend` | Delete all `be-*.md` and `fe-clientlibs.md` rules. Keep `accessibility.md`, `naming.md`. |\n| `java` | Delete all `fe-*.md` rules. Keep `be-*.md`, `accessibility.md`, `naming.md`. |\n\nUse Glob to list matching files, then delete those that don't apply. If no files match the deletion criteria, report \"no rules to filter\".\n\n### 5b. Verify project values in rules\n\nRead each `.claude\u002Frules\u002F*.md` file that was installed from an aem-init template. Verify that project-specific values from `.ai\u002Fconfig.yaml` are present — not generic placeholders. Check for:\n\n- Java package name (should match `aem.java-package` from config.yaml `aem:` section)\n- Component path (should match `aem.component-path` from config.yaml `aem:` section)\n- Component group (should match `aem.component-group` from config.yaml `aem:` section)\n\nOther substitution values are read from `.ai\u002Fconfig.yaml`:\n- `project.type`, `project.role` — from the `project:` section\n- `toolchain.*` values — from the `toolchain:` section\n- `build.*` values — from the `build:` section\n\nIf any file still contains generic examples instead of real project values, substitute them with values from `.ai\u002Fconfig.yaml`. If a file already has correct project-specific values, skip it silently.\n\n## Phase 6: Report\n\n```markdown\n## Project Adapted: \u003Cname>\n\n**Type:** \u003Ctype>\n**Role:** \u003Crole>\n**Config:** `.ai\u002Fconfig.yaml` updated (project + toolchain sections)\n\n### Rules Updated\n\u003Clist of .claude\u002Frules\u002F files modified with substitutions made>\n\u003Clist of files skipped (already customized)>\n\n### Next Steps\n- Review `project:` and `toolchain:` sections in `.ai\u002Fconfig.yaml` — edit and re-run `\u002Fdx-adapt` if any values need correction\n- `\u002Fdx-init` — re-run if base config.yaml needs changes\n- `\u002Faem-init` — re-run if AEM rule templates need reinstalling\n```\n\n## Examples\n\n1. `\u002Fdx-adapt` — First run after `\u002Fdx-init`. Scans the codebase to detect 3 brands, 45 components, Node 10 with Gulp build. Updates `config.yaml` with `project:` and `toolchain:` sections, then substitutes placeholders in `.claude\u002Frules\u002F` files (e.g., `{{BRANDS}}` becomes the actual brand list, `{{BUILD_COMMAND}}` becomes `npm run build:new`).\n\n2. `\u002Fdx-adapt` (re-run after adding a new brand) — Detects existing `project:` section in config.yaml, asks whether to re-detect or keep existing values. User chooses re-detect. Finds the new brand directory, updates config.yaml, and re-runs Phase 4 substitution to update rules files with the expanded brand list.\n\n3. `\u002Fdx-adapt` (AEM project) — Detects AEM project structure during Phase 1. After Phase 3 (config.yaml updated), automatically chains to `\u002Faem-init` to install AEM-specific rules before Phase 4 runs substitution on all rule files including AEM ones.\n\n## Troubleshooting\n\n- **\"project profile already exists — re-detect or keep?\"**\n  **Cause:** `\u002Fdx-adapt` was run before and detection results are saved in config.yaml's `project:` section.\n  **Fix:** Choose \"re-detect\" if the project structure changed (new components, new brands). Choose \"keep\" if you only want to re-run the substitution phase (Phase 4) with existing values.\n\n- **Placeholders left in rule files after adaptation**\n  **Cause:** The value could not be extracted from the codebase (e.g., no brands found, build tool not recognized).\n  **Fix:** Check `project:` and `toolchain:` sections in `.ai\u002Fconfig.yaml` for missing values. Fill them in manually and re-run `\u002Fdx-adapt` — Phase 4 will substitute using the updated values.\n\n- **Rule file skipped during substitution**\n  **Cause:** The rule file has no remaining placeholders (already customized) or was manually edited.\n  **Fix:** This is expected behavior — `\u002Fdx-adapt` never overwrites user customizations. If you want to re-apply the template, delete the rule file and run `\u002Fdx-adapt` again (it will reinstall from the plugin template first).\n\n## Rules\n\n- **Read real source files** — extract values from actual code, not defaults\n- **Never overwrite user customizations** — if a rule file has no matching placeholder, skip it\n- **Idempotent** — safe to re-run; Phase 0 check skips detection if config.yaml already has a `project:` section (unless user chooses re-detect)\n- **Phase 4 is always run** — even if project profile already exists in config.yaml, substitution runs on re-run (user may have reinstalled rules)\n- **Graceful on missing data** — if a value can't be extracted, leave the placeholder and note it in the report\n","You detect the project's technical profile from source files and update `.ai\u002Fconfig.yaml` with the `project:`, `toolchain:`, and additional `build:` fields. Then you substitute the detected values into `.claude\u002Frules\u002F` files (replacing generic placeholders with real project values).\n\nUse ultrathink — project detection requires reading multiple source files and making accurate inferences.\n\n## 0. Check Prerequisites\n\nRead `.ai\u002Fconfig.yaml`. If it doesn't exist: \"Run `\u002Fdx-init` first.\" STOP.\n\nCheck if `.ai\u002Fconfig.yaml` already has a `project:` section with `type` field:\n- **If no `project:` section:** Go directly to Phase 1. (This is normal on first run or when called from `dx-init`.)\n- **If `project:` section exists:** Display the current values and ask: **(A) Keep as-is**, **(B) Re-detect** (re-reads source files), **(C) Edit** (re-confirm with current values pre-loaded). If A: skip to Phase 4 (rule substitution only).\n\n## Phase 1: Detect Project Type\n\n### 1a. Auto-detect (or use argument)\n\nIf the user provided an argument (`aem-fullstack`, `aem-frontend`, `frontend`), use it. Otherwise detect:\n\n| Check | Type |\n|---|---|\n| `pom.xml` exists AND contains `com.adobe.cq` or AEM `uber-jar` dependency | `aem-fullstack` |\n| `pom.xml` exists AND contains `content-package-maven-plugin` AND no Java source in `src\u002Fmain\u002Fjava\u002F` | `aem-frontend` |\n| `package.json` exists AND contains `aem-clientlib-generator` or `clientlib.config.js` exists | `aem-frontend` |\n| `package.json` exists AND no AEM indicators | `frontend` |\n| Only `pom.xml` (no AEM) | `java` |\n\n### 1b. Extract details per project type\n\n**For `aem-fullstack`:**\n\n```bash\n# Find Java package root\nfind . -path \"*\u002Fsrc\u002Fmain\u002Fjava\u002F*.java\" | head -1\n# → extract package from first line of that file\n\n# Find component namespace from filter.xml or .content.xml\ngrep -r \"componentGroup\" --include=\"*.xml\" -l | head -5\n\n# Find base branch\ngit symbolic-ref refs\u002Fremotes\u002Forigin\u002FHEAD 2>\u002Fdev\u002Fnull | sed 's|refs\u002Fremotes\u002Forigin\u002F||'\n\n# Find Maven modules\nfind . -maxdepth 3 -name \"pom.xml\" | grep -v \"^.\u002Fpom.xml\"\n```\n\nRead 2-3 `.content.xml` files with `componentGroup` to extract:\n- `componentGroup` — the group name string (e.g., `\"MyProject General\"`)\n- `componentPath` — derive from the file path (e.g., `\u002Fapps\u002Fmyproject\u002Fcomponents`)\n- `componentSelector` — from `@Exporter` annotation in any Java `@Model` class\n- `serviceVendor` — from `@Component(property = \"service.vendor=...\")` in any Java class\n- `dialogPropertyPrefix` — check if dialog XML uses `.\u002Fdata\u002F` nesting or `.\u002F` directly\n- `rteInheritancePath` — search for `sling:resourceSuperType` containing `rteConfigs`\n- `authorPort` — from `pom.xml` properties (default 4502)\n\nExtract build commands from `pom.xml` and `package.json` (if frontend submodule exists):\n- `build.full` — `mvn clean install -PautoInstallPackage` (with correct `-pl` if multi-module)\n- `build.deploy` — `mvn clean install -PautoInstallPackage -DskipTests` (quick deploy, no tests)\n- `build.compile` — frontend compile if `package.json` submodule exists\n- `build.test` — `mvn test -pl \u003Ccore-module>`\n- `build.testSingle` — `mvn test -pl \u003Ccore-module> -Dtest={className}`\n- `build.lint` — from `package.json` scripts if frontend submodule exists\n\nExtract modules list from child `pom.xml` files:\n```bash\nfind . -maxdepth 3 -name \"pom.xml\" ! -path \".\u002Fpom.xml\" \\\n  -exec grep -l \"packaging\" {} \\; | sort\n```\nFor each, read packaging type: `bundle`, `content-package`, `jar`.\n\nExtract `sourceRoots`, `testRoots`, `componentPaths` from the module paths found.\n\n**For `aem-frontend`:**\n\nRead `package.json` scripts to extract build, lint, test commands.\nRead webpack\u002Fclientlib config to find component output paths.\nNo Java extraction needed — omit `aem.javaPackage`, `aem.componentSelector`, etc.\n\n**For `frontend`:**\n\nRead `package.json` for framework, scripts (build, test, lint, dev).\nRead `tsconfig.json` if present for TypeScript confirmation.\nRead directory structure (`src\u002F`, `app\u002F`, `pages\u002F`, `components\u002F`) for source roots.\n\n### 1c. Git and SCM details\n\n```bash\n# Base branch\ngit symbolic-ref refs\u002Fremotes\u002Forigin\u002FHEAD 2>\u002Fdev\u002Fnull | sed 's|refs\u002Fremotes\u002Forigin\u002F||'\n\n# Branch prefix from recent branches\ngit branch -r | grep -E \"feature\u002F|bugfix\u002F\" | head -5\n```\n\nRead `scm.base-branch` from `.ai\u002Fconfig.yaml` as fallback.\n\n## Phase 2: Confirm with User\n\nPrint all detected values as a table. Ask: **\"Correct? Type 'yes' or correct any values.\"**\n\n```markdown\n## Detected: \u003Cproject type>\n\n| Property | Value |\n|---|---|\n| Project Type | \u003Ctype> |\n| Name | \u003Cname from config.yaml> |\n| Build (full) | `\u003Ccommand>` |\n| Build (compile) | `\u003Ccommand or \"—\">` |\n| Test | `\u003Ccommand>` |\n| Test (single) | `\u003Cpattern>` |\n| Lint | `\u003Ccommand or \"none\">` |\n| Base Branch | \u003Cbranch> |\n| Source Roots | \u003Clist> |\n| Test Roots | \u003Clist> |\n| Component Paths | \u003Clist> |\n\u003CAEM-only rows:>\n| Java Package | \u003Cpackage> |\n| Component Path | \u003Cpath> |\n| Component Group | \u003Cgroup> |\n| Selector | \u003Cselector or \"—\"> |\n| Service Vendor | \u003Cvendor or \"—\"> |\n| Dialog Property Prefix | \u003Cprefix> |\n| AEM Author Port | \u003Cport> |\n```\n\n## Phase 3: Update .ai\u002Fconfig.yaml with project profile\n\n### 3a. Derive project role\n\nDerive `project.role` from `project.type`:\n\n| project.type | project.role |\n|---|---|\n| aem-fullstack | fullstack |\n| aem-frontend | frontend |\n| frontend | frontend |\n| java | backend |\n| (other) | Ask user to confirm |\n\nConfirm with user: \"Detected project role: **{role}**. Is this correct?\"\n\n### 3b. Read existing config.yaml\n\nRead `.ai\u002Fconfig.yaml` in full. You will append\u002Fupdate sections — never overwrite the entire file.\n\n### 3c. Update config.yaml sections\n\nAdd or update the following sections in `.ai\u002Fconfig.yaml`. Preserve all existing sections (`dx:`, `scm:`, `build:`, `aem:`, etc.) — only add\u002Fupdate the fields listed below.\n\n**Add `project:` section** (add after `dx:` section, or update if it already exists):\n\n```yaml\nproject:\n  type: \"{{type}}\"           # aem-fullstack | aem-frontend | frontend | java\n  role: \"{{role}}\"           # fullstack | frontend | backend (derived above)\n```\n\n**Add `toolchain:` section** (add after `project:` section):\n\n```yaml\ntoolchain:\n  node-version: \"{{version}}\"          # detected from .nvmrc, .node-version, or package.json engines\n  build-tool: \"{{tool}}\"               # webpack | vite | maven | gradle | etc.\n  css-compiler: \"{{compiler}}\"         # sass | less | postcss | none\n  component-base-class: \"{{class}}\"    # e.g. \"com.adobe.cq.export.json.ComponentExporter\" (AEM only, omit if N\u002FA)\n```\n\nOnly include fields that were actually detected. Omit fields with no detected value.\n\n**Update `build:` section** — append these granular fields to the existing `build:` section if detected:\n\n```yaml\nbuild:\n  # ... existing fields (command, test, etc.) stay as-is ...\n  serve: \"{{command}}\"        # dev server command (e.g. \"npm run dev\")\n  lint-js: \"{{command}}\"      # JS\u002FTS linting (e.g. \"npm run lint:js\")\n  lint-scss: \"{{command}}\"    # SCSS\u002FCSS linting (e.g. \"npm run lint:scss\")\n  lint-fix: \"{{command}}\"     # auto-fix linting (e.g. \"npm run lint:fix\")\n```\n\nOnly add fields that were detected from `package.json` scripts or build configs. Do not add fields with empty values.\n\n**Update `aem:` section** — if project type is `aem-fullstack` or `aem-frontend` and the `aem:` section already exists, add\u002Fupdate `component-prefix` if a prefix was detected (e.g., from component group or path convention). Do NOT duplicate fields that already exist in the `aem:` section (`java-package`, `component-path`, `component-group` are already managed by `\u002Faem-init`).\n\n**Fields NOT written** (derivable from filesystem, dropped per spec): `modules`, `sourceRoots`, `testRoots`, `componentPaths`, `source`, `output`, `component.registration`.\n\nPrint: `Updated .ai\u002Fconfig.yaml with project profile`\n\n## Phase 4: Update Template-Seeded Files\n\nRe-generate files seeded from plugin templates. These are the plugin's responsibility (not user-customized), so they always reflect the latest template.\n\n### 4a. Regenerate agent.index.md\n\nRead `templates\u002FINDEX.md.template` from the plugin directory. Replace `{{PROJECT_NAME}}` with `dx.project-name` from `.ai\u002Fconfig.yaml`. Write to `agent.index.md` (project root). Always overwrite.\n\n### 4b. Regenerate .ai\u002FREADME.md\n\nRead `templates\u002FREADME.md.template` from the plugin directory. Replace `{{PROJECT_NAME}}` with the project name. Write to `.ai\u002FREADME.md`. Always overwrite.\n\n### 4c. Re-run scaffold for new static files\n\nRun scaffold.sh to pick up any new rule templates or utilities added since last init:\n\n```bash\nbash skills\u002Fdx-init\u002Fscripts\u002Fscaffold.sh\n```\n\nEach file is skipped if it already exists — only newly added templates are installed.\n\n## Phase 5: Filter and Verify .claude\u002Frules\u002F\n\n### 5a. Filter rules by project type\n\nRead `project.type` from `.ai\u002Fconfig.yaml`.\n\n| project.type | Action |\n|---|---|\n| `aem-fullstack` | Keep all rules. No deletions. |\n| `aem-frontend` | Delete all `be-*.md` rules in `.claude\u002Frules\u002F`. Keep `fe-*.md`, `accessibility.md`, `naming.md`. |\n| `frontend` | Delete all `be-*.md` and `fe-clientlibs.md` rules. Keep `accessibility.md`, `naming.md`. |\n| `java` | Delete all `fe-*.md` rules. Keep `be-*.md`, `accessibility.md`, `naming.md`. |\n\nUse Glob to list matching files, then delete those that don't apply. If no files match the deletion criteria, report \"no rules to filter\".\n\n### 5b. Verify project values in rules\n\nRead each `.claude\u002Frules\u002F*.md` file that was installed from an aem-init template. Verify that project-specific values from `.ai\u002Fconfig.yaml` are present — not generic placeholders. Check for:\n\n- Java package name (should match `aem.java-package` from config.yaml `aem:` section)\n- Component path (should match `aem.component-path` from config.yaml `aem:` section)\n- Component group (should match `aem.component-group` from config.yaml `aem:` section)\n\nOther substitution values are read from `.ai\u002Fconfig.yaml`:\n- `project.type`, `project.role` — from the `project:` section\n- `toolchain.*` values — from the `toolchain:` section\n- `build.*` values — from the `build:` section\n\nIf any file still contains generic examples instead of real project values, substitute them with values from `.ai\u002Fconfig.yaml`. If a file already has correct project-specific values, skip it silently.\n\n## Phase 6: Report\n\n```markdown\n## Project Adapted: \u003Cname>\n\n**Type:** \u003Ctype>\n**Role:** \u003Crole>\n**Config:** `.ai\u002Fconfig.yaml` updated (project + toolchain sections)\n\n### Rules Updated\n\u003Clist of .claude\u002Frules\u002F files modified with substitutions made>\n\u003Clist of files skipped (already customized)>\n\n### Next Steps\n- Review `project:` and `toolchain:` sections in `.ai\u002Fconfig.yaml` — edit and re-run `\u002Fdx-adapt` if any values need correction\n- `\u002Fdx-init` — re-run if base config.yaml needs changes\n- `\u002Faem-init` — re-run if AEM rule templates need reinstalling\n```\n\n## Examples\n\n1. `\u002Fdx-adapt` — First run after `\u002Fdx-init`. Scans the codebase to detect 3 brands, 45 components, Node 10 with Gulp build. Updates `config.yaml` with `project:` and `toolchain:` sections, then substitutes placeholders in `.claude\u002Frules\u002F` files (e.g., `{{BRANDS}}` becomes the actual brand list, `{{BUILD_COMMAND}}` becomes `npm run build:new`).\n\n2. `\u002Fdx-adapt` (re-run after adding a new brand) — Detects existing `project:` section in config.yaml, asks whether to re-detect or keep existing values. User chooses re-detect. Finds the new brand directory, updates config.yaml, and re-runs Phase 4 substitution to update rules files with the expanded brand list.\n\n3. `\u002Fdx-adapt` (AEM project) — Detects AEM project structure during Phase 1. After Phase 3 (config.yaml updated), automatically chains to `\u002Faem-init` to install AEM-specific rules before Phase 4 runs substitution on all rule files including AEM ones.\n\n## Troubleshooting\n\n- **\"project profile already exists — re-detect or keep?\"**\n  **Cause:** `\u002Fdx-adapt` was run before and detection results are saved in config.yaml's `project:` section.\n  **Fix:** Choose \"re-detect\" if the project structure changed (new components, new brands). Choose \"keep\" if you only want to re-run the substitution phase (Phase 4) with existing values.\n\n- **Placeholders left in rule files after adaptation**\n  **Cause:** The value could not be extracted from the codebase (e.g., no brands found, build tool not recognized).\n  **Fix:** Check `project:` and `toolchain:` sections in `.ai\u002Fconfig.yaml` for missing values. Fill them in manually and re-run `\u002Fdx-adapt` — Phase 4 will substitute using the updated values.\n\n- **Rule file skipped during substitution**\n  **Cause:** The rule file has no remaining placeholders (already customized) or was manually edited.\n  **Fix:** This is expected behavior — `\u002Fdx-adapt` never overwrites user customizations. If you want to re-apply the template, delete the rule file and run `\u002Fdx-adapt` again (it will reinstall from the plugin template first).\n\n## Rules\n\n- **Read real source files** — extract values from actual code, not defaults\n- **Never overwrite user customizations** — if a rule file has no matching placeholder, skip it\n- **Idempotent** — safe to re-run; Phase 0 check skips detection if config.yaml already has a `project:` section (unless user chooses re-detect)\n- **Phase 4 is always run** — even if project profile already exists in config.yaml, substitution runs on re-run (user may have reinstalled rules)\n- **Graceful on missing data** — if a value can't be extracted, leave the placeholder and note it in the report\n",{"name":5,"description":7,"when_to_use":49,"allowed-tools":50,"argument-hint":52,"disable-model-invocation":53},"Use when auto-detecting project structure and build commands, when refreshing detected values after restructuring, when the user says 'detect project type', 'update config from project', or 'adapt to this codebase'.",[37,35,38,36,51],"agent","[aem-fullstack|aem-frontend|frontend] (optional — auto-detects if omitted)",true,"main","a99cabc3f459fbeaa42b13a1604db1bccb6a364b","plugins\u002Fdx-core\u002Fskills\u002Fdx-adapt",3,"https:\u002F\u002Fgithub.com\u002Feasingthemes\u002Fdx-aem-flow","https:\u002F\u002Fgithub.com\u002Feasingthemes","https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fdraganfilipovic\u002F","Agentic SDLC platform in production. I build agent-ready codebases. AEM MCP Server author.","2026-11-11 09:59:48",{"source":8,"skillName":5,"commands":64,"prompt":74,"zipAvailable":53},[65,68,71],{"tool":66,"command":67},"npx","npx skills add easingthemes\u002Fdx-aem-flow --skill dx-adapt",{"tool":69,"command":70},"bunx","bunx skills add easingthemes\u002Fdx-aem-flow --skill dx-adapt",{"tool":72,"command":73},"pnpm","pnpm dlx skills add easingthemes\u002Fdx-aem-flow --skill dx-adapt","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Feasingthemes\u002Fdx-aem-flow\u002Fblob\u002Fmain\u002Fplugins\u002Fdx-core\u002Fskills\u002Fdx-adapt\u002FSKILL.md",[],[77,100,120,142,157,172],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":44},"01M6H48W19F46A7B7TSSQAMYRW","dx-hub-status","Show hub dispatch status — which repos are running, done, blocked or failed. Use for 'hub status', 'what's running'.","https:\u002F\u002Fgithub.com\u002Feasingthemes\u002Fdx-aem-flow\u002Fblob\u002Fmain\u002Fplugins\u002Fdx-hub\u002Fskills\u002Fdx-hub-status\u002FSKILL.md",[],[26,84,85,86,87,88,89,90,91,92,93,94,95,96,97,37,36,98,99],"dx hub status","hub","status","hub status","which","show","for","ticket","clean","use","done","Bash","id","dispatch","repos","grep",{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":44},"01M6H48R6ZH7YMVPMVWMMWT3RA","dx-hub-init","Initialize a hub directory for multi-repo orchestration. Discovers sibling repos, merges configs, validates CLI compatibility. Use when setting up hub mode for the first time. Trigger on \"init hub\", \"set up hub\", \"multi-repo setup\".","https:\u002F\u002Fgithub.com\u002Feasingthemes\u002Fdx-aem-flow\u002Fblob\u002Fmain\u002Fplugins\u002Fdx-hub\u002Fskills\u002Fdx-hub-init\u002FSKILL.md",[],[42,107,26,108,85,109,110,111,112,113,114,115,116,117,95,118,119,37,36,35],"hub init","dx hub init","SET","time","mode","default","up","repo setup","orchestration","configure","multi-repo","cli","directory",{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":129,"publishedAt":44},"01M6H48K267CWEF8YNN3Y49BVT","dx-hub-dispatch","Dispatch a ticket to several repos — open an independent Claude session per repo in VS Code terminals. Use for 'hub dispatch', 'work on ticket across repos'.","https:\u002F\u002Fgithub.com\u002Feasingthemes\u002Fdx-aem-flow\u002Fblob\u002Fmain\u002Fplugins\u002Fdx-hub\u002Fskills\u002Fdx-hub-dispatch\u002FSKILL.md",[126],{"categoryNo":127,"categoryName":128,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[26,130,97,85,131,90,132,133,134,91,135,136,93,137,95,138,139,140,96,141],"dx hub dispatch","ado","repo","work on","session","open","MCP","URL","vscode","code","across","work",{"skillNo":143,"name":144,"nameZh":6,"description":145,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":146,"categories":147,"keywords":148,"publishedAt":44},"01M6H48FAWKTT6AAWT3H80ZKE0","dx-hub-config","View and edit hub configuration — add repos, adjust terminal delay. Use to manage hub settings. Trigger on \"hub config\", \"add repo to hub\", \"terminal delay\".","https:\u002F\u002Fgithub.com\u002Feasingthemes\u002Fdx-aem-flow\u002Fblob\u002Fmain\u002Fplugins\u002Fdx-hub\u002Fskills\u002Fdx-hub-config\u002FSKILL.md",[],[26,149,85,41,89,150,132,151,152,153,154,93,116,95,155,37,156,36,35,98],"dx hub config","view","manage","trigger","true","adjust","terminal","settings",{"skillNo":158,"name":159,"nameZh":6,"description":160,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":161,"categories":162,"keywords":163,"publishedAt":44},"01M6H48BNMYEJY6CCWPYHNQDAT","dx-discover-repos","Resolve which repos a work item touches (explicit directive → simple block → cross-repo table → LLM). Used by the KAI-HUB router to fan an agent out across repos; 'which repos'.","https:\u002F\u002Fgithub.com\u002Feasingthemes\u002Fdx-aem-flow\u002Fblob\u002Fmain\u002Fplugins\u002Fdx-hub\u002Fskills\u002Fdx-discover-repos\u002FSKILL.md",[],[164,26,165,98,88,132,140,166,96,167,141,168,85,169,170,171],"discover","dx discover repos","router","directive","simple","block","sonnet","table",{"skillNo":173,"name":174,"nameZh":6,"description":175,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":176,"categories":177,"keywords":179,"publishedAt":44},"01M6H487QA1FDSBT1HTZGW4HAQ","dx-upgrade","Upgrade a consumer project to the installed plugin versions — run dx-doctor, fix stale and missing files, list manual actions. Use after upgrading plugins.","https:\u002F\u002Fgithub.com\u002Feasingthemes\u002Fdx-aem-flow\u002Fblob\u002Fmain\u002Fplugins\u002Fdx-core\u002Fskills\u002Fdx-upgrade\u002FSKILL.md",[178],{"categoryNo":127,"categoryName":128,"taxonomyType":21,"taxonomyTypeDesc":22},[180,26,181,32,182,38,183,184,27,40,37,36,35,185,186,187,188,93,189,190],"upgrade","dx upgrade","actions","fix","files","list","doctor","manual","missing","plugin","plugins"]