| name | gitcode-issue-fix |
|---|---|
| description | Use this skill for GitCode-hosted repositories when asked to analyze repository architecture and contribution rules, discover security/functionality/pre-existing bug issues, create GitCode issues with gitcode-cli, fix issues, submit pull requests, or repair PR CI failures while following project contribution guidelines. |
Use this skill for a full GitCode open-source contribution loop: understand the repository, generate a repository architecture and contribution-rules Markdown profile, identify candidate issues, file issues with gitcode, implement minimal fixes, open/update PRs, and drive local/remote CI to green.
Use the GitCode CLI as gitcode/gitcode.exe by default. On Windows PowerShell, do not use bare gc because it is a built-in alias for Get-Content; use gitcode.exe, gc.exe, or python -m gc_cli instead. Inspect gitcode <subcommand> --help and adapt commands if flags differ.
Before proposing issues or editing code:
- Preserve local work: run
git status --short,git branch --show-current, andgit remote -v. - Read repository rules:
AGENTS.md,CONTRIBUTING*,SECURITY*,.gitcode/PULL_REQUEST_TEMPLATE*,.gitcode/ISSUE_TEMPLATE*,.gitcode/workflows/,.pre-commit-config.yaml, build/test configs, and language manifests. - Generate or refresh a repository profile Markdown:
python "<skill>/scripts/generate_repo_profile.py" --repo "." --output "docs/architecture-and-contribution-rules.md"- If the repo has another docs convention, choose the nearest existing docs path.
- Read
references/gitcode-cli-workflow.mdbefore usinggitcode. - Read
references/pr-quality-gate.mdbefore committing, pushing, or opening a PR.
For work that may sprawl across files, or when discovering new engineering issues, read
references/scope-and-archetypes.md for the minimal-change scope guard and common issue archetypes.
Look for issues in three buckets:
security: unsafe permissions, command injection, path traversal, secret leakage, insecure downloads, missing input validation, unsafe temporary files, or risky default behavior.functionality: incorrect behavior, edge cases, missing validation, bad error handling, broken docs/examples, platform incompatibility, or API contract mismatches.pre-existing bug: failures visible in tests, static analysis, TODO/FIXME markers with clear impact, stale CI scripts, broken build flags, or contradictions between docs and code.
For each candidate, collect evidence before filing:
- impacted files and exact behavior,
- reproduction or static proof,
- expected behavior,
- severity and user impact,
- proposed minimal fix,
- validation plan.
Do not file noisy issues. Skip duplicates, vague design ideas, private-environment problems, issues already owned by maintainers, or items with no reviewable validation path.
Use repository templates when present. For this common GitCode layout:
- Bug: title prefix like
[Bug-Report|缺陷反馈]: <short summary>, labelbug-report. - Requirement: title prefix like
[Requirement|需求建议]: <short summary>, labelrequirement. - Documentation: follow the repo's documentation issue template and labels.
Prefer body files to avoid shell quoting mistakes:
gitcode issue create -R <owner>/<repo> --title "<template prefix>: <summary>" --body-file <issue-body.md> --label <label>After creating an issue, comment /assign @yourself only if the project workflow asks contributors to self-assign and you intend to fix it.
- Fetch issue metadata with
gitcode issue view <number> -R <owner>/<repo> --commentsand search linked PRs withgitcode issue prs <number> -R <owner>/<repo>. - Classify:
skip: closed, duplicate, already fixed, active maintainer owner, or outside repo scope.needs-info: missing reproduction, design decision needed, hardware/private data required with no local proxy.candidate: narrow root cause and at least one local/static/test validation path.
- Create one branch per independent root cause from the upstream default branch:
codex/issue-<number>-<slug>. - Implement the smallest mergeable fix. Avoid broad refactors, unrelated formatting, and test weakening.
- Add or update focused regression tests where practical. If hardware is required, add deterministic static/unit/docs validation that CI can still review.
- Run the quality gate. Record exact commands and results.
- Commit using project style and required trailers. Use sign-off only if the project requires it.
- Push to a fork and create a PR with
gitcode pr create, filling the project PR template and linking the issue.
Use gitcode pr test <number> -R <owner>/<repo> when the project supports explicit PR test triggering. For projects that use bot comments such as compile, follow the contribution guide and comment only after local validation passes.
When CI fails:
- Inspect PR details and comments:
gitcode pr view <number> -R <owner>/<repo> --comments,gitcode pr comments <number> -R <owner>/<repo>. - Classify failures: lint/format, build, unit test, docs, permission gate, hardware gate, flaky/environmental, or reviewer feedback.
- Fix only failures caused by the PR. Do not hide failures by deleting tests, weakening assertions, or bypassing checks unless the check is demonstrably wrong.
- Re-run the closest local equivalent before pushing.
- If CI is blocked by maintainer permission or unavailable hardware, leave a concise PR comment with local validation and the exact remaining gate.
End work with:
- repository profile path,
- issue numbers or skipped issue candidates with reasons,
- root cause and changed files,
- tests/validation commands and results,
- CI status or remaining maintainer/hardware gate,
- PR URL or a generated handoff path.
If automatic PR creation fails, create a local handoff:
python "<skill>/scripts/generate_pr_report.py" --input <handoff.json> --output <handoff.html>