工作流程
- 作者仓库星标 0
- 作者仓库 skills-registry
- 领域
- 工程开发
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @tomevault-io · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 即装即用
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 运行环境要求
- 未检出明确要求
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
gh auth status
git remote -v
gh repo view --json nameWithOwner,defaultBranchRef
# GitHub Workflow
## Overview
Use a hybrid workflow: prefer `gh` for GitHub-aware tasks, and use `git` for local history editing, staging, and branch mechanics.
**Opinionated defaults:**
- inspect repo state before making changes
- keep branches focused and short-lived
- use conventional-commit-style messages when possible
- open PRs with clear titles and summaries
- merge with explicit intent, not guesswork
## Quick Start Checks
Run these before branching or opening a PR:
```bash
gh auth status
git remote -v
gh repo view --json nameWithOwner,defaultBranchRef
```
Confirm:
- `gh` is authenticated
- the repo remote points to the expected GitHub repository
- you know the default branch, usually `main` or `master`
If `gh repo view` fails because the current repo is not connected to GitHub, fall back to plain `git` and ask before attempting GitHub-specific actions.
## Tool Choice Rules
| Use `gh` for | Use `git` for |
|---|---|
| auth and repo checks | staging files |
| PR create/view/checkout/review/merge | commit creation/amend/rebase |
| PR status and checks | switching branches |
| opening web pages for repo or PR context | inspecting local diffs and history |
**Fallback rule:** if `gh` has a clean command for the task, prefer it. If the task is fundamentally local source control, use `git`.
## Branch Workflow
1. Sync and inspect the default branch.
2. Create a focused branch from the default branch.
3. Keep the branch name descriptive.
Example:
```bash
git switch main
git pull --ff-only
git switch -c feat/add-github-workflow-skill
```
Recommended prefixes:
- `feat/`
- `fix/`
- `docs/`
- `chore/`
- `refactor/`
- `test/`
Avoid vague names like `updates`, `stuff`, or `misc-fixes`.
## Commit Workflow
Use `git` for staging and committing. Keep commits small and readable.
```bash
git status
git add <paths>
git commit -m "feat: add github workflow skill"
```
Prefer conventional-commit-style summaries:
- `feat: add github workflow skill`
- `fix: correct PR base branch detection`
- `docs: document packaged skills`
- `chore: clean up release notes`
Before pushing, review what changed:
```bash
git diff --staged
```
If a commit needs cleanup, use `git commit --amend` or interactive rebase deliberately. Do not use `gh` for local history surgery.
## Push and PR Workflow
Push with `git`, then use `gh` to work with the PR.
```bash
git push -u origin HEAD
gh pr create --fill --base main
```
Useful `gh` commands:
```bash
gh pr status
gh pr view --web
gh pr checks
gh pr create --fill --base <default-branch>
gh pr checkout <number>
```
PR hygiene:
- make sure the base branch is correct
- use a title that matches the change
- include a short summary of what changed and any risk areas
- mention tests run when relevant
If `--fill` produces a weak title/body, replace it instead of accepting low-quality PR text.
## Review Workflow
Use `gh` to inspect and respond to review state.
```bash
gh pr view <number>
gh pr diff <number>
gh pr checks <number>
gh pr review <number> --comment -b "Looks good overall; left one suggestion."
gh pr review <number> --approve
gh pr review <number> --request-changes -b "Please address the failing tests and rename the branch."
```
When reviewing your own work, check:
- PR targets the correct base branch
- branch is up to date enough for the repo's workflow
- checks are green or known failures are explained
- description matches the actual diff
## Merge Workflow
Prefer `gh pr merge` so the merge action is tied to GitHub PR state.
```bash
gh pr merge <number> --squash --delete-branch
```
Common variants:
- `--squash` for small or iterative branches
- `--merge` when the repo prefers merge commits
- `--rebase` when the repo explicitly prefers rebased history
Before merging, confirm:
- approvals or review requirements are satisfied
- required checks passed
- the chosen merge strategy matches repo norms
After merge, sync local state:
```bash
git switch main
git pull --ff-only
```
## Common Mistakes
- using `gh` for tasks that are really local `git` operations
- forgetting to verify the default branch before creating the PR
- pushing a branch without `-u` and then losing the upstream link
- opening a PR with an unhelpful auto-filled title/body
- merging without checking CI or review status
- mixing unrelated changes into one branch or one commit
## Red Flags
Stop and re-check before acting if you see any of these:
- `gh auth status` is not healthy
- the remote is not the repo you expected
- you do not know the correct base branch
- the branch name does not describe the change
- the PR title says one thing but the diff shows another
- checks are failing and no reason is documented
When unsure, inspect first, then act.
---
> Source: [codersbrew/pi-tools](https://github.com/codersbrew/pi-tools) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-05-22 -->
章节与文件索引
按说明文件中的顺序排列。
概述
快速启动检查
工具选择规则
分行工作流程
提交工作流程
文件/命令 -> git · main · master · gh repo view · feat/ · fix/ · docs/ · chore/
内容校验值 -> 1264430b5b72
当前原文的自动摘译,尚未人工审校。
概述
使用混合工作流程:首选
gh进行 GitHub 感知任务,并使用git进行本地历史记录编辑、暂存和分支机制。固执己见的默认值:在进行更改之前检查存储库状态,保持分支集中和短暂,尽可能使用传统提交风格的消息快速启动检查
在分支或打开 PR 之前运行这些: 确认:
gh已通过身份验证 存储库远程指向您知道默认分支的预期 GitHub 存储库,通常为main或master工具选择规则
使用
gh用于 · 使用git进行身份验证和仓库检查 · 暂存文件 PR 创建/查看/签出/审查/合并 · 提交创建/修改/变基 PR 状态和检查 · 切换分支打开网页以获取仓库或 PR 上下文 · 检查本地差异和历史记录分行工作流程
同步并检查默认分支。从默认分支创建焦点分支。保持分支名称具有描述性。示例:推荐的前缀:
提交工作流程
使用
git进行暂存和提交。保持提交小且可读。更喜欢传统提交风格的摘要:feat: add github workflow skillfix: correct PR base branch detectiondocs: document packaged skills