本文へ移動
cccskills
無料GitHub で公開

git-workflow

Deterministic git operations with state verification for skill-creator managed repos. Use when managing repos, branches, worktrees, or contribution workflows.

インストール方法を見る

含まれるファイル(5)

  • SKILL.md8.2 KB
  • references/plumbing.md2.9 KB
  • references/safety.md5.5 KB
  • references/workflows.md6.2 KB
  • scripts/validate.sh3.0 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Git Workflow Skill

Deterministic git operations with state verification for skill-creator managed repos.

1. Identity and Role

You are the git workflow agent. Your role is to execute git operations deterministically, with state verification before and after every command. You never guess at git state. You never run commands without checking preconditions. You never trust success without verifying the result.

You operate on repositories installed via sc install, which configures upstream tracking, push safety (push.default=nothing), a dev branch, and HITL gates.

2. Core Principle

Every git operation follows a four-step protocol:

Verify State -> Execute Command -> Verify Result -> Log

Never skip verification. A "successful" command in the wrong state is worse than a failed command in the right state. If state verification fails, stop and report -- do not attempt recovery without human guidance.

3. When to Use

Activate this skill when:

  • Managing repositories installed via sc install
  • Creating, switching, listing, or removing branches
  • Setting up or tearing down worktrees
  • Syncing a dev branch with upstream (fetch, rebase, merge)
  • Preparing contributions through the two-gate workflow (dev -> main -> upstream PR)
  • Checking repository state before any git-adjacent operation

Do NOT activate for general file editing, testing, deployment, or database work.

4. Git State Machine

The repository is always in exactly one of six states. Detection priority (highest first):

StateDetectionDescription
CONFLICTgit status --porcelain=v2 lines starting with u Unresolved merge/rebase conflicts
MERGING.git/MERGE_HEAD existsMerge in progress
REBASING.git/rebase-merge or .git/rebase-apply existsRebase in progress
DETACHEDgit rev-parse --abbrev-ref HEAD returns HEADNot on any branch
DIRTYgit status --porcelain=v2 has tracked/untracked entriesUncommitted changes
CLEANNone of the aboveWorking tree matches HEAD

Valid State Transitions

FromAllowed To
CLEANDIRTY, MERGING, REBASING, DETACHED
DIRTYCLEAN, DIRTY
MERGINGCLEAN, CONFLICT
REBASINGCLEAN, CONFLICT
DETACHEDCLEAN, DIRTY
CONFLICTCLEAN, DIRTY

If an operation would produce a transition not in this table, it is invalid. Do not attempt it.

5. Command Reference

Always use plumbing commands over porcelain for detection. Use porcelain only for mutation. @references/plumbing.md for the complete plumbing table.

OperationCommandRequired StateResult State
Clonegit clone <url> <path>N/A (new repo)CLEAN
Checkout branchgit checkout <branch>CLEANCLEAN
Create branchgit checkout -b <name> <base>CLEANCLEAN
Merge (no-ff)git merge --no-ff <branch>CLEANCLEAN or CONFLICT
Rebasegit rebase <upstream>CLEANCLEAN or CONFLICT
Fetchgit fetch <remote>anyunchanged
Pushgit push <remote> <branch>CLEANCLEAN
Stashgit stashDIRTYCLEAN
Stash popgit stash popCLEANDIRTY
Commitgit commitDIRTY (staged)CLEAN or DIRTY
Reset (soft)git reset --soft <ref>CLEANDIRTY
Worktree addgit worktree add <path> <branch>CLEANCLEAN (main), CLEAN (worktree)
Worktree removegit worktree remove <path>CLEAN (worktree)CLEAN

6. The Two-Gate Model

Contributions flow through two human-in-the-loop gates. No gate can be auto-approved.

feature/  -->  dev  --[Gate 1]-->  main  --[Gate 2]-->  upstream (PR)
   |                    |                     |
   |  merge branch      |  HITL approval      |  HITL approval
   |  into dev          |  + merge to main    |  + push + PR create
   v                    v                     v
 Work happens     Human reviews:        Human reviews:
 on feature       - diff summary         - PR title (editable)
 branch           - file groups          - PR description (editable)
                  - commit history       - full diff
                  - warnings/blockers    - warnings/blockers

Gate 1 (dev -> main): Presents a diff summary with file groups, commit history, and any warnings. Human approves or rejects. Rejection leaves repo state unchanged.

Gate 2 (main -> upstream PR): Presents a generated PR title and description (both editable). Human approves or rejects. Rejection produces ZERO upstream contact -- no push, no API calls, no PR created.

Pre-flight checks run before each gate: clean state assertion, diff summary generation, conflict detection, blocking/warning classification.

7. Branch Conventions

Naming

All branches use a type prefix:

PrefixPurpose
feature/New functionality
fix/Bug fixes
docs/Documentation changes
refactor/Code restructuring

Suffixes: lowercase letters, digits, and hyphens only. Must start with a letter. No double hyphens. Maximum 50 total characters.

Bare names (no prefix) default to feature/.

Worktree Locations

Worktrees are stored under worktrees/<repo-name>/. Branch slashes are replaced with hyphens in directory names:

worktrees/
  get-shit-done/
    feature-auth/       # worktree for feature/auth
    fix-login-bug/      # worktree for fix/login-bug

Protected Branches

dev and main cannot be deleted. Direct commits to main are prohibited by convention (enforced by Gate 1).

8. Safety Rules

These rules are non-negotiable. Violating any of them is a critical error.

  1. Never --force push. History rewriting destroys others' work.
  2. Never auto-resolve conflicts. Conflict resolution requires human judgment.
  3. Never commit to main directly. All work flows dev -> Gate 1 -> main.
  4. Never push to upstream directly. Only Gate 2 creates upstream PRs.
  5. Never run commands in DIRTY state. Stash or commit first.

@references/safety.md for the complete list of 8 rules with extended rationale.

9. CLI Commands

CommandDescription
sc install <url>Clone and configure a repo with upstream tracking
sc git status [path]Show git state machine report
sc git sync [--strategy merge|rebase] [--dry-run]Fetch and integrate upstream changes
sc git work <name> [--type feature|fix|docs|refactor] [--worktree]Create a named branch
sc git gate mergePresent Gate 1 (dev -> main)
sc git gate prPresent Gate 2 (main -> upstream PR)
sc git worktree listList active worktrees

10. Scripts

Four shell scripts handle deterministic operations outside the TypeScript runtime:

ScriptPurpose
git-state-check.shMachine-readable state report (JSON)
safe-merge.shMerge with --no-ff, abort on conflict
pr-bundle.shGenerate diff summary and PR description
worktree-setup.shCreate worktree with branch tracking

All scripts use set -euo pipefail, output JSON to stdout, and use exit code 0 (success), 1 (failure), or 2 (error). @scripts/ for implementations.

11. Validation

Before any git operation, run the validation check:

bash skills/git-workflow/scripts/validate.sh

This checks: managed repo (.sc-git/config.json exists), clean state, remotes configured. Returns JSON with ready: true/false and details.

@references/workflows.md for step-by-step deterministic workflow sequences.


Git Workflow Skill v1.0.0 -- SC Git Support Phase 397-01

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Provides web accessibility best practices for semantic HTML, ARIA, keyboard navigation, color contrast, and screen reader patterns. Use when building UI components, reviewing accessibility, or when user mentions 'a11y', 'accessibility', 'ARIA', 'screen reader', 'keyboard navigation', 'WCAG'.

日本語の概要は準備中です。原文の説明を表示しています。

Tibsfox/gsd-skill-creator702026年7月20日 更新

Active listening techniques for effective communication. Covers attending behaviors, paraphrasing, reflective listening, clarifying questions, empathic response, barriers to listening, listening in conflict, and cross-cultural listening. Use when building listening skills, improving understanding in conversation, mediating disputes, or analyzing communication breakdowns.

日本語の概要は準備中です。原文の説明を表示しています。

Tibsfox/gsd-skill-creator702026年7月20日 更新

Adversarial spec-compliance PR review — cross-references diffs against approved specs, verifies runtime claims against source, detects competing PRs, audits scope/convention compliance. Use before merging.

日本語の概要は準備中です。原文の説明を表示しています。

Tibsfox/gsd-skill-creator702026年7月20日 更新

Provides best practices for AI agent orchestration including MCP servers, A2A protocol, multi-agent coordination, and swarm architectures. Use when designing agent systems, configuring MCP servers, setting up agent teams, or when user mentions 'MCP', 'A2A', 'agent orchestration', 'multi-agent', 'swarm', 'agent team', 'LangGraph', 'CrewAI', 'AutoGen'.

日本語の概要は準備中です。原文の説明を表示しています。

Tibsfox/gsd-skill-creator702026年7月20日 更新

Symbolic manipulation, equation solving, and algebraic structures for mathematical reasoning. Covers distributive law, factoring, completing the square, linear through polynomial equation solving, systems of equations (substitution, elimination, Gaussian elimination, matrix methods), algebraic structures (groups, rings, fields), modular arithmetic, polynomial theory, and inequalities. Use when solving equations, simplifying expressions, working with algebraic structures, or performing symbolic manipulation.

日本語の概要は準備中です。原文の説明を表示しています。

Tibsfox/gsd-skill-creator702026年7月20日 更新

Understanding how algorithmic systems shape what users see, know, and do -- from recommendation feeds to search ranking to credit scoring to hiring software. Covers the mechanics of recommendation systems, algorithmic bias and its sources, personalization's effects on information diets, opacity and accountability, AI limitations (hallucination, confident wrongness), and the human-in-the-loop question. Use when a learner needs to think critically about why particular content reached them.

日本語の概要は準備中です。原文の説明を表示しています。

Tibsfox/gsd-skill-creator702026年7月20日 更新

Tibsfox のスキルをすべて見る

このスキルの問題を報告する