public-git-workflow-expert-base
Skill25 starsChanged 4 months agoApache-2.0View on GitHub
Git 工作流知识基座。extends netresearch/git-workflow-skill 上游通用 Git 知识,叠加团队 commit 规范、分支策略、Gitea 工作流、镜像同步经验。供 devlab-git-workflow-expert 等下游技能通过 extends 继承。
- Commits and pushes
In this repository57 other files it gives its agents.
- base-cn-registry-mirror-strategySkill
- base-manual-captureSkill
- devlab-ai-agent-engineeringSkill
- devlab-ai-kit-minerSkill
- devlab-cicd-onboardSkill
- devlab-contract-web-serverSkill
- devlab-dao-sql-compatSkill
- devlab-db-data-migrationSkill
- devlab-eval-driven-agentSkill
- devlab-integration-fullstackSkill
- devlab-srv-test-apiSkill
- devlab-tech-debt-opsSkill
- devlab-test-expertSkill
- devlab-test-onboardSkill
- devlab-web-contextSkill
- devlab-web-deep-acceptanceSkill
- devlab-web-echarts-usageSkill
- devlab-web-engineeringSkill
- devlab-web-extension-bootstrapSkill
- devlab-web-skywalking-rum-usageSkill
- devlab-web-test-e2eSkill
- devlab-web-visual-opsSkill
- devlab-web-xyflow-usageSkill
- diag-container-oomSkill
- diag-k8s-node-pressureSkill
- diag-k8s-pod-crashloopSkill
- diag-mysql-deadlockSkill
- diag-mysql-replicationSkill
- diag-mysql-slow-querySkill
- diag-network-port-unreachSkill
- infra-dify-opsSkill
- infra-harbor-opsSkill
- infra-jenkins-pipeline-opsSkill
- infra-nexus-opsSkill
- infra-ragflow-opsSkill
- infra-sonarqube-opsSkill
- infra-system-env-opsSkill
- infra-woodpecker-pipeline-opsSkill
- markitdownSkill
- patent-disclosure-workflowSkill
- patent-reviewSkill
- patent-specification-writerSkill
- public-kafka-expert-baseSkill
- public-mongodb-expert-baseSkill
- public-mysql-expert-baseSkill
- public-nl2sql-expert-baseSkill
- public-oracle-expert-baseSkill
- public-postgres-expert-baseSkill
- public-rabbitmq-expert-baseSkill
- public-redis-expert-baseSkill
- work-convertSkill
- work-exportSkill
- work-markitdownSkill
- work-sc-document-sop-builderSkill
- work-sc-docx-comment-replySkill
- work-sc-patent-specification-writerSkill
- work-sc-software-copyright-writerSkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 10 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 30
Create branch following naming conventions (Section: Branch Naming).
- Distinctive: line 33
Ensure CI green + all review threads resolved before merge.
- Distinctive: line 110
Default-branch check before PR operations
- Distinctive: line 245
Never force-push to main/master without explicit user approval.
- Very specific: line 246
Never use plain --force — always --force-with-lease.
- Distinctive: line 247
Never push secrets, tokens, or credentials in commits.
- Distinctive: line 248
Never skip CI checks before merge — ensure all gates green.
- Distinctive: line 249
Never use merge commit for feature PRs — use squash merge.
- Very specific: line 250
Never use dev/xxx or unprefixed branch names — always feature/xxx, fix/xxx, etc.
- Distinctive: line 251
Never git clone from GitHub when a Gitea internal mirror exists.
- Distinctive: line 252
Prefer git pull --rebase over git pull to avoid merge commits on feature branches.
- Distinctive: line 253
Use git add -p for interactive staging when changes span multiple concerns.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Git Workflow Knowledge Base
Foundational guidance for Git version control workflows, branching strategies, commit conventions, and collaborative development.
Source: Extends netresearch/git-workflow-skill v1.18.8 (CC-BY-SA-4.0). Team-specific rules overlay on top.
架构分层
┌─────────────────────────────────────────────┐
│ 下游技能(extends 本基座) │
│ devlab-git-workflow-expert 等 │
├─────────────────────────────────────────────┤
│ 团队规范叠加层(本文件 §团队规范章节) │
│ commit 规范 / 分支策略 / Gitea / 镜像同步 │
├─────────────────────────────────────────────┤
│ 上游通用知识(netresearch/git-workflow-skill) │
│ branching / commits / PR / CI / hooks │
└─────────────────────────────────────────────┘Workflow
- Determine the workflow model (Git Flow / GitHub Flow / Trunk-based).
- Create branch following naming conventions (Section: Branch Naming).
- Make atomic commits with Conventional Commits (Section: Commit Conventions).
- Push and open PR with proper description (Section: PR Workflow).
- Ensure CI green + all review threads resolved before merge.
- Merge with appropriate strategy — feature PR 默认 squash(见 §PR Workflow)。
- Release 打 tag:
v{major}.{minor}.{patch}(见 §Release & Tag)。
Critical Rules (Non-Negotiable)
- No direct push to main — always open a PR.
- No merge before all threads resolved — see references/pull-request-workflow.md.
- Feature PR 默认 squash merge — 开发分支历史压缩为一个干净 commit;release/hotfix 保留完整历史。
- No "tested/verified" without pasted command output — else say so explicitly.
- Force-push only with
--force-with-lease— never plain--force. - Commit before rebase — add → commit → fetch → rebase → push. Dirty tree aborts rebase.
- No editorializing — state what changed, not how good it is.
- Gitea-first —
git clone和git remote优先使用 Gitea 内网地址,避免直连 GitHub。 - 内网镜像优先 —
git clone时优先 Gitea 内网镜像 URL,减少公网流量和延迟。
Commit Conventions
上游 Conventional Commits
<type>[scope]: <description>
[optional body]
[optional footer(s)]Types: feat (MINOR), fix (PATCH), docs, style, refactor, perf, test, build, ci, chore, revert
Breaking change: Add ! after type or BREAKING CHANGE: in footer.
团队叠加规范
在通用 Conventional Commits 基础上,团队额外约定:
- scope 使用组件/模块 ID:如
feat(cli):,fix(compose-app-deploy):,docs(harness-ai-kit-forge): - description 使用中文或英文均可,但同一 PR 内保持一致
- 多变更拆原子 commit:一个 commit 做一件事,便于 bisect 和 revert
- commit body 说明 why:type+scope 说明 what,body 说明 why(非显而易见时)
- CHANGELOG 由 commit 自动生成:
feat/fix/BREAKING CHANGE会出现在 CHANGELOG 中
References:
- team-commit-conventions
Branch Naming
feature/TICKET-123-description
fix/TICKET-456-bug-name
release/1.2.0
hotfix/1.2.1-security-patch
docs/update-skill-guide
refactor/simplify-auth-flow团队分支策略选择
| 项目类型 | 推荐策略 | 理由 |
| 个人工具/脚本仓库 | Trunk-based(直接 main) | 轻量,无需 PR 流程 |
| CLI / Skill / 正式项目 | GitHub Flow(feature → main) | PR review + CI gate |
| 多人协作 / 生产服务 | Git Flow(develop + release + hotfix) | 完整发布管理 |
团队特殊约定
- 02-工程工作空间:大部分子项目使用 Trunk-based 或 GitHub Flow
- fleet-platform / 控制仓:必须 PR + review,禁止直推 main
- harness-ai-kit skills 仓库:PR + CI gate,merge 后自动 publish
References:
- team-branch-strategy
PR Workflow
上游规则(netresearch/git-workflow-skill)
- Default-branch check before PR operations
- Atomic commits, no squash unless asked
- Merge strategies: merge / squash / rebase
- Review thread resolution mandatory
- Merge gate: CI green + threads resolved + rebased + signed
团队叠加
- PR 标题遵循 commit convention:
feat(cli): add shared-resources command - PR body 包含变更摘要和影响范围
- Gitea PR:使用
tea pr create或 REST API,参考 giteactl 技能 - 自审 checklist:merge 前自行检查 — 无遗留 TODO、测试通过、文档更新
合并策略(来自踩坑纠正)
| 场景 | 策略 | 理由 |
| Feature PR → main | squash merge(默认) | 历史干净,一个 feature 一个 commit |
| Release branch → main | merge commit | 保留 release 完整历史 |
| Hotfix → main | merge commit | 保留修复上下文 |
| 小修小补(typo/docs) | rebase (fast-forward) | 线性历史 |
注意:上游 netresearch/git-workflow-skill 默认 no squash。本团队覆盖为 feature PR 默认 squash,release/hotfix 保留 merge commit。
References:
- team-pr-workflow
Release & Tag
Tag 命名规范(来自踩坑纠正)
v{major}.{minor}.{patch}| 示例 | 含义 |
v1.0.0 | 首个正式版 |
v1.2.3 | patch 修复 |
v2.0.0-rc.1 | 预发布候选 |
v0.1.0 | draft/trial 阶段 |
规则:
- Tag 必须带
v前缀 - 严格遵循 SemVer(语义化版本)
- 打 tag 前确保 CI green、CHANGELOG 已更新
git tag -a v1.2.3 -m "release: v1.2.3"使用 annotated tag(不用 lightweight)- 推送 tag:
git push origin v1.2.3
Tag 触发 CI Release
- Woodpecker:
.woodpecker.yml配置when: { event: tag }触发 release pipeline - Jenkins:Jenkinsfile 配置 tag filter 触发 release build
多仓协同(来自高频踩坑)
团队日常在多个 Git 仓库间切换(Gitea 镜像、server-apps、控制仓、应用仓),86% 会话涉及多仓操作。
目录结构规范
~/repos/
├── gitea/ # Gitea 内网仓库
│ ├── server-apps/
│ ├── fleet-platform/
│ └── my-app/
└── github/ # GitHub 开源/镜像
└── open-source-project/多仓操作最佳实践
- 按 remote 分目录:
gitea/vsgithub/,避免混淆 - 使用 git worktree:同一仓库多分支并行开发(详见 REFERENCE-ADVANCED-GIT.md)
- 批量状态检查:
for d in */; do echo "=== $d ==="; git -C "$d" status -s; done - 统一 remote 命名:origin = 主 remote(Gitea),upstream = 上游(GitHub)
References:
- multi-repo
CI/CD Integration
上游规则
- Watching CI from CLI:
gh pr checks,gh run watch - Git mirror repository sync:
git push --mirrorgotchas
团队叠加
- Woodpecker CI:Team 项目主要 CI,使用
.woodpecker.yml - Jenkins:Java 项目 + shared library,使用 Jenkinsfile
- Git mirror sync:Gitea ↔ GitHub 双向镜像,注意
--mirror会覆盖所有 refs
References:
- team-ci-cd
Git Hooks
上游支持
Detect hooks first:
ls lefthook.yml .lefthook.yml captainhook.json .pre-commit-config.yaml .husky/pre-commit 2>/dev/null || echo "No hooks"Install: lefthook install | composer install | npm install | pre-commit install
团队叠加
- 优先使用 lefthook(跨语言、配置简洁)
- Python 项目可配合 pre-commit + ruff/black/isort
- 提交前必须通过 hook 检查:commit message 格式 + 基础 lint
Advanced Operations
Reference:
- advanced-git — rebase, cherry-pick, bisect, stash, worktrees, reflog, recovery
Gitea 工作流
团队内部 Git 平台为 Gitea,与 GitHub 的差异:
| 操作 | GitHub | Gitea |
| CLI | gh | tea / giteactl |
| PR 创建 | gh pr create | tea pr create 或 REST API |
| Mirror | git push --mirror | Gitea 内置镜像同步 |
| Webhook | GitHub Actions | Woodpecker CI |
| Token | Personal Access Token | API Token(Settings → Applications) |
References:
- team-gitea-workflow
Guardrails
- Never force-push to main/master without explicit user approval.
- Never use plain
--force— always--force-with-lease. - Never push secrets, tokens, or credentials in commits.
- Never skip CI checks before merge — ensure all gates green.
- Never use merge commit for feature PRs — use squash merge.
- Never use
dev/xxxor unprefixed branch names — alwaysfeature/xxx,fix/xxx, etc. - Never
git clonefrom GitHub when a Gitea internal mirror exists. - Prefer
git pull --rebaseovergit pullto avoid merge commits on feature branches. - Use
git add -pfor interactive staging when changes span multiple concerns.
参考文档:
- references/REFERENCE-README.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

