From dx-core
Upgrade consumer project to latest plugin versions — runs dx-doctor, then fixes stale files, installs missing files, and reports what needs manual action. Use after upgrading plugins.
npx claudepluginhub easingthemes/dx-aem-flow --plugin dx-coreThis skill is limited to using the following tools:
You upgrade a consumer project's dx workflow files to match the latest installed plugin versions. You diagnose first (dx-doctor), then fix issues with smart handling of user-customized files.
Bumps Agent Alchemy plugin versions across 5 locations each, detects drift, applies updates, adds CHANGELOG entries, and creates conventional commits.
Smart update for SDLC wizard — shows changelog, compares files, lets you selectively adopt changes while preserving customizations.
Applies organization-wide rules from merge-rules output to current project. Detects tech stack, merges Principles, cleans .local.md patterns, and fixes non-conforming files.
Share bugs, ideas, or general feedback.
You upgrade a consumer project's dx workflow files to match the latest installed plugin versions. You diagnose first (dx-doctor), then fix issues with smart handling of user-customized files.
Glob — never [ -f ], test -f, or Bash test commandsRead — never cat or head in BashWrite — never echo > or cat <<EOF in BashRead, compare in-context — never shell diffchmod +x on scripts, bash to run install scripts (steps 3e), and git commandsRead/Write/Glob tools in parallel when independent — do not serialize into one Bash command with &&/||Run the full /dx-doctor flow inline with the same scope argument the user passed. Collect all issues into three categories:
| Category | Description | Examples |
|---|---|---|
| Auto-fix | Plugin-owned files that can be updated without asking | Stale utility scripts, stale seed data, stale universal rules, missing template-generated files |
| Needs confirmation | Files the user may have intentionally customized | Stale shared rules (.ai/rules/*), stale AEM convention rules |
| Manual action | Issues that cannot be auto-fixed | Missing gitignore entries, missing config sections, broken branch references |
If dx-doctor reports zero issues:
✓ All checks passed. Nothing to upgrade.
STOP.
Before applying any fixes, present a summary table for each category:
## Upgrade Plan
### Auto-fix (no confirmation needed)
| File | Issue | Fix |
|------|-------|-----|
| .ai/lib/audit.sh | stale | Update from plugin |
| .ai/project/component-index.md | stale | Update from plugin data |
| .github/agents/ | 4 new, 2 stale | Install new + update stale from templates |
### Needs confirmation
| File | Issue | Action |
|------|-------|--------|
| .ai/rules/pr-answer.md | stale | Show diff, ask |
| .claude/rules/be-components.md | stale | Show diff, ask |
### Manual action required
| Issue | Suggested Fix |
|-------|--------------|
| .ai/run-context/ not in .gitignore | Add to .gitignore manually |
| Missing project seed data | Run /aem-init or /aem-refresh |
Ask: Proceed with auto-fixes? (the confirmation items will be handled one-by-one next)
If the user declines, STOP.
If .ai/project.yaml exists (NOT .ai/project/project.yaml):
.ai/project.yaml.ai/config.yamltype → project.type (add to project: section)role → project.role (derive from type if not set: aem-frontend→frontend, aem-fullstack→fullstack, java→backend)toolchain.* → toolchain: section (add new top-level section)build.serve → build.serve (add if not present)build.lint-js → build.lint-js (add if not present)build.lint-scss → build.lint-scss (add if not present)build.lint-fix → build.lint-fix (add if not present)component.base-class → toolchain.component-base-classrepos: section exists in .ai/config.yaml:
capabilities: exists but role: does not:
role: field, remove capabilities:.ai/config.yaml.ai/project.yaml → .ai/project.yaml.migratedFind each plugin root directory (same method as dx-doctor):
**/skills/dx-doctor/SKILL.md, navigate up 3 levels**/skills/aem-init/SKILL.md, navigate up 3 levels**/skills/auto-init/SKILL.md, navigate up 3 levelsThese are plugin-owned files — update without asking.
For each stale or missing script:
| Installed | Plugin Source | Post-copy |
|---|---|---|
.ai/lib/audit.sh | <dx-plugin>/data/lib/audit.sh | chmod +x |
.ai/lib/dx-common.sh | <dx-plugin>/data/lib/dx-common.sh | chmod +x |
.ai/lib/pre-review-checks.sh | <dx-plugin>/data/lib/pre-review-checks.sh | chmod +x |
.ai/lib/plan-metadata.sh | <dx-plugin>/data/lib/plan-metadata.sh | chmod +x |
.ai/lib/gather-context.sh | <dx-plugin>/data/lib/gather-context.sh | chmod +x |
.ai/lib/ensure-feature-branch.sh | <dx-plugin>/data/lib/ensure-feature-branch.sh | chmod +x |
.ai/lib/queue-pipeline.sh | <dx-plugin>/data/lib/queue-pipeline.sh | chmod +x |
.claude/hooks/stop-guard.sh | <dx-plugin>/data/hooks/stop-guard.sh | chmod +x |
Read the plugin source file, Write to the installed location.
Comment-only differences: If dx-doctor reported the script as ✓ up to date (project-specific examples) — meaning the only differences are in comment lines where the project uses real infrastructure names (e.g., kai-dedupe) instead of the plugin's generic placeholders (e.g., myai-dedupe) — do NOT overwrite. The project-specific names are intentional and correct. Only update scripts that have functional code changes.
For each stale or missing output template in .ai/templates/:
For each subdirectory (spec/, wiki/, ado-comments/):
.ai/templates/<subdir>/ if missing*.template file in <dx-plugin>/data/templates/<subdir>/:
.ai/templates/<subdir>/<name>These are plugin-owned format definition files — always update without asking.
| Installed | Plugin Source |
|---|---|
.claude/rules/reuse-first.md | <dx-plugin>/templates/rules/universal-reuse-first.md.template |
Read template, Write to installed location.
.ai/project/ exists and aem.docs-repo is configured)Seed data files in .ai/project/ are project-specific — they are NOT copied from a plugin directory. To refresh them, use /aem-refresh which pulls from the docs repo or a local path.
Report: ℹ Seed data refresh is handled by /aem-refresh, not dx-upgrade.
Check dx.version in .ai/config.yaml:
<dx-plugin>/skills/dx-sync/scripts/migrate-config.shdx.version to current plugin version✓ Config migrated from <old-version> → <new-version>✓ Config version up to date (<version>)Migration script location: <dx-plugin>/skills/dx-sync/scripts/migrate-config.sh — this is the same script used by /dx-sync. Running /dx-upgrade on a single repo applies the same migrations that /dx-sync would apply across all consumers.
Use a recursive glob to find all templates: <aem-plugin>/templates/rules/**/*.md.template
For each .md.template file found:
.template extension to get the destination filename<aem-plugin>/templates/rules/ → .claude/rules/
shared/audit.md.template → .claude/rules/audit.mdshared/qa-basic-auth.md.template → .claude/rules/qa-basic-auth.mdbe/be-components.md.template → .claude/rules/be-components.mdfe/fe-tokens.md.template → .claude/rules/fe-tokens.md.claude/rules/, not in a subdir)If .github/agents/ exists (Copilot was enabled):
Agents: Run the agent install script:
bash <dx-plugin>/skills/dx-init/scripts/install-copilot-agents.sh --force <dx-plugin>
The --force flag overwrites stale agents with latest templates.
For missing (not stale) template-generated files:
| Missing File | Plugin Source | Action |
|---|---|---|
.ai/me.md | — | Create with the demo template (same as dx-init step 5e) |
If .claude/settings.json is missing or lacks attribution:
{"attribution": {"commit": "", "pr": ""}}attribution key, Write back (preserve other settings)Check .claude/settings.local.json:
.claude/settings.local.json".QA_BASIC_AUTH_USER, QA_BASIC_AUTH_PASS, QA_BASIC_AUTH_FALLBACK_USER, QA_BASIC_AUTH_FALLBACK_PASS, AXE_API_KEY. If project has aem: section in config, also add: AEM_INSTANCES (with default value local:http://localhost:4502:admin:admin,qa:https://qa-author.example.com:USER:PASS). Report count of new keys added (or "up to date").If .mcp.json org mismatch was detected:
.mcp.json, update the org in the ado server args, Write backIf .mcp.json is missing and scm.provider is ado:
scm.org from configFor each file flagged as "needs confirmation" — these are files the user may have intentionally edited:
.ai/rules/*.md)For each stale shared rule:
<dx-plugin>/templates/rules/<name>.md.template)If the file has AEM sections appended (for pr-review.md and pr-answer.md):
## AEM or ## Sling heading).claude/rules/)For each stale AEM rule found via <aem-plugin>/templates/rules/**/*.md.template (e.g., be/be-*.md.template, fe/fe-*.md.template, shared/naming.md.template, shared/accessibility.md.template):
.claude/rules/<name>.md) and corresponding templateIf .ai/automation/policy/pipeline-policy.yaml is flagged:
When upgrading automation files, read automationProfile from .ai/automation/infra.json (if it exists). Adapt checks:
pr-only / pr-delegation): Do NOT flag missing Lambda handlers, agent step directories, or AWS resource scripts as issues. These are hub-only files and are intentionally absent. DO check that consumer has a webhooks.pr-answer entry in infra.json (added in v2.10) — if missing, add it as a manual action: "Run /auto-webhooks to create repo-scoped PR Answer hook."If .ai/automation/infra.json exists and has webhooks.pr-answer WITHOUT a filter field containing repository:
/auto-webhooks to create a repo-scoped hook filtered to this repo + base branch."This applies to both hub and consumer profiles — all repos should have their own repo-scoped PR Answer hook.
List all issues that cannot be auto-fixed. These require the user to take action:
### Manual Actions Required
1. **Add to .gitignore:** `.ai/run-context/`
2. **Run /aem-init:** project seed data is missing
3. **Run /auto-init:** .ai/automation/infra.json not found
4. **Verify branch:** scm.base-branch 'develop' not found in remotes — check .ai/config.yaml
5. **Check build config:** build.command uses 'mvn' but pom.xml not found
For missing config sections, always suggest running the appropriate init skill — dx-upgrade does not create config sections (that requires interactive user input from the init flow).
## Upgrade Complete
| Action | Count |
|--------|-------|
| Files updated | 5 |
| Files created | 1 |
| Files skipped (kept by user) | 1 |
| Manual actions remaining | 2 |
### Updated
- .ai/lib/audit.sh ← from plugin
- .claude/hooks/stop-guard.sh ← from plugin
- .ai/project/component-index.md ← from plugin data
- .ai/project/markets.md ← from plugin data
- .claude/rules/be-components.md ← from plugin template
### Created
- .ai/me.md ← demo template
### Kept (user's version)
- .ai/rules/pr-review.md
### Manual Actions Required
1. Add `.ai/run-context/` to .gitignore
2. Verify `scm.base-branch` in .ai/config.yaml
→ Run /dx-doctor to verify
/dx-upgrade all — Runs dx-doctor across all plugins, finds 3 stale utility scripts and 2 missing Copilot agents. Presents the fix plan, auto-updates plugin-owned files, shows diffs for 1 customized rule file (user chooses "Keep"), and lists 1 manual action (missing gitignore entry).
/dx-upgrade dx — Scopes the upgrade to only the dx-core plugin. Updates audit.sh and stop-guard.sh from plugin data, installs 4 new Copilot skill templates, and reports "Suggest re-run: /dx-doctor to verify."
/dx-upgrade aem — Scopes to the dx-aem plugin. Updates stale AEM convention rules in .claude/rules/, preserves user-customized pr-review.md AEM section, and reports seed data refresh should be done via /aem-refresh.
Copilot CLI's /plugin marketplace update may fail for local marketplaces with "Failed to fetch git marketplace". To update plugins in Copilot CLI, uninstall and reinstall:
/plugin uninstall dx-core
/plugin uninstall dx-aem
/plugin install dx-core@dx-aem-flow
/plugin install dx-aem@dx-aem-flow
This picks up the latest version from the local marketplace source.
"All checks passed. Nothing to upgrade." Cause: All project files match the latest plugin versions. Fix: No action needed. This is the desired state after a successful upgrade.
Customized rule file shows unexpected diff
Cause: Both the plugin template and the user have made changes to the same file.
Fix: Choose option (C) "Show diff" to see both versions side by side, then decide to keep your version or replace with the template. You can also choose to write the template as .template and manually merge.
"Missing config section" reported as manual action
Cause: A newer plugin version introduced a config section (e.g., aem: or automation:) that doesn't exist in your .ai/config.yaml.
Fix: Run the appropriate init skill (/aem-init, /auto-init) to interactively add the missing config section.
/dx-doctor to verify"