← 返回 Skills 市场
freddydk

Git Hub Projects V2

作者 freddydk · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
64
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install git-hub-projects-v2
功能描述
Manage GitHub Projects v2 using the `gh project` CLI. Use this skill when the agent needs to list backlog items, set project fields (status, iteration, prior...
使用说明 (SKILL.md)

GitHub Projects v2 Skill

Auth prerequisite

gh auth status                  # verify scopes
gh auth refresh -s project      # add project scope if missing

ID note: Most gh project commands take a project number (e.g. 1) + --owner. item-edit is the exception — it requires --project-id with the GraphQL node ID (e.g. PVT_xxx). Get it with: gh project list --owner \x3Cowner> --format json | jq '.projects[] | select(.number==1) | .id'


1. List backlog items

# List all items (default 30, use --limit to raise)
gh project item-list \x3Cnumber> --owner \x3Cowner> --limit 100

# Filter by status — show only backlog
gh project item-list \x3Cnumber> --owner \x3Cowner> --query "status:Backlog"

# Filter open issues assigned to you
gh project item-list \x3Cnumber> --owner \x3Cowner> --query "assignee:@me is:issue is:open"

# JSON output for scripting
gh project item-list \x3Cnumber> --owner \x3Cowner> --format json \
  | jq '.items[] | {id, title, status}'

2. Set fields on an item (status, iteration, priority, etc.)

item-edit requires the project node ID and item node ID — both available from item-list --format json.

# Get project node ID
PROJECT_ID=$(gh project list --owner \x3Cowner> --format json \
  | jq -r '.projects[] | select(.number==\x3Cnumber>) | .id')

# Get item IDs and current field values
gh project item-list \x3Cnumber> --owner \x3Cowner> --format json | jq '.items[]'

# Get field IDs and option IDs (needed for single-select and iteration fields)
gh project field-list \x3Cnumber> --owner \x3Cowner> --format json | jq '.fields[]'

# Set a single-select field (e.g. Status, Priority)
gh project item-edit --project-id $PROJECT_ID --id \x3Citem-node-id> \
  --field-id \x3Cfield-node-id> --single-select-option-id \x3Coption-id>

# Set an iteration field (e.g. Sprint)
gh project item-edit --project-id $PROJECT_ID --id \x3Citem-node-id> \
  --field-id \x3Cfield-node-id> --iteration-id \x3Citeration-id>

# Set a date field
gh project item-edit --project-id $PROJECT_ID --id \x3Citem-node-id> \
  --field-id \x3Cfield-node-id> --date "2025-12-31"

# Set a number field (e.g. Story Points)
gh project item-edit --project-id $PROJECT_ID --id \x3Citem-node-id> \
  --field-id \x3Cfield-node-id> --number 5

# Clear any field value
gh project item-edit --project-id $PROJECT_ID --id \x3Citem-node-id> \
  --field-id \x3Cfield-node-id> --clear

3. Add a comment to an issue

# Add a comment (issue number, not project item ID)
gh issue comment \x3Cissue-number> --repo \x3Cowner>/\x3Crepo> --body "Your comment here"

# From a file
gh issue comment \x3Cissue-number> --repo \x3Cowner>/\x3Crepo> --body-file comment.md

4. Create an issue and add it to the project

# Create issue in a repo
ISSUE_URL=$(gh issue create \
  --repo \x3Cowner>/\x3Crepo> \
  --title "Fix login timeout" \
  --body "Users are being logged out after 5 minutes." \
  --assignee "@me" \
  --label "bug")

# Add the new issue to the project
gh project item-add \x3Cnumber> --owner \x3Cowner> --url "$ISSUE_URL"

5. Create a sub-issue

Native gh issue doesn't support sub-issues yet. Use the gh-sub-issue extension:

# Install once
gh extension install yahsan2/gh-sub-issue

# Create a new issue as a sub-issue of an existing parent
gh sub-issue create --parent \x3Cparent-issue-number> \
  --repo \x3Cowner>/\x3Crepo> \
  --title "Implement login endpoint" \
  --body "POST /api/login"

# Link an existing issue as a sub-issue of a parent
gh sub-issue add \x3Cparent-issue-number> \x3Cchild-issue-number> --repo \x3Cowner>/\x3Crepo>

# List sub-issues of a parent
gh sub-issue list \x3Cparent-issue-number> --repo \x3Cowner>/\x3Crepo>

If the extension is not available, fall back to GraphQL:

gh api graphql -f query='
  mutation($parentId: ID!, $childId: ID!) {
    addSubIssue(input: { issueId: $parentId, subIssueId: $childId }) {
      issue { number title }
      subIssue { number title }
    }
  }
' -F parentId=\x3Cparent-node-id> -F childId=\x3Cchild-node-id>
安全使用建议
Install only if you are comfortable giving the agent GitHub write authority for the relevant repositories and projects. Review each command before execution, avoid installing the third-party extension unless you trust and pin it, and prefer a GitHub token limited to the specific owner, repo, and project needed for the task.
能力评估
Purpose & Capability
The core project-listing and field-editing commands fit the stated GitHub Projects v2 purpose, but the artifact also documents issue comments, issue creation, sub-issue creation, and GraphQL mutations, which broaden the remote write authority beyond the frontmatter summary.
Instruction Scope
The skill distinguishes some read and edit workflows, but it does not clearly gate mutating commands with explicit user confirmation or fully explain that comments, issue creation, sub-issue linking, field clearing, and GraphQL calls change GitHub state.
Install Mechanism
The skill instructs users to install the external `yahsan2/gh-sub-issue` GitHub CLI extension without pinning a version or providing provenance checks, adding persistent third-party code to the user's CLI environment.
Credentials
GitHub CLI access is expected for this purpose, but the stated `project` scope is incomplete for the documented issue-write and sub-issue operations, so users may need broader repository permissions than the headline guidance suggests.
Persistence & Privilege
Authentication scope changes and the GitHub CLI extension installation can persist beyond a single task, while the artifact does not provide cleanup, rollback, or least-privilege separation guidance.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install git-hub-projects-v2
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /git-hub-projects-v2 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of the GitHub Projects v2 skill. - Enables listing and filtering project backlog items using the `gh project` CLI. - Supports setting project fields such as status, iteration, priority, and more. - Provides commands for adding comments to issues and creating new issues with project assignment. - Includes instructions for managing sub-issues via the `gh-sub-issue` extension or GraphQL fallback. - Requires users to authenticate with the `project` scope for full functionality.
元数据
Slug git-hub-projects-v2
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Git Hub Projects V2 是什么?

Manage GitHub Projects v2 using the `gh project` CLI. Use this skill when the agent needs to list backlog items, set project fields (status, iteration, prior... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 64 次。

如何安装 Git Hub Projects V2?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install git-hub-projects-v2」即可一键安装,无需额外配置。

Git Hub Projects V2 是免费的吗?

是的,Git Hub Projects V2 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Git Hub Projects V2 支持哪些平台?

Git Hub Projects V2 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Git Hub Projects V2?

由 freddydk(@freddydk)开发并维护,当前版本 v1.0.0。

💬 留言讨论