This skill helps you retrieve and analyze issue information from GitCode repositories, especially for Ascend projects.
When to Call
Call this skill in the following situations:
- The user wants to collect issue information from GitCode repositories
- The user wants to analyze closed issues to find solutions
- The user wants to get handling suggestions for open issues
- The user mentions GitCode, issues, or Ascend projects (mind-cluster, RecSDK, etc.)
Supported Repositories
For Ascend projects, the following repositories are supported:
- mind-cluster
- RecSDK
- IndexSDK
- DrivingSDK
- AgentSDK
- VisionSDK
- MultimodalSDK
- RAGSDK
- MindInferenceService
- MEF
- OMSDK
- ascend-deployer
- memfabric_hybrid
- memcache
You can also find more repositories at the following link:https://gitcode.com/Ascend
Prerequisites
Environment Variable Configuration
This skill requires storing a GitCode API token in the environment variable GITCODE_TOKEN .
Before using this skill, guide the user to set the token:
Windows (PowerShell):
# 临时设置(仅当前会话有效)
$env:GITCODE_TOKEN = "your_token_here"
# 永久设置(用户级别)
[Environment]::SetEnvironmentVariable("GITCODE_TOKEN", "your_token_here", "User")
# 永久设置(系统级别 - 需要管理员权限)
[Environment]::SetEnvironmentVariable("GITCODE_TOKEN", "your_token_here", "Machine")
Linux/macOS:
# 临时设置(仅当前会话有效)
export GITCODE_TOKEN="your_token_here"
# 永久设置 - 添加到 ~/.bashrc 或 ~/.zshrc
echo 'export GITCODE_TOKEN="your_token_here"' >> ~/.bashrc
source ~/.bashrc
How to get a GitCode token:
- Log in to GitCode (https://gitcode.com)
- Go to Settings -> Access Tokens
- Generate a new token with appropriate permissions
Workflow
Step 1: Extract the repository name
From the user's prompt, extract the repository name using the following patterns:
- Direct repository name: "Collect issue information under the mind-cluster repository" -> repo = "mind-cluster"
- Extract from URL:"https://gitcode.com/Ascend/mind-cluster" -> repo = "mind-cluster"
- Partial match: If the user mentions a project name, match it against the list of supported repositories
Step 2: Retrieve Issues
Retrieve issues by calling the script via a bash command, replacing ${repo} with the repository name extracted from the user's prompt:
The retrieval script is located in the skill directory:.opencode/skill/gitcode-issue-analyzer/scripts/fetch/
Retrieve open issues:
Save the xlsx file to this directory:.opencode/skill/gitcode-issue-analyzer/
python scripts/fetch/fetch_open_issues.py ${repo}
Retrieve closed issues:
Save the xlsx file to this directory:.opencode/skill/gitcode-issue-analyzer/
python scripts/fetch/fetch_closed_issues.py ${repo}
Retrieve all comments under the repository issues:
Save the xlsx file to this directory:.opencode/skill/gitcode-issue-analyzer/
python scripts/fetch/fetch_issue_comments.py ${repo}
Verify whether the issue spreadsheet was created successfully:
python scripts/validate/validate_issue.py ${repo}
The script will automatically:
- Read GITCODE_TOKEN from the environment variable
- Call the GitCode API to retrieve issue data
- Save the data as
${repo_open_issue.xlsx}and${repo_closed_issue.xlsx}as well as${repo_issue_comments.xlsx} - Verify whether the issue spreadsheet was created successfully
Step 3: Generate the issue comment handling document
Process the issues by calling the script via a bash command, replacing ${repo} with the repository name extracted from the user's prompt:
The classification script is located in the skill directory:.opencode/skill/gitcode-issue-analyzer/scripts/classify/
Generate the issue comment handling document:
python scripts/classify/classify_issue_comments.py ${repo_issue_comments.xlsx}
Place the generated issue comment handling document in the references directory of the skill directory:.opencode/skill/gitcode-issue-analyzer/references/
Note: first finish generating the issue comment handling document before proceeding to Step 4: Analyze Issues
Step 4: Analyze Issues
Match from the local handling suggestions document
The matching script is located in the skill directory:.opencode/skill/gitcode-issue-analyzer/scripts/match/
First match from the local issue handling suggestions document in the references directory by calling the python script:
python scripts/match/match_open_issues.py ${repo_open_issue.xlsx}
The script will automatically:
- Read the
${repo_open_issue.xlsx}file - Load the issue handling suggestion documents in the references directory
- Match based on title similarity (threshold 80%)
- Write the matching results into the output directory categorized by tag
For open_issues that are not matched, search on the corresponding repository on the web.
If the match is high, write the matching suggestions to the markdown document in the references directory:.opencode/skill/gitcode-issue-analyzer/references/
Match handling suggestions from repository documents
Match handling suggestions from documents in each repository's doc directory:
Search the README document under the repository and the documents in the docs directory:
- README document:
https://gitcode.com/Ascend/{repo}/blob/master/README.md - docs directory:
https://gitcode.com/Ascend/{repo}/tree/master/docs
For example, the mind-cluster repository:
https://gitcode.com/Ascend/mind-cluster/blob/master/README.mdhttps://gitcode.com/Ascend/mind-cluster/tree/master/docs
Match from public information on the web
If no match is found by searching the corresponding repository on the web, use public information on the web:
Important requirements:
- There must be a reliable and trustworthy source of information
- The source link must be provided
- Do not fabricate arbitrarily
If the match is high, write the matching suggestions to the markdown document in the references directory:.opencode/skill/gitcode-issue-analyzer/references/
Analyze closed Issues:
When analyzing closed issues, focus on the following:
- Common patterns - Common patterns in issue titles and content
- Resolution indicators - The status in the issue_state field (such as "DONE")
- Related issues - Issues with similar keywords or tags
- Comment activity - Issues with more comments may have detailed discussions
Usage example
User request:
"Help me collect issue information under the mind-cluster repository, and analyze the closed issues to give handling suggestions"
Execution steps:
- Extract repo = "mind-cluster"
- Check the GITCODE_TOKEN environment variable
- Execute
python scripts/fetch/fetch_open_issues.py mind-cluster - Execute
python scripts/fetch/fetch_closed_issues.py mind-cluster - Execute
python scripts/fetch/fetch_issue_comments.py mind-cluster - Execute
python scripts/validate/validate_issue.py mind-cluster - Execute the script to analyze the handling comments of the issue
- Provide handling suggestions for open issues
Output format
Excel file:
mind-cluster_open_issue.xlsx- Contains all open issuesmind-cluster_closed_issue.xlsx- Contains all closed issuesmind-cluster_issue_comments.xlsx- Contains comments on all issues
Analysis report:
Provide a summary, including:
- The total number of open/closed issues
- Common issue types and their distribution
- Key patterns found in closed issues
- Specific handling suggestions for open issues
- Reference links to similar closed issues
Error handling
- Token not found: Guide the user to set the GITCODE_TOKEN environment variable
- Repository not found: Verify the repository name and suggest checking the URL
- API rate limit: Wait and retry, or suggest that the user wait
- Empty result: Notify the user that no issue was found
Notes
- Ensure the Excel file is saved in UTF-8 encoding to prevent character encoding issues
- The API may return paginated results; handle pagination if needed
- Comply with API rate limits and implement appropriate delays between requests