Install
openclaw skills install gitcode-issue-workflowEnd-to-end GitCode issue workflow covering issue pickup, analysis, code modification, and PR submission. Use when user asks to handle/fix/resolve a GitCode issue, or when working on issue-driven development for GitCode repositories. Triggers on phrases like "接取 issue", "处理 issue", "修复 issue", "fix issue", "handle issue", "resolve issue", "提交 PR", "create PR for issue". Requires gitcode CLI (GitCode CLI) and git. NOT for code review (use code-review skill), issue triage without code changes, or non-GitCode platforms.
openclaw skills install gitcode-issue-workflowEnd-to-end workflow: Issue → Analysis → Code Fix → PR Submission.
gh). Source: https://github.com/codeasier/gitcode-cliCLI command name:
gitcode — full command name, works on all platforms (recommended on Windows)gc — short alias, works on macOS/Linux (conflicts with PowerShell Get-Content on Windows)gitcode CLI detection (follow this order):
gitcode --version first (recommended, works everywhere)gc --version (macOS/Linux fallback)gitcode CLI authentication check:
After confirming the CLI is installed, try a lightweight command to verify authentication (e.g., gitcode issue view 1 --repo <owner>/<repo>). If it returns a token-related error like Invalid header parameter: private-token, required, the CLI is not authenticated.
Stop and prompt the user to authenticate first:
gitcode auth login
Or if they have a token, use --with-token (not --token):
echo <your_token> | gitcode auth login --with-token
Windows note: If the CLI outputs emoji characters and throws UnicodeEncodeError: 'gbk' codec can't encode character, set the Python IO encoding before running CLI commands:
$env:PYTHONIOENCODING="utf-8"
gitcode issue view <number> --repo <owner>/<repo>
Do not proceed with the workflow until authentication is successful.
Windows note: On PowerShell, gc is an alias for Get-Content. Always use gitcode on Windows.
Fetch the issue using gitcode CLI:
gitcode issue view <number> --repo <owner>/<repo>
gitcode issue view <number> --repo <owner>/<repo> --comments
(gc can be used as shorthand on macOS/Linux, e.g., gc issue view ...)
If the CLI returns an authentication error (e.g., Invalid header parameter: private-token, required):
gitcode auth statusgitcode auth login and stop the workflowcurl -s "https://api.gitcode.com/api/v5/repos/<owner>/<repo>/issues/<number>?access_token=<token>"
curl -s "https://api.gitcode.com/api/v5/repos/<owner>/<repo>/issues/<number>/comments?access_token=<token>"
Parse and present to user:
Must confirm with user before proceeding:
cd <repo_path>
git status
git log --oneline -3
master):git pull <remote> <branch>
⚠️ Constraints:
upstream (the target org repo) vs personal forkRead the files that need modification based on the issue description:
# Use read tool to examine the file contents
read <file_path>
Analysis requirements:
⚠️ Must get user approval before modifying any files.
Present to the user:
- old content
+ new content
Wait for user confirmation before proceeding to Step 5.
If user requests adjustments, revise the proposal and re-present.
After user approval, apply the changes:
# Edit the file using edit tool
edit <file_path> oldText -> newText
Verify the changes:
cd <repo_path>
git diff <file>
Show the diff output to user for final confirmation.
This step involves multiple sub-steps. Follow them in strict order.
Branch naming format: [type]_[YYYYMMDD]_[brief_description]
doc, fix, feat, refactor, test, chore, etc.cd <repo_path>
git checkout -b <branch_name>
Examples:
doc_20260424_contributing_guidefix_20260424_null_checkfeat_20260424_export_csvCommit message format: [type]([module]): [detailed description]
git add <changed_files>
git commit -m "<type>(<module>): <description>"
Examples:
docs(readme): elevate contributing guide to standalone sectionfix(parser): add null check for empty inputfeat(export): add CSV export support⚠️ Critical constraints:
git remote -v
Then push:
git push <personal_remote> <branch_name>
Method 1: gitcode CLI (preferred)
gitcode pr create -R <upstream_owner>/<repo> \
--fork <personal_owner>/<repo> \
--head <branch_name> \
--base <target_branch> \
--title "<commit_message>" \
--body "<pr_description>"
On macOS/Linux, gc is a valid shorthand: gc pr create ...
⚠️ Must ask user for the target branch (e.g., master, main, develop) if not already known. Do not assume.
PR body template:
## PR描述 (What this PR does / why we need it?)
<!--
- 请明确说明您提交PR的变更内容。本部分旨在概述所做的变更,以及此PR是如何解决该问题的。请尽可能地提供有助于评审人员更高效、更快速完成检视审查的实用说明。
- 请说明为何需要这些更改,例如具体的使用场景或bug描述。
- 关联issue号(如果有)
- Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue.
If possible, please consider writing useful notes for better and faster reviews in your PR.
- Please clarify why the changes are needed. For instance, the use case and bug description.
- Fixes [#<issue-number>](https://gitcode.com/<upstream_owner>/<repo>/issues/<issue-number>)
-->
## 面向用户的变更 (Does this PR introduce _any_ user-facing change)?
<!--
请注意,这里指的是**任何**面向用户的变更,包括但不限于API、用户界面或其他使用方式上的变更。
Note that it means *any* user-facing change including all aspects such as API, interface or other behavior changes.
-->
## 功能验证 (How was this patch tested?)
<!--
请确认CI已通过增量及存量的单元测试用例。
如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤(最好提供完整的可复现的操作路径及关键截图),以便Committer能够快速复现验证,也便于后续的维护。
如果未添加测试,请说明未添加的原因,以及为何难添加测试。
- [_] 功能自验
- [_] 本地自验截图(涉及个人标识符等敏感信息请注意脱敏)
- [_] 新增/变更内容是否已新增/适配UT测试用例看护
CI passed with new added/existing test.
If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
If tests were not added, please describe why they were not added and/or why it was difficult to add.
- [_] Self-verification of the feature.
- [_] Screenshot of local self-verification (please anonymize any sensitive information such as personal identifiers)
- [_] Have new or modified unit test (UT) cases been added or adapted to cover the newly added or changed content?
-->
Method 2: GitCode API (fallback if gc CLI fails)
See references/gitcode-api.md for the API endpoint and parameters.
curl -s -X POST "https://api.gitcode.com/api/v5/repos/<owner>/<repo>/pulls?access_token=<token>" \
-H "Content-Type: application/json" \
-d @<payload_file>
Payload structure:
{
"title": "<PR title>",
"body": "<PR description>",
"head": "<fork_owner>:<branch_name>",
"base": "<target_branch>",
"fork_path": "<fork_owner>/<repo>"
}
Method 3: Manual (last resort)
If both gc CLI and API fail, provide the user with the manual creation URL:
https://gitcode.com/<fork_owner>/<repo>/merge_requests/new?source_branch=<branch_name>
And the PR description text for them to paste.
After PR creation, present a summary:
| Item | Value |
|---|---|
| PR URL | <link> |
| PR Number | #<number> |
| Source | <fork_owner>/<repo>:<branch> |
| Target | <upstream_owner>/<repo>:<base_branch> |
| Linked Issue | #<issue_number> |
| Status | Opened |
[type]([module]): [description][type]_[YYYYMMDD]_[brief_description]git diff before committing| Action | Ask First? |
|---|---|
| Read files, check git status | ❌ Just do it |
| Fetch issue details | ❌ Just do it |
| Propose changes | ❌ Present proposal |
| Modify files | ✅ Wait for approval |
| Push to remote | ✅ Ask which remote |
| Create PR | ✅ Ask target branch if unknown |
| Post issue comments | ✅ Always confirm |
All temporary files generated during the workflow must be stored in temp/ directory under the workspace:
workspace/temp/
├── *.md # Downloaded files for review
├── *.json # API payloads
└── * # Other temp files
⚠️ Clean up temp/ directory after workflow completion:
Remove-Item -Recurse -Force temp/ # Windows
rm -rf temp/ # Linux/macOS