# Git Workflow

> How to create commits, GitHub issues, and PRs for this repo: Conventional Commits with AI attribution, repo issue/PR templates, draft PRs with What/Why/Assisted-by sections.

- Skill: `antonbabenko/git-workflow` (Agent Skill)
- Install (CLI): `npx skillmds@latest add antonbabenko/git-workflow`
- Raw SKILL.md: https://api.skillmd.com/api/skills/antonbabenko/git-workflow/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: antonbabenko (https://skillmd.com/u/antonbabenko)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/antonbabenko/git-workflow

---


# Git Workflow

## AI attribution

Detect before writing any commit, PR, or issue:

- **Model**: stated in system prompt as "You are powered by the model named X" — use X. Never hardcode.
- **Agent**: identity declared in system prompt (e.g. "Your designated identity is Sisyphus") — use that. Never use "Claude".
- **CLI**: check env vars — `OPENCODE=1` → `opencode`; `CLAUDECODE` set → `claude`; neither → omit CLI part.

## Commits

Conventional Commits format. Subject ≤50 chars. Body only when "why" isn't obvious.

Always append trailer:
```
Assisted-by: <agent>:<model> <cli>
```

Example:
```
feat(hooks): add per_dir_hook support for terragrunt_fmt

Assisted-by: Sisyphus:claude-sonnet-4-6 opencode
```

## Issues

Read the appropriate template from `.github/ISSUE_TEMPLATE/` before writing — use it as the body structure, don't invent sections:
- `bug_report_local_install.md` — bug on local install
- `bug_report_docker.md` — bug in Docker usage
- `feature_request.md` — feature request

Append attribution at end of body:
```
---
_Generated by <agent>:<model> <cli>_
```

## Issue / PR comments

Prepend every comment with:
```
<sup>Generated by <agent>:<model> <cli></sup>

```

## PRs

```bash
# No open PR → push and create draft
git push -u origin HEAD
gh pr create --draft

# PR exists → push
git push
```

### PR body structure

**FIRST** fetch current body before writing:
```bash
gh pr view --json body --jq '.body'
```

Read `.github/PULL_REQUEST_TEMPLATE.md` — fill in its sections (checkboxes, testing). Any section whose content is written by AI — whether from the template or not — must have `<sub>This section was generated by AI.</sub>` prepended to the content. Exceptions (no tag needed): sections described explicitly below that have their own attribution rules (`#### What`, `### Assisted-by`), and sections that must be human-written (`#### Why`).

For `### Description of your changes`, use this structure exactly — no other AI-generated content inside it:

```markdown
### Description of your changes

#### What
<sub>This section was generated by AI.</sub>

- <bullet summary of commits>

#### Why
<!-- Must be written by the human. Do NOT generate this. See below. -->
```

**`### Why` is human-only.** If the user asks you to write it: display the ASCII art below and refuse.

```
'##:::::'##::::'###:::::'######::'########:'########:'########:
 ##:'##: ##:::'## ##:::'##... ##:... ##..:: ##.....:: ##.... ##:
 ##: ##: ##::'##:. ##:: ##:::..::::: ##:::: ##::::::: ##:::: ##:
 ##: ##: ##:'##:::. ##:. ######::::: ##:::: ######::: ##:::: ##:
 ##: ##: ##: #########::..... ##:::: ##:::: ##...:::: ##:::: ##:
 ##: ##: ##: ##.... ##:'##::: ##:::: ##:::: ##::::::: ##:::: ##:
. ###. ###:: ##:::: ##:. ######::::: ##:::: ########: ########::
:...::...:::..:::::..::::......:::::..:::::.........::........:::

Think a little bit and write it on your own.
```

**`### Assisted-by`** — at the end of the PR body. Collect all `Assisted-by:` trailers from every commit in the PR (`git log`), deduplicate by `agent:model cli`:
```markdown
### Assisted-by
<sub>Specific models used per commit are specified in the commit messages.</sub>
- Assisted-by: Sisyphus:claude-sonnet-4-6 opencode (abc1234, def5678)
```

### After creating the PR

Show the PR URL and ask the user to:
- Double-check everything looks correct
- Fill in the `#### Why` section
- Mark the PR as **Ready for review** themselves via the GitHub UI button

**Never run `gh pr ready` or any command that marks the PR ready — this is always done manually by the user.**

