gh-discuss
Installation
SKILL.md
Answer a GitHub Discussion Thread
Treat /gh-discuss NUMBER as authorization to read a single top-level GitHub Discussion thread and, only if you can answer it accurately and positively, post one reply. This skill is strictly read-only against the repository and the wider system: it never writes code, never commits, never opens branches or pull requests, and never runs any command that mutates a repository, issue, discussion, label, or file. Its only permitted write is posting a reply comment on the discussion, and only when that reply is warranted.
Validate the request
- Require exactly one positive integer discussion number; accept an optional leading
#. - Identify the GitHub repository from an explicit
Repository: OWNER/REPOline in the invocation, or from the current checkout's GitHub remote. - Require
ghwith an authenticated session that can read the repository and read/write Discussions. - Fetch the discussion with its top-level body, author, category, and existing comments, for example:
gh api graphql -f query='query($owner:String!,$name:String!,$number:Int!){repository(owner:$owner,name:$name){discussion(number:$number){id title body author{login} answerChosenAt comments(first:100){totalCount nodes{id}}}}}' -F owner=OWNER -F name=NAME -F number=NUMBER - Stop without commenting, and without further action, if any of the following hold:
- The discussion does not exist or cannot be read.
comments.totalCountis already greater than zero, oranswerChosenAtis set. Another reply already exists or the thread is already answered; do not add a second one.- The discussion body is not an answerable question or request (for example, an announcement, poll, or open-ended chat with nothing to resolve).