What:依 jsc-meta:skill-check 的稽核結果修正技能與工具——補上每個步驟的可檢核完成條件、 把留在內文的標準輸入輸出流程下放 tools/、修正查表與退碼路由造成的誤判。 Why:稽核發現這些缺失會讓技能在實際執行時走錯分支或靜默通過。 完成條件缺漏是最常被違反的一項;退碼誤判與查表錯誤則會讓良性狀況被當成失敗。 How:逐項對照 references/guidelines.md 的審核檢查清單修正,新增的工具都有 documented exit codes,並以真實執行驗證每條路徑。 Who:jsc-meta:skill-check 例行稽核(2026-08-25)。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
4.3 KiB
4.3 KiB
name, description
| name | description |
|---|---|
| pr | Commit all changes via jsc-git:commit, create a target branch named from the highest-priority commit type plus a summarized title, push, then open a Gitea PR with the templated description against the base branch the caller passed in (falling back to develop, main, master only when none was given). Branch priority is revert > fix > feat > perf > refactor > test > docs > style > chore. Use when work is ready for review; not for plain commits. |
pr — create a Push Request
Steps
- Call
jsc-git:committo commit every file change first. Done whengit status --porcelainprints nothing. - Resolve the base branch:
tools/base-branch.sh {base branch the caller passed in, omitted when the caller passed none}. A base branch passed in by the caller wins over everything else —jsc-sdlc:implementpasses the analysis page's source branch, and silently retargeting that PR atdevelopwould merge a single work package straight past the feature branch it belongs to. Done when the script prints one branch name; a non-zero exit → report and stop, never fall back silently. - Create the target branch from the remote base branch:
- Take the type with the highest priority across all commits:
revert > fix > feat > perf > refactor > test > docs > style > chore. Done when exactly one type is picked. - Summarize one title from all commit messages. Done when one title line covers every commit in the range.
- Translate the requirement and the title into a short English phrase, then run
tools/slugify.sh {type} {phrase}to build the target branch name{type}/{requirement or feature}-{title}(example: a non-English request to export order reports becomes the phraseorder export report, thenfeat/order-export-report). Done when the script prints one slug on stdout; exit 2 (non-ASCII input) or exit 3 (empty slug) → re-translate the title into an English phrase and retry, never hand-build the branch name. - Run
git checkout -b {target branch} origin/{base branch}so the branch starts at the remote base, then bring step 1's commits onto it (git cherry-pickthem when they landed on another branch). Done whengit branch --show-currentprints the target branch andgit log --oneline origin/{base branch}..HEADlists exactly step 1's commits.
- Take the type with the highest priority across all commits:
- Run
git push -u origin {target branch}. Done whengit ls-remote --heads originshows the target branch's ref. - Create the PR:
jsc-gitea/tools/gitea.sh pr-create {owner}/{repo} {target branch} {base branch} "{branch name}" {description file}.- Title = branch name.
- Write the description into a temp file first, using
templates/pr-description.md(a Traditional Chinese template; the generated description stays in Traditional Chinese per the STE100 output rule). - Done when the command prints a PR URL; no URL → report the error and stop.
- Prerequisite PR blocking: when the description lists a prerequisite Push Request, run
jsc-gitea/tools/gitea.sh pr-depend {owner}/{repo} {this PR number} {prerequisite owner}/{repo} {prerequisite PR number}to add the dependency. Gitea then blocks merging until the prerequisite PR closes. On exit 4 (the dependency API call failed) degrade: prefix the PR title withWIP:, which Gitea blocks merging on natively, and record in the PR description that the prefix comes off once the prerequisite PR closes. Done whenpr-dependprintedOK {owner}/{repo}#{number} depends on ..., or the PR title starts withWIP:and the description names the prerequisite PR. - Report the PR URL. Done when the reported URL is the one step 5 printed, together with the base branch and the target branch it was opened against.
Rules
- No template section may stay empty: fill the literal 「無」 when there is no plan page, analyze page, or prerequisite PR.
- Read the
jsc-sdlcplan page and analyze page throughjsc-gitea:wiki, which resolvesJSC_WIKI_REPO_PLANfor the plan page andJSC_WIKI_REPO_ANALYZEfor the analyze page from the inherited environment, falls back toJSC_WIKI_REPO, and asks only when neither is set. Each page type reads its own variable only; a page type never borrows another type's variable. Take both links from the pages read this way; the analyze link must point at the work package heading anchor. - Branch title summarization (step 3.2) and description drafting MUST run as a sub agent.