GitHub (gh)
Project-local skill for ScienceDiscovery.
New issues and pull requests go to
openJiuwen-ai/sciencediscovery
with gh. Do not open them in the browser, and do not use the gitcode
CLI for a new issue or pull request. GitCode
(openJiuwen/sciencediscovery) is a read-only mirror. The
gitcode skill is only for an existing mirror item that
still has to be read or commented on.
The full pull-request procedure — local UT/ST/E2E, pushing the branch to your
own fork, the release label, reading Actions back — is
create-github-pr. This page is the usage
guide those steps assume.
Language
Issue and pull request titles and bodies are English.
That includes the explanation under any template heading, the validation
numbers, and the E2E conclusion. Write Chinese only when the person who asked
explicitly wants Chinese. If a GitHub issue or pull request was filed in
Chinese by mistake, fix it with gh issue edit or gh pr edit before calling
it done.
Edit only items you created. On someone else's issue or pull request, add a
comment; do not rewrite their title, body or comments. The one exception is
adding yourself as an assignee to an issue you start implementing, under
Issues.
Setup
gh auth status # retry once if it fails, then ask the operator
gh api user --jq .login # current login; do not hard-code a person; never print a token
Always pass --repo openJiuwen-ai/sciencediscovery so a checkout whose
origin is something else still hits this repository.
origin on a current clone of this repo is
openJiuwen-ai/sciencediscovery. Do not git push origin a task branch.
Push the branch to the operator's own fork, then open the pull request with
--head <login>:<branch>.
Issues
Search before creating. A duplicate title is not a new issue.
gh issue list --repo openJiuwen-ai/sciencediscovery --state open --limit 50 \
--search "keywords"
gh issue create --repo openJiuwen-ai/sciencediscovery \
--title "[Feature]: Short English summary" \
--body-file .tmp/issue.md
gh issue view <n> --repo openJiuwen-ai/sciencediscovery
gh issue edit <n> --repo openJiuwen-ai/sciencediscovery --body-file .tmp/issue.md
gh issue comment <n> --repo openJiuwen-ai/sciencediscovery --body-file .tmp/comment.md
Read the issue back after create or edit and confirm the number, the English
title, and that the body is the text you wrote.
To put a screenshot in the body, reference a local image in the Markdown and
pass the same path to --attach. gh rewrites the reference to a
user-attachments URL. --attach needs write access on this repository. A
person can also drop the file into the issue on the website; that upload does
not require a git push, but agents should use --attach rather than asking
someone to paste by hand.
gh issue edit <n> --repo openJiuwen-ai/sciencediscovery \
--body-file .tmp/issue.md \
--attach '.tmp/screen.png#What the screen shows'
Work on an existing issue
These steps apply when you start implementing an existing issue. Reading it,
giving a brief answer, or creating a new issue alone does not claim the work.
-
Resolve the current gh login and inspect the issue's assignees:
login=$(gh api user --jq .login)
gh issue view <n> --repo openJiuwen-ai/sciencediscovery \
--json number,title,assignees
-
If you are already assigned, skip the assignment. Otherwise add yourself;
--add-assignee preserves everyone already assigned:
gh issue edit <n> --repo openJiuwen-ai/sciencediscovery --add-assignee @me
If @me is unavailable, use the resolved login instead; never hard-code a
person's login:
gh issue edit <n> --repo openJiuwen-ai/sciencediscovery --add-assignee "$login"
-
Read the issue back and check whether assignees contains your login:
gh issue view <n> --repo openJiuwen-ai/sciencediscovery \
--json number,assignees
If your login is missing, do not retry assignment or report it as assigned.
Still post the plan comment in step 4, say you are working on the issue,
and ask a maintainer to assign it to you. The "$login" fallback above only
covers @me being unavailable; it does not grant assignment permissions.
-
Post an English plan whether or not assignment persisted, describing what
you intend to change and how completion will be judged. If other assignees
are present, say that you are also working on it. Add a new English progress comment when a PR
opens, work is blocked or the plan changes. Leave other people's titles,
bodies and comments unchanged:
gh issue comment <n> --repo openJiuwen-ai/sciencediscovery \
--body-file .tmp/issue-plan.md
# When there is progress:
gh issue comment <n> --repo openJiuwen-ai/sciencediscovery \
--body-file .tmp/issue-progress.md
Pull requests
Follow create-github-pr. The commands that
file the request:
login=$(gh api user --jq .login)
git push -u <fork-remote> HEAD:<branch>
gh pr create --repo openJiuwen-ai/sciencediscovery \
--draft --base main --head "${login}:<branch>" \
--title "type(scope): what changes, in English" \
--body-file .tmp/pr.md
gh pr view <n> --repo openJiuwen-ai/sciencediscovery \
--json number,title,state,isDraft,baseRefName,headRefName,url
Keep the braces in "${login}:<branch>": zsh reads $login:chore/… as
$login with a :c modifier (likewise :h, :t, :r, :e) and sends
GitHub a head that is not your branch. The symptom and both of its causes are
in the create-github-pr skill's Troubleshooting, under No commits between.
Keep it a draft while preparing the change. Drafts already run L1. Once it
is ready, mark it ready for review to start UT, ST and mocked E2E, then
request review from a code owner listed in
.github/CODEOWNERS. An automated review also
runs on the pull request.
gh pr ready <n> --repo openJiuwen-ai/sciencediscovery
The title is an English sentence a reader can understand without the diff.
update, fix bug, and a raw file name are not titles. The body states what
changed, why, what was run (with numbers), and the E2E conclusion. A change
with no user-observable path may say the E2E is not applicable and why.
Backend-only is not that reason.
What not to do
- Do not file a new issue or pull request on gitcode.com.
- Do not write the GitHub title or body in Chinese unless asked.
- Do not put tokens, local absolute paths, or private notes in the body.
- Do not
git push origin a task branch.