create-pr
Solid创建 Pull Request 到目标分支。 当变更已提交、需要发起 Pull Request 评审时使用。
AI & Automation 83 stars
5 forks Updated today MIT
Install
Quality Score: 82/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# 创建 Pull Request
创建 Pull Request,并在与任务关联时立即补齐核心元数据和 reviewer 摘要。
## 行为边界 / 关键规则
版本戳规则:创建或更新 `task.md` frontmatter 时,先读取 `.agents/rules/version-stamp.md`,并写入或刷新 `agent_infra_version`。
## 任务上下文解析
> 入口允许省略 task ref,也接受旧位置 task ref 或 `--task <ref>` / `-t <ref>`。先从完整参数中分离 task scope 并原样保留其他业务操作数,再调用 `agent-infra-internal task-context resolve {task-scope}`;`{task-scope}` 为空、位置 ref 或 task flag 之一。只读取结构化结果的 `taskId`,后续把 `{task-id}` 绑定为该完整 `TASK-YYYYMMDD-HHMMSS`。解析失败时透传非零退出码,不自行扫描任务。
## 步骤开始:started 标记
真实执行 `platform-pr create` 时由 typed core 在远端写入前幂等登记 `Create PR [started]`;dry-run 不登记。调用方不得重复手写该条目。
## 执行流程
### 前置门控:项目级 PR 流程检查
**门控读取(项目级 PR 流程策略)**:在执行编号步骤前,读取 `.agents/.airc.json` 的 `prFlow` 字段(三态:字段缺省 = 默认推荐 PR、允许跳过;`"required"` = 强制 PR;`"disabled"` = 强制无 PR)。
按读取结果分支:
- 缺省 / `"required"` → 继续到下方第 1 步
- `"disabled"` → 输出以下消息后**立即停止**,不要执行任何后续编号步骤、不要触发任何 PR 创建命令、不要修改 `task.md` 的 `pr_number` / `pr_status`、不要发布 PR 摘要评论:
```
当前项目未启用 PR 流程(`.agents/.airc.json` 中 `prFlow: "disabled"`)。
无需创建 Pull Request,请直接运行:
- Claude Code / OpenCode:/complete-task {task-ref}
- Gemini CLI:/agent-infra:complete-task {task-ref}
- Codex CLI:$complete-task {task-ref}
```
### 1. 解析命令参数
从命令参数中识别:
- 匹配 `TASK-{yyyyMMdd-HHmmss}` 格式的参数 -> `{task-id}`
- 其余参数 -> `{target-branch}`
如果提供了 `{task-id}`,读取 `.agents/workspace/active/{task-id}/task.md` 获取任务信息(例如 `issue_number`、`type` 等)。
如果未提供,可从当前 session 上下文获取;仍无法确定 `{task-id}` 时,后续步骤中的任务关联逻辑跳过。
### 2. 确定目标分支
如果用户显式提供参数就直接使用;否则根据 Git 历史和分支拓扑自动推断。
...
Details
- Author
- fitlab-ai
- Repository
- fitlab-ai/agent-infra
- Created
- 4 months ago
- Last Updated
- today
- Language
- TypeScript
- License
- MIT
Integrates with
Similar Skills
Semantically similar based on skill content — not just same category
AI & Automation Solid
watch-pr
监控 PR 的 required checks 并在失败时自愈。 当需要监控 PR 的 required checks 并在失败时自愈时使用。
83 Updated today
fitlab-ai AI & Automation Solid
git-workflow
安全处理 Git 状态检查、提交信息、commit、分支、push、PR 和 rebase。用于用户要求检查改动、生成或创建提交、管理分支、推送、发起 PR 或整理历史时;严格区分每个动作的授权,并保护工作树中已有和无关的修改。
686 Updated 2 days ago
laolaoshiren AI & Automation Solid
refine-title
重构 Issue/PR 标题为 Conventional Commits 格式。 当某个 Issue/PR 标题需要改写为 Conventional Commits 格式时使用。
83 Updated today
fitlab-ai