mcpField
G
graphic-2d-PR

graphic-2d-PR

github.com/openharmonyinsightDevelopment3563 installsUpdated 11w ago
Repository

About graphic-2d-PR

A workflow skill for contributors to OpenHarmony’s graphic_graphic_2d repository, covering signed commits, fork pushes, and Gitcode issue and pull-request coordination.

Key features

  1. 01Stage changes and create a branch
  2. 02Require DCO-signed commits
  3. 03Push branches to a fork
  4. 04Create and link issues and pull requests

Use cases

  1. 01Prepare a code change for upstream review
  2. 02Link a pull request to its tracking issue

MCP support

Uses Gitcode MCP tools to create upstream issues, pull requests, and issue comments.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/openharmonyinsight/openharmony-skills --skill graphic-2d-pr

After installing, type/graphic-2d-prin Claude Code to confirm it loaded.

Details

From the project README

Prerequisites

  • Git remotes configured (use git remote -v to check):
    • upstream repository (openharmony/graphic_graphic_2d)
    • user's fork (username/graphic_graphic_2d)
  • Gitcode MCP tools available (if not installed, install from this repo)
  • Build passes successfully

Workflow

1. Stage and Commit Changes
# Reset any staged changes and stage everything together
git reset HEAD .
git add .
git status

# Create a new branch from current branch
git checkout -b feature/descriptive-branch-name

# Commit with signoff (required)
git commit -s -m "type: brief description

Detailed explanation of the change.

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>"

Note: Always use -s flag for signed commits (DCO compliance).

2. Push to Fork
# Push branch to fork (remote 'z')
git push -u z feature/descriptive-branch-name
3. Create Issue

Use gitcode MCP tool to create an issue in the upstream repository:

mcp__gitcode__create_issue
- owner: openharmony
- repo: graphic_graphic_2d
- title: Brief issue title
- body: Detailed issue description with:
  - Summary
  - Problem
  - Solution
  - Impact
  - Files Modified

Example issue body:

## Summary
Brief description of the issue/change.

## Problem
What problem does this solve?

## Solution
How is it solved?

## Impact
- What changes are made?
- Performance impact
- Test results

## Files Modified
- file1.h
- file2.cpp
4. Create Pull Request

Use gitcode MCP tool to create PR in upstream repository:

mcp__gitcode__create_pull_request
- owner: openharmony
- repo: graphic_graphic_2d
- base: master (NOT main - use master)
- head: zhoutianer:feature/descriptive-branch-name
- title: PR title (matches issue title)
- body: Detailed PR description

Critical: Use master as the base branch, not main.

Example PR body:

## Summary
Brief description.

## Problem
What problem does this solve?

## Solution
Technical details of the implementation.

## Impact
- Code quality improvements
- Performance impact
- Test results

## Test plan
- [x] Build passes
- [x] All tests pass
- [x] No new warnings

## Files Modified
- file1.h
- file2.cpp

Closes #<issue-number>

The Closes #<issue-number> at the end automatically links the PR to the issue.

5. Link Issue to PR

Add a comment to the issue referencing the PR:

mcp__gitcode__create_issue_comment
- owner: openharmony
- repo: graphic_graphic_2d
- issue_number: <issue-number>
- body: Link to PR and summary

Example comment:

This issue is addressed by PR #<pr-number>: https://gitcode.com/openharmony/graphic_graphic_2d/merge_requests/<pr-number>

The PR implements:
- Key change 1
- Key change 2

Build passes in X:YY time with all tests passing.

Important Notes

  1. Base branch: Always use master, not main
  2. Sign commits: Always use git commit -s for DCO compliance
  3. Branch naming: Use descriptive names like refactor/feature-name, fix/bug-description
  4. Issue-PR linking: Include Closes #<issue-number> in PR body
  5. Remote names:
    • gitcode - upstream (openharmony/graphic_graphic_2d)
    • z - fork (zhoutianer/graphic_graphic_2d)

Example Session

# After making code changes
git reset HEAD .
git add .
git checkout -b refactor/color-picker-common-impl
git commit -s -m "refactor: Extract common implementation

- Add HandleColorUpdate to base interface
- Extract CreateColorPickerInfo helper
- Remove ~200 lines of duplication

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>"

git push -u z refactor/color-picker-common-impl

Then use MCP tools to create issue #22224, PR #28311, and link them.

Troubleshooting

PR creation fails with API error (400):

  • Check that base branch is master, not main
  • Ensure branch was pushed to fork first

Issue not linking to PR:

  • Verify Closes #<issue-number> is in PR body
  • Check issue number is correct
  • Add manual comment to issue if auto-link fails

Comments

Markdown supported