From gitea-workflow
Gitea APIを使ってプルリクエストの作成やレビューコメントの取得を行う。PRの作成、レビューコメントの確認・返信などGitea操作全般に使用する。
How this skill is triggered — by the user, by Claude, or both
Slash command
/gitea-workflow:giteaThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
このプロジェクトではGitHubではなく**Gitea**をGitホスティングとして使用している。`gh` CLIは利用できないため、すべての操作はGitea REST APIで行う。
このプロジェクトではGitHubではなくGiteaをGitホスティングとして使用している。gh CLIは利用できないため、すべての操作はGitea REST APIで行う。
認証情報は環境変数から取得する:
GITEA_USERNAMEGITEA_TOKENGITEA_PASSWORDAPIのベースURLは git remote get-url origin の出力から取得する。
http://<host>:<port>/<owner>/<repo>.git
この情報から以下を組み立てる:
http://${GITEA_USERNAME}:${GITEA_TOKEN}@<host>:<port>/api/v1<owner>/<repo> を抽出以降の例では以下の変数を使う:
API=http://${GITEA_USERNAME}:${GITEA_TOKEN}@<host>:<port>/api/v1
OWNER_REPO=<owner>/<repo>
POST ${API}/repos/${OWNER_REPO}/pulls
Content-Type: application/json
{
"title": "PRタイトル (70文字以内)",
"body": "## Summary\n- 変更点1\n- 変更点2\n\n## Test plan\n- [ ] テスト項目\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)",
"head": "feature-branch-name",
"base": "main"
}
curl -s -X POST "${API}/repos/${OWNER_REPO}/pulls" \
-H "Content-Type: application/json" \
-d '{"title":"...","body":"...","head":"feature-branch","base":"main"}'
html_url: PRのURL(ユーザーに返す)number: PR番号(以降のAPI呼び出しで使用)"pull request already exists" エラーが返ったら、既存PRの一覧を取得して更新する:
GET ${API}/repos/${OWNER_REPO}/pulls?state=open
PATCH ${API}/repos/${OWNER_REPO}/pulls/{index}
GET ${API}/repos/${OWNER_REPO}/pulls/{index}/reviews
レスポンスの各レビューから確認すべきフィールド:
id: レビューID(コメント取得に使用)state: REQUEST_CHANGES, APPROVED, COMMENT などuser.login: レビュアー名body: レビュー本文(あれば)GET ${API}/repos/${OWNER_REPO}/pulls/{index}/reviews/{review_id}/comments
レスポンスの各コメントから確認すべきフィールド:
id: コメントIDpath: 対象ファイルパスbody: コメント内容diff_hunk: 該当コードの差分position: diff内の行位置commit_id: 対象コミットSHAGitea APIには「コメントへの直接返信」機能がない(ソースコードで replyReviewID が 0 にハードコードされている)。
そのため、Web UIの内部エンドポイントを利用する専用スクリプトを使用する。
gitea/reply_to_review_comment.py を uv run で実行する。
パスワードは環境変数 GITEA_PASSWORD から取得する。
uv run gitea/reply_to_review_comment.py \
--url http://<host>:<port> \
--user "${GITEA_USERNAME}" --password "${GITEA_PASSWORD}" \
--repo <owner>/<repo> \
--pr <PR番号> \
--comment-id <返信先コメントID> \
--message "返信内容"
--url: GiteaのベースURL(例: http://localhost:3000)--user: ログインユーザー名--password: ログインパスワード(APIトークンではない)--repo: リポジトリ(例: owner/repo)--pr: PR番号--comment-id: 返信先のレビューコメントID(APIレスポンスの id フィールド)--message: 返信メッセージ本文id フィールドを使用するpull_request_review_id)を自動解決するため、利用者はコメントIDだけ指定すればよいnpx claudepluginhub backpaper0/claude-plugins --plugin gitea-workflowAddresses PR review comments and issue feedback via gh CLI, ensuring systematic resolution of GitHub pull request discussions.
Terminal-based GitHub PR dashboard showing CI/CD progress, bot comments, file changes, and one-command merges.
Guides contributing to GitHub projects: forking, branching, PRs, code reviews, and issue management.