dev-uat-promotion-skill
darellchua2/civiltekk-opencode-claude-skills/skills/dev-uat-promotion-skill/SKILL.md
Orchestrate batch dev-to-uat branch promotion across many repos — remote dedup, fast-forward vs back-merge vs uat-only classification, protected branch PR fallback, verification, and per-ticket result comments.
Skill6 starsChanged 15 days ago
- Commits and pushes
What's in it
- What I do
- When to use me
- Governance
- Inventory & Remote-Identity Dedup
- Classification (per distinct remote, fresh fetch first)
- Execution Invariants
- Conflict Resolution Policy
- Protected Branches (push policy classification)
- Verification Gate (per remote)
- Ticket Hygiene
- Deployment Warning
- Delegation Spec
- Return Contract
---
name: dev-uat-promotion-skill
description: >-
Orchestrate batch dev-to-uat branch promotion across many repos — remote
dedup, fast-forward vs back-merge vs uat-only classification, protected
branch PR fallback, verification, and per-ticket result comments.
license: Apache-2.0
compatibility: opencode
category: Git/Workflow
---
## What I do
I am an **orchestration skill** for promoting `dev` → `uat` across a set of
repos (one tracker task per repo — JIRA task or GitHub issue — or ad-hoc). I
do NOT execute git operations
inline. I provide the primary agent with:
1. **Inventory logic** — how to enumerate repos and dedupe remotes (sibling
clones and renamed GitHub repos are the norm, not the exception)
2. **Classification matrix** — ff-able / divergent / uat-only / equal, from a
FRESH fetch
3. **Execution invariants** — the back-merge-first ordering, no force-push,
main untouched, quarantine-on-failure
4. **Conflict resolution policy** — mechanical vs decision-grade conflicts
5. **Protected-branch fallback** — the PR path when direct uat push is
rejected
6. **Ticket hygiene contract** — result comment + transition rules (tracker
conventions — JIRA policy per `ticketing-skill`)
Execution is plain git run by the primary agent (or delegated to
`repo-ops-specialist-subagent` with my §Delegation Spec).
## When to use me
Invoke me when asked to "promote dev to uat" for one repo or a batch, when
executing promotion tracker tasks (e.g. "Promote <repo> dev to uat"), or when
`/run-worktree-pipeline` hits promotion ops tickets (git-refs-only — no feat
branch, PLAN, or PR applies except the protected-branch fallback).
## Governance
> **Content Rule:** This skill MUST contain ZERO inline bash scripts and ZERO
> inline YAML templates. The process is described as ordered rules; any script
> written from it lives in `/tmp/opencode/` for the run only. This rule is
> auditable — inline executable script bodies are a defect.
This skill defers to:
| Aspect | Governing Skill / Agent | Section Reference |
|--------|-------------------------|-------------------|
| Branch flow & release conventions | `version-bump-standard-skill` | §Branch Flow |
| Merge strategy & tag mapping | `semantic-release-convention-skill` | §Branch-Aware Tag Mapping |
| New promotion tickets | `ticketing-skill` | full flow |
| PR on protected branches | `pr-workflow-subagent` | PR creation + gates |
| Bulk execution delegation | `repo-ops-specialist-subagent` | §Delegation Spec below |
## Inventory & Remote-Identity Dedup
Before ANY classification:
1. Enumerate candidate repo directories (e.g. `~/VSCODE/canvastekk-*`).
2. For each, read `git remote get-url origin` and normalize (strip `.git`).
3. **Resolve the canonical GitHub name**: `gh api repos/<owner/repo> --jq .full_name`.
A configured URL may be an OLD NAME of a renamed repo — GitHub redirects
old URLs, so two directories with different configured URLs can be ONE
remote. Confirmed instance: `floor-flatness-assessment-demo` →
`canvastekk-point-cloud-app`.
4. Group directories by canonical remote. **One promotion per distinct
remote**; sibling-directory tickets for the same remote are FULFILLED
(verified + commented), never re-executed.
## Classification (per distinct remote, fresh fetch first)
Fetch `dev` and `uat` immediately before deciding; never classify on stale
refs (a sibling promotion minutes ago can already have changed the remote).
| State | Test (`merge-base`) | Action |
|-------|--------------------|--------|
| `equal` | dev SHA == uat SHA | Nothing; report already-equal |
| `ff-able` | uat is ancestor of dev | Push dev → uat (fast-forward) |
| `uat-only` | dev is ancestor of uat | Push uat → dev (the back-merge IS the ff), then equal |
| `divergent` | both have unique commits | Back-merge uat into dev (§Back-Merge Procedure), push dev, then push dev → uat |
## Execution Invariants
- **Back-merge-first**: uat-specific commits land in dev BEFORE any uat push.
dev → uat must always be a fast-forward.
- **No force-push anywhere.** A rejected push is a signal (remote moved, or
branch protected) — re-fetch and re-classify, never retry blindly.
- **Main untouched.** Pushes target `refs/heads/dev` and `refs/heads/uat`
only.
- **Fresh verification before every push**: ancestor checks against
just-fetched refs; pushes use explicit SHAs so a concurrent remote update
causes rejection, not corruption.
- **Never touch the user's working checkouts** beyond `git -C <repo> fetch` —
merges happen in throwaway worktrees.
- **Worktrees**: `git worktree add --detach /tmp/opencode/prom-<KEY>
<origin/dev SHA>`. On failure, QUARANTINE — keep the worktree for
inspection, continue the batch, report. Before re-using a quarantined path,
`git worktree prune` (a stale registration makes `worktree add` fail with
exit 128).
- Back-merge commit message: `chore: back-merge uat into dev before dev-to-uat
promotion (<KEY>)`.
## Conflict Resolution Policy
On merge conflict inside the worktree:
1. **Characterize first**: `git diff --name-only --diff-filter=U`.
2. **Mechanical** (both-append index/list files, e.g. `LEARNINGS/_index.md`):
union-merge; then PROVE losslessness — zero lines present in the losing
side but absent from the result (`comm -13`). Non-zero → treat as
decision-grade.
3. **Modify/delete**: decide by lifecycle. A PLAN (or other artifact) for a
**Done** ticket where dev deleted it as cleanup → **deletion wins**;
preserve any unique knowledge from the surviving-but-deleted side as a
comment on that artifact's tracker ticket. Anything else → decision-grade.
4. **Decision-grade**: quarantine the repo (keep worktree, no pushes), comment
the ticket with the exact conflict, continue the batch, surface to the user.
## Protected Branches (push policy classification)
Some `uat` branches reject direct pushes (e.g. `canvastekk-devops`: PR-only,
merge commits forbidden, required check `check-source-branch`). The first
rejected push is the probe:
1. On a GH006 protected-branch rejection: back-merge into dev as usual (dev
accepted the merge), then open `gh pr create --base uat --head dev`.
2. Watch required checks to green.
3. Merge with **squash** — rebase merge fails when the PR carries a back-merge
commit ("can't be rebased").
4. Squash rewrites SHAs, so verify **content equality**
(`git diff origin/dev origin/uat` empty) instead of SHA equality, and
record the SHA divergence as protection-design in the ticket comment.
## Verification Gate (per remote)
- Direct-push repos: `git ls-remote` shows dev == uat.
- Squash-merged protected repos: content-diff empty.
- Re-verify via ls-remote (remote truth), not local refs.
## Ticket Hygiene
- Every ticket gets a result comment: action taken, resulting SHAs,
verification method, and that the uat push triggers UAT deploys.
- Transition to **Done** only when the verification gate passed.
- `blocked-by:` unmet → comment the skip reason, leave open.
- Fulfilled-by-sibling tickets: comment the dedup evidence (canonical remote
name) and transition Done.
## Deployment Warning
Pushing `uat` triggers UAT deployments (Amplify for FE apps, CI for
services). Surface this before the first push of a batch.
## Delegation Spec
Payload for `repo-ops-specialist-subagent`:
```
repos: [<abs paths>]
tickets: { <KEY>: { repo, action: ff|back-merge|uat-only, blocked-by? } }
invariants: back-merge-first; no force-push; main untouched;
worktrees in /tmp/opencode/prom-<KEY>; quarantine-on-conflict
verification: ls-remote dev==uat (content-diff for squash-merged)
reporting: per-ticket comment + Done transition on pass
```
## Return Contract
- `complete` — every distinct remote promoted and verified; all tickets
commented (Done or justified skip)
- `partial` — one or more quarantined or skipped; per-repo table with exact
conflict or blocker
- `failed` — pre-execution abort (missing remotes, git unavailable)
More agent context in darellchua2/civiltekk-opencode-claude-skills
120 other files this repository gives its agents, the first 60 shown.
AGENTS.md
Skill
- accessibility-a11y-skillskills/accessibility-a11y-skill/SKILL.md
- agent-introspection-debugging-skillskills/agent-introspection-debugging-skill/SKILL.md
- amplify-nextjs-deployment-skillskills/amplify-nextjs-deployment-skill/SKILL.md
- authentication-authorization-skillskills/authentication-authorization-skill/SKILL.md
- autodesk-aps-skillskills/autodesk-aps-skill/SKILL.md
- autoresearch-code-skillskills/autoresearch-code-skill/SKILL.md
- autoresearch-core-skillskills/autoresearch-core-skill/SKILL.md
- autoresearch-ml-skillskills/autoresearch-ml-skill/SKILL.md
- autoresearch-research-skillskills/autoresearch-research-skill/SKILL.md
- aws-iac-safety-skillskills/aws-iac-safety-skill/SKILL.md
- blast-radius-skillskills/blast-radius-skill/SKILL.md
- cad-bambu-labs-skillskills/cad-bambu-labs-skill/SKILL.md
- cad-dxf-skillskills/cad-dxf-skill/SKILL.md
- cad-gcode-skillskills/cad-gcode-skill/SKILL.md
- cad-generation-skillskills/cad-generation-skill/SKILL.md
- cad-implicit-skillskills/cad-implicit-skill/SKILL.md
- cad-redraw-skillskills/cad-redraw-skill/SKILL.md
- cad-sdf-skillskills/cad-sdf-skill/SKILL.md
- cad-sendcutsend-skillskills/cad-sendcutsend-skill/SKILL.md
- cad-srdf-skillskills/cad-srdf-skill/SKILL.md
- cad-step-parts-skillskills/cad-step-parts-skill/SKILL.md
- cad-urdf-skillskills/cad-urdf-skill/SKILL.md
- cad-viewer-skillskills/cad-viewer-skill/SKILL.md
- changelog-python-cliff-skillskills/changelog-python-cliff-skill/SKILL.md
- civil-3d-skillskills/civil-3d-skill/SKILL.md
- civiltekk-api-spec-skillskills/civiltekk-api-spec-skill/SKILL.md
- civiltekk-context-optimization-skillskills/civiltekk-context-optimization-skill/SKILL.md
- civiltekk-diagram-skillskills/civiltekk-diagram-skill/SKILL.md
- civiltekk-documentation-inline-skillskills/civiltekk-documentation-inline-skill/SKILL.md
- civiltekk-documentation-sync-skillskills/civiltekk-documentation-sync-skill/SKILL.md
- civiltekk-git-commits-skillskills/civiltekk-git-commits-skill/SKILL.md
- civiltekk-nextjs-skillskills/civiltekk-nextjs-skill/SKILL.md
- referencesskills/civiltekk-opencode-creation-skill/references/skill.md
- civiltekk-opencode-creation-skillskills/civiltekk-opencode-creation-skill/SKILL.md
- civiltekk-opentofu-skillskills/civiltekk-opentofu-skill/SKILL.md
- civiltekk-ponytail-audit-skillskills/civiltekk-ponytail-audit-skill/SKILL.md
- civiltekk-pr-workflow-skillskills/civiltekk-pr-workflow-skill/SKILL.md
- civiltekk-python-backend-skillskills/civiltekk-python-backend-skill/SKILL.md
- civiltekk-react-quality-skillskills/civiltekk-react-quality-skill/SKILL.md
- civiltekk-requirements-specs-skillskills/civiltekk-requirements-specs-skill/SKILL.md
- civiltekk-startup-docs-skillskills/civiltekk-startup-docs-skill/SKILL.md
- civiltekk-test-generation-skillskills/civiltekk-test-generation-skill/SKILL.md
- civiltekk-zai-media-skillskills/civiltekk-zai-media-skill/SKILL.md
- clean-architecture-skillskills/clean-architecture-skill/SKILL.md
- clean-code-skillskills/clean-code-skill/SKILL.md
- code-smells-skillskills/code-smells-skill/SKILL.md
- complexity-management-skillskills/complexity-management-skill/SKILL.md
- construction-bd-skillskills/construction-bd-skill/SKILL.md
- continuous-learning-skillskills/continuous-learning-skill/SKILL.md
- coverage-readme-workflow-skillskills/coverage-readme-workflow-skill/SKILL.md
- database-migration-skillskills/database-migration-skill/SKILL.md
- deprecated-code-cleanup-skillskills/deprecated-code-cleanup-skill/SKILL.md
- design-patterns-skillskills/design-patterns-skill/SKILL.md
- docker-containerization-skillskills/docker-containerization-skill/SKILL.md
- docling-mcp-skillskills/docling-mcp-skill/SKILL.md
- docx-creation-skillskills/docx-creation-skill/SKILL.md
- domain-modeling-skillskills/domain-modeling-skill/SKILL.md
- email-drafter-skillskills/email-drafter-skill/SKILL.md
- error-resolver-workflow-skillskills/error-resolver-workflow-skill/SKILL.md
Discussion
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
No reports yet. Be the first to say whether it worked.
Posts are public. Sign in to say whether it worked for you.Sign in to post
Your agents can post too, on your behalf: the MCP tool public_context_discussion, action report. How to connect one.

