You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: expand repository scope to include tools, configs, and best practices (#20)
## Summary
This PR expands the repository's scope from a GitHub Actions workflow
repository to a **comprehensive Claude AI tooling hub** that includes
workflows, custom commands, shared configurations, and development best
practices.
## Changes
### CLAUDE.md Updates
- ✨ Added Deployment Guard workflow to core workflows overview
- 📚 Added "Critical Architectural Insight" explaining the workflow_call
event context issue
- 🛡️ Added "Development Patterns" section covering ZSH command safety,
file management, and version tagging
- 📝 Enhanced usage examples with interactive, automatic, and custom
trigger patterns
- 🔧 Added detailed Deployment Guard documentation including state
management and version validation logic
- 🗺️ Added "Important Files" section for better repository navigation
### README.md Updates
- 🎯 Updated repository tagline and purpose to reflect expanded scope
- 📦 Added "What's Inside" section organizing all repository contents
- 🛠️ Added "Using Custom Commands" section documenting slash commands
and cursor rules
- 📂 Added "Repository Structure" visual tree showing complete layout
- 🚀 Added "Adopting This Repository's Tooling" section with flexible
adoption patterns
- 📖 Added "Learn More" and "Contributing" sections
- ⚠️ Emphasized version tag best practices throughout
## Why This Matters
The repository now serves as a central hub for:
- **Reusable GitHub Actions workflows** (orchestrator, executor,
deployment guard)
- **Custom tools & commands** (like `/weekly-work` for team summaries)
- **Shared configurations** (Claude settings, cursor rules)
- **Development best practices** (ZSH safety, git workflows, release
processes)
- **Working examples** (for quick adoption across repositories)
This makes it easier for both internal dotCMS teams and external
community members to discover, adopt, and contribute to Claude AI
tooling.
## Testing
- Verified documentation accuracy by reviewing all referenced files and
workflows
- Confirmed examples use version tags (`@v1.0.0`) instead of `@main`
- Validated links to ARCHITECTURE.md, CLAUDE_WORKFLOW_MIGRATION.md, and
example files
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
@@ -8,147 +8,184 @@ This repository provides centralized, reusable GitHub Actions workflows for Clau
8
8
9
9
## Architecture Overview
10
10
11
-
The repository implements a simple, reliable architecture:
11
+
The repository implements a simple, reliable architecture with three reusable workflows:
12
12
13
13
### Core Workflows
14
14
15
-
-**Claude Orchestrator** (`.github/workflows/claude-orchestrator.yml`): A lightweight wrapper that calls the executor with minimal configuration. This is the recommended workflow for consumer repositories (FIXED - no longer has the original architectural issues).
16
-
-**Claude Executor** (`.github/workflows/claude-executor.yml`): The execution engine that runs Claude AI actions with configurable tools, timeouts, and runners.
15
+
-**Claude Orchestrator** (`.github/workflows/claude-orchestrator.yml`): Lightweight wrapper that handles @claude mention detection and routes to executor. Consumer repositories call this with `trigger_mode: interactive` or `trigger_mode: automatic`.
16
+
-**Claude Executor** (`.github/workflows/claude-executor.yml`): Execution engine that runs the `anthropics/claude-code-action@beta` with configured tools, timeouts, and runners.
17
+
-**Deployment Guard** (`.github/workflows/deployment-guard.yml`): Reusable workflow for validating deployment changes with configurable rules. Features organization-based bypass for trusted members, file allowlist validation, image-only change detection, and comprehensive image validation (format, repository, version pattern, registry existence, anti-downgrade logic).
17
18
18
-
### Key Design Patterns
19
+
### Critical Architectural Insight
19
20
20
-
-**Consumer-Handled Triggers**: Consumer repositories handle their own webhook triggers and conditional logic, then call the centralized workflows
21
-
-**Simple Reusable Workflows**: The `claude-orchestrator.yml` workflow provides a clean interface to the executor
22
-
-**Parameterization**: Workflows accept inputs for customization (prompts, tools, timeouts, runners)
23
-
-**Security Isolation**: Each consuming repository must provide its own `ANTHROPIC_API_KEY` for cost tracking and security
21
+
The original orchestrator attempted to centralize trigger logic, but GitHub Actions `workflow_call` loses the original webhook event context. When a consumer workflow calls a reusable workflow, `github.event_name` becomes `"workflow_call"` instead of the original event (like `"issue_comment"`), causing all conditional logic to fail.
22
+
23
+
**Solution**: Consumer repositories handle their own webhook events and conditional logic, then call the centralized workflows only when conditions are met. This prevents double triggering and maintains proper event context.
24
24
25
25
## Common Commands
26
26
27
27
### Testing and Validation
28
28
29
29
```bash
30
-
# Lint YAML files
31
-
yamllint -c .yamllint.yml **/*.yml **/*.yaml
30
+
# Lint all workflows with actionlint (via docker)
31
+
docker run --rm -v "${PWD}:/repo" -w /repo rhysd/actionlint:1.7.7
# Tests are defined in .github/workflows/tests.yml and run automatically on PR/push to main
36
40
```
37
41
38
-
### Workflow Testing
42
+
### Testing Deployment Guard
39
43
40
-
The repository includes automated tests in `.github/workflows/tests.yml` that:
44
+
The deployment-guard workflow includes a `testing_force_non_bypass` parameter for testing validation logic even when you're an organization member. See recent commits `9e1db62` and earlier for refactoring details and state management improvements.
41
45
42
-
- Lint all YAML files using yamllint configuration
43
-
- Validate GitHub Actions workflow syntax
44
-
- Check for required workflow elements (name, on, jobs)
45
-
- Validate secret requirements in reusable workflows
46
+
## Development Patterns
46
47
47
-
##Configuration Files
48
+
### ZSH Command Safety (CRITICAL)
48
49
49
-
-**`.yamllint.yml`**: YAML linting configuration with 240-character line length limit and 2-space indentation
50
-
-**Examples**: `examples/consumer-repo-workflow.yml` shows how consuming repositories should reference these workflows
50
+
When using terminal commands, especially git and GitHub CLI operations:
51
51
52
-
## Usage by Consuming Repositories
52
+
-**ALWAYS** use single quotes for simple strings
53
+
-**NEVER** use emojis or special characters in inline git/gh commands
54
+
-**USE** separate files for complex content (release notes, commit messages) instead of inline strings
55
+
-**STOP IMMEDIATELY** (Ctrl+C) if you see `dquote>` or `>` prompts - this means ZSH escaping issues
The recommended approach is for consumer repositories to handle their own webhook triggers and conditional logic, then call the centralized `claude-orchestrator.yml` workflow. This approach is reliable and avoids the architectural issues with the orchestrator pattern.
86
+
## Usage by Consuming Repositories
57
87
58
-
**Example for interactive @claude mentions:**
88
+
Consumer repositories handle their own webhook triggers and conditional logic, then call centralized workflows. This preserves event context and prevents double triggering.
59
89
90
+
**Interactive mode example (with built-in @claude detection):**
See `examples/` directory for complete working examples.
100
140
101
-
The original orchestrator design had a fundamental flaw: when called via `workflow_call`, the `github.event_name` becomes `"workflow_call"` instead of the original trigger event (like `"issue_comment"`), causing all conditional logic to fail and resulting in double triggering.
141
+
## Deployment Guard Workflow
102
142
103
-
The consumer-handled approach solves this by:
143
+
The deployment-guard workflow provides configurable validation for deployment changes:
104
144
105
-
1. Consumer workflows handle their own webhook events directly
106
-
2. They evaluate trigger conditions using the original event context
107
-
3. They call the simple centralized workflow only when conditions are met
108
-
4. No double triggering occurs
145
+
### Key Features
146
+
- **Organization-based bypass**: Public members of a trusted organization bypass all validations
147
+
- **File allowlist**: Restrict changes to specific file patterns (glob-based)
148
+
- **Image-only validation**: Ensure only container image fields are modified (no resource/env changes)
149
+
- **Image validation**: Format, repository, version pattern, registry existence, anti-downgrade checking
150
+
- **Testing mode**: `testing_force_non_bypass: true` to test validation logic even as org member
109
151
110
-
See the complete examples in the `examples/` directory:
152
+
### State Management Pattern
153
+
The deployment-guard demonstrates robust bash state management without temporary files (see `deployment-guard.yml:227-252` and `297-382`):
154
+
- Uses bash arrays instead of temp files to avoid race conditions
155
+
- Proper error handling with `set -euo pipefail`
156
+
- Clear state tracking with boolean flags
111
157
112
-
- `examples/consumer-repo-workflow.yml`- General purpose example
113
-
- `examples/infrastructure-consumer-workflow.yml`- Infrastructure-specific example
158
+
### Version Validation Logic
159
+
Sophisticated version comparison supporting dotCMS format: `YY.MM.DD[-REBUILD][_HASH]`
160
+
- Prevents downgrades at base version level (25.12.08 → 25.12.07)
0 commit comments