AgentSkillsCN

Git Workflow

管理实验室生成工作流中的 Git 操作,包括分支创建、提交以及推送操作。

SKILL.md
--- frontmatter
description: Manages Git operations for lab generation workflow including branch creation, commits, and push operations
globs:
  - "workspace/**"
  - ".github/agents/**"

Git Workflow Management Skill

This skill provides Git operations support for the lab generation workflow.

Capabilities

1. Branch Creation

  • Create feature branches with pattern lab/{nome-do-lab}
  • Verify branch doesn't already exist
  • Switch to newly created branch
  • Base branch: main (default) or specified by user

2. Commit Operations

  • Stage all files in workspace/{nome-do-lab}/ directory
  • Create structured commits with clear messages
  • Commit message format:
    code
    feat: add lab {nome-do-lab}
    
    - Generated by @orquestrador-de-labs
    - Includes research, drafts, revisions, and final output
    - Review cycles: {N}
    - Status: {APPROVED/NEEDS_REVIEW}
    

3. Push Operations

  • Push branch to remote repository
  • Verify push success
  • Handle push errors gracefully

Usage Instructions

When a user or agent needs to create a branch for a new lab:

  1. Extract lab name from context (format: kebab-case)
  2. Create branch: lab/{nome-do-lab}
  3. Confirm branch creation with user

When ready to commit generated content:

  1. Verify all expected files exist in workspace/{nome-do-lab}/
  2. Stage all files recursively
  3. Create commit with structured message
  4. Push to remote

Error Handling

  • If branch already exists: ask user if they want to use existing or create new with suffix
  • If push fails: provide clear error message and retry instructions
  • If files missing: list missing files before committing

Examples

Creating branch:

bash
git checkout -b lab/kubernetes-hpa-metricas-custom

Committing files:

bash
git add workspace/kubernetes-hpa-metricas-custom/
git commit -m "feat: add lab kubernetes-hpa-metricas-custom

- Generated by @orquestrador-de-labs
- Includes research, drafts, revisions, and final output
- Review cycles: 2
- Status: APPROVED"
git push origin lab/kubernetes-hpa-metricas-custom

Guardrails

  • Never force push
  • Never commit to main/master directly
  • Always verify file contents before committing
  • Keep commit messages descriptive and structured