Review gitcode pr

From openharmonyinsight/openharmony-skills · View interactive version

Review gitcode pr is an AI agent skill from the GitHub repository openharmonyinsight/openharmony-skills. 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

How to use this skill

Skill file

Review GitCode PR

Run this skill when the review starts from a GitCode PR reference and must combine oh-gc artifacts with local repository inspection.

Workflow

1. Resolve The PR

Normalize the user input first.

2. Collect Remote Context

Use scripts/collect_pr_context.py to fetch and save the PR context before reviewing code manually.

The script gathers:

Review the generated artifact directory before making claims. Read artifacts in this order:

  1. summary.json to identify changed files, parsed hunks, commentable new-side lines, and existing normalized context.
  2. pr-diff.txt to verify exact diff text and hunk boundaries for any candidate finding.
  3. pr-view.json for title, description, branch, and high-level PR metadata.
  4. 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.

3. Read Local Code

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:

Do 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.

4. Produce Findings

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:

If a valid diff line cannot be supported, fall back in this order:

  1. File-level comment with path
  2. General PR comment

Never 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:

5. Prepare Submission Draft

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:

Approval gate:

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.

6. Submit Only After Confirmation

Never submit to GitCode implicitly.

When the user explicitly asks to submit:

  1. Build the draft JSON
  2. Run prepare_review_submission.py without --execute to preview commands
  3. Show the user the exact summary and comment count you plan to post
  4. After confirmation, run the same command with --execute

If execution fails partway through, report exactly which comments succeeded and which did not.

Quick Flow

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:

Depth reminder:

  1. Read summary.json
  2. Classify each changed file by risk using references/deep-review-checklist.md
  3. Review every file until it has a final status
  4. Only then decide whether the review has zero findings

Preview 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

Failure Handling

Handle failures explicitly. For each blocker, report:

`oh-gc` unavailable

Authentication or permission failure

Local repository mismatch

Diff JSON missing, malformed, or incomplete

Submission preview or execute failure

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.