
gh-agent-task
Use gh agent-task commands to create, run, and monitor agent tasks.
- Installs
- 58
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/github/gh-aw --skill gh-agent-task- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads gh-agent-task automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
GitHub CLI Agent Task Extension
The gh agent-task extension creates GitHub Copilot coding agent tasks from the CLI. A task is a GitHub issue that triggers automated code changes from natural language instructions.
Repository: https://github.com/github/agent-task (internal GitHub extension)
Overview
Agent tasks are GitHub issues that:
- Contain natural language instructions for code changes
- Trigger GitHub Copilot to autonomously execute the task
- Create pull requests with the implemented changes
- Provide a workflow for reviewing and merging automated code modifications
Installation
Install via GitHub CLI:
gh extension install github/agent-task
Note: This extension requires authentication with a Personal Access Token (PAT) that has appropriate permissions for creating issues and pull requests.
Core Commands
Create Agent Task
Create a new agent task from a description:
# Create task with inline description
gh agent-task create "Fix the bug in authentication flow"
# Create task from file
gh agent-task create --from-file task-description.md
# Specify base branch
gh agent-task create --base develop "Implement new feature"
# Create in different repository
gh agent-task create --repo owner/repo "Update documentation"
Command Parameters:
- Description (positional): Natural language description of the task
--from-file <path>: Read task description from file--base <branch>: Base branch for the pull request (default: repository default branch)--repo <owner/repo>: Target repository (default: current repository)
Output Format: The command outputs the URL of the created agent task:
https://github.com/owner/repo/issues/123
List Agent Tasks
List agent tasks in a repository:
# List all agent tasks
gh agent-task list
# List with filters
gh agent-task list --state open
gh agent-task list --state closed
gh agent-task list --state all
View Agent Task
View details of a specific agent task:
# View by number
gh agent-task view 123
# View by URL
gh agent-task view https://github.com/owner/repo/issues/123
Update Agent Task
Update an existing agent task:
# Update description
gh agent-task update 123 "Updated task description"
# Update from file
gh agent-task update 123 --from-file updated-description.md
Task Description Format
Agent task descriptions should be clear, specific natural language instructions:
Good Example:
# Refactor User Authentication
Refactor the user authentication flow in `src/auth/login.js` to:
1. Use async/await instead of callbacks
2. Add proper error handling with specific error messages
3. Add input validation for email format
4. Update tests to cover the new implementation
Maintain backward compatibility with the existing API.
Poor Example:
Fix auth
Best Practices:
- Be specific about what needs to change
- Reference file paths when relevant
- Include acceptance criteria
- Specify any constraints or requirements
- Mention testing expectations
Integration with GitHub Agentic Workflows
The gh agent-task extension is used by the create-agent-task safe output feature in GitHub Agentic Workflows (gh-aw).
Safe Output Configuration
safe-outputs:
create-agent-task:
base: main # Base branch for agent task PR
target-repo: "owner/target-repo" # Cross-repository task creation
Workflow Example
on:
issues:
types: [labeled]
permissions:
contents: read
actions: read
engine: claude
safe-outputs:
create-agent-task:
base: main
# Code Task Delegator
When an issue is labeled with "code-task", analyze the requirements and create a GitHub Copilot coding agent task with detailed instructions for implementing the requested changes.
Implementation Details
The safe output processor:
- Reads agent output from the workflow execution
- Extracts
create_agent_taskitems from the structured output - Writes task descriptions to temporary files
- Executes
gh agent-task create --from-file <file> --base <branch> - Captures the created task URL and number
- Reports results in job summary
Environment Variables:
GITHUB_AW_AGENT_TASK_BASE: Base branch for the pull requestGITHUB_AW_TARGET_REPO: Target repository for cross-repo task creationGITHUB_AW_SAFE_OUTPUTS_STAGED: Preview mode flag
Authentication Requirements
Agent task creation requires elevated permissions beyond the default GITHUB_TOKEN:
Required Permissions:
contents: write- To create branches and commitsissues: write- To create the agent task issuepull-requests: write- To create pull requests
Token Precedence:
COPILOT_GITHUB_TOKEN- Dedicated Copilot operations token (recommended)GH_AW_GITHUB_TOKEN- General override token (legacy)- Custom token via
github-tokenconfiguration field
Note: The default GITHUB_TOKEN is not supported as it lacks required permissions. The COPILOT_CLI_TOKEN and GH_AW_COPILOT_TOKEN secrets are no longer supported as of v0.26+.
Setting Up Authentication
Store your Personal Access Token in repository secrets:
# In your repository settings, add secret:
# Name: COPILOT_GITHUB_TOKEN (recommended)
# Value: ghp_YourPersonalAccessToken
:::note[Backward Compatibility]
Legacy token name GH_AW_GITHUB_TOKEN is still supported for backward compatibility. The GH_AW_COPILOT_TOKEN token is no longer supported as of v0.26+.
:::
Error Handling
Authentication Errors
Error: failed to create agent task
authentication required
Solution: Configure COPILOT_GITHUB_TOKEN or legacy GH_AW_GITHUB_TOKEN with a PAT.
Permission Errors
Error: 403 Forbidden
Resource not accessible by integration
Solution: Ensure the token has contents: write, issues: write, and pull-requests: write permissions.
Repository Not Found
Error: repository not found
Solution: Verify the target repository exists and the token has access to it.
Testing in Staged Mode
When safe-outputs.staged: true, agent tasks are previewed without creation:
safe-outputs:
staged: true
create-agent-task:
Staged Output:
## 🎭 Staged Mode: Create Agent Tasks Preview
The following agent tasks would be created if staged mode was disabled:
### Task 1
**Description:**
Refactor authentication to use async/await pattern
**Base Branch:** main
**Target Repository:** owner/repo
Common Patterns
Issue-Triggered Agent Tasks
on:
issues:
types: [labeled]
engine: claude
safe-outputs:
create-agent-task:
When issue is labeled with "needs-implementation", create an agent task with implementation instructions.
Scheduled Code Improvements
on:
schedule:
- cron: "0 9 * * 1" # Monday 9AM
engine: copilot
safe-outputs:
create-agent-task:
base: develop
Analyze codebase for improvement opportunities and create agent tasks for top 3 improvements.
Cross-Repository Task Delegation
on: workflow_dispatch
engine: claude
safe-outputs:
create-agent-task:
target-repo: "organization/backend-repo"
base: main
Create agent task in backend repository to implement the API changes described in this issue.
Best Practices
Task Description Guidelines
- Be Specific: Include file paths, function names, and exact requirements
- Include Context: Explain why the change is needed
- Define Success: Specify acceptance criteria or expected outcomes
- Mention Tests: Request test coverage for changes
- Set Constraints: Note any compatibility requirements or limitations
Security Considerations
- Token Security: Store PATs as secrets, never commit to repository
- Permission Scope: Use minimum required permissions on tokens
- Repository Access: Validate target repository before task creation
- Review Process: Establish review workflow for agent-generated code
Operational Guidelines
- Monitor Usage: Track agent task creation and completion rates
- Review Output: Always review agent-generated pull requests
- Iterate: Refine task descriptions based on agent performance
- Document: Maintain patterns for common task types
Troubleshooting
Task Creation Fails Silently
Symptom: No error but no task created
Check:
- Verify
COPILOT_GITHUB_TOKENis set in repository secrets - Confirm token has required permissions
- Check job logs for error messages
- Verify target repository exists and is accessible
Agent Task Not Triggering Copilot
Symptom: Task created but no automated PR
Possible Causes:
- GitHub Copilot not enabled for repository
- Task description unclear or ambiguous
- Repository settings blocking automated PRs
- Copilot service issues
Solution: Check repository Copilot settings and refine task description.
Cross-Repository Tasks Fail
Symptom: Error when creating tasks in different repository
Check:
- Token has access to target repository
- Target repository exists and is spelled correctly
- Token has required permissions in target repository
Output Structure
When used via safe outputs, the create-agent-task job provides outputs:
outputs:
task_number: "123"
task_url: "https://github.com/owner/repo/issues/123"
Usage in Dependent Jobs:
jobs:
follow_up:
needs: create_agent_task
steps:
- name: Notify team
run: |
echo "Agent task created: ${{ needs.create_agent_task.outputs.task_url }}"
References
FAQ
What does the gh-agent-task skill do?
Use gh agent-task commands to create, run, and monitor agent tasks.
How do I install gh-agent-task?
Run npx skills add https://github.com/github/gh-aw --skill gh-agent-task in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/gh-agent-task/ (personal) or .claude/skills/gh-agent-task/ (project).
Which AI agents can use gh-agent-task?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is gh-agent-task safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains gh-agent-task?
It is published by github in github/gh-aw, and it is an official skill from the maker of the technology it covers. It has 58 recorded installs.
More from github/gh-aw
github-mcp-server
github/gh-aw
Reference for GitHub MCP server tools, methods, and usage patterns.
developer
github/gh-aw
Core developer rules and coding conventions for gh-aw changes.
javascript-refactoring
github/gh-aw
Split large JavaScript files into maintainable modules safely.
debugging-workflows
github/gh-aw
Diagnose gh-aw failures using the canonical debugging strategy and evidence reference.
agentic-workflows
github/gh-aw
Route gh-aw design, creation, diagnosis, patching, active debugging, and upgrade requests to the right strategies.
github-pr-query
github/gh-aw
Query GitHub pull requests with jq filtering and reusable selectors.
Popular productivity & automation skills
agent-browser
vercel-labs/agent-browser
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.
lark-doc
open.feishu.cn
飞书云文档(Docx / Wiki)内容操作:读取、创建、编辑文档,插入或下载图片附件,以及操作思维笔记。用户提供文档 URL/token(包括 doubao.com 的 /docx/、/wiki/)时使用;按 URL 路径/token 而非域名路由;/page/ 是妙搭应用,非飞书云文档。文档内嵌资源按读取参考中的统一规则分流。独立评论操作走 lark-drive;随正文读取评论使用 docs +fetch。表格或 Base 内部数据操作不在本 skill。
lark-base
open.feishu.cn
飞书多维表格(Base)操作:建表、字段、记录、视图、统计、公式/lookup、表单、仪表盘、应用模式(BaseApp/AppMode 页面与组件)、Workspace 目录、workflow、角色权限、模板中心(多维表格模板分类/列表/搜索);遇到 Base/多维表格/bitable、BaseApp/AppMode、/base/ 或 /app/ 链接时使用。BaseApp 不走 lark-apps;文件导入/导出转 lark-drive,认证/授权转 lark-shared。
lark-drive
open.feishu.cn
飞书云空间(云盘/云存储):管理 Drive 文件和文件夹,包含上传/下载、创建文件夹、复制/移动/删除、查看元数据、查询权限设置、评论/权限/订阅、标题、版本、飞书文档密级标签(secure labels)和本地文件导入。用户需要整理云盘目录、处理云空间资源 URL/token、判断链接类型/真实 token/标题,或导入 Word/Markdown/Excel/CSV/PPTX/.base 为 docx/sheet/bitable/slides 时使用;doubao.com 云空间 URL/token 也按资源路径和 token 路由,不回退 WebFetch。不负责:文档内容编辑(走 lark-doc)、表格/Base 表内数据操作(走 lark-sheets/lark-base)、知识空间节点/成员管理(走 lark-wiki)、原生 Markdown 文件读写/patch/diff(走 lark-markdown)。
lark-shared
open.feishu.cn
Use for lark-cli setup/auth tasks: auth login/status/logout, user vs bot identity, business-domain permissions (--domain, including all/docs/drive), missing scopes, revoking authorization, or handling notice JSON.
lark-im
open.feishu.cn
飞书即时通讯:收发消息和管理群聊。发送和回复消息、搜索聊天记录、管理群聊成员、上传下载图片和文件、管理表情回复、发送应用内/短信/电话加急、发送和处理交互卡片(Interactive Card)、监听卡片按钮回调(card.action.trigger)。当用户需要发消息、查看或搜索聊天记录、下载聊天中的文件、查看群成员、搜索群、创建群聊或话题群、管理标记数据、管理 Feed 置顶(添加/移除/查询置顶会话)、管理标签数据、处理卡片回调时使用。