mcpField
G
graphic-2d-PR

graphic-2d-PR

github.com/openharmonyinsight開発3563 回インストール11 週間前に更新
リポジトリ

graphic-2d-PR について

OpenHarmony の graphic_graphic_2d への貢献者向けワークフローです。署名付きコミット、フォークへのプッシュ、Gitcode での Issue と PR の管理を扱います。

主な機能

  1. 01変更のステージングとブランチ作成
  2. 02DCO 準拠の署名付きコミット
  3. 03フォークへのブランチのプッシュ
  4. 04Issue と PR の作成および関連付け

活用シーン

  1. 01コード変更を上流レビューに提出する準備
  2. 02PR を追跡用 Issue に関連付け

MCP 対応

Gitcode MCP ツールを使って、上流リポジトリの Issue、PR、Issue コメントを作成します。

インストール

コマンドをコピーしてターミナルで実行します。

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

インストール後、Claude Code で/graphic-2d-prを入力して読み込まれたか確認します。

詳細

前提条件

  • Git リモートが設定されていること(git remote -v で確認してください):
    • 上流リポジトリ(openharmony/graphic_graphic_2d)
    • ユーザーのフォーク(username/graphic_graphic_2d)
  • Gitcode MCP ツールが利用できること(インストールされていない場合は、このリポジトリからインストールしてください)
  • ビルドが正常に完了すること

ワークフロー

1. 変更をステージングしてコミットする
# 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]>"

注:DCO に準拠するため、署名付きコミットには必ず -s フラグを使用してください。

2. フォークにプッシュする
# Push branch to fork (remote 'z')
git push -u z feature/descriptive-branch-name
3. Issue を作成する

gitcode MCP ツールを使用して、上流リポジトリに Issue を作成します。

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

Issue 本文の例:

## 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. プルリクエストを作成する

gitcode MCP ツールを使用して、上流リポジトリに PR を作成します。

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

重要:ベースブランチには main ではなく master を使用してください。

PR 本文の例:

## 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>

末尾の Closes #<issue-number> によって、PR が Issue に自動的に紐付けられます。

5. Issue を PR に紐付ける

PR を参照するコメントを Issue に追加します。

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

コメントの例:

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.

重要事項

  1. ベースブランチ:必ず main ではなく master を使用してください
  2. コミットへの署名:DCO に準拠するため、必ず git commit -s を使用してください
  3. ブランチ名:refactor/feature-name、fix/bug-description のような、内容がわかる名前を使用してください
  4. Issue と PR の紐付け:PR 本文に Closes #<issue-number> を含めてください
  5. リモート名:
    • gitcode - 上流(openharmony/graphic_graphic_2d)
    • z - フォーク(zhoutianer/graphic_graphic_2d)

セッションの例

# 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

次に MCP ツールを使用して、Issue #22224 と PR #28311 を作成し、両者を紐付けます。

トラブルシューティング

API エラー(400)により PR の作成に失敗する場合:

  • ベースブランチが main ではなく master であることを確認してください
  • フォークにブランチを先にプッシュしたことを確認してください

Issue が PR に紐付かない場合:

  • PR 本文に Closes #<issue-number> が含まれていることを確認してください
  • Issue 番号が正しいことを確認してください
  • 自動で紐付かない場合は、Issue に手動でコメントを追加してください

コメント