一键导入
ks-pr-prep
Delivery-context organizer. Compress post-review changes into reviewer-ready PR and merge context without replacing release decisions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Delivery-context organizer. Compress post-review changes into reviewer-ready PR and merge context without replacing release decisions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Lightweight task compressor. Turn messy input into a one-page brief that can route to roundtable or writing-plan without replacing direction decisions.
Formal quality gate with multi-persona review, confidence thresholds, and QA routing based on fresh verification evidence.
Direction convergence skill. Use brainstorm, align, or challenge mode to turn messy questions or existing proposals into a clear directional decision.
Use this when direction is already clear and the next job is to compress it into an executable block with scope, done criteria, and routing.
Fast failure classifier. Decide whether the problem is a spec gap, an implementation bug, or a rollback candidate before routing to writing-plan, diagnose, or ship.
Use this when the system is broken, tests are failing, or behavior is abnormal and the root cause is still unknown. No investigation, no fix.
| name | ks-pr-prep |
| description | Delivery-context organizer. Compress post-review changes into reviewer-ready PR and merge context without replacing release decisions. |
| layer | operation |
| owner | pr-prep |
| inputs | ["review_report","verification_report","diff"] |
| outputs | ["pr_summary","merge_context"] |
| entry_modes | ["build-ready","release-ready"] |
Preamble: see templates/preamble.md
Packages the purpose of the change, validation results, risk disclosure, and reviewer context into a PR-ready summary. Enter when implementation and verification are finished, review produced a formal quality judgment, and the next job is clear delivery context for a PR or merge. Does not do quality approval, release approval, or promise validation that never happened.
Never list validation that did not actually run.
PR prep is not release.
The Risks field must never be empty.
Detect the change scope from the actual diff. Do not guess or hard-code values.
_BASE=$(git merge-base HEAD origin/main 2>/dev/null || git merge-base HEAD main 2>/dev/null || echo "HEAD~10")
_FILE_COUNT=$(git diff --name-only $_BASE | wc -l | tr -d ' ')
_FILES=$(git diff --name-only $_BASE | head -20)
_LINES=$(git diff --numstat $_BASE | awk '{sum += $1 + $2} END {print sum}')
echo "BASE: $_BASE"
echo "Changed files: $_FILE_COUNT"
echo "Files: $_FILES"
echo "Total changed lines: $_LINES"
If no diff is found, see E1.
Explain the problem in 1-2 sentences. Do not replay the whole chat history.
Questions to answer:
Extract 1-3 high-level changes. Avoid turning it into a file-by-file changelog.
Format: "Added [X]", "Fixed [Y]", "Removed [Z]". Not "changed line 47 in foo.py, line 92 in bar.py, ...".
List only real checks that actually ran. Say "not run" when something was not run.
Sources of evidence:
For each validation item, state:
The Risks field must never be empty. If no risks are known, write: "No known risks identified; reviewer should assess independently."
Content:
## PR Prep
**Goal**: [one sentence]
### Summary
- [1-3 high-level changes]
### Why
- [why this is happening now, 1-2 sentences]
### Validation
- [executed validation with pass/fail status]
- [not-run items with reason]
### Risks
- [known risks]
- [reviewer focus areas]
### Not Included
- [explicit exclusions]
### Reviewer Notes
- [what reviewers should focus on and why]
When Step 1 produces no diff between the current branch and the base:
git log --oneline origin/main..HEADHEAD~5 as a fallback baserelease instead of pr-prepWhen review or verification reports are not available:
verify firstdecision: pr-context-ready confidence: 0.9 rationale: Reviewer-ready delivery context was prepared from verify and review evidence, while risks and unexecuted validation remain honestly disclosed. fallback: If the review conclusion changes, regenerate the PR context from the new evidence. escalate: false next_skill: ship or release next_action: Use the prepared context for PR, merge, or downstream delivery work.
_KS_CLI="${KEYSTONE_CLI:-./keystone}"
$_KS_CLI state set last_decision "pr-context-ready" >/dev/null 2>&1 || true
$_KS_CLI state set artifacts.pr_prep_status "ready" >/dev/null 2>&1 || true
mkdir -p .keystone/telemetry/events
echo "{\"skill\":\"pr-prep\",\"ts\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\"decision\":\"pr-context-ready\"}" >> .keystone/telemetry/events/$(date +%Y-%m).jsonl