用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tenfyzhong/skills-hub --skill new-issue命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | new-issue |
| description | Create or file a GitHub issue, bug report, or feature request from the conversation context. |
Create a GitHub issue based on the current conversation context.
Mode Detection: Check if user specified a target repository.
| User Input | Mode | Git Repo Required |
|---|---|---|
https://github.com/owner/repo | Explicit | No |
owner/repo | Explicit | No |
| No repo specified | Auto-detect | Yes |
# Check if gh CLI is available and authenticated
gh auth status
If gh not authenticated → "Please run gh auth login first."
# Check if in a git repository
git rev-parse --is-inside-work-tree
# Get repository info
gh repo view --json owner,name,url
If not in git repo and no target specified → "Please specify a target repository (e.g., owner/repo or GitHub URL), or navigate to a git project."
The user triggers this skill with phrases like:
Optional: User may specify target repository:
https://github.com/owner/repoowner/repoContext for the issue comes from:
Case A: User specified a repository
Parse the user input to extract owner/repo:
# From URL: https://github.com/owner/repo or https://github.com/owner/repo/...
# Extract: owner/repo
# From short form: owner/repo
# Use directly
# Validate the repository exists and is accessible
gh repo view "$TARGET_REPO" --json owner,name,url
If repo not found or inaccessible → "Repository '$TARGET_REPO' not found or you don't have access."
Case B: Auto-detect from current git repo
# Get repository info and check if it's a fork
gh repo view --json owner,name,isFork,parent,url
# If it's a fork, get parent (upstream) info
IS_FORK=$(gh repo view --json isFork -q '.isFork')
if [ "$IS_FORK" = "true" ]; then
UPSTREAM_OWNER=$(gh repo view --json parent -q '.parent.owner.login')
UPSTREAM_NAME=$(gh repo view --json parent -q '.parent.name')
TARGET_REPO="$UPSTREAM_OWNER/$UPSTREAM_NAME"
else
# Use current repo as target
TARGET_REPO=$(gh repo view --json owner,name -q '.owner.login + "/" + .name')
fi
Based on the conversation context, generate:
Language Requirement:
Title Generation Rules:
[Bug], [Feature], [Enhancement], [Question]Description Generation:
Structure the description with these sections as applicable:
## Description
[Clear explanation of the issue/feature request]
## Context
[Relevant background information from the conversation]
## Steps to Reproduce (for bugs)
1. [Step 1]
2. [Step 2]
3. [Expected vs Actual behavior]
## Proposed Solution (if discussed)
[Any solutions discussed in the conversation]
## Additional Information
- [Relevant code snippets]
- [Error messages]
- [Environment details if relevant]
MUST use the question tool to present the draft and get user confirmation.
Present the generated issue to the user:
## Issue Draft
**Target Repository**: [TARGET_REPO]
**Title**: [Generated Title]
**Description**:
[Generated Description]
---
Please review the above issue draft.
Use the question tool to ask:
Options:
1. "Submit as-is" - Create the issue with current content
2. "Modify title" - Change the issue title
3. "Modify description" - Change the issue description
4. "Cancel" - Do not create the issue
If user chooses to modify:
For title modification:
For description modification:
Loop until user confirms or cancels.
Once user confirms, create the issue:
# Create issue on the target repository
gh issue create \
--repo "$TARGET_REPO" \
--title "$ISSUE_TITLE" \
--body "$ISSUE_BODY"
Use HEREDOC for body to preserve formatting:
gh issue create --repo "$TARGET_REPO" --title "$ISSUE_TITLE" --body "$(cat <<'EOF'
## Description
[Description content here]
## Context
[Context content here]
EOF
)"
After issue creation, provide:
# Get the created issue details
gh issue view --repo "$TARGET_REPO" <ISSUE_NUMBER> --json number,title,url,state
Issue: #[NUMBER] - [TITLE] Repository: [TARGET_REPO] URL: [ISSUE_URL]
[Brief confirmation of what was submitted]
| Situation | Action |
|---|---|
| No context provided | Ask user to describe the issue they want to create |
| User cancels | "Issue creation cancelled. No issue was created." |
| API error | Report the error and suggest checking permissions |
| Rate limited | Inform user and suggest waiting |
| No write access | "You don't have permission to create issues on [REPO]. Consider forking first." |
| Repo not specified + not in git repo | Ask user to specify target repo or navigate to a git project |
| Invalid repo format | "Invalid repository format. Use 'owner/repo' or full GitHub URL." |