// This skill should be used when users need to create, modify, optimize, or troubleshoot GitHub Actions CI/CD workflows. Use when users ask about automating builds, tests, deployments, or any GitHub Actions-related tasks. Triggers include requests like "create a CI workflow", "deploy to AWS", "automate testing", "setup GitHub Actions", or when debugging workflow failures.
| name | github-actions-writer |
| description | This skill should be used when users need to create, modify, optimize, or troubleshoot GitHub Actions CI/CD workflows. Use when users ask about automating builds, tests, deployments, or any GitHub Actions-related tasks. Triggers include requests like "create a CI workflow", "deploy to AWS", "automate testing", "setup GitHub Actions", or when debugging workflow failures. |
Write production-ready GitHub Actions workflows with built-in security, performance optimization, and best practices. Generate complete CI/CD pipelines, deployment workflows, and automation tasks using battle-tested templates and expert guidance.
Invoke this skill when users:
Ask targeted questions to understand requirements and generate customized workflows:
Example interaction:
User: "I need to test my Node.js app on every pull request"
Ask:
1. What Node.js versions do you need to support?
2. Do you use npm, yarn, or pnpm?
3. What test framework (Jest, Mocha, etc.)?
4. Do you need code coverage reporting?
5. Any special build steps required?
Generate: Complete node-ci.yml with testing, caching, coverage, and best practices
Question framework:
Use templates from assets/templates/ as starting points, then customize based on specific requirements.
Template categories:
CI Templates (assets/templates/ci/):
node-ci.yml - Node.js testing, building, npm publishingpython-ci.yml - Python testing with pytest, linting, PyPI publishingdocker-build-push.yml - Multi-registry Docker builds with security scanningmulti-language-matrix.yml - Cross-platform/version matrix testingmonorepo-selective.yml - Intelligent monorepo builds with path filteringDeployment Templates (assets/templates/cd/):
aws-oidc-deploy.yml - Secure AWS deployment with OIDC (no credentials)kubernetes-gitops.yml - GitOps-style K8s deploymentsmulti-environment.yml - Dev โ Staging โ Production with approval gatesSecurity Templates (assets/templates/security/):
security-scan.yml - Comprehensive security scanning (CodeQL, Snyk, Trivy, etc.)Advanced Patterns (assets/templates/advanced/):
reusable-workflow.yml - Organization-wide reusable workflowscomposite-action/action.yml - Custom composite actionsEvery generated workflow includes:
Security:
write-all)Performance:
Reliability:
When users have existing workflows, analyze and improve them:
Analysis process:
Example:
User: "My workflow is slow and expensive"
Analyze:
- Check for missing dependency caching โ Add actions/cache
- Check for unnecessary full checkouts โ Use fetch-depth: 1
- Check for serial jobs โ Parallelize independent jobs
- Check for missing concurrency control โ Add cancel-in-progress
- Check for large artifacts โ Optimize artifact uploads
- Provide estimated time/cost savings
Reference references/performance-and-troubleshooting.md for common issues:
Common problems:
Debugging techniques:
Understand the project:
Ask clarifying questions:
Select appropriate template:
node-ci.yml, python-ci.yml, etc.aws-oidc-deploy.yml, kubernetes-gitops.yml, etc.monorepo-selective.yml, multi-language-matrix.ymlCustomize the template:
Add inline documentation:
Validate before delivering:
Read the current workflow file
Analyze for issues:
Prioritize improvements:
Provide specific fixes:
Understand the error:
Reference troubleshooting guide:
references/performance-and-troubleshooting.mdProvide solution:
assets/templates/)How to use:
Customization checklist:
references/)Load these into context when needed:
syntax-quick-reference.md: Quick lookup for workflow syntax, triggers, expressions
security-best-practices.md: Comprehensive security guide with OIDC setup, permissions, secrets
performance-and-troubleshooting.md: Performance optimization and common error solutions
How to reference:
For detailed syntax: Read references/syntax-quick-reference.md
For security setup: Read references/security-best-practices.md
For debugging help: Read references/performance-and-troubleshooting.md
scripts/)Provide these scripts to users for validation and auditing:
validate_workflow.py: Validates workflow YAML for syntax, schema, best practices
python3 scripts/validate_workflow.py .github/workflows/*.yml
security_audit.py: Audits workflows for security issues
python3 scripts/security_audit.py .github/workflows/*.yml --fail-on=high
When to suggest:
validate_workflow.py"security_audit.py"User request: "Test my Node.js app on PRs"
Response:
name: CI
on:
pull_request:
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm test
User request: "Deploy to staging on develop, production on main with approval"
Use: assets/templates/cd/multi-environment.yml
User request: "Deploy to AWS without storing credentials"
Use: assets/templates/cd/aws-oidc-deploy.yml
id-token: write permissionUser request: "Only build changed packages in my monorepo"
Use: assets/templates/ci/monorepo-selective.yml
Before delivering any workflow, ensure:
pull_request_target used correctly (if at all)User: I need to deploy my React app to AWS S3 when I push to main
Response:
1. Ask: "Do you have an existing S3 bucket and CloudFront distribution?"
2. If yes: Provide aws-oidc-deploy.yml S3 deployment section
3. Guide OIDC setup:
- Create OIDC provider in AWS
- Create IAM role with trust policy
- Add S3 permissions to role
- Save role ARN as secret
4. Customize workflow:
- Update bucket name
- Add CloudFront invalidation
- Configure cache headers
5. Provide complete workflow with inline docs
User: My CI takes 15 minutes and costs too much
Response:
1. Ask: "Can you share your workflow file?"
2. Analyze:
- Missing cache โ npm ci takes 5 min every time
- No concurrency โ old runs still running
- Sequential jobs โ lint and test can run in parallel
3. Provide specific fixes:
- Add actions/setup-node cache
- Add concurrency group
- Parallelize independent jobs
- Estimate: Reduce to 6 minutes, save 60% cost
4. Show before/after comparison
User: Security scan flagged my workflow
Response:
1. Analyze the workflow
2. Identify issues:
- permissions: write-all โ CRITICAL
- Unpinned actions โ HIGH
- Direct secret usage in run โ MEDIUM
3. Provide fixes:
- Set minimal permissions
- Pin actions to SHA
- Use environment variables for secrets
4. Explain WHY each fix matters
5. Suggest running security_audit.py regularly
A successful GitHub Actions workflow: