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

gh-agent-task

Skill4 starsChanged 6 months agoMITView on GitHub

GitHub CLI (`gh agent-task`) operations for creating, listing, and viewing preview agent tasks. You MUST load this skill when working with the `gh agent-task` command.

1 other project uses 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

13 rules. About 0 are common, 4 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When you need to create, view, or list GitHub Copilot preview agent tasks directly from the CLI.

    line 16
  2. Distinctive:

    When investigating the status or logs of an asynchronous agent task session.

    line 18
  3. Very specific:

    If your environment uses an older version of gh (< v2.80.0) that doesn't support the agent-task plugin.

    line 23
  4. Very specific:

    Keep descriptions clear when creating tasks.

    line 40
  5. Very specific:

    Always use non-interactive mode.

    line 41
  6. Very specific:

    Create a task from a file (recommended for complex tasks): gh agent-task create -F task-desc.md

    line 47
  7. Very specific:

    Create a task using stdin: echo "description" | gh agent-task create -F -

    line 50
  8. Very specific:

    Create a task with a custom agent on a specific base branch: gh agent-task create "fix errors" --base main --custom-agent my-agent

    line 53
  9. Very specific:

    Create a task and follow logs: gh agent-task create "build me a new app" --follow

    line 56
  10. Very specific:

    If a task creation fails, verify repository permissions and ensure the GitHub CLI is authenticated (gh auth status).

    line 83
  11. Very specific:

    If using a custom agent, ensure the agent file exists in .github/agents/.

    line 84
  12. Distinctive:

    gh: Use for general GitHub CLI operations.

    line 98
  13. Distinctive:

    gh-pr: Use for pull request specific operations.

    line 99

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Skill: gh-agent-task

<!-- markdownlint-disable MD013 MD023 MD031 MD032 -->

Provides usage patterns and expert guidance for the GitHub CLI gh agent-task extension, which manages preview agent tasks on repositories and pull requests. The agent-task command set is only available in v2.80.0 or later of the GitHub CLI. This command set is a public preview and is subject to change.

When to Use

  • When you need to create, view, or list GitHub Copilot preview agent tasks directly from the CLI.
  • To automate the assignment of an agent to a specific pull request or issue.
  • When investigating the status or logs of an asynchronous agent task session.

When Not to Use

  • For standard GitHub CLI operations (like listing PRs or Issues) that don't involve the agent task extension.
  • If your environment uses an older version of gh (< v2.80.0) that doesn't support the agent-task plugin.
  • For triggering generic GitHub Actions (use gh workflow run instead).

Common Pitfalls

  • Interactive Prompts: Running gh agent-task create without -F or providing an inline description, causing the CLI to hang waiting for user input.
  • Parsing Raw Text: Relying on grep to parse the task status instead of using the built-in --json and --jq flags.
  • Assuming Completion: Firing off an agent task but failing to poll or --follow its status, leading to race conditions in automated scripts.

Core Process

  1. Determine if the goal is to create a new task, list existing tasks, view a specific task, or view tasks associated with a PR.
  2. Select the correct subcommand (create, list, or view).
  3. Apply filtering (--jq), formatting (--json, --template), or input options (-F) as required.

Core Principles

  • Keep descriptions clear when creating tasks; prefer using a file (-F) for multi-line instructions instead of inline strings.
  • Always use non-interactive mode. For JSON extraction, rely on the built-in --jq and --json flags rather than external piping when possible.

Commands / Usage Patterns

Create an Agent Task

Create a task from a file (recommended for complex tasks): gh agent-task create -F task-desc.md

Create a task using stdin: echo "description" | gh agent-task create -F -

Create a task with a custom agent on a specific base branch: gh agent-task create "fix errors" --base main --custom-agent my-agent

Create a task and follow logs: gh agent-task create "build me a new app" --follow

List Agent Tasks

List tasks and format output with JSON/JQ: gh agent-task list --limit 10 --json id,state,pullRequestNumber --jq '.[] | "\(.id): \(.state)"'

View Agent Tasks

View an agent task by session ID: gh agent-task view e2fa49d2-f164-4a56-ab99-498090b8fcdf

View an agent task by PR number: gh agent-task view 12345

View an agent task by PR reference: gh agent-task view OWNER/REPO#12345

View task and output specific JSON fields: gh agent-task view 12345 --json id,state,pullRequestNumber

Show agent session logs: gh agent-task view 12345 --log

Diagnostics and Troubleshooting

  • If a task creation fails, verify repository permissions and ensure the GitHub CLI is authenticated (gh auth status).
  • If using a custom agent, ensure the agent file exists in .github/agents/.

Limitations

  • The gh agent-task commands are currently in preview and subject to change.

References

Related Skills

  • gh: Use for general GitHub CLI operations.
  • gh-pr: Use for pull request specific operations.

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.