pr
Runs tests, build, code review and creates pull requests with issue tracking.
- License 许可
- MIT
- 所属仓库
- goffity/dev-km
- 最近更新
- 2026-11-10
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- pr
- description
- Runs tests, build, code review and creates pull requests with issue tracking.
- user-invocable
- true
02 资源文件 9
- 参考文档agents/openai.yaml315 B
- 参考文档issue-comments.md2.1 KB
- 参考文档pr-post-create.md6.5 KB
- 参考文档references/golden-set.md13.6 KB
- 参考文档references/quality-rubric.md4.1 KB
- 参考文档references/quick-rules.md20.6 KB
- 参考文档references/upstream-notice.md3.3 KB
- 脚本scripts/audit-humanize-output.mjs16.6 KB
- 脚本scripts/calque-patterns.mjs7.2 KB
03 SKILL.md 正文
Create Pull Request
รัน tests, build, code review และสร้าง PR พร้อม update issue ทุกขั้นตอน
Usage
/pr
Flow
make test → make build → Code Review → Create PR
↓ ↓ ↓
(fail) (fail) (fail)
↓ ↓ ↓
Fix Fix Agent Fix
↓ ↓ ↓
Retry Retry Re-review
Instructions
Language Setting
Check
LANGUAGEindocs/current.md. Ifth, translate output perreferences/language-guide.md. Seereferences/bash-helpers.mdfor detection snippet.
Issue Comment Pattern
ทุก step จะ comment ไปที่ issue ตาม pattern นี้ (ดู templates เต็มที่ issue-comments.md):
export TZ='Asia/Bangkok'
ISSUE=$(grep "^ISSUE:" docs/current.md | cut -d: -f2 | tr -d ' #')
gh issue comment $ISSUE --body "[template from issue-comments.md]"
Step 0: Read Current Focus
export TZ='Asia/Bangkok'
echo "=== Current Focus ==="
cat docs/current.md
ISSUE=$(grep "^ISSUE:" docs/current.md | cut -d: -f2 | tr -d ' #')
TASK=$(grep "^TASK:" docs/current.md | cut -d: -f2-)
echo "Issue: #$ISSUE"
echo "Task: $TASK"
เก็บค่า ISSUE และ TASK ไว้ใช้ตลอด flow
Step 1: Run Tests
- Comment issue: "Running Tests"
- รัน
make test - ถ้า fail: Comment "Tests Failed" พร้อม error → แจ้ง user หยุด → รัน
/prอีกครั้ง - ถ้า pass: Comment "Tests Passed" → ไป Step 2
echo "=== Running Tests ==="
make test 2>&1
TEST_EXIT_CODE=$?
echo "Exit code: $TEST_EXIT_CODE"
Step 2: Run Build
- รัน
make build - ถ้า fail: Comment "Build Failed" พร้อม error → แจ้ง user หยุด → รัน
/prอีกครั้ง - ถ้า pass: Comment "Build Passed" → ไป Step 3
echo "=== Building ==="
make build 2>&1
BUILD_EXIT_CODE=$?
echo "Exit code: $BUILD_EXIT_CODE"
Step 3: Code Review (Subagent)
- Comment issue: "Code Review Started"
- ใช้ Agent tool กับ subagent_type="general-purpose" เพื่อ review:
Prompt:
"Review the code changes in this branch compared to main.
Check for:
1. **Code Quality**: Best practices, clean code, naming conventions
2. **Bugs**: Potential bugs, logic errors, edge cases
3. **Security**: SQL injection, XSS, command injection, secrets exposure
4. **Performance**: N+1 queries, memory leaks, inefficient algorithms
5. **Tests**: Test coverage, missing tests, test quality
For each finding, provide:
- Severity: CRITICAL / WARNING / INFO
- File and line number
- Description of the issue
- Suggested fix
Output format:
## Review Summary
### Critical Issues (must fix)
- [ ] Issue description
### Warnings (should fix)
- [ ] Issue description
### Info (nice to have)
- [ ] Issue description
### Overall Assessment
Pass / Fail with reason"
- ถ้ามี CRITICAL: Comment "Code Review Failed" → Agent auto-fix → re-review (loop)
- ถ้า pass: Comment "Code Review Passed" → ไป Step 4
Agent auto-fix prompt:
"Fix the following critical issues from code review:
[list of critical issues]
For each issue:
1. Locate the file and line
2. Apply the suggested fix
3. Verify the fix is correct
4. Report what was changed"
Step 4: Push Code
git push -u origin $(git branch --show-current)
Step 5: Create Pull Request
export TZ='Asia/Bangkok'
ISSUE=$(grep "^ISSUE:" docs/current.md | cut -d: -f2 | tr -d ' #')
TASK=$(grep "^TASK:" docs/current.md | cut -d: -f2- | xargs)
# Determine PR type from task or branch
TYPE="feat"
if echo "$TASK" | grep -qi "fix\|bug"; then
TYPE="fix"
elif echo "$TASK" | grep -qi "refactor"; then
TYPE="refactor"
elif echo "$TASK" | grep -qi "doc"; then
TYPE="docs"
fi
# Detect base branch (prefer develop, fallback to default)
if git branch -r | grep -q "origin/develop"; then
BASE_BRANCH="develop"
else
BASE_BRANCH=$(git remote show origin | grep 'HEAD branch' | cut -d: -f2 | xargs)
fi
gh pr create \
--base "$BASE_BRANCH" \
--title "$TYPE: $TASK" \
--body "$(cat <<EOF
## Summary
$TASK
## Changes Made
$(git diff main...HEAD --name-only | sed 's/^/- /')
## Testing
| Test | Status |
|------|--------|
| Unit Tests (\`make test\`) | Passed |
| Build (\`make build\`) | Passed |
| Code Review | Passed |
## Related Issues
Fixes #$ISSUE
EOF
)"
Comment issue: "Pull Request Created" พร้อม PR URL (see issue-comments.md)
For post-PR-creation steps (auto-polling, confirmation, flow diagram), see pr-post-create.md.
Related Commands
| Command | Purpose |
|---|---|
/focus |
ตั้ง focus และสร้าง issue |
/td |
สร้าง retrospective |
/pr |
รัน tests, build, review และสร้าง PR (คุณอยู่ที่นี่) |
/pr-review |
ตอบ PR feedback |
/commit |
Atomic commits |
04 同仓库更多 Skills
wait-what
Stop. That last message did not land: re-pitch it.
tdd
Test-driven development loop (red-green-refactor) with commit-based phase state and Jira traceability. Use when the user wants to build a feature or fix a bug test-first, mentions "tdd", "red-green-refactor", or "test-first". Replaces the tdg plugin — combines its commit/phase discipline with seam-based test quality rules from kb Testing Standards.
td
Creates post-task retrospectives with Before/After context and session documentation.
summary
Generates weekly or monthly session summaries from retrospectives and activity logs.
share
Shares knowledge across projects by copying to shared-knowledge directory with cross-project metadata.
session-analyzer
Analyzes git changes and creates retrospective drafts with Before/After context.