Skip to content

feat: add comprehensive replication skills for AEM 6…#48

Open
abhishekgarg18 wants to merge 5 commits intoadobe:betafrom
abhishekgarg18:feature/aem-replication-skills-6.5-lts
Open

feat: add comprehensive replication skills for AEM 6…#48
abhishekgarg18 wants to merge 5 commits intoadobe:betafrom
abhishekgarg18:feature/aem-replication-skills-6.5-lts

Conversation

@abhishekgarg18
Copy link
Copy Markdown
Collaborator

@abhishekgarg18 abhishekgarg18 commented Apr 9, 2026

Add AEM 6.5 LTS Replication Skills

Adds comprehensive replication skills for AEM 6.5 LTS customers, integrated into the existing aem-6-5-lts plugin.

Architecture

Follows the established pattern from dispatcher and aem-workflow skills:

aem-replication/
├── SKILL.md                           # Router with Intent Router table
├── README.md                          # Getting started guide
├── configure-replication-agent/       # Configure agents (671 lines)
├── replicate-content/                 # Activate/deactivate content (876 lines)
├── replication-api/                   # Programmatic API usage (1,750 lines)
├── troubleshoot-replication/          # Diagnose and fix issues (852 lines)
├── replication-orchestrator/          # End-to-end workflows (469 lines)
└── references/replication-foundation/ # Shared references (900+ lines)
    ├── agent-types.md
    ├── queue-mechanics.md
    ├── 65-lts-guardrails.md
    └── api-reference.md

Key Design Decisions:

  • References Foundation: Eliminates duplication across 900+ lines by centralizing agent types, queue mechanics, guardrails, and API quick reference
  • Orchestrator Sub-Skill: Coordinates multi-step workflows (new environment setup, incident response, performance optimization, migration preparation)
  • Intent Router: Clear navigation via table mapping user intent to specialist skills

Complete Feature Set

Sub-Skills

Sub-Skill Purpose Lines Key Features
configure-replication-agent Configure replication agents 671 Default agents, Dispatcher Flush, Reverse replication, Multi-publish setup, Security best practices
replicate-content Activate/deactivate content 876 Quick Publish, Manage Publication, Tree Activation, Package Manager, Workflows, Scheduled activation, CURL examples with JSON validation
replication-api Programmatic API usage 1,750 49 complete Java examples, Replicator/ReplicationOptions/ReplicationStatus APIs, ResourceResolver lifecycle, Error handling patterns, Service user configuration
troubleshoot-replication Diagnose and fix issues 852 Blocked queues, Connection errors, SSL issues, Dispatcher cache, Performance optimization, 12+ troubleshooting scenarios
replication-orchestrator End-to-end workflows 469 New environment setup, Production incidents, Performance tuning, Cloud migration preparation

Foundation References

Reference Purpose Lines
agent-types.md Agent type reference 150+
queue-mechanics.md Queue behavior 250+
65-lts-guardrails.md Best practices & limits 309
api-reference.md API quick reference 400+

Code Quality & Security

Java Code Examples (49 total)

  • ✅ Complete imports for copy-paste readiness
  • ✅ Comprehensive Javadoc on custom methods
  • ✅ Defensive programming (null checks, empty list validation)
  • ✅ ResourceResolver lifecycle management (try-with-resources)
  • ✅ Error handling patterns with comparison table (exceptions vs return codes vs HTTP status)
  • ✅ Thread-blocking implications documented for synchronous replication

Security Best Practices

  • ✅ Service user configuration in correct OSGi JSON format (not invalid XML)
  • ✅ "NEVER DO THIS" anti-patterns with explanations
  • ✅ Environment variables instead of hardcoded credentials ($AEM_USER:$AEM_PASSWORD)
  • ✅ JMX security considerations with production access guidance
  • ✅ Input validation with resource type checking

Error Handling & Resilience

  • ✅ Three recovery patterns: retry with exponential backoff, fallback to async, circuit breaker
  • ✅ JSON response validation in CURL examples (not just HTTP status codes)
  • ✅ Comprehensive error handling pattern guidance

Operational Readiness

  • ✅ Queue listener pattern for event-driven monitoring
  • ✅ JMX MBean references for metrics collection
  • ✅ Alert threshold guidance (queue depth > 20)
  • ✅ Performance considerations and batch size limits

Migration & Forward-Looking Design

  • AEM as a Cloud Service Migration: Official Adobe Cloud Service documentation links (not non-existent internal references)
  • End-of-Life Planning: AEM 6.5 LTS extended support ends 2029
  • Abstraction Recommendations: Reduce migration effort by avoiding agent ID filtering and tight coupling
  • API Stability Tracking: Guidance on checking release notes for deprecations across 6.5.x service packs

Documentation Sources

All content 100% based on official Adobe AEM 6.5 LTS documentation:

Changes

New Files (13 total):

  • skills/aem/6.5-lts/skills/aem-replication/README.md
  • skills/aem/6.5-lts/skills/aem-replication/SKILL.md
  • skills/aem/6.5-lts/skills/aem-replication/configure-replication-agent/SKILL.md
  • skills/aem/6.5-lts/skills/aem-replication/replicate-content/SKILL.md
  • skills/aem/6.5-lts/skills/aem-replication/replication-api/SKILL.md
  • skills/aem/6.5-lts/skills/aem-replication/troubleshoot-replication/SKILL.md
  • skills/aem/6.5-lts/skills/aem-replication/replication-orchestrator/SKILL.md
  • skills/aem/6.5-lts/skills/aem-replication/references/replication-foundation/agent-types.md
  • skills/aem/6.5-lts/skills/aem-replication/references/replication-foundation/queue-mechanics.md
  • skills/aem/6.5-lts/skills/aem-replication/references/replication-foundation/65-lts-guardrails.md
  • skills/aem/6.5-lts/skills/aem-replication/references/replication-foundation/api-reference.md

Updated Files (2 total):

  • README.md - Added AEM Replication section with sub-skill table and feature list
  • skills/aem/6.5-lts/.claude-plugin/plugin.json - Updated description and added "replication" keyword

Stats

  • 13 files changed (11 new, 2 modified)
  • 6,287 lines added
  • 5,717 lines of skill documentation (including references)
  • 49 Java code examples (OSGi services, servlets, workflow steps, listeners)
  • 8 public APIs fully documented
  • 12+ troubleshooting scenarios with step-by-step resolution
  • 5 commits: Initial feature + 4 rounds of fixes and polish

Commit History

  1. feat: Initial AEM 6.5 LTS replication skills (964be7f)
  2. fix: Address security and compatibility issues (426a4c6) - Service user config, hardcoded credentials, null safety
  3. fix: Correct Maven dependencies - focus on 6.5 LTS (7351e78) - Remove specific versions
  4. refactor: Add references architecture and orchestrator (218c101) - 5 references + orchestrator + lifecycle/error handling docs
  5. docs: Polish with minor enhancements (4392619) - Imports, Javadoc, JSON validation, recovery patterns, JMX security, queue listeners

Abhishek Garg and others added 3 commits April 9, 2026 09:47
….5 LTS

Add four specialist replication skills under skills/aem/6.5-lts/skills/aem-replication:

- configure-replication-agent: Configure replication agents for publishing, dispatcher flush, and reverse replication
- replicate-content: Activate/deactivate content using UI, workflows, and package manager
- replication-api: Use Replication API programmatically with 49 Java code examples
- troubleshoot-replication: Diagnose and fix 12+ common replication issues

Key features:
- 3,575 lines of comprehensive documentation
- All based on official Adobe AEM 6.5 LTS documentation
- Complete coverage of 8 public Replication APIs (Replicator, ReplicationOptions, AgentManager, ReplicationQueue, etc.)
- Router pattern following dispatcher skill structure
- Integrated into aem-6-5-lts plugin

Documentation sources:
- Official AEM 6.5 LTS Replication Guide
- Official AEM 6.5 LTS Troubleshooting Guide
- Official AEM 6.5 LTS JavaDoc API Reference

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Critical fixes:
- Replace hardcoded admin:admin credentials with environment variables in CURL examples
- Add security note about using proper service account credentials

Important fixes:
- Add null checks after resolver.adaptTo(Session.class) calls to prevent NullPointerException
- Add compatibility metadata to router SKILL.md (AEM 6.5 LTS/AMS only, not Cloud Service)
- Add Cloud Service migration guidance section referencing Sling Distribution API
- Add input validation to servlet example (path validation and session null check)
- Update Maven dependencies from 6.5.0 to 6.5.21 with comment to use latest version

These changes address all critical and important issues identified in the PR review,
improving security practices, code safety, and forward-looking guidance for AEM customers.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…ions

- Remove specific version numbers (6.5.0, 6.5.21) from Maven dependencies
- Remove potentially incorrect individual cq-replication artifact
- Keep only uber-jar dependency without version specification
- Add explanation that version should match AEM 6.5 LTS installation
- Maintain focus on '6.5 LTS' as the designation, not point releases

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@abhishekgarg18 abhishekgarg18 force-pushed the feature/aem-replication-skills-6.5-lts branch from 2e10f55 to 7351e78 Compare April 9, 2026 06:09
Abhishek Garg and others added 2 commits April 9, 2026 13:54
…entation

This commit addresses all important review findings except MCP tool contract:

## New Architecture Components

**References Foundation (references/replication-foundation/):**
- agent-types.md: Documentation for Default, Dispatcher Flush, Reverse, Static agents
- queue-mechanics.md: FIFO processing, retry logic, blocking behavior, queue management
- 65-lts-guardrails.md: Service users, timeouts, batch limits, security best practices
- api-reference.md: Quick reference for Replicator, ReplicationOptions, ReplicationStatus

**Replication Orchestrator (replication-orchestrator/SKILL.md):**
- New sub-skill for end-to-end workflows spanning multiple concerns
- Workflow 1: New environment setup (configure → test → troubleshoot)
- Workflow 2: Production incident response (diagnose → fix → verify)
- Workflow 3: Performance optimization (measure → tune → validate)
- Workflow 4: Migration preparation (audit → plan → execute)

## Documentation Enhancements

**Router SKILL.md:**
- Added orchestrator to Intent Router table
- Added Replication Orchestrator to Skill Overview
- Added Foundation References section with links to shared references

**replication-api/SKILL.md:**
- Fixed service user mapping configuration (invalid XML → correct OSGi config)
- Added comprehensive "ResourceResolver Lifecycle Management" section
  - Caller responsibility pattern with JavaDoc examples
  - Try-with-resources pattern (recommended)
  - Manual close pattern (legacy)
  - Resource leak prevention examples
- Added "Error Handling Patterns" section
  - Pattern 1: Throw exceptions (library code)
  - Pattern 2: Return boolean (service layer)
  - Pattern 3: HTTP status codes (servlets/REST)
  - Comparison table and anti-patterns
- Enhanced input validation with resource type checking
  - Added isReplicableResource() helper method
  - Validates cq:Page, dam:Asset, experience fragments
  - Prevents replication of system/config resources

**replicate-content/SKILL.md:**
- Enhanced CURL examples with HTTP status code checking
- Added error handling versions with response validation
- Added simple versions for quick testing (with warnings)
- All examples use environment variables for credentials

## Alignment with Established Patterns

This refactor brings the replication skill set into alignment with dispatcher
and aem-workflow patterns:
- Shared foundation references (like dispatcher-foundation/)
- Orchestrator sub-skill for multi-step workflows
- Separation of reference content from workflow guidance

## Files Changed

Modified:
- skills/aem/6.5-lts/skills/aem-replication/SKILL.md
- skills/aem/6.5-lts/skills/aem-replication/replicate-content/SKILL.md
- skills/aem/6.5-lts/skills/aem-replication/replication-api/SKILL.md

New directories:
- skills/aem/6.5-lts/skills/aem-replication/references/replication-foundation/
- skills/aem/6.5-lts/skills/aem-replication/replication-orchestrator/

New files:
- references/replication-foundation/agent-types.md
- references/replication-foundation/queue-mechanics.md
- references/replication-foundation/65-lts-guardrails.md
- references/replication-foundation/api-reference.md
- replication-orchestrator/SKILL.md

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Address all minor review findings to improve documentation completeness:

Code Examples (replication-api/SKILL.md):
- Add missing import statements to all Java examples for copy-paste readiness
- Add comprehensive Javadoc to isReplicableResource() method
- Add defensive null/empty check to bulk activation example
- Document thread-blocking implications of synchronous replication

CURL Examples (replicate-content/SKILL.md):
- Enhance examples with jq-based JSON response validation
- Validate success status in response body, not just HTTP codes

Error Handling (api-reference.md):
- Add retry with exponential backoff pattern
- Add fallback to async on timeout pattern
- Add circuit breaker pattern for cascade failure prevention

Agent Configuration (agent-types.md):
- Add null safety checks for programmatic agent access
- Document agent ordering implications (parallel processing)

Queue Monitoring (queue-mechanics.md):
- Add JMX security considerations and access control guidance
- Add queue listener pattern for event-driven monitoring

Guardrails (65-lts-guardrails.md):
- Add version-specific API deprecation tracking guidance
- Link to official release notes for service pack compatibility

Cloud Migration (replication-orchestrator/SKILL.md):
- Fix reference to non-existent cloud service docs
- Link to official Adobe Cloud Service documentation instead

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@abhishekgarg18 abhishekgarg18 marked this pull request as ready for review April 10, 2026 10:56
@abhishekgarg18
Copy link
Copy Markdown
Collaborator Author

Screenshot 2026-04-10 at 4 30 55 PM Screenshot 2026-04-10 at 4 31 11 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant