Agent SkillsChorus-AIDLC/Chorus › pr-workflow

pr-workflow

GitHub

提供从本地代码变更到合并的完整PR工作流,涵盖分支创建、提交、PR发起、CI检查、失败修复及合并。

.claude/skills/pr-workflow/SKILL.md Chorus-AIDLC/Chorus

Trigger Scenarios

需要提交代码变更并创建Pull Request PR的CI检查失败需要排查和修复

Install

npx skills add Chorus-AIDLC/Chorus --skill pr-workflow -g -y
More Options

Non-standard path

npx skills add https://github.com/Chorus-AIDLC/Chorus/tree/main/.claude/skills/pr-workflow -g -y

Use without installing

npx skills use Chorus-AIDLC/Chorus@pr-workflow

指定 Agent (Claude Code)

npx skills add Chorus-AIDLC/Chorus --skill pr-workflow -a claude-code -g -y

安装 repo 全部 skill

npx skills add Chorus-AIDLC/Chorus --all -g -y

预览 repo 内 skill

npx skills add Chorus-AIDLC/Chorus --list

SKILL.md

Frontmatter
{
    "name": "pr-workflow",
    "license": "AGPL-3.0",
    "metadata": {
        "author": "chorus",
        "version": "0.1.0",
        "category": "development"
    },
    "description": "Complete workflow for submitting code changes — create branch, commit, open PR, check CI, fix failures, and merge."
}

PR Workflow

Complete workflow for taking local code changes through branch creation, PR, CI verification, failure fix, and merge.

Prerequisites

  • Code changes are already made and tested locally
  • Remote origin is configured
  • gh CLI is authenticated

Steps

1. Pre-flight Check

git status
git diff --stat
git log --oneline -5

Verify before proceeding:

  • Only intended files are modified
  • No sensitive files (.env, credentials) staged
  • No temp artifacts (screenshots, logs) left behind

2. Create Branch

Branch from current HEAD. Naming convention:

Type Prefix Example
Bug fix fix/ fix/remove-legacy-textarea
Feature feat/ feat/structured-ac-editor
Refactor refactor/ refactor/service-layer
Test test/ test/e2e-proposal-flow
Docs docs/ docs/api-reference
Chore chore/ chore/bump-deps
git checkout -b {prefix}{short-description}

3. Stage and Commit

Stage specific files only — never use git add . or git add -A:

git add path/to/file1 path/to/file2

Note: Next.js paths need shell escaping:

git add src/app/\(dashboard\)/projects/\[uuid\]/file.tsx

Commit with HEREDOC for clean multi-line messages:

git commit -m "$(cat <<'EOF'
{type}: {concise description of why, not what}

{Optional body explaining context or trade-offs}

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
EOF
)"

4. Push and Open PR

git push -u origin {branch-name}
gh pr create --title "{type}: {title under 70 chars}" --body "$(cat <<'EOF'
## Summary
- Change 1
- Change 2

## Changed files
| File | Change |
|------|--------|
| `path/file.ts` | What changed |

## Test plan
- [x] Automated test passed
- [ ] Manual verification needed

Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"

5. Check CI

gh pr checks {pr-number}
  • All pass — report to user, ready for merge
  • Any fail — proceed to Step 6

6. Fix CI Failures

Get the failed logs:

gh pr checks {pr-number}                          # find failed run ID
gh run view {run-id} --log-failed 2>&1 | tail -80  # read failure details

Common failure types and fixes:

Failure Local repro Fix
Test assertion npx vitest run path/to/test.ts Update test expectations to match new behavior
Type error npx tsc --noEmit Fix types; check only your errors with | grep {keyword}
Lint error pnpm lint Auto-fix or manual fix
Missing test update grep -r "changedField" src/**/__tests__/ Update test fixtures/helpers using the old field

After fixing:

git add {fixed-files}
git commit -m "$(cat <<'EOF'
fix: {what was fixed in tests/types}

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
EOF
)"
git push

Re-check CI — repeat until green:

gh pr checks {pr-number}

7. Merge

Only when user explicitly requests. Default to squash merge:

gh pr merge {pr-number} --squash --delete-branch
git checkout main && git pull

Checklist

Before opening PR:

  • npx tsc --noEmit passes (or no new errors)
  • Related tests pass locally
  • No screenshots, temp files, or debug logs in working tree
  • Grep test files for any changed field/function names

Before merging:

  • CI is green
  • User has approved the merge

Version History

  • c08357a Current 2026-07-25 08:34

Same Skill Collection

.claude/skills/blog/SKILL.md
.claude/skills/e2e-verification/SKILL.md
.claude/skills/openspec-apply-change/SKILL.md
.claude/skills/openspec-archive-change/SKILL.md
.claude/skills/openspec-explore/SKILL.md
.claude/skills/openspec-propose/SKILL.md
.claude/skills/plugin-maintenance/SKILL.md
.claude/skills/release/SKILL.md
packages/chorus-dsh/skills/brainstorm-chorus/SKILL.md
packages/chorus-dsh/skills/chorus/SKILL.md
packages/chorus-dsh/skills/code-reviewer-chorus/SKILL.md
packages/chorus-dsh/skills/develop-chorus/SKILL.md
packages/chorus-dsh/skills/docs-chorus/SKILL.md
packages/chorus-dsh/skills/idea-chorus/SKILL.md
packages/chorus-dsh/skills/openspec-aware-chorus/SKILL.md
packages/chorus-dsh/skills/orchestrate-chorus/SKILL.md
packages/chorus-dsh/skills/proposal-chorus/SKILL.md
packages/chorus-dsh/skills/proposal-reviewer-chorus/SKILL.md
packages/chorus-dsh/skills/quick-dev-chorus/SKILL.md
packages/chorus-dsh/skills/review-chorus/SKILL.md
packages/chorus-dsh/skills/task-reviewer-chorus/SKILL.md
packages/chorus-dsh/skills/yolo-chorus/SKILL.md
packages/chorus-pi/skills/chorus/SKILL.md
packages/chorus-pi/skills/develop/SKILL.md
packages/chorus-pi/skills/docs/SKILL.md
packages/chorus-pi/skills/idea/SKILL.md
packages/chorus-pi/skills/openspec-aware/SKILL.md
packages/chorus-pi/skills/orchestrate/SKILL.md
packages/chorus-pi/skills/proposal/SKILL.md
packages/chorus-pi/skills/quick-dev/SKILL.md
packages/chorus-pi/skills/review/SKILL.md
packages/chorus-pi/skills/yolo/SKILL.md
packages/openclaw-plugin/skills/brainstorm/SKILL.md
packages/openclaw-plugin/skills/chorus/SKILL.md
packages/openclaw-plugin/skills/code-reviewer/SKILL.md
packages/openclaw-plugin/skills/develop/SKILL.md
packages/openclaw-plugin/skills/docs/SKILL.md
packages/openclaw-plugin/skills/idea/SKILL.md
packages/openclaw-plugin/skills/openspec-aware/SKILL.md
packages/openclaw-plugin/skills/orchestrate/SKILL.md
packages/openclaw-plugin/skills/proposal-reviewer/SKILL.md
packages/openclaw-plugin/skills/proposal/SKILL.md
packages/openclaw-plugin/skills/quick-dev/SKILL.md
packages/openclaw-plugin/skills/review/SKILL.md
packages/openclaw-plugin/skills/task-reviewer/SKILL.md
packages/openclaw-plugin/skills/yolo/SKILL.md
plugins/chorus/skills/brainstorm/SKILL.md
plugins/chorus/skills/chorus-proposal-reviewer/SKILL.md
plugins/chorus/skills/chorus-task-reviewer/SKILL.md

Metadata

Files
0
Version
96a2f67
Hash
a5d747ad
Indexed
2026-07-25 08:34

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 07:47
浙ICP备14020137号-1 $Гость$