AgentSkillsCN

git-workflow

当您提交并推送代码变更时,可使用此技能,以确保遵守 DCO 规范并顺利通过 pre-commit 校验。

SKILL.md
--- frontmatter
name: git-workflow
description: Use when committing and pushing code changes, ensures DCO compliance and pre-commit validation

Git Workflow

Before Committing

Always run pre-commit validation:

bash
# Validate specific files
pre-commit run --files <changed-files>

# Or validate all staged files
pre-commit run

Fix any issues before proceeding.

DCO (Developer Certificate of Origin)

All commits must include a Signed-off-by line for DCO compliance:

bash
git commit -s -m "commit message"

Or add manually:

code
Signed-off-by: Your Name <your.email@example.com>

Commit Workflow

  1. Stage changes

    bash
    git add <files>
    
  2. Run pre-commit

    bash
    pre-commit run
    
  3. Fix any issues and re-stage if needed

  4. Commit with DCO sign-off

    bash
    git commit -s -m "type: description"
    

Commit Message Format

code
type: short description

Optional longer description.

Signed-off-by: Name <email>

Types: feat, fix, docs, refactor, test, chore

Push

bash
git push origin <branch>

Quick Reference

TaskCommand
Pre-commit checkpre-commit run
Commit with DCOgit commit -s -m "message"
Amend with DCOgit commit --amend -s
Pushgit push origin <branch>