Skip to content

Instantly share code, notes, and snippets.

@kmurugulla
Last active November 3, 2025 21:12
Show Gist options
  • Select an option

  • Save kmurugulla/b0371a1743b8c98aac461dff4ce15b9a to your computer and use it in GitHub Desktop.

Select an option

Save kmurugulla/b0371a1743b8c98aac461dff4ce15b9a to your computer and use it in GitHub Desktop.
Custom /init command for AEM Edge Delivery Services - Sets up CLAUDE.md, AGENTS.md, and development skills

Custom /init Command for AEM Edge Delivery Services

πŸ“š Primary Reference: https://www.aem.live/developer/ai-coding-agents

Installation

curl -o ~/.claude/commands/init.md https://gist.githubusercontent.com/kmurugulla/b0371a1743b8c98aac461dff4ce15b9a/raw/claudecode_init_eds.md

Usage

In any AEM/EDS project:

/init

What It Does

Automatically installs in your project:

  1. Installs gh-upskill - If not already installed (automatic)
  2. CLAUDE.md (274 lines) - Adobe guide + Skills section
  3. AGENTS.md (275 lines) - Adobe guide + Skills section
  4. .claude/skills/ - 6 development skills (24 files)
  5. .agents/discover-skills - Helper script

Both CLAUDE.md and AGENTS.md get the full Adobe development guide plus the skills section, ensuring all AI tools know how to use the installed skills.

Quick Commands

# List all skills
./.agents/discover-skills

# Search for blocks
node .claude/skills/block-collection-and-party/scripts/search-block-collection.js [term]

# Find pages with a block
node .claude/skills/content-driven-development/scripts/find-block-content.js [block-name]

No Prerequisites!

Just run /init - it handles everything automatically including gh-upskill installation.

That's it!

description
Analyze codebase and create CLAUDE.md, AGENTS.md, and skills with project-specific guidance

Please analyze this codebase and create documentation files and skills for AI coding assistants.

Detection Logic

  1. First, check if this is an AEM/EDS project by looking for:

    • package.json with "name": "@adobe/aem-boilerplate" or contains @adobe/aem-boilerplate
    • Presence of scripts/aem.js file
    • blocks/ directory structure
    • References to aem.live, hlx, or helix in the code
  2. If AEM/EDS project detected:

    • Check if gh-upskill is available: gh upskill --version or upskill --version

    • If NOT available, install it automatically:

      gh extension install trieloff/gh-upskill

      Then verify it was installed successfully before proceeding.

    • Once available, proceed:

      • Fetch the standard template from: https://raw.githubusercontent.com/adobe/aem-boilerplate/refs/heads/agents-md/AGENTS.md
      • Create CLAUDE.md with the fetched content (change header from "# AGENTS.md" to "# CLAUDE.md")
      • Create AGENTS.md with the fetched content (keep header as "# AGENTS.md")
      • Install skills using gh-upskill:
        gh upskill adobe/helix-website -b main
        OR if gh extension not available but upskill binary is:
        upskill adobe/helix-website -b main
      • This will automatically:
        • Create .claude/skills/ with all 6 skills
        • Create .agents/discover-skills script
        • ADD skills section to existing AGENTS.md (preserves all existing content)
    • Inform the user that standard AEM/EDS documentation and skills were installed

  3. If NOT an AEM/EDS project:

    • Follow the standard init process to analyze the codebase
    • Create both CLAUDE.md AND AGENTS.md with the same custom contents based on analysis
    • Include:
      • Build/lint/test commands from package.json
      • High-level architecture requiring multiple files to understand
      • Important patterns from README.md, CONTRIBUTING.md, .cursor/rules, .cursorrules, .github/copilot-instructions.md
    • Avoid obvious instructions or listing every file
    • Focus on "big picture" architecture and commonly-used commands
    • Do NOT install AEM-specific skills

File Format

Both files should start with:

# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Or for AGENTS.md:

# AGENTS.md

This file provides guidance to AI coding assistants when working with code in this repository.

AEM Skills Installation Using gh-upskill

When an AEM/EDS project is detected:

Step 1: Ensure gh-upskill is installed

gh upskill --version || upskill --version

If not found, install it automatically:

gh extension install trieloff/gh-upskill

Verify installation succeeded before continuing.

Step 2: Create CLAUDE.md and AGENTS.md

Fetch the official Adobe template:

curl -s "https://raw.githubusercontent.com/adobe/aem-boilerplate/refs/heads/agents-md/AGENTS.md"

Create CLAUDE.md:

  • Write the fetched content to CLAUDE.md
  • Change the first line header from "# AGENTS.md" to "# CLAUDE.md"
  • Keep all other content identical

Create AGENTS.md:

  • Write the fetched content to AGENTS.md
  • Keep the header as "# AGENTS.md" (original)
  • Keep all content identical to CLAUDE.md except the header

Step 3: Install skills with gh-upskill

gh upskill adobe/helix-website -b main

This automatically:

  • Creates .claude/skills/ with all 6 skills (24 files)
  • Creates .agents/discover-skills script (executable)
  • ADDS skills section to existing AGENTS.md (using markers, doesn't replace)

Important: gh-upskill only updates AGENTS.md. We need to manually add the skills section to CLAUDE.md as well.

Step 3b: Add skills section to CLAUDE.md

After gh-upskill completes, copy the skills section from AGENTS.md to CLAUDE.md:

  • Extract the content between <!-- upskill:skills:start --> and <!-- upskill:skills:end --> markers from AGENTS.md
  • Append this content to the end of CLAUDE.md
  • This ensures Claude Code knows about and uses the skills

Step 4: Verify installation

Check that:

  • CLAUDE.md exists at project root
  • AGENTS.md exists at project root (created/updated by gh-upskill)
  • .claude/skills/ contains 6 skill directories
  • .agents/discover-skills exists and is executable

Important Notes

Directory Structure:

  • .agents/ and .claude/ must be at the SAME LEVEL (both in project root)
  • Do NOT create .agents/ inside .claude/
  • Correct structure:
    project-root/
    β”œβ”€β”€ .agents/           ← At root level
    β”‚   └── discover-skills
    β”œβ”€β”€ .claude/           ← At root level
    β”‚   └── skills/
    β”‚       β”œβ”€β”€ building-blocks/
    β”‚       β”œβ”€β”€ content-driven-development/
    β”‚       β”œβ”€β”€ content-modeling/
    β”‚       β”œβ”€β”€ testing-blocks/
    β”‚       β”œβ”€β”€ block-collection-and-party/
    β”‚       └── docs-search/
    β”œβ”€β”€ CLAUDE.md          ← At root level
    └── AGENTS.md          ← At root level
    

Other Notes:

  • Create BOTH CLAUDE.md and AGENTS.md so the documentation works with Claude Code AND other AI assistants like Cursor
  • For AEM projects, install all skills to enable advanced development workflows
  • Keep the content identical in both documentation files for consistency
  • Don't repeat obvious instructions
  • Don't include generic development practices
  • Focus on project-specific commands and architecture
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment