30 lines
1.5 KiB
Markdown
30 lines
1.5 KiB
Markdown
---
|
|
name: git-workflow
|
|
description: >
|
|
Inspect, stage, commit, and manage isolated branches and pull requests. Enforces worktree isolation and structured PR telemetry.
|
|
scope: global
|
|
---
|
|
|
|
# Git workflow
|
|
|
|
1. **Isolation**: When starting complex or multi-step tasks, operate within an
|
|
isolated physical worktree ([references/worktrees.md](references/worktrees.md))
|
|
or a T3 Code managed thread workspace. Never commit directly to primary branches
|
|
(`main` or `master`).
|
|
2. **Inspection**: Inspect staged, unstaged, and untracked changes. Identify
|
|
ownership and requested scope before staging anything.
|
|
3. **Cohesive grouping**: Group commits by complete behavior. Keep implementation,
|
|
tests, and docs together when they belong to the same change; do not split
|
|
automatically by file type or layer.
|
|
4. **Staging & checks**: Stage named files or selected hunks. Preserve unrelated user
|
|
edits. Run relevant checks under [shared verification](../../protocols/workflow.md#verification)
|
|
and formatters. Use conventional commit messages (`feat:`, `fix:`, `perf:`, `docs:`).
|
|
5. **Pull requests & telemetry**: Push feature branches and generate pull requests
|
|
using `gh pr create` with the structured WHAT-WHY-HOW-LEARNINGS format
|
|
([references/pr-template.md](references/pr-template.md)).
|
|
6. **Cleanup**: Remove ephemeral worktrees after PR creation or merge.
|
|
|
|
No routine confirmation prompt is needed for authorized staging or commits on
|
|
feature branches. Destructive operations (force push, hard reset) are strictly
|
|
forbidden under repository negative constraints.
|