AgentSkillsCN

git-workflow

提供 Git 工作流规范,包括常规提交、分支命名、PR 审查指南,以及与 Issue 跟踪系统的集成。适用于执行 Git 操作、创建提交、发起 PR、进行代码审查,或管理分支时使用。

SKILL.md
--- frontmatter
name: git-workflow
description: Provides git workflow conventions including conventional commits, branch naming, PR review guidelines, and issue tracker integration. Use when performing git operations, creating commits, opening PRs, conducting code reviews, or managing branches.

Git Workflow Conventions

Quick Start

Commit Format

All commits follow Conventional Commits:

code
<type>(<scope>): <description>

[optional body]

[optional footer]

Types: feat, fix, docs, style, refactor, perf, test, chore, build, ci

Scopes: Define project-specific scopes in project-context.mdc. Common examples: api, ui, db, auth, build, cursor

Agentic workflow commits: Use chore(cursor): for commands/rules/plans, docs(cursor): for reference docs.

Branch Naming

code
<firstname>/<issue-id>-<short-slug>
  • First name only (e.g., ryan not ryankilroy)
  • Slug under 30 chars, action verb + key noun
  • Example: ryan/{prefix}-149-add-agentic-context

PR Review Prefixes

PrefixMeaningBlocking
major:Must fixYes
minor:Should fixNo
nit:Tiny improvementNo
suggestion:Loose ideaNo
question:ClarificationNo
praise:Positive feedbackNo

Use "we"/"the code" instead of "you" in review comments.

Issue Tracker Integration

Configure your issue tracker in project-context.mdc:

  • Branch names include issue ID: username/{prefix}-xxx-description
  • Magic words auto-close on merge: Closes {PREFIX}-XXX, Fixes {PREFIX}-XXX, Resolves {PREFIX}-XXX
  • Link without closing: Refs {PREFIX}-XXX

Examples:

  • Linear: ryan/n43-123-add-auth, Closes N43-123
  • Jira: ryan/proj-456-fix-bug, Closes PROJ-456
  • GitHub: ryan/789-update-docs, Closes #789

PR Workflow

  1. Squash commits into logical chunks
  2. Rebase onto main (never merge)
  3. Use --force-with-lease when pushing after rebase

Additional Resources