skills/review-gitcode-pr/SKILL.md
Review a GitCode pull request from a PR number or URL when `oh-gc` must fetch PR metadata, diff, and comments, local repository code must be inspected for context, and the output should be concrete findings or a GitCode submission draft. Use for GitCode PR review or comment-submission requests that depend on `oh-gc`. Do not use for generic local review, GitHub/GitLab flows, or automatic submission without explicit user confirmation.
npx skillsauth add openharmonyinsight/openharmony-skills review-gitcode-prInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Run this skill when the review starts from a GitCode PR reference and must combine oh-gc artifacts with local repository inspection.
Normalize the user input first.
OWNER/REPO.OWNER/REPO, scripts/collect_pr_context.py will try to infer it from the current repository's GitCode remote URLs.--repo OWNER/REPO explicitly.scripts/normalize_pr_ref.py for this normalization step.Use scripts/collect_pr_context.py to fetch and save the PR context before reviewing code manually.
The script gathers:
oh-gc pr:view NUMBER --jsonoh-gc pr:diff NUMBER --jsonoh-gc pr:diff NUMBER --name-onlyoh-gc pr:diff NUMBER --color neveroh-gc pr:comments NUMBER --json --comment-type pr_commentoh-gc pr:comments NUMBER --json --comment-type diff_commentReview the generated artifact directory before making claims. Read artifacts in this order:
summary.json to identify changed files, parsed hunks, commentable new-side lines, and existing normalized context.pr-diff.txt to verify exact diff text and hunk boundaries for any candidate finding.pr-view.json for title, description, branch, and high-level PR metadata.pr-diff.json or raw comments output only when the normalized summary is insufficient.Do not load every artifact by default. Start from summary.json and only drill down when a finding needs more evidence.
Do not review from the diff alone.
Use references/deep-review-checklist.md as the required checklist for depth, stopping conditions, and risk-specific review prompts.
For every changed file, assign exactly one review status before finishing:
reviewed: the file and its relevant context were inspected deeply enough to support findings or a no-finding conclusionmechanical-low-risk: the change is demonstrably mechanical and low-risk after verification against the checklistskipped-with-reason: the file was not reviewed in depth, and the reason and residual risk are stated explicitlyDo not stop after finding one or two issues. Keep reviewing until every changed file has one of the statuses above.
For each changed file that matters:
Minimum depth rules:
Prioritize:
Prefer high-signal findings over style commentary.
Depth expectations:
Use references/review-rubric.md when deciding whether a candidate issue is a real finding, assigning severity, or explaining residual risk when no findings are confirmed.
Default output is issue-driven review, not a broad summary.
Use this template for each finding shown to the user:
Severity | Path:Line | Problem | Evidence | Fix
Include:
high, medium, or lowIf a valid diff line cannot be supported, fall back in this order:
pathNever invent a diff line number.
If no valid findings are discovered, state that explicitly and include:
Do not say "no actionable issues found" unless the file coverage and checklist pass were completed for the inspected scope.
Use references/no-finding-template.md as the default output shape when the inspected scope has no confirmed findings.
When drafting comments that may be submitted back to GitCode:
This skill uses a two-step submission flow.
Default behavior:
Use references/review-draft-schema.md for the draft shape and scripts/prepare_review_submission.py to validate it against the collected context.
The draft may include:
path and lineApproval gate:
approve: true only when no blocking or high-severity findings remain and the user explicitly wants approval.oh-gc pr:review.Important: oh-gc pr:review only supports approval. It is not a general "submit review" endpoint.
For submitted comments, follow the Markdown and Chinese-writing rules in references/review-draft-schema.md.
Never submit to GitCode implicitly.
When the user explicitly asks to submit:
prepare_review_submission.py without --execute to preview commands--executeIf execution fails partway through, report exactly which comments succeeded and which did not.
Use these commands only as a compact reminder after reading the workflow above.
python3 skills/review-gitcode-pr/scripts/collect_pr_context.py 123
Primary review artifacts:
summary.jsonpr-diff.txtpr-view.jsonDepth reminder:
summary.jsonreferences/deep-review-checklist.mdPreview a draft submission:
python3 skills/review-gitcode-pr/scripts/prepare_review_submission.py \
--context-dir .review-gitcode-pr/pr-123 \
--draft review-draft.json
Execute only after explicit user confirmation:
python3 skills/review-gitcode-pr/scripts/prepare_review_submission.py \
--context-dir .review-gitcode-pr/pr-123 \
--draft review-draft.json \
--execute
Handle failures explicitly. For each blocker, report:
Blocker: what failed and which command or assumption failedFallback: what review scope remains possibleNext step: what the user or agent should do nextoh-gc unavailableoh-gc is missing from PATH or cannot be executed.oh-gc, or point to existing artifacts to review offline.oh-gc returns authentication, authorization, or API permission errors for PR view, diff, or comments.pr:diff --json changes shape, omits hunks, or cannot be parsed reliably enough for structured line mapping.pr-diff.txt as the source of truth for diff reasoning. Only emit line comments when a new-side line can still be verified confidently from raw diff text; otherwise fall back to file-level or general comments.prepare_review_submission.py validation fails, preview commands do not match the draft, or --execute fails for some comments.testing
--- name: ohos-req-value-decision description: Use after review meeting to record decision and route to next step. Triggers: 评审决策纪要, 评审结论回流, value decision, 评审接纳, 评审不接纳, 评审退回, 下次重新上会. Do NOT use for feature baseline (ohos-req-feature-baseline), review gate checks (ohos-req-review-gate), or IR generation (ohos-req-feature-to-ir). metadata: author: openharmony scope: common stage: requirements capability: value-decision version: 0.3.0 status: draft tags: - sdd - requirements
development
Use when converting an OpenHarmony requirement document, spec, or design proposal into an OpenHarmony review slide deck (需求评审 / 需求变更评审 / 设计评审 PPTX) — produces the fixed OpenHarmony-branded review-deck structure (OH logo on every page) with architecture/flow diagrams and field tables. Triggers on "需求评审PPT", "需求变更评审", "把需求文档转成评审PPT", "spec转评审PPT", "requirement/spec to review deck". NOT for arbitrary or generic slide decks unrelated to OpenHarmony requirement/design review.
testing
Use when performing the Phase 0 Step 0.5 Review Ready Gate on a 04-feature.md, especially when the user says "evaluate gate", "review readiness", "feature ready?", "should we generate IR", or when the ohos-req-intake-orchestration main session needs a structured Ready / Conditional Ready / Not Ready judgment instead of doing the check inline. Reads 01-04, runs seven fixed checks plus a conditional-items check, and returns a machine-readable JSON summary plus a human-readable table that the main session can route on. Do NOT use for feature baseline generation (ohos-req-feature-baseline), value decision recording (ohos-req-value-decision), or IR generation (ohos-req-feature-to-ir).
testing
--- name: ohos-req-requirement-intake description: Use when importing an OHOS requirement into Phase 0.1, especially for 01-requirement.md, requirement intake, background, user value, scenarios, scope, FR/NFR, affected modules, or priority. Triggers: 需求导入, 01-requirement, 需求基线, RR单号. Do NOT use for feasibility analysis (ohos-req-feasibility-analysis), architecture decision (ohos-req-arch-decision), or feature baseline (ohos-req-feature-baseline). metadata: author: openharmony scope: common