Create GitHub Reusable Workflows to Share CI Logic Across Repos
Once you have multiple repos running similar CI steps, extract them into a reusable workflow — a fix in one place fixes all of them. Ask Claude to write the callable workflow and the caller stub.
# Prompt:
# "Create a GitHub reusable workflow for PHP projects stored in .github/workflows/php-ci.yml:
# - Inputs: php-version (default '8.3'), run-coverage (bool, default false)
# - Jobs: lint (Pint), static analysis (PHPStan level 9), tests (Pest)
# - Cache Composer dependencies keyed by composer.lock hash
# - Upload coverage to Codecov if run-coverage is true
# - Output test-outcome (pass/fail) for caller workflows to branch on
# Also write the caller workflow that another repo would use."
The tricky part of reusable workflows is inputs vs secrets scoping — Claude gets this right and comments why each value is an input versus a secret that needs explicit inheritance.
The resulting caller is clean and minimal:
jobs:
ci:
uses: my-org/.github/.github/workflows/php-ci.yml@main
with:
php-version: '8.3'
run-coverage: true
secrets: inherit
Claude also handles the edge cases: workflow_call trigger syntax, making outputs available across jobs, and ensuring the cache key invalidates correctly when composer.lock changes.
Copying CI YAML between repos is tech debt waiting to happen — one reusable workflow fixes every repo at once.
Log in to leave a comment.
Set up Claude Code as an automated reviewer in your CI pipeline — on every pull request, it reads the diff, checks for bugs, security issues, missing tests, and convention violations, then posts its findings as a PR comment. Your human reviewers get a head start because the obvious issues are already flagged before they look.
Before deploying, tell Claude to read your project — migrations, environment variables, queue workers, scheduled tasks, caching, third-party integrations — and generate a deployment checklist that's specific to your app. Not a generic "did you run migrations?" list, but one that knows YOUR infrastructure and catches the things YOUR deploy can break.
Instead of writing a README from memory or copying a template, tell Claude to read your project and generate one that's actually accurate — real setup instructions from your config, real architecture from your directory structure, real API examples from your routes, and real prerequisites from your dependency files.