Comprehensive technical documentation of the GitHub Workflow Blueprint system architecture, design decisions, and implementation details
┌─────────────────────────────────────────────────────────────────┐
│ USER INTERFACE LAYER │
│ │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
│ │ Slash Commands │ │ Setup Wizard │ │ Documentation │ │
│ │ (8 commands) │ │ (Interactive) │ │ (8 guides) │ │
│ └─────────────────┘ └─────────────────┘ └─────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────────┐
│ AUTOMATION LAYER │
│ │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
│ │ Agents │ │ Composite │ │ Validators │ │
│ │ (4 specialized) │ │ Actions (5) │ │ & Helpers │ │
│ └─────────────────┘ └─────────────────┘ └─────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────────┐
│ WORKFLOW LAYER │
│ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │Bootstrap│ │PR Checks│ │Plan→ │ │Status │ │
│ │ │ │ │ │Issues │ │Sync │ ... │
│ └─────────┘ └─────────┘ └─────────┘ └─────────┘ │
│ (8 Core Workflows) │
└─────────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────────┐
│ INTEGRATION LAYER │
│ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ GitHub │ │ GitHub │ │ Claude │ │ External│ │
│ │ REST API│ │ GraphQL │ │ Code │ │ Tools │ │
│ └─────────┘ └─────────┘ └─────────┘ └─────────┘ │
└─────────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────────┐
│ FOUNDATION LAYER │
│ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ Git │ │ GitHub │ │ Project │ │ Issue │ │
│ │ │ │ Actions │ │ Board │ │ Tracking│ │
│ └─────────┘ └─────────┘ └─────────┘ └─────────┘ │
└─────────────────────────────────────────────────────────────────┘
| Component | Technology | Version | Rationale |
|---|---|---|---|
| CI/CD | GitHub Actions | Latest | Native integration, free for public repos |
| Package Manager | pnpm | 9.x | Fast, efficient, workspace support |
| Runtime | Node.js | 20 LTS | Stable, long-term support, modern features |
| Project Management | GitHub Projects v2 | Latest | GraphQL API, flexible, native GitHub |
| AI Automation | Claude Code Action | v1 GA | Official Anthropic integration, stable API |
| Version Control | Git | 2.40+ | Industry standard, ubiquitous |
| Purpose | Technology | Usage |
|---|---|---|
| JSON Validation | jq | Parse and validate plan JSON |
| Path Filtering | dorny/paths-filter@v3 | Smart workflow triggers |
| Semantic PR | amannn/action-semantic-pull-request@v5 | Conventional commit validation |
| Script Execution | actions/github-script@v7 | JavaScript in workflows |
| Caching | actions/cache@v4 | Speed up builds |
GitHub Actions over Jenkins/CircleCI:
pnpm over npm/yarn:
Projects v2 over Classic Projects:
Claude Code Action v1 GA over Beta:
Principle: Prefer simple, obvious solutions over clever ones.
Examples:
Rationale: Lower cognitive load for users, easier debugging, fewer edge cases.
Principle: Fail safe, not fail fast. Prevent destructive operations.
Examples:
Rationale: Protects users from mistakes, prevents cascading failures.
Principle: Show simple options first, advanced options on demand.
Examples:
Rationale: Lowers barrier to entry, doesn’t overwhelm beginners.
Principle: Extract common patterns into reusable components.
Examples:
reusable-pr-checks.yml (called by multiple workflows)Rationale: Easier maintenance, consistent behavior, fewer bugs.
Principle: Operations should be safe to retry.
Examples:
Rationale: Transient failures shouldn’t cause permanent issues.
Principle: Validate inputs early, fail with clear messages.
Examples:
Rationale: Fast feedback, clear error messages, saves compute time.
Principle: Every operation should be visible and debuggable.
Examples:
Rationale: Easier debugging, better user experience, builds trust.
┌──────────────────────┐
│ pr-into-dev.yml │
│ │
│ 1. Fork check ────┼────→ .github/actions/fork-safety
│ 2. Rate limit ────┼────→ .github/actions/rate-limit-check
│ 3. Quality ────┼────→ .github/workflows/reusable-pr-checks.yml
│ │ │
└──────────────────────┘ │
├────→ .github/actions/setup-node-pnpm
└────→ .github/actions/quality-gates
Flow:
pr-into-dev.ymlBenefits:
User runs: /blueprint-init
↓
Claude Code executes command
↓
Command prompts user (interactive)
↓
Command calls: gh workflow run bootstrap.yml
↓
Workflow executes in GitHub Actions
↓
Results displayed to user
Integration Points:
gh workflow runDesign Decision: Commands are thin wrappers around workflows, not duplicating logic.
User runs: /plan-to-issues plan.json
↓
plan-converter agent (Claude Code)
↓
Agent validates plan structure
↓
Agent calls: gh workflow run claude-plan-to-issues.yml
↓
Workflow processes via GitHub REST API:
- Create milestone (if specified)
- Create issues (max 10)
- Apply labels
- Link dependencies
↓
Workflow syncs to Project Board via GraphQL
↓
Agent displays summary to user
API Usage:
Rate Limit Strategy:
Issue Created (#123)
↓
Labels: claude-code + status:ready
↓
create-branch-on-issue.yml triggers
↓
GraphQL Mutation:
- Add issue to project
- Set Status: "Ready"
↓
Developer works on branch
↓
PR Created → dev
↓
pr-status-sync.yml updates:
- Issue Status: "In Review"
- Project Board: "In Review"
↓
PR Merged
↓
pr-status-sync.yml updates:
- Issue Status: "To Deploy"
- Project Board: "To Deploy"
↓
Release to main
↓
release-status-sync.yml closes:
- Issue closed
- Project Board: "Done"
Bidirectional Sync:
/sync-status command)Status Mapping:
Issue Labels Project Board Status
───────────────── ────────────────────
status:ready → Ready
status:in-progress → In Progress
status:in-review → In Review
status:to-deploy → To Deploy
[closed] → Done
1. PLANNING PHASE
┌─────────────────────┐
│ Claude Code Plan │
│ (JSON, max 10 tasks)│
└──────────┬──────────┘
↓
┌─────────────────────┐
│ /plan-to-issues │
│ (command) │
└──────────┬──────────┘
↓
┌─────────────────────┐
│ claude-plan-to- │
│ issues.yml │
│ (workflow) │
└──────────┬──────────┘
↓
┌─────────────────────┐
│ GitHub Issues │
│ (10 issues created) │
│ Labels: claude-code │
│ status:ready│
└──────────┬──────────┘
↓
┌─────────────────────┐
│ Project Board │
│ Status: Ready │
└─────────────────────┘
2. DEVELOPMENT PHASE
┌─────────────────────┐
│ Issue #123 labeled │
│ claude-code + │
│ status:ready │
└──────────┬──────────┘
↓
┌─────────────────────┐
│ create-branch-on- │
│ issue.yml │
└──────────┬──────────┘
↓
┌─────────────────────┐
│ Branch created: │
│ feature/issue-123- │
│ description │
└──────────┬──────────┘
↓
┌─────────────────────┐
│ Developer commits │
│ to feature branch │
└──────────┬──────────┘
↓
┌─────────────────────┐
│ /commit-smart │
│ (quality checks) │
└──────────┬──────────┘
↓
┌─────────────────────┐
│ /create-pr │
│ PR → dev │
└─────────────────────┘
3. REVIEW PHASE
┌─────────────────────┐
│ PR opened to dev │
└──────────┬──────────┘
↓
┌─────────────────────┐
│ pr-into-dev.yml │
│ - Validate branch │
│ - Validate title │
│ - Check linked issue│
│ - Run quality gates │
└──────────┬──────────┘
↓
┌─────────────────────┐
│ reusable-pr-checks │
│ - Lint │
│ - Typecheck │
│ - Unit tests │
└──────────┬──────────┘
↓
┌─────────────────────┐
│ pr-status-sync.yml │
│ Issue: In Review │
│ Board: In Review │
└──────────┬──────────┘
↓
┌─────────────────────┐
│ /review-pr │
│ (optional) │
└──────────┬──────────┘
↓
┌─────────────────────┐
│ PR approved & merged│
└─────────────────────┘
4. DEPLOYMENT PHASE
┌─────────────────────┐
│ PR merged to dev │
└──────────┬──────────┘
↓
┌─────────────────────┐
│ pr-status-sync.yml │
│ Issue: To Deploy │
│ Board: To Deploy │
│ Branch deleted │
└──────────┬──────────┘
↓
┌─────────────────────┐
│ /release │
│ PR: dev → main │
└──────────┬──────────┘
↓
┌─────────────────────┐
│ dev-to-main.yml │
│ - Build prod │
│ - Smoke tests │
│ - Security scan │
└──────────┬──────────┘
↓
┌─────────────────────┐
│ PR merged to main │
└──────────┬──────────┘
↓
┌─────────────────────┐
│ release-status- │
│ sync.yml │
│ - Close issues │
│ - Board: Done │
│ - Create release │
└─────────────────────┘
5. PRODUCTION
┌─────────────────────┐
│ GitHub Release │
│ v1.2.3 │
│ - Changelog │
│ - Artifacts │
└─────────────────────┘
Issue Label Change
↓
GitHub Webhook
↓
Workflow Triggered (pr-status-sync.yml)
↓
┌─────────────────────────────────────┐
│ Determine New Status │
│ - PR opened → "In Review" │
│ - PR draft → "In Progress" │
│ - PR merged → "To Deploy" │
│ - PR closed (not merged) → reset │
└─────────────┬───────────────────────┘
↓
┌─────────────────────────────────────┐
│ Update Issue Labels │
│ - Remove old status label │
│ - Add new status label │
└─────────────┬───────────────────────┘
↓
┌─────────────────────────────────────┐
│ Update Project Board (GraphQL) │
│ - Query project ID │
│ - Query status field ID │
│ - Mutate status value │
└─────────────┬───────────────────────┘
↓
┌─────────────────────────────────────┐
│ Post Comment (if applicable) │
│ "Status updated to: In Review" │
└─────────────────────────────────────┘
Debouncing: 10-second delay between status updates prevents infinite loops.
Decision: Hard limit of 10 tasks per Claude Code plan.
Rationale:
Technical:
User Experience:
Performance:
Alternative Considered: No limit
Customization: Users can change limit in workflow (see CUSTOMIZATION.md)
Decision: Use GitHub GraphQL API for project board operations.
Rationale:
Projects v2 Requirement:
GraphQL Advantages:
GraphQL Challenges:
Mixed Approach:
Example GraphQL Query:
query($owner: String!, $repo: String!, $number: Int!) {
repository(owner: $owner, name: $repo) {
issue(number: $number) {
id
projectItems(first: 10) {
nodes {
project {
id
title
}
}
}
}
}
}
Decision: Support Simple, Standard, and Complex branching strategies.
Rationale:
Flexibility:
User Personas:
Solo Developer (Simple):
Small Team (Standard):
Enterprise (Complex):
Implementation Cost:
Alternative Considered: Force Standard strategy
Decision: Default to pnpm for package management.
Rationale:
Performance:
Reliability:
Modern Features:
Adoption:
Backwards Compatibility:
Trade-offs:
Override: Users can switch to npm/yarn (see CUSTOMIZATION.md)
Decision: Default to Node.js 20 (LTS).
Rationale:
Long-Term Support:
Modern Features:
Ecosystem Compatibility:
Trade-offs:
Override: Users can specify different version (see CUSTOMIZATION.md)
uses: ./.github/actions/setup-node-pnpm
with:
node-version: '22' # Use Node 22 instead
Decision: Check API rate limits before operations, fail-fast if too low.
Rationale:
Problem: GitHub API rate limits
Without Rate Limiting:
With Circuit Breakers:
Thresholds:
claude-plan-to-issues.yml: 100 minimum (creates up to 10 issues)pr-into-dev.yml: 50 minimum (validation + comments)Implementation:
- name: Check rate limit
uses: ./.github/actions/rate-limit-check
with:
minimum-remaining: 100
Benefits:
Decision: Enforce squash merges (no merge commits, no rebase).
Rationale:
Linear History:
Simplified Commits:
Review Efficiency:
Trade-offs:
Alternatives Considered:
Override: Change branch protection settings if needed
Decision: Fork PRs run checks but skip write operations.
Rationale:
Security Risk:
GitHub Security Model:
GITHUB_TOKENOur Implementation:
Example:
- name: Check if PR is from fork
id: fork-safety
uses: ./.github/actions/fork-safety
- name: Update project board
if: steps.fork-safety.outputs.is-fork != 'true'
run: |
# Only runs for non-fork PRs
User Experience:
Secrets Required:
ANTHROPIC_API_KEY - Claude Code integrationPROJECT_URL - GitHub Projects v2 boardGITHUB_TOKEN - Auto-provided by GitHub ActionsStorage:
Best Practices:
# ✅ Good: Secret only in workflow
env:
ANTHROPIC_API_KEY: $
# ❌ Bad: Secret in code
env:
API_KEY: "sk-ant-..." # Never hardcode!
# ✅ Good: Validate secret format
- name: Validate API key
run: |
if [[ ! "$" =~ ^sk-ant- ]]; then
echo "Invalid API key format"
exit 1
fi
Rotation:
Workflow Permissions:
# Default: Read-only
permissions:
contents: read
# Add permissions as needed
permissions:
contents: read # Read repository content
pull-requests: write # Create PR comments
issues: write # Create/update issues
statuses: write # Update commit statuses
Progressive Permissions:
Examples:
bootstrap.yml (setup):
permissions:
contents: write # Create labels, configure repo
issues: write # Create milestone
pr-into-dev.yml (validation):
permissions:
contents: read # Read code
pull-requests: write # Post comments
issues: read # Validate linked issues
release-status-sync.yml (deployment):
permissions:
contents: write # Create GitHub release
issues: write # Close issues
pull-requests: read # Read merged PRs
Detection:
- name: Check if PR is from fork
id: fork-check
run: |
IS_FORK=$
echo "is-fork=$IS_FORK" >> $GITHUB_OUTPUT
Conditional Execution:
- name: Update project board
if: steps.fork-check.outputs.is-fork != 'true'
run: |
# Safe to run write operations
User Communication:
- name: Log fork status
run: |
if [[ "$IS_FORK" == "true" ]]; then
echo "⚠️ Fork PR detected - write operations disabled"
fi
Circuit Breaker Pattern:
- name: Check API rate limit
id: rate-limit
uses: ./.github/actions/rate-limit-check
with:
minimum-remaining: 100
- name: Fail if rate limit too low
if: steps.rate-limit.outputs.can-proceed != 'true'
run: |
echo "❌ Rate limit too low: $"
echo "Resets at: $"
exit 1
Exponential Backoff:
- name: Retry with backoff
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
retry_wait_seconds: 30
command: gh api /repos/$REPO/issues
Batching:
// Create issues in batches of 3 with delays
for (let i = 0; i < issues.length; i += 3) {
const batch = issues.slice(i, i + 3);
await Promise.all(batch.map(createIssue));
await sleep(1000); // 1 second between batches
}
Principle: Operations should be safe to retry without side effects.
Implementation Examples:
Label Creation (bootstrap.yml):
# Check if label exists before creating
if ! gh label list | grep -q "claude-code"; then
gh label create "claude-code" --color "0e8a16"
else
echo "Label already exists, skipping"
fi
Issue Creation (claude-plan-to-issues.yml):
// Check for existing issue with same title
const existing = await github.rest.issues.listForRepo({
state: 'all'
}).then(({data}) => data.find(i => i.title === task.title));
if (existing) {
console.log(`Issue already exists: #${existing.number}`);
continue; // Skip creation
}
Branch Creation (create-branch-on-issue.yml):
# Check if branch exists
if git rev-parse --verify "feature/issue-$NUMBER" 2>/dev/null; then
echo "Branch already exists"
exit 0
fi
# Create branch
git checkout -b "feature/issue-$NUMBER"
GitHub API Limits:
Mitigation Strategies:
1. Caching:
- name: Cache API responses
uses: actions/cache@v4
with:
path: ~/.gh-cache
key: api-cache-$
2. Conditional Requests (ETags):
# Use ETags to avoid fetching unchanged data
ETAG=$(gh api /repos/$REPO/issues --include | grep -i etag)
gh api /repos/$REPO/issues --header "If-None-Match: $ETAG"
# Returns 304 Not Modified if unchanged (doesn't count against rate limit)
3. Batching:
// GraphQL allows multiple queries in one request
query {
issue1: repository(...) { issue(number: 1) { ... } }
issue2: repository(...) { issue(number: 2) { ... } }
issue3: repository(...) { issue(number: 3) { ... } }
}
4. Pagination:
// Use pagination for large result sets
const allIssues = await github.paginate(
github.rest.issues.listForRepo,
{ owner, repo, per_page: 100 }
);
Challenge: Multiple workflows can run simultaneously.
Concurrency Control:
# Cancel in-progress runs for same PR
concurrency:
group: pr-checks-$
cancel-in-progress: true
Benefits:
Grouping Strategies:
By PR:
group: pr-$
By Branch:
group: branch-$
By Workflow:
group: $-$
What to Cache:
Implementation:
pnpm Cache:
- name: Cache pnpm store
uses: actions/cache@v4
with:
path: ~/.pnpm-store
key: $-pnpm-$
restore-keys: |
$-pnpm-
Build Cache:
- name: Cache Next.js build
uses: actions/cache@v4
with:
path: .next/cache
key: $-nextjs-$
Cache Hit Rate:
Workflow Execution Time:
Target:
Optimizations:
1. Parallel Jobs:
jobs:
lint:
runs-on: ubuntu-latest
test:
runs-on: ubuntu-latest
build:
runs-on: ubuntu-latest
# All run in parallel
2. Matrix Strategy:
strategy:
matrix:
node-version: [18, 20, 22]
# Tests run in parallel across versions
3. Path Filtering:
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
frontend:
- 'src/**'
- name: Frontend tests
if: steps.changes.outputs.frontend == 'true'
run: npm run test:frontend
# Only run frontend tests if frontend code changed
4. Fail-Fast:
strategy:
fail-fast: true
# Stop all jobs if one fails (for validation)
Workflow Limits:
Runner Limits:
Workarounds:
Long Workflows:
Storage:
Concurrency:
GraphQL Only:
Rate Limiting:
Field Types:
Workarounds:
Complex Queries:
Custom Fields:
Capabilities:
Limitations:
Best Practices:
1. Visual Workflow Designer
2. Advanced Analytics
3. Multi-Repository Support
4. Enhanced AI Integration
5. Mobile App Integration
1. Workflow Deduplication
2. Smart Caching
3. Advanced Concurrency
4. Cost Optimization
1. Feature Flags Integration
2. Automated Dependency Updates
3. Deployment Previews
4. Code Coverage Tracking
✅ Modular: Clear separation of concerns ✅ Scalable: Handles growth in users and workflows ✅ Secure: Multiple layers of protection ✅ Performant: Optimized for speed ✅ Maintainable: DRY principles, well-documented ✅ Flexible: Supports multiple workflows and strategies ✅ Observable: Clear logging and error messages
This architecture is designed to scale from solo developers to enterprise teams while maintaining simplicity, security, and performance.
Last Updated: 2025-11-06 Version: 1.0.0