quick-fix-suggestion
Note: If you have
mcporterinstalled locally, you should usemcporterto invoke the MCP tool instead of directly calling the MCP tool. ThemcporterCLI provides a more convenient interface and better error handling.
Quick Fix Suggestion via Gitee MCP
Analyze a Gitee Issue and generate intelligent fix suggestions including:
- Identification of files that need to be modified
- Code location hints (line numbers, function names)
- Draft implementation code snippets
- Step-by-step implementation plan
Prerequisites
- Gitee MCP Server configured (tools:
get_repo_issue_detail,list_issue_comments,search_files_by_content,get_file_content) - Must be executed in a local clone of the repository
- User must provide: repository owner, repository name, Issue number
Local-First Search Strategy
Why Local-First?
This skill prioritizes local file operations over Gitee API for code search:
- Speed: Local searches complete in milliseconds vs. seconds for API calls
- No Rate Limits: No 100 requests/minute restriction
- Real-time: Searches include uncommitted local changes
- Cost: Zero API usage costs
Tool Selection Priority
| Priority | Tool | Availability |
|---|---|---|
| 1st | glob, grep (built-in) |
100% |
| 2nd | ast_grep_search, lsp_find_references |
100% |
| 3rd | Git commands (via bash) | ~90% |
| Last | Gitee API (search_files_by_content) |
Fallback only |
Steps
Step 1: Fetch Issue Details
Use get_repo_issue_detail to retrieve full Issue information:
- Title and description
- Labels (bug/feature/enhancement)
- Existing comments
Step 2: Analyze Issue Content
Identify Issue Type:
bug: error, crash, broken, not working, 错误, 失败feature: add, support, implement, new, 新增, 添加enhancement: improve, optimize, 改进, 优化
Extract Code Entities:
- Function names (in backticks or patterns)
- Class names
- File names
- Error messages / stack traces
Step 3: Search Code (Local-First)
Use built-in tools in priority order:
// 1. File name search (fastest)
glob(`**/*${keyword}*.{js,ts,py,go}`, { cwd: localRepoPath })
// 2. Content search
grep({
pattern: `function\\s+${funcName}`,
path: localRepoPath,
output_mode: "content"
})
// 3. AST search (semantic)
ast_grep_search({
pattern: "function $NAME($$$) { $$$ }",
lang: "javascript",
paths: [localRepoPath]
})
// 4. Fallback: Remote search (max 3 calls)
if (localResults.length < 3) {
search_files_by_content({ owner, repo, query: keyword, limit: 10 })
}
Step 4: Read and Analyze Key Files
Read each candidate file to:
- Identify relevant functions/classes
- Understand code structure
- Assess how the Issue relates to this file
Step 5: Generate Fix Suggestions
Present results in this format:
## Issue #{number}: {title}
**Type**: {bug/feature} | **Confidence**: {score}% | **Complexity**: {low/medium/high}
### Primary Files (Must Modify)
**1. `{file_path}`** [Confidence: XX%]
- **Change**: {modify/add/delete}
- **Location**: Around line {X}
<details>
<summary>Code Draft</summary>
```{language}
// Current:
{existing_code}
// Suggested:
{suggested_code}
Secondary Files (May Need Changes)
{file_path}: {reason}
Implementation Plan
- {step 1} - File:
{file}, ~{time} - {step 2} - File:
{file}, ~{time}
Testing Suggestions
- {test suggestion}
Questions for You
- {uncertainty_question}
### Step 6: Handle User Response
- **Approve**: Summarize and transition to `implement-issue` skill
- **Adjust**: Re-analyze with new information
- **Search More**: Expand search scope
- **Cancel**: Offer other help
## Notes
- Always indicate confidence level - ask for clarification when uncertain
- Follow existing code patterns when suggesting changes
- Warn immediately if Issue mentions credentials/secrets
- If unable to locate relevant code, ask for more context rather than guessing
## References
- [Tool Reference Guide](references/TOOL_REFERENCE.md) - Detailed search patterns and tool usage
More from oschina/gitee-agent-skills
repo-explorer
Use this skill when the user asks to explore a repository, get familiar with a project, "repo explorer", "tell me about this repo", "repo-explorer", "what does this repository do", or wants an overview of a Gitee repository. Requires Gitee MCP Server to be configured.
74daily-digest
Use this skill when the user asks for a daily summary, today's to-dos, "what's on my plate today", "daily digest", "daily-digest", "show my notifications", "pending PRs and issues". Requires Gitee MCP Server to be configured.
71review-pr
Use this skill when the user asks to review a PR, do a code review, check a pull request, "review this PR", "review-pr", or "look at this pull request". Requires Gitee MCP Server to be configured.
64create-pr
Use this skill when the user asks to create a PR, open a pull request, "create-pr", "submit a pull request", or "open a merge request". Requires Gitee MCP Server to be configured.
59close-issue-flow
Use this skill when the user asks to close an issue, wrap up an issue, "close issue", "close-issue-flow", or finish up after a fix has been merged. Requires Gitee MCP Server to be configured.
57search-and-fork
Use this skill when the user asks to search for and fork an open source repository, "find me an open source project", "search and fork", "search-and-fork", "find a similar project on Gitee", or "fork a repository". Requires Gitee MCP Server to be configured.
56