Deployment Composer
Compose the smallest safe deployment workflow from the repository's actual branching model, CI setup, deploy provider, and release risk. Routes work to focused skills instead of treating every deploy as the same checklist.
Authorized Scope
Apply this engine only within the user's requested task and existing explicit
authorization. Loading or delegating to it grants no additional authority.
Preserve report-only restrictions and the caller's target, host, provider, and
cost limits. Existing approval satisfies a gate only for the same actions and
scope; obtain approval before expanding them. Forward these limits to delegates.
Contract
Inputs:
- Repository root
- Desired release/deploy goal
- Optional target environment, source branch, target branch, PR number, or provider
Outputs:
- Deployment route: release PR, provider deploy, CI setup, or repair
- Selected delegated skills
- Quality gate state
- Confirmation gates still required
Creates/Modifies:
- Nothing during discovery
- May create local release notes or PR body files
- May create GitHub PRs only through
release-pr-gates after confirmation rules are satisfied
External Side Effects:
- Reads git/GitHub metadata and workflow status
- May trigger provider deployment commands through delegated skills
Confirmation Required:
- Before production deploys or merges
- Before creating GitHub PRs when the user did not explicitly request PR creation
- Before running provider commands with production flags
Delegates To:
release-pr-gates
deploy
github-fix-ci
ec2-backend-deployer
testing-cicd-init
changelog-generator
Composed Skills
| Stage |
Use |
release-pr-gates |
GitHub release PRs, branch discovery, gate + cut releases on the trunk, waiting for checks |
deploy |
General staging/production deploy checklist, local quality gates, post-deploy monitoring |
github-fix-ci |
Failed GitHub Actions checks on release or deploy PRs |
ec2-backend-deployer |
Docker + GitHub Actions + EC2 backend deployment setup |
testing-cicd-init |
Missing or weak GitHub Actions/test infrastructure |
changelog-generator |
Release notes from commit history |
| Provider-specific skills |
Vercel, Docker, Turborepo, monitoring, or app-specific deployment when present |
Discovery Phase
Always inspect before choosing a path:
git status -sb
git remote -v
git branch -r
find . -maxdepth 3 -type f \( -name 'package.json' -o -name 'vercel.json' -o -name 'Dockerfile' -o -name 'docker-compose.yml' -o -name 'docker-compose.yaml' -o -name 'turbo.json' \)
find .github/workflows -maxdepth 1 -type f 2>/dev/null
For GitHub repos:
gh repo view --json nameWithOwner,defaultBranchRef
gh workflow list
Capture:
- Current branch and dirty worktree state
- Default (trunk) branch and remote branch list
- CI provider and required checks
- Deploy provider: Vercel, EC2/Docker, GitHub Actions, custom scripts, or unknown
- Package manager and quality commands
- Environment targets: preview, staging, production
Routing Rules
Release
If the user wants to cut a release:
- Use
release-pr-gates to gate the release on the trunk (default branch).
- A short-lived feature or fix branch is merged into the trunk via PR; the release is then cut from the trunk as a semver tag + GitHub release.
staging and production are deployment environments driven by CI/tags — not git branches.
- Wait for quality gates before calling the release ready.
- Use
github-fix-ci if checks fail.
Direct Provider Deploy
If the user wants to deploy the current branch/app to an environment:
- Use
deploy for local pre-deploy checks and post-deploy verification.
- Route provider setup or execution:
- Vercel project: use Vercel-specific guidance or CLI.
- EC2/Docker backend: use
ec2-backend-deployer.
- Turborepo: inspect
turbo.json and use affected builds where appropriate.
- Unknown provider: inspect scripts and workflow files before acting.
- Do not deploy production without explicit confirmation.
CI Setup or Repair
If the repo has no CI or weak gates:
- Use
testing-cicd-init to add baseline checks.
- Use
deploy after CI exists.
- For failing existing checks, use
github-fix-ci.
Release Notes
If the release needs user-facing notes or a PR body:
- Use
changelog-generator for commit summaries.
- Include migrations, env changes, and rollback notes when visible.
Deployment Workflow
Discover repo topology and deployment provider.
Choose the narrowest route from the routing rules.
Run local gates before every release PR or deployment. Format, lint, and type-check are mandatory:
bun run format || npm run format || npx biome check --write .
bun run lint || npm run lint || bunx turbo lint
bun run typecheck || bun run type-check || npm run typecheck || npm run type-check || npx tsc --noEmit
bun run test || npm test
bun run build || npm run build
Fix format, lint, and type-check failures before pushing or deploying. Tests
and build should run when configured; report absent scripts as coverage gaps.
Execute the selected release or deploy path.
Wait for remote checks or deployment status.
Verify the deployed environment:
- health endpoint
- critical page/API path
- logs or monitoring when available
Report final status and blockers.
Safety Rules
- Never hide a dirty worktree; identify whether local changes are part of the deploy.
- Never bypass branch protection or required checks.
- Never merge or deploy production without explicit confirmation.
- Never assume a
staging environment is configured; verify CI/deployment settings.
- Never call skipped or absent checks green.
- Prefer existing repo scripts and workflows over inventing new deploy commands.
- If a provider cannot be identified, stop after discovery and report what is missing.
Output Shape
Return a compact deployment state:
Deployment route: [release PR / provider deploy / CI setup / repair]
Repository: [owner/repo]
Branches: [source] -> [target] or [current branch]
Provider: [Vercel/EC2/Docker/GitHub Actions/custom/unknown]
Checks: [passing/failing/pending/not configured]
Deployment: [not started/in progress/succeeded/failed]
Verification: [passed/failed/not available]
Needs confirmation: [production merge/deploy, if applicable]
1---
2name: deployment-composer
3description: Compose deployment workflows from smaller skills and repo signals, including trunk-based releases, CI quality gates, provider deployment, post-deploy verification, rollback, and failed-check diagnosis. Use when the user asks for a deployment plan, release workflow, ship-to-staging/production environments, or a smart deploy process across GitHub, Vercel, EC2, Docker, or custom CI.
4compatibility: Requires local repository access. GitHub release flows require gh and git access.
5metadata:
6 version: "1.2.1"
7 tags: "deployment, orchestration, release, ci-cd, github, staging, production"
8allowed-tools: Bash(git *) Bash(gh *) Bash(ls *) Bash(find *) Bash(rg *) Bash(cat *)
9---
10
11# Deployment Composer
12
13Compose the smallest safe deployment workflow from the repository's actual branching model, CI setup, deploy provider, and release risk. Routes work to focused skills instead of treating every deploy as the same checklist.
14
15## Authorized Scope
16
17Apply this engine only within the user's requested task and existing explicit
18authorization. Loading or delegating to it grants no additional authority.
19Preserve report-only restrictions and the caller's target, host, provider, and
20cost limits. Existing approval satisfies a gate only for the same actions and
21scope; obtain approval before expanding them. Forward these limits to delegates.
22
23## Contract
24
25Inputs:
26
27- Repository root
28- Desired release/deploy goal
29- Optional target environment, source branch, target branch, PR number, or provider
30
31Outputs:
32
33- Deployment route: release PR, provider deploy, CI setup, or repair
34- Selected delegated skills
35- Quality gate state
36- Confirmation gates still required
37
38Creates/Modifies:
39
40- Nothing during discovery
41- May create local release notes or PR body files
42- May create GitHub PRs only through `release-pr-gates` after confirmation rules are satisfied
43
44External Side Effects:
45
46- Reads git/GitHub metadata and workflow status
47- May trigger provider deployment commands through delegated skills
48
49Confirmation Required:
50
51- Before production deploys or merges
52- Before creating GitHub PRs when the user did not explicitly request PR creation
53- Before running provider commands with production flags
54
55Delegates To:
56
57- `release-pr-gates`
58- `deploy`
59- `github-fix-ci`
60- `ec2-backend-deployer`
61- `testing-cicd-init`
62- `changelog-generator`
63
64## Composed Skills
65
66| Stage | Use |
67|-------|-----|
68| `release-pr-gates` | GitHub release PRs, branch discovery, gate + cut releases on the trunk, waiting for checks |
69| `deploy` | General staging/production deploy checklist, local quality gates, post-deploy monitoring |
70| `github-fix-ci` | Failed GitHub Actions checks on release or deploy PRs |
71| `ec2-backend-deployer` | Docker + GitHub Actions + EC2 backend deployment setup |
72| `testing-cicd-init` | Missing or weak GitHub Actions/test infrastructure |
73| `changelog-generator` | Release notes from commit history |
74| Provider-specific skills | Vercel, Docker, Turborepo, monitoring, or app-specific deployment when present |
75
76## Discovery Phase
77
78Always inspect before choosing a path:
79
80```bash
81git status -sb
82git remote -v
83git branch -r
84find . -maxdepth 3 -type f \( -name 'package.json' -o -name 'vercel.json' -o -name 'Dockerfile' -o -name 'docker-compose.yml' -o -name 'docker-compose.yaml' -o -name 'turbo.json' \)
85find .github/workflows -maxdepth 1 -type f 2>/dev/null
86```
87
88For GitHub repos:
89
90```bash
91gh repo view --json nameWithOwner,defaultBranchRef
92gh workflow list
93```
94
95Capture:
96
97- Current branch and dirty worktree state
98- Default (trunk) branch and remote branch list
99- CI provider and required checks
100- Deploy provider: Vercel, EC2/Docker, GitHub Actions, custom scripts, or unknown
101- Package manager and quality commands
102- Environment targets: preview, staging, production
103
104## Routing Rules
105
106### Release
107
108If the user wants to cut a release:
109
1101. Use `release-pr-gates` to gate the release on the trunk (default branch).
1112. A short-lived feature or fix branch is merged into the trunk via PR; the release is then cut from the trunk as a semver tag + GitHub release.
1123. `staging` and `production` are deployment environments driven by CI/tags — not git branches.
1134. Wait for quality gates before calling the release ready.
1145. Use `github-fix-ci` if checks fail.
115
116### Direct Provider Deploy
117
118If the user wants to deploy the current branch/app to an environment:
119
1201. Use `deploy` for local pre-deploy checks and post-deploy verification.
1212. Route provider setup or execution:
122 - Vercel project: use Vercel-specific guidance or CLI.
123 - EC2/Docker backend: use `ec2-backend-deployer`.
124 - Turborepo: inspect `turbo.json` and use affected builds where appropriate.
125 - Unknown provider: inspect scripts and workflow files before acting.
1263. Do not deploy production without explicit confirmation.
127
128### CI Setup or Repair
129
130If the repo has no CI or weak gates:
131
1321. Use `testing-cicd-init` to add baseline checks.
1332. Use `deploy` after CI exists.
1343. For failing existing checks, use `github-fix-ci`.
135
136### Release Notes
137
138If the release needs user-facing notes or a PR body:
139
1401. Use `changelog-generator` for commit summaries.
1412. Include migrations, env changes, and rollback notes when visible.
142
143## Deployment Workflow
144
1451. Discover repo topology and deployment provider.
1462. Choose the narrowest route from the routing rules.
1473. Run local gates before every release PR or deployment. Format, lint, and type-check are mandatory:
148
149 ```bash
150 bun run format || npm run format || npx biome check --write .
151 bun run lint || npm run lint || bunx turbo lint
152 bun run typecheck || bun run type-check || npm run typecheck || npm run type-check || npx tsc --noEmit
153 bun run test || npm test
154 bun run build || npm run build
155 ```
156
157 Fix format, lint, and type-check failures before pushing or deploying. Tests
158 and build should run when configured; report absent scripts as coverage gaps.
159
1604. Execute the selected release or deploy path.
1615. Wait for remote checks or deployment status.
1626. Verify the deployed environment:
163 - health endpoint
164 - critical page/API path
165 - logs or monitoring when available
1667. Report final status and blockers.
167
168## Safety Rules
169
170- Never hide a dirty worktree; identify whether local changes are part of the deploy.
171- Never bypass branch protection or required checks.
172- Never merge or deploy production without explicit confirmation.
173- Never assume a `staging` environment is configured; verify CI/deployment settings.
174- Never call skipped or absent checks green.
175- Prefer existing repo scripts and workflows over inventing new deploy commands.
176- If a provider cannot be identified, stop after discovery and report what is missing.
177
178## Output Shape
179
180Return a compact deployment state:
181
182```markdown
183Deployment route: [release PR / provider deploy / CI setup / repair]
184Repository: [owner/repo]
185Branches: [source] -> [target] or [current branch]
186Provider: [Vercel/EC2/Docker/GitHub Actions/custom/unknown]
187Checks: [passing/failing/pending/not configured]
188Deployment: [not started/in progress/succeeded/failed]
189Verification: [passed/failed/not available]
190Needs confirmation: [production merge/deploy, if applicable]
191```