Note: For main usage instructions and up-to-date examples, see README.md.
This document outlines the migration of Claude AI workflows to the centralized dotCMS/claude-workflows repository to implement DRY principles and enable reuse across multiple repositories.
The following files should exist in the dotCMS/claude-workflows repository:
Location: claude-executor-reusable.yml (rename to claude-executor.yml)
- Reusable workflow that handles Claude AI execution
- Configurable allowed tools, timeout, and runner
- Accepts trigger mode and direct prompt inputs
Location: claude-orchestrator-reusable.yml (rename to claude-orchestrator.yml)
- Reusable workflow that orchestrates Claude interactions
- Handles all trigger events (comments, PRs, issues)
- Configurable prompts, tools, and statically calls the executor workflow
- Each repository maintains its own Claude workflow files
- Duplication of logic across repositories
- Updates require changes in multiple places
- Inconsistent configurations between repositories
- Single source of truth for Claude workflows
- Repository-specific configurations via parameters
- Easier maintenance and updates
- Consistent behavior across all repositories
- DRY principle implementation
Historical Note: This step is already completed in this repository. The required workflows are present and correctly named. For forks or future migrations, ensure the following files exist in the correct locations:
.github/workflows/claude-executor.yml.github/workflows/claude-orchestrator.yml
The infrastructure-as-code repository has been updated to:
- Reference centralized workflows from
dotCMS/claude-workflows - Maintain infrastructure-specific configurations:
- Terraform/Terragrunt allowed tools
- Cost-aware automatic review prompts
- Customer path exclusions
After setup, test the workflows by:
- Creating a test PR
- Verifying automatic reviews work
- Testing @claude mentions in comments
- Confirming path exclusions still apply
- Allowed Tools: Terraform, Terragrunt, and Git commands
- Automatic Review Prompt: Includes cost impact analysis
- Path Exclusions: Customer-specific Kubernetes files ignored
- Timeout: 15-minute execution limit
- Runner: Ubuntu-latest
- Interactive @claude mentions (case-insensitive)
- Automatic PR reviews (when no @claude mention)
- Issue comments and reviews
- Pull request events
- Prevents multiple Claude jobs per PR/issue
- Maintains existing behavior
- Ensure reusable workflows exist in claude-workflows repository (already done here)
- Test the migration with a sample PR
- Apply to other repositories using the same pattern with version tags (e.g.,
@v1.0.0) - Document usage for other teams
When referencing the centralized workflows, always use version tags instead of @main:
# ✅ Good - Production stable
uses: dotCMS/claude-workflows/.github/workflows/claude-orchestrator.yml@v1.0.0
# ❌ Bad - Can cause unexpected behavior
uses: dotCMS/claude-workflows/.github/workflows/claude-orchestrator.yml@mainWhy version tags matter:
- Stability: Version tags are immutable and won't change unexpectedly
- Predictability: You know exactly which version you're using
- Rollback: Easy to rollback to previous versions if needed
- Production Safety: Prevents breaking changes from affecting production workflows
Other dotCMS repositories can now easily add Claude support by:
- Creating a simple orchestrator workflow that calls the centralized version
- Customizing allowed tools for their specific needs
- Setting repository-specific prompts and configurations
- Maintaining consistent Claude behavior across the organization
This migration addresses issue dotCMS/dotcat#213 and establishes the foundation for organization-wide Claude workflow standardization.