Skill: git-workflow
Overview
Git Workflow Enforcer. Three-branch model: feature → dev → main. AI commits blocked on protected branches. Feature branches merge to dev via PR. Squash at PR creation only. Submodule-aware.
Persona
Git Workflow Enforcer. Focus: three-branch workflow, block AI on protected branches, squash-on-PR-only discipline.
Tasks
| Task |
Words |
pre-work |
≈480 |
implementation |
≈400 |
review-prep |
≈390 |
pr-creation |
≈385 |
rebase-pending |
≈1666 |
cleanup |
≈950 |
release-promotion |
≈500 |
check-pr |
≈50 |
provenance |
≈460 |
pair-pre-work |
≈400 |
pair-commit |
≈350 |
pair-pr-creation |
≈300 |
pair-cleanup |
≈350 |
pair-mode-resume |
≈300 |
completion |
≈200 |
Routing: Feature PR vs Release PR
| Request Type |
Target |
| Feature PR (feature/* → dev) |
pr-creation-workflow skill |
| Release PR (dev → main) |
git-workflow --task release-promotion |
Invocation
skill({name: "git-workflow"}) — call the skill, then call via task():
| Task |
Call via task() |
pre-work |
task(..., prompt: "execute pre-work task from git-workflow") |
implementation |
task(..., prompt: "execute implementation task from git-workflow") |
review-prep |
task(..., prompt: "execute review-prep task from git-workflow") |
pr-creation |
task(..., prompt: "execute pr-creation task from git-workflow") |
rebase-pending |
task(..., prompt: "execute rebase-pending task from git-workflow") |
cleanup |
task(..., prompt: "execute cleanup task from git-workflow") |
release-promotion |
task(..., prompt: "execute release-promotion task from git-workflow") |
check-pr |
task(..., prompt: "execute check-pr task from git-workflow") |
provenance |
task(..., prompt: "execute provenance task from git-workflow") |
completion |
task(..., prompt: "execute completion task from git-workflow") |
CLI equivalent (for human TUI use): /skill git-workflow --task <task>
Sub-Agent Tasks for Submodule Operations
| Sub-Agent Task |
Trigger |
Task Context (MUST receive) |
Exclusions (MUST NOT receive) |
Words |
submodule-tag-prework |
pre-work Step 3.5 |
parent_repo, issue_number, submodule_paths |
Implementation context, agent memory, other sub-agent results |
≈400 |
submodule-feature-push |
review-prep Step 0 |
parent_repo, issue_number, submodule_paths, submodule_branches |
Implementation context, agent memory, orchestrator reasoning |
≈450 |
submodule-liveness-check |
enforcement-gate Step 0, PR-time |
submodule_paths, referenced_hashes, parent_repo, issue_number |
Implementation context, agent memory, prior verification results |
≈350 |
submodule-dev-restore |
cleanup Step 1.9 |
submodule_paths |
Implementation context, agent memory, other sub-agent results |
≈300 |
Operating Protocol
- Worktree first: set
worktree.path before file ops (direct-branch mode when WORKTREE_REQUIRED not set).
- Protected branches: never commit to
main/dev.
- Squash discipline: squash ONLY at PR creation, not during feature dev.
- Clean-room content diff: before branch deletion, verify content exists on target branch.
- Compare URL base: feature →
compare/dev...<branch>. Release → compare/main...dev.
- Submodule repos: git ops from inside submodule dir. No
--recursive.
- Pair mode:
pair-* branches use WIP-commit switching, not worktrees.
- Adversarial-audit call: after PR merge verification, call
adversarial-audit --task closure-verification --pr <N> with audit_phase: post_merge.
- No dependency-sync PRs: tag-based hash permanence replaces intermediate PRs. Submodule SHAs are preserved via parent-repo-prefixed tags. See AGENTS.md §Tag Layers.
Sub-Agent Routing
All tasks run via task(subagent_type="general") with { branch_name, worktree.path, github.owner, github.repo }, excluding implementation context and agent memory. Auditor tasks use subagent_type from resolve-models result contract (auditor_1/auditor_2) — NOT general. Include audit_phase in task context when routing auditors. See adversarial-audit SKILL.md §DISPATCH_GATE. pr-creation receives spec summary. cleanup receives PR merge status. provenance receives submodule path. pre-analysis receives only { issue_number, task_description, github.owner, github.repo }. No inline work.
Submodule sub-agents (submodule-tag-prework, submodule-feature-push, submodule-liveness-check, submodule-dev-restore) receive scoped context per the Sub-Agent Tasks for Submodule Operations table above. All are clean-room runs — no implementation context, agent memory, or orchestrator reasoning shared. Submodule git operations are NEVER performed inline.
Cross-References
Skills: conflict-resolution, pr-creation-workflow, using-git-worktrees, pre-analysis, adversarial-audit --task closure-verification. Guidelines: 010-approval-gate.md, 000-critical-rules.md.
schema_version: "2.0"
last_updated: "2026-05-01T00:00:00Z"
rules:
- id: git-workflow-001
title: "No commits to main or dev branches"
conditions:
any: ["current_branch == 'main'", "current_branch == 'dev'"]
actions: [HALT]
source: "git-workflow/SKILL.md"
- id: git-workflow-002
title: "Squash only at PR creation time"
conditions:
all: ["squash_attempted == true", "pr_creation_context == false"]
actions: [HALT]
source: "git-workflow/SKILL.md"
- id: git-workflow-003
title: "Compare URL base must be dev for feature branches"
conditions:
all: ["compare_url_generated == true", "base_branch != 'dev'", "is_feature_branch == true"]
actions: [HALT]
source: "git-workflow/SKILL.md"
- id: git-workflow-submodule-001
title: "Pre-work MUST tag submodule dev tips with <parent>/<issue> format"
conditions:
all: ["pipeline_stage == 'pre_work'", "has_submodules == true", "submodule_tag_created == false"]
actions: [HALT, REQUIRE_TAG]
source: "git-workflow/SKILL.md"
- id: git-workflow-submodule-002
title: "Submodule changes MUST use feature-branch pushes with tip tags, not dev pushes"
conditions:
all: ["submodule_push_attempted == true", "push_target == 'dev'", "is_feature_branch_push == false"]
actions: [HALT]
source: "git-workflow/SKILL.md"
- id: git-workflow-submodule-003
title: "PR-time MUST verify submodule hash reachability via tags (liveness check, no auto-remediation)"
conditions:
all: ["pipeline_stage == 'pr_time'", "has_submodules == true", "submodule_liveness_verified == false"]
actions: [HALT, REQUIRE_LIVENESS_CHECK]
source: "git-workflow/SKILL.md"
- id: git-workflow-submodule-004
title: "Cleanup MUST restore submodules to dev tip, NO dependency-sync PR"
conditions:
all: ["pipeline_stage == 'cleanup'", "has_submodules == true", "submodule_dev_restored == false"]
actions: [HALT, RESTORE_SUBMODULES]
source: "git-workflow/SKILL.md"
- id: git-workflow-submodule-005
title: "Submodule operations MUST run via sub-agents, never inline"
conditions:
all: ["submodule_operation_pending == true", "routed_to_sub_agent == false"]
actions: [HALT]
source: "git-workflow/SKILL.md"
---
> Source: [michael-conrad/.opencode](https://github.com/michael-conrad/.opencode) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-06-16 -->
1---2name: michael-conrad-opencode-git-workflow3description: Skill: git-workflow4---56# Skill: git-workflow78## Overview910Git Workflow Enforcer. Three-branch model: feature → dev → main. AI commits blocked on protected branches. Feature branches merge to `dev` via PR. Squash at PR creation only. Submodule-aware.1112## Persona1314Git Workflow Enforcer. Focus: three-branch workflow, block AI on protected branches, squash-on-PR-only discipline.1516## Tasks1718| Task | Words |19|------|-------|20| `pre-work` | ≈480 |21| `implementation` | ≈400 |22| `review-prep` | ≈390 |23| `pr-creation` | ≈385 |24| `rebase-pending` | ≈1666 |25| `cleanup` | ≈950 |26| `release-promotion` | ≈500 |27| `check-pr` | ≈50 |28| `provenance` | ≈460 |29| `pair-pre-work` | ≈400 |30| `pair-commit` | ≈350 |31| `pair-pr-creation` | ≈300 |32| `pair-cleanup` | ≈350 |33| `pair-mode-resume` | ≈300 |34| `completion` | ≈200 |3536## Routing: Feature PR vs Release PR3738| Request Type | Target |39|---|---|40| Feature PR (feature/* → dev) | `pr-creation-workflow` skill |41| Release PR (dev → main) | `git-workflow --task release-promotion` |4243## Invocation4445`skill({name: "git-workflow"})` — call the skill, then call via task():4647| Task | Call via task() |48|------|----------|49| `pre-work` | `task(..., prompt: "execute pre-work task from git-workflow")` |50| `implementation` | `task(..., prompt: "execute implementation task from git-workflow")` |51| `review-prep` | `task(..., prompt: "execute review-prep task from git-workflow")` |52| `pr-creation` | `task(..., prompt: "execute pr-creation task from git-workflow")` |53| `rebase-pending` | `task(..., prompt: "execute rebase-pending task from git-workflow")` |54| `cleanup` | `task(..., prompt: "execute cleanup task from git-workflow")` |55| `release-promotion` | `task(..., prompt: "execute release-promotion task from git-workflow")` |56| `check-pr` | `task(..., prompt: "execute check-pr task from git-workflow")` |57| `provenance` | `task(..., prompt: "execute provenance task from git-workflow")` |58| `completion` | `task(..., prompt: "execute completion task from git-workflow")` |5960**CLI equivalent (for human TUI use):** `/skill git-workflow --task <task>`6162## Sub-Agent Tasks for Submodule Operations6364| Sub-Agent Task | Trigger | Task Context (MUST receive) | Exclusions (MUST NOT receive) | Words |65|----------------|---------|----------------------------------|-------------------------------|-------|66| `submodule-tag-prework` | pre-work Step 3.5 | parent_repo, issue_number, submodule_paths | Implementation context, agent memory, other sub-agent results | ≈400 |67| `submodule-feature-push` | review-prep Step 0 | parent_repo, issue_number, submodule_paths, submodule_branches | Implementation context, agent memory, orchestrator reasoning | ≈450 |68| `submodule-liveness-check` | enforcement-gate Step 0, PR-time | submodule_paths, referenced_hashes, parent_repo, issue_number | Implementation context, agent memory, prior verification results | ≈350 |69| `submodule-dev-restore` | cleanup Step 1.9 | submodule_paths | Implementation context, agent memory, other sub-agent results | ≈300 |7071## Operating Protocol72731. **Worktree first:** set `worktree.path` before file ops (direct-branch mode when `WORKTREE_REQUIRED` not set).742. **Protected branches:** never commit to `main`/`dev`.753. **Squash discipline:** squash ONLY at PR creation, not during feature dev.764. **Clean-room content diff:** before branch deletion, verify content exists on target branch.775. **Compare URL base:** feature → `compare/dev...<branch>`. Release → `compare/main...dev`.786. **Submodule repos:** git ops from inside submodule dir. No `--recursive`.797. **Pair mode:** `pair-*` branches use WIP-commit switching, not worktrees.808. **Adversarial-audit call:** after PR merge verification, call `adversarial-audit --task closure-verification --pr <N>` with `audit_phase: post_merge`.819. **No dependency-sync PRs:** tag-based hash permanence replaces intermediate PRs. Submodule SHAs are preserved via parent-repo-prefixed tags. See AGENTS.md §Tag Layers.8283## Sub-Agent Routing8485All tasks run via `task(subagent_type="general")` with `{ branch_name, worktree.path, github.owner, github.repo }`, excluding implementation context and agent memory. Auditor tasks use subagent_type from resolve-models result contract (auditor_1/auditor_2) — NOT `general`. Include audit_phase in task context when routing auditors. See adversarial-audit SKILL.md §DISPATCH_GATE. `pr-creation` receives spec summary. `cleanup` receives PR merge status. `provenance` receives submodule path. `pre-analysis` receives only `{ issue_number, task_description, github.owner, github.repo }`. No inline work.8687Submodule sub-agents (`submodule-tag-prework`, `submodule-feature-push`, `submodule-liveness-check`, `submodule-dev-restore`) receive scoped context per the Sub-Agent Tasks for Submodule Operations table above. All are clean-room runs — no implementation context, agent memory, or orchestrator reasoning shared. Submodule git operations are NEVER performed inline.8889## Cross-References9091Skills: `conflict-resolution`, `pr-creation-workflow`, `using-git-worktrees`, `pre-analysis`, `adversarial-audit --task closure-verification`. Guidelines: `010-approval-gate.md`, `000-critical-rules.md`.9293```yaml+symbolic94schema_version: "2.0"95last_updated: "2026-05-01T00:00:00Z"96rules:97 - id: git-workflow-00198 title: "No commits to main or dev branches"99 conditions:100 any: ["current_branch == 'main'", "current_branch == 'dev'"]101 actions: [HALT]102 source: "git-workflow/SKILL.md"103104 - id: git-workflow-002105 title: "Squash only at PR creation time"106 conditions:107 all: ["squash_attempted == true", "pr_creation_context == false"]108 actions: [HALT]109 source: "git-workflow/SKILL.md"110111 - id: git-workflow-003112 title: "Compare URL base must be dev for feature branches"113 conditions:114 all: ["compare_url_generated == true", "base_branch != 'dev'", "is_feature_branch == true"]115 actions: [HALT]116 source: "git-workflow/SKILL.md"117118 - id: git-workflow-submodule-001119 title: "Pre-work MUST tag submodule dev tips with <parent>/<issue> format"120 conditions:121 all: ["pipeline_stage == 'pre_work'", "has_submodules == true", "submodule_tag_created == false"]122 actions: [HALT, REQUIRE_TAG]123 source: "git-workflow/SKILL.md"124125 - id: git-workflow-submodule-002126 title: "Submodule changes MUST use feature-branch pushes with tip tags, not dev pushes"127 conditions:128 all: ["submodule_push_attempted == true", "push_target == 'dev'", "is_feature_branch_push == false"]129 actions: [HALT]130 source: "git-workflow/SKILL.md"131132 - id: git-workflow-submodule-003133 title: "PR-time MUST verify submodule hash reachability via tags (liveness check, no auto-remediation)"134 conditions:135 all: ["pipeline_stage == 'pr_time'", "has_submodules == true", "submodule_liveness_verified == false"]136 actions: [HALT, REQUIRE_LIVENESS_CHECK]137 source: "git-workflow/SKILL.md"138139 - id: git-workflow-submodule-004140 title: "Cleanup MUST restore submodules to dev tip, NO dependency-sync PR"141 conditions:142 all: ["pipeline_stage == 'cleanup'", "has_submodules == true", "submodule_dev_restored == false"]143 actions: [HALT, RESTORE_SUBMODULES]144 source: "git-workflow/SKILL.md"145146 - id: git-workflow-submodule-005147 title: "Submodule operations MUST run via sub-agents, never inline"148 conditions:149 all: ["submodule_operation_pending == true", "routed_to_sub_agent == false"]150 actions: [HALT]151 source: "git-workflow/SKILL.md"152153---154> Source: [michael-conrad/.opencode](https://github.com/michael-conrad/.opencode) — distributed by [TomeVault](https://tomevault.io).155<!-- tomevault:4.0:skill_md:2026-06-16 -->