agentleFS
Cogni-AI-OUCogni-AI-OU/cogni-ai-agent-skills/gh-issue/SKILL.md

gh-issue

Skill4 starsChanged 6 months agoMITView on GitHub

GitHub CLI (`gh issue`) operations for managing, viewing, and editing issues. You MUST load this skill when working with the `gh issue` command.

  • Deletes or force-pushes

11 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

17 rules. 0 are common, 10 are distinctive, and 7 are very specific to this project.

  • 0

    Common

    Most of the 10 edited versions we read keep these.

  • 10

    Distinctive

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use gh issue to natively interact with GitHub Issues.

    line 11
  2. Distinctive:

    Prefer native fields and explicit routing over brittle shell post-processing.

    line 12
  3. Distinctive:

    Always prefer non-interactive creation in automated environments:

    line 45
  4. Very specific:

    Write the comment to a temporary file first, then use --body-file:

    line 77
  5. Distinctive:

    When executing autonomously within a GitHub Actions environment, adhere strictly to these interaction constraints:

    line 89
  6. Very specific:

    Check github.event_name and payload to identify trigger source:

    line 93
  7. Distinctive:

    Symmetric Routing: ALWAYS reply via the exact originating channel.

    line 104
  8. Very specific:

    Direct API Responses ONLY: Use gh issue comment to post directly.

    line 105
  9. Distinctive:

    "Could not resolve to an issue": Verify the issue number and ensure the repository context is correct.

    line 111
  10. Very specific:

    "Permission denied": Check gh auth status. Ensure the token has repo and issue scopes.

    line 112
  11. Very specific:

    Avoid using gh api for issue operations that have native gh issue subcommands.

    line 117
  12. Very specific:

    Do not use gh issue comment to provide large code blocks if they can be committed to a branch instead.

    line 118
  13. Distinctive:

    Before finishing your session, you MUST ensure the workspace is in a valid state.

    line 122
  14. Distinctive:

    If the runtime did not involve intended modification of files:

    line 126
  15. Distinctive:

    Verify: Run git status to confirm the workspace is clean.

    line 128
  16. Distinctive:

    Clean: If untracked or modified files exist (e.g., temporary analysis artifacts), run git clean -fd and git checkout -- ..

    line 129
  17. Distinctive:

    Assert: Ensure no PR or commit is triggered for purely informational tasks.

    line 131

“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

gh-issue Skill

Use gh issue to natively interact with GitHub Issues. Prefer native fields and explicit routing over brittle shell post-processing.

When to Use

  • User asks to manage, view, list, or inspect an issue using the GitHub CLI (gh issue).
  • Task involves querying issue metadata, comments, labels, or assignees.
  • Extracting issue context, reviewing issue body, or commenting on specific issues.

Mindmap of Commands

mindmap
  root((gh-issue))
    create
      Create a new issue
    list
      List and filter issues
    view
      View issue details and comments
    edit
      Edit issue title, body, labels, etc.
    comment
      Add a comment to an issue
    close
      Close an issue
    reopen
      Reopen an issue

Advanced Issue Workflows

  • Issue Creation: Always prefer non-interactive creation in automated environments:

    gh issue create --title "bug: unexpected crash" --body-file /tmp/description.md --label "bug" --assignee "@me"
  • Listing Issues: To quickly identify open issues with specific labels:

    gh issue list --state open --label "bug" --json number,title,createdAt --limit 10
  • Viewing Issue Details: For quick structured review of an issue without leaving the terminal:

    gh issue view <number> --json title,body,state,labels,assignees,comments
  • Modifying Issues: Be explicit about the modifications:

    gh issue edit <number> --add-label "in-progress" --add-assignee "@me"
    gh issue close <number> --reason "completed"

Interaction & Comments

  • For issue thread interactions, use gh issue comment.
  • For long comments, avoid heredocs as they can cause shell hangs if truncated. Write the comment to a temporary file first, then use --body-file:

    # Use your file-writing tools to write the comment to /tmp/comment.md, then:
    gh issue comment <number> --body-file /tmp/comment.md

For high-level issue thread interactions, response routing, and workspace invariants in GitHub Actions, refer to the github-issue skill.

GitHub Actions Runtime

When executing autonomously within a GitHub Actions environment, adhere strictly to these interaction constraints:

Response Detection & Routing

Check github.event_name and payload to identify trigger source:

  • Issue comment (issue_comment):
    • Condition: if: ${{ !github.event.issue.pull_request }}
    • Reply Method: gh issue comment
  • General PR comment (issue_comment):
    • Condition: if: ${{ github.event.issue.pull_request }}
    • Reply Method: gh pr comment

Routing Invariants:

  • Symmetric Routing: ALWAYS reply via the exact originating channel. NEVER cross threads.
  • Direct API Responses ONLY: Use gh issue comment to post directly. NEVER write comment text to files in the workspace.
  • Parse github.event.comment.id to maintain thread continuity.

Failure Signatures

  • "Could not resolve to an issue": Verify the issue number and ensure the repository context is correct.
  • "Permission denied": Check gh auth status. Ensure the token has repo and issue scopes.
  • "Issue is locked": Some repositories restrict comments on locked issues.

What to Avoid

  • Avoid using gh api for issue operations that have native gh issue subcommands.
  • Do not use gh issue comment to provide large code blocks if they can be committed to a branch instead.

Pre-Completion

Before finishing your session, you MUST ensure the workspace is in a valid state.

Workspace Cleanliness (Non-Modifying Tasks)

If the runtime did not involve intended modification of files:

  1. Verify: Run git status to confirm the workspace is clean.
  2. Clean: If untracked or modified files exist (e.g., temporary analysis artifacts), run git clean -fd and git checkout -- ..
  3. Assert: Ensure no PR or commit is triggered for purely informational tasks.

Related Skills

  • gh-pr: You MUST load this skill when working with the gh pr command.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.