oss

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

OSS Contribution Workflows

开源软件(OSS)贡献工作流

Overview

概述

Facilitate GitHub-based open source contribution workflows including pull requests, issues, and discussions. This skill provides structured automation for common OSS contribution tasks, ensuring consistent formatting, proper metadata application, and adherence to repository conventions. Use this skill when contributing to open source projects or managing GitHub repositories through the command line.
The skill emphasizes semantic analysis over mechanical operations—understand the intent and context of changes before generating titles, descriptions, or selecting templates. All generated content should be conversational and informal rather than robotic or overly formal.
基于GitHub的开源软件贡献工作流,包括拉取请求(PR)、议题(Issue)和讨论。此Skill为常见的OSS贡献任务提供结构化自动化支持,确保格式一致、元数据应用正确,并遵循仓库约定。在为开源项目做贡献或通过命令行管理GitHub仓库时,可使用此Skill。
该Skill强调语义分析而非机械操作——在生成标题、描述或选择模板之前,先理解变更的意图和上下文。所有生成的内容应采用对话式、非正式的语气,而非生硬或过于正式的风格。

Prerequisites

前提条件

Before using any OSS contribution workflow, verify GitHub CLI authentication status:
bash
gh auth status
Ensure the output shows you are logged in to github.com with appropriate scopes (repo, read:org, etc.). If not authenticated, run:
bash
gh auth login
For pull request workflows, also verify:
  • Working tree is clean or changes are committed
  • Current branch has commits ahead of the base branch
  • Remote tracking is configured for the current branch
使用任何OSS贡献工作流之前,请验证GitHub CLI的认证状态:
bash
gh auth status
确保输出显示你已登录github.com,且拥有适当的权限范围(repo、read:org等)。若未认证,请运行:
bash
gh auth login
对于拉取请求工作流,还需验证:
  • 工作目录已清理或变更已提交
  • 当前分支相对于基础分支存在超前提交
  • 已为当前分支配置远程跟踪

Related Skills

相关Skill

For detailed GitHub CLI command syntax, flags, and patterns, activate the
cli-gh
skill. That skill covers the full gh command surface including issue management, PR operations, repository queries, workflow triggers, and API interactions.
如需了解GitHub CLI命令的详细语法、参数和使用模式,请激活
cli-gh
Skill。该Skill涵盖完整的gh命令范围,包括议题管理、PR操作、仓库查询、工作流触发和API交互。

Pull Requests

拉取请求

Create GitHub pull requests with semantic change analysis and structured formatting. The workflow generates meaningful titles and descriptions by reading actual code changes rather than relying solely on commit messages or filenames.
通过语义变更分析和结构化格式创建GitHub拉取请求。该工作流通过读取实际代码变更而非仅依赖提交信息或文件名,生成有意义的标题和描述。

Workflow Steps

工作流步骤

Validate Prerequisites
Confirm git state before proceeding:
  • Check
    git status
    for uncommitted changes
  • Verify branch has commits ahead of base branch via
    git log
  • Confirm remote tracking is configured
  • Ensure gh CLI is authenticated
Parse Arguments
Support the following arguments:
  • base-branch
    : Target branch for the PR (default: main/master)
  • reviewers
    : Comma-separated list of GitHub usernames
  • --draft
    : Create as draft PR
  • --test-plan
    : Include test plan section in body
Semantic Change Analysis
Read the actual diff to understand what changed:
bash
git diff base-branch...HEAD
Analyze:
  • Nature of changes (feature, fix, refactor, docs, test, chore)
  • Scope of impact (which components/modules affected)
  • Intent and purpose (why the change was made)
  • Dependencies or related changes
Generate Title and Body
Craft a concise title summarizing the change. Generate a body with:
  • Summary section (1-3 bullet points explaining what and why)
  • Test Plan section if
    --test-plan
    flag provided (bulleted checklist)
  • GitHub admonitions (NOTE, TIP, IMPORTANT, WARNING, CAUTION) where appropriate
Pass the body using HEREDOC syntax:
bash
gh pr create --title "the pr title" --body "$(cat <<'EOF'
验证前提条件
在继续操作前确认Git状态:
  • 检查
    git status
    是否存在未提交变更
  • 通过
    git log
    验证分支相对于基础分支存在超前提交
  • 确认已配置远程跟踪
  • 确保gh CLI已完成认证
解析参数
支持以下参数:
  • base-branch
    : PR的目标分支(默认:main/master)
  • reviewers
    : 以逗号分隔的GitHub用户名列表
  • --draft
    : 创建草稿PR
  • --test-plan
    : 在正文中包含测试计划部分
语义变更分析
读取实际差异以理解变更内容:
bash
git diff base-branch...HEAD
分析内容包括:
  • 变更类型(功能新增、Bug修复、重构、文档更新、测试、日常维护)
  • 影响范围(涉及哪些组件/模块)
  • 意图和目的(变更的原因)
  • 依赖关系或相关变更
生成标题和正文
撰写简洁的标题总结变更内容。生成包含以下部分的正文:
  • 摘要部分(1-3个要点,说明变更内容和原因)
  • 若提供
    --test-plan
    参数,则包含测试计划部分(项目符号清单)
  • 必要时使用GitHub提示框(NOTE、TIP、IMPORTANT、WARNING、CAUTION)
使用HEREDOC语法传递正文:
bash
gh pr create --title "the pr title" --body "$(cat <<'EOF'

Summary

摘要

  • First bullet point
  • Second bullet point
  • 第一个要点
  • 第二个要点

Test Plan

测试计划

  • Test item one
  • Test item two EOF )"

**Create Pull Request**

Execute the gh command with all parsed flags and generated content. Include:

- `--base` for target branch
- `--reviewer` for each reviewer
- `--draft` if draft mode requested
- Return the PR URL to the user

For the complete pull request workflow with detailed steps, examples, and edge cases, refer to `references/create-pr.md`.
  • 测试项一
  • 测试项二 EOF )"

**创建拉取请求**

执行包含所有解析参数和生成内容的gh命令,包括:

- `--base`: 指定目标分支
- `--reviewer`: 指定每位评审者
- `--draft`: 若请求草稿模式
- 向用户返回PR的URL

如需完整的拉取请求工作流,包括详细步骤、示例和边缘情况,请参考`references/create-pr.md`。

Update Pull Requests

更新拉取请求

Update existing GitHub pull requests with semantic change analysis. The workflow regenerates titles and descriptions by reading actual code changes rather than relying solely on commit messages.
通过语义变更分析更新现有GitHub拉取请求。该工作流通过读取实际代码变更而非仅依赖提交信息,重新生成标题和描述。

Workflow Steps

工作流步骤

Validate Prerequisites
Same as Pull Requests: confirm gh CLI auth, verify git repo state.
Check for Existing PR
Verify a PR exists for the current branch:
bash
gh pr view --json number,url,title,baseRefName 2>/dev/null
If no PR found, error and direct user to
/create-pr
.
Parse Arguments
Interpret arguments as natural language instructions:
  • References to "title" → update title
  • References to "description" or "body" → regenerate description
  • Quoted text → use as new title or append to description
  • Everything else → additional context for description
Semantic Change Analysis
Same process as Pull Requests: read the diff, analyze intent, generate content.
Execute Update
bash
gh pr edit --title "$title" --body "$body"
Push any local commits after updating.
For the complete update workflow with detailed steps and examples, refer to
references/update-pr.md
.
验证前提条件
与拉取请求的前提条件相同:确认gh CLI已认证,验证Git仓库状态。
检查现有PR
验证当前分支是否存在对应的PR:
bash
gh pr view --json number,url,title,baseRefName 2>/dev/null
若未找到PR,请提示错误并引导用户使用
/create-pr
解析参数
将参数解读为自然语言指令:
  • 提及“title”→ 更新标题
  • 提及“description”或“body”→ 重新生成描述
  • 带引号的文本→ 用作新标题或追加到描述中
  • 其他内容→ 作为描述的额外上下文
语义变更分析
与拉取请求的流程相同:读取差异、分析意图、生成内容。
执行更新
bash
gh pr edit --title "$title" --body "$body"
更新后推送所有本地提交。
如需完整的更新工作流,包括详细步骤和示例,请参考
references/update-pr.md

Issues

议题

Create GitHub issues with automatic template selection and label application. The workflow intelligently chooses the appropriate issue template based on the description content and applies relevant labels for repositories where you have write access.
通过自动模板选择和标签应用创建GitHub议题。该工作流会根据描述内容智能选择合适的议题模板,并在你拥有写入权限的仓库中应用相关标签。

Workflow Steps

工作流步骤

Check for Issue Templates
Search the repository for issue templates:
bash
ls -la .github/ISSUE_TEMPLATE/
Templates may be in YAML or Markdown format. Parse YAML frontmatter to extract:
  • Template name
  • Description
  • Labels to auto-apply
Auto-Select Template
Analyze the issue description to determine the most appropriate template:
  • Bug reports: errors, crashes, unexpected behavior
  • Feature requests: enhancements, new functionality
  • Documentation: docs improvements, clarifications
  • Questions: how-to, usage inquiries
If no template matches or templates don't exist, proceed without one.
Apply Labels
For repositories where you have write access, apply labels using the
--label
flag:
bash
gh issue create --label "bug" --label "needs-triage"
Extract labels from:
  • Selected template metadata
  • Issue description content (infer appropriate labels)
Support Similar Issue Search
When
--check
flag is provided, search for similar existing issues before creating:
bash
gh issue list --search "search terms" --state all
Display results and ask user if they want to proceed with creation.
Create Issue
Execute the gh command with generated title, body, and metadata. Pass multi-line bodies using HEREDOC syntax. Return the issue URL to the user.
For the complete issue creation workflow with template examples, label strategies, and search patterns, refer to
references/create-issue.md
.
检查议题模板
在仓库中搜索议题模板:
bash
ls -la .github/ISSUE_TEMPLATE/
模板可能为YAML或Markdown格式。解析YAML前置元数据以提取:
  • 模板名称
  • 描述
  • 自动应用的标签
自动选择模板
分析议题描述以确定最合适的模板:
  • Bug报告:错误、崩溃、意外行为
  • 功能请求:增强、新功能
  • 文档:文档改进、澄清
  • 问题咨询:操作方法、使用疑问
若没有匹配的模板或模板不存在,则不使用模板继续操作。
应用标签
在你拥有写入权限的仓库中,使用
--label
参数应用标签:
bash
gh issue create --label "bug" --label "needs-triage"
从以下来源提取标签:
  • 所选模板的元数据
  • 议题描述内容(推断合适的标签)
支持相似议题搜索
当提供
--check
参数时,在创建前搜索相似的现有议题:
bash
gh issue list --search "search terms" --state all
显示搜索结果并询问用户是否继续创建。
创建议题
执行包含生成的标题、正文和元数据的gh命令。使用HEREDOC语法传递多行正文。向用户返回议题的URL。
如需完整的议题创建工作流,包括模板示例、标签策略和搜索模式,请参考
references/create-issue.md

Claude Code Issues

Claude Code议题

Create issues specifically in the anthropics/claude-code repository with environment information gathering and specialized templates. This workflow is optimized for reporting bugs, requesting features, or improving documentation for Claude Code itself.
在anthropics/claude-code仓库中创建议题,包含环境信息收集和专用模板。该工作流专为报告Claude Code的Bug、请求功能或改进文档而优化。

Workflow Steps

工作流步骤

Identify Issue Type
Determine which template to use based on user intent:
  • bug_report
    : Errors, crashes, unexpected behavior
  • feature_request
    : New functionality or enhancements
  • documentation
    : Docs improvements or clarifications
  • model_behavior
    : Issues related to Claude's responses or reasoning
Gather Environment Information
Collect relevant environment details:
bash
undefined
确定议题类型
根据用户意图确定使用的模板:
  • bug_report
    : 错误、崩溃、意外行为
  • feature_request
    : 新功能或增强
  • documentation
    : 文档改进或澄清
  • model_behavior
    : 与Claude响应或推理相关的问题
收集环境信息
收集相关的环境详情:
bash
undefined

Claude Code version

Claude Code版本

claude --version
claude --version

Operating system (macOS)

操作系统(macOS)

scripts/get-macos-version.sh
scripts/get-macos-version.sh

Terminal emulator (macOS)

终端模拟器(macOS)

echo $TERM_PROGRAM
echo $TERM_PROGRAM

Shell

Shell

echo $SHELL

**Generate Issue Body**

Create structured content following the selected template format:

- Clear description of the issue or request
- Steps to reproduce (for bugs)
- Expected vs actual behavior (for bugs)
- Environment information section
- Additional context or screenshots

Use GitHub admonitions for important callouts:

```markdown
> [!IMPORTANT]
> This issue affects all macOS users on Apple Silicon
Create in anthropics/claude-code
Execute the gh command targeting the correct repository:
bash
gh issue create \
  --repo anthropics/claude-code \
  --title "Issue title" \
  --body "$(cat <<'EOF'
Issue content here
EOF
)"
Return the issue URL to the user.
For the complete Claude Code issue workflow with template examples and environment gathering scripts, refer to
references/issue-claude-code.md
.
echo $SHELL

**生成议题正文**

按照所选模板格式创建结构化内容:

- 清晰描述问题或请求
- 复现步骤(针对Bug)
- 预期与实际行为(针对Bug)
- 环境信息部分
- 额外上下文或截图

使用GitHub提示框突出重要信息:

```markdown
> [!IMPORTANT]
> 此问题影响所有Apple Silicon架构的macOS用户
在anthropics/claude-code中创建
执行目标为指定仓库的gh命令:
bash
gh issue create \
  --repo anthropics/claude-code \
  --title "Issue title" \
  --body "$(cat <<'EOF'
Issue content here
EOF
)"
向用户返回议题的URL。
如需完整的Claude Code议题工作流,包括模板示例和环境收集脚本,请参考
references/issue-claude-code.md

Codex CLI Issues

Codex CLI议题

Create issues specifically in the openai/codex repository with environment information gathering and specialized templates. This workflow is optimized for reporting bugs, requesting features, improving documentation, or reporting VS Code extension issues for Codex CLI.
在openai/codex仓库中创建议题,包含环境信息收集和专用模板。该工作流专为报告Codex CLI的Bug、请求功能、改进文档或报告VS Code扩展问题而优化。

Workflow Steps

工作流步骤

Identify Issue Type
Determine which template to use based on user intent:
  • 2-bug-report
    : Errors, crashes, unexpected behavior in CLI
  • 4-feature-request
    : New functionality or enhancements
  • 3-docs-issue
    : Docs improvements or clarifications
  • 5-vs-code-extension
    : Issues with the VS Code/Cursor/Windsurf extension
Gather Environment Information
Collect relevant environment details:
bash
undefined
确定议题类型
根据用户意图确定使用的模板:
  • 2-bug-report
    : CLI中的错误、崩溃、意外行为
  • 4-feature-request
    : 新功能或增强
  • 3-docs-issue
    : 文档改进或澄清
  • 5-vs-code-extension
    : VS Code/Cursor/Windsurf扩展相关问题
收集环境信息
收集相关的环境详情:
bash
undefined

Codex CLI version

Codex CLI版本

codex --version
codex --version

Platform (macOS)

平台(macOS)

scripts/get-macos-version.sh
scripts/get-macos-version.sh

For VS Code extension issues

针对VS Code扩展问题

code --version

**Generate Issue Body**

Create structured content following the selected template format:

- Clear description of the issue or request
- Steps to reproduce (for bugs)
- Expected vs actual behavior (for bugs)
- Environment information section (version, platform, model, subscription)
- Additional context

**Create in openai/codex**

Execute the gh command targeting the correct repository:

```bash
gh issue create \
  --repo openai/codex \
  --title "Issue title" \
  --body "$(cat <<'EOF'
Issue content here
EOF
)"
Return the issue URL to the user.
For the complete Codex CLI issue workflow with template examples and environment gathering scripts, refer to
references/issue-codex-cli.md
.
code --version

**生成议题正文**

按照所选模板格式创建结构化内容:

- 清晰描述问题或请求
- 复现步骤(针对Bug)
- 预期与实际行为(针对Bug)
- 环境信息部分(版本、平台、模型、订阅)
- 额外上下文

**在openai/codex中创建**

执行目标为指定仓库的gh命令:

```bash
gh issue create \
  --repo openai/codex \
  --title "$title" \
  --body "$(cat <<'EOF'
Issue content here
EOF
)"
向用户返回议题的URL。
如需完整的Codex CLI议题工作流,包括模板示例和环境收集脚本,请参考
references/issue-codex-cli.md

Sablier Issues

Sablier议题

Create issues in
sablier-labs/*
repositories with automatic label application. Since the user is the org owner, labels are always applied across four dimensions: Type, Work (Cynefin), Priority, and Effort. The
sablier-labs/command-center
repository additionally supports Scope labels for domain categorization.
sablier-labs/*
仓库中创建议题,自动应用标签。由于你是组织所有者,标签始终从四个维度应用:类型、工作复杂度(Cynefin)、优先级和工作量。
sablier-labs/command-center
仓库还支持用于领域分类的范围标签。

Workflow Steps

工作流步骤

Parse Repository
The first argument token is the repo name (without org prefix). It maps to
sablier-labs/{repo_name}
.
Apply Labels
Always applied (org owner). Analyze issue content to determine:
  • Type (bug, feature, docs, etc.)
  • Work complexity (clear, complicated, complex, chaotic)
  • Priority (0-3)
  • Effort (low, medium, high, epic)
  • Scope (frontend, backend, evm, solana, etc. — command-center only)
Generate Issue Body
Uses a default template with Problem, Solution, and Files Affected sections. No YAML/Markdown template detection—Sablier repos don't use GitHub issue templates.
Create in sablier-labs/{repo_name}
bash
gh issue create \
  --repo "sablier-labs/{repo_name}" \
  --title "$title" \
  --body "$body" \
  --label "type: feature,work: clear,priority: 2,effort: medium"
Return the issue URL to the user.
For the complete Sablier issue workflow with label reference tables, scope labels, and examples, refer to
references/issue-sablier.md
.
解析仓库
第一个参数为仓库名称(不含组织前缀),对应
sablier-labs/{repo_name}
应用标签
始终应用标签(组织所有者权限)。分析议题内容以确定:
  • 类型(bug、feature、docs等)
  • 工作复杂度(clear、complicated、complex、chaotic)
  • 优先级(0-3)
  • 工作量(low、medium、high、epic)
  • 范围(frontend、backend、evm、solana等,仅command-center仓库支持)
生成议题正文
使用包含问题、解决方案和受影响文件部分的默认模板。Sablier仓库不使用GitHub议题模板,因此无需检测YAML/Markdown模板。
在sablier-labs/{repo_name}中创建
bash
gh issue create \
  --repo "sablier-labs/{repo_name}" \
  --title "$title" \
  --body "$body" \
  --label "type: feature,work: clear,priority: 2,effort: medium"
向用户返回议题的URL。
如需完整的Sablier议题工作流,包括标签参考表、范围标签和示例,请参考
references/issue-sablier.md

Discussions

讨论

Create GitHub discussions using the GraphQL API with automatic category selection. Discussions are ideal for Q&A, ideas, announcements, and general community conversations that don't fit the issue format.
使用GraphQL API创建GitHub讨论,自动选择分类。讨论适用于问答、创意分享、公告和不适合议题格式的社区对话。

Workflow Steps

工作流步骤

Fetch Repository Information
Query the repository to get its node ID:
bash
gh api graphql -f query='
  query($owner: String!, $repo: String!) {
    repository(owner: $owner, name: $repo) {
      id
    }
  }
' -f owner="OWNER" -f repo="REPO"
Fetch Discussion Categories
Query available categories for the repository:
bash
gh api graphql -f query='
  query($owner: String!, $repo: String!) {
    repository(owner: $owner, name: $repo) {
      discussionCategories(first: 10) {
        nodes {
          id
          name
          description
        }
      }
    }
  }
' -f owner="OWNER" -f repo="REPO"
Auto-Select Category
Analyze the discussion title and body to choose the most appropriate category:
  • Ideas: Feature suggestions, proposals, brainstorming
  • Q&A: Questions seeking answers, how-to inquiries
  • General: Broad discussions, community topics
  • Announcements: Important updates (if you have permissions)
  • Show and Tell: Demos, showcases, sharing work
If uncertain, default to "General" or ask the user to select.
Support Similar Discussion Search
When
--check
flag is provided, search for similar existing discussions:
bash
gh api graphql -f query='
  query($owner: String!, $repo: String!, $search: String!) {
    repository(owner: $owner, name: $repo) {
      discussions(first: 5, orderBy: {field: CREATED_AT, direction: DESC}, filterBy: {query: $search}) {
        nodes {
          title
          url
        }
      }
    }
  }
' -f owner="OWNER" -f repo="REPO" -f search="search terms"
Display results and confirm before proceeding.
Create Discussion
Execute the GraphQL mutation to create the discussion:
bash
gh api graphql -f query='
  mutation($repositoryId: ID!, $categoryId: ID!, $title: String!, $body: String!) {
    createDiscussion(input: {
      repositoryId: $repositoryId
      categoryId: $categoryId
      title: $title
      body: $body
    }) {
      discussion {
        url
      }
    }
  }
' -f repositoryId="REPO_ID" -f categoryId="CATEGORY_ID" -f title="Title" -f body="Body"
Return the discussion URL to the user.
For the complete discussion workflow with GraphQL examples, category selection logic, and search patterns, refer to
references/create-discussion.md
.
获取仓库信息
查询仓库以获取其节点ID:
bash
gh api graphql -f query='
  query($owner: String!, $repo: String!) {
    repository(owner: $owner, name: $repo) {
      id
    }
  }
' -f owner="OWNER" -f repo="REPO"
获取讨论分类
查询仓库可用的讨论分类:
bash
gh api graphql -f query='
  query($owner: String!, $repo: String!) {
    repository(owner: $owner, name: $repo) {
      discussionCategories(first: 10) {
        nodes {
          id
          name
          description
        }
      }
    }
  }
' -f owner="OWNER" -f repo="REPO"
自动选择分类
分析讨论标题和正文以选择最合适的分类:
  • 创意: 功能建议、提案、头脑风暴
  • 问答: 寻求答案的问题、操作方法咨询
  • 综合: 广泛讨论、社区话题
  • 公告: 重要更新(需拥有权限)
  • 成果展示: 演示、作品分享
若不确定,默认选择“综合”或询问用户选择。
支持相似讨论搜索
当提供
--check
参数时,搜索相似的现有讨论:
bash
gh api graphql -f query='
  query($owner: String!, $repo: String!, $search: String!) {
    repository(owner: $owner, name: $repo) {
      discussions(first: 5, orderBy: {field: CREATED_AT, direction: DESC}, filterBy: {query: $search}) {
        nodes {
          title
          url
        }
      }
    }
  }
' -f owner="OWNER" -f repo="REPO" -f search="search terms"
显示结果并在继续前确认。
创建讨论
执行GraphQL突变以创建讨论:
bash
gh api graphql -f query='
  mutation($repositoryId: ID!, $categoryId: ID!, $title: String!, $body: String!) {
    createDiscussion(input: {
      repositoryId: $repositoryId
      categoryId: $categoryId
      title: $title
      body: $body
    }) {
      discussion {
        url
      }
    }
  }
' -f repositoryId="REPO_ID" -f categoryId="CATEGORY_ID" -f title="Title" -f body="Body"
向用户返回讨论的URL。
如需完整的讨论工作流,包括GraphQL示例、分类选择逻辑和搜索模式,请参考
references/create-discussion.md

Common Patterns

通用模式

Shared conventions and patterns used across all OSS contribution workflows.
所有OSS贡献工作流中使用的共享约定和模式。

HEREDOC for Multi-line Content

多行内容的HEREDOC语法

Always use HEREDOC syntax when passing multi-line bodies to gh commands:
bash
gh pr create --title "Title" --body "$(cat <<'EOF'
First paragraph

Second paragraph
EOF
)"
The single quotes around
'EOF'
prevent variable expansion, ensuring literal content is passed.
向gh命令传递多行正文时,始终使用HEREDOC语法:
bash
gh pr create --title "Title" --body "$(cat <<'EOF'
第一段

第二段
EOF
)"
'EOF'
两侧的单引号可防止变量展开,确保传递的是字面内容。

GitHub Admonitions

GitHub提示框

Use GitHub-flavored markdown admonitions to highlight important information:
markdown
> [!NOTE]
> Useful information that users should know

> [!TIP]
> Helpful advice for doing things better

> [!IMPORTANT]
> Key information users need to know

> [!WARNING]
> Urgent info that needs immediate attention

> [!CAUTION]
> Advises about risks or negative outcomes
Apply these judiciously—overuse reduces their impact.
使用GitHub风格的Markdown提示框突出重要信息:
markdown
> [!NOTE]
> 用户应了解的实用信息

> [!TIP]
> 优化操作的实用建议

> [!IMPORTANT]
> 用户需要知晓的关键信息

> [!WARNING]
> 需要立即关注的紧急信息

> [!CAUTION]
> 关于风险或负面结果的提示
谨慎使用——过度使用会降低其效果。

Semantic Analysis Over Mechanical Operations

语义分析优先于机械操作

Never generate content based solely on filenames or commit messages. Always read the actual changes:
bash
undefined
永远不要仅根据文件名或提交信息生成内容。务必读取实际变更:
bash
undefined

Read the diff

读取差异

git diff base-branch...HEAD
git diff base-branch...HEAD

Or for specific files

或针对特定文件

git diff base-branch...HEAD -- path/to/file

Understand:

- What changed (the mechanics)
- Why it changed (the intent)
- How it fits into the broader system (the context)

Use this understanding to craft meaningful titles and descriptions that communicate value, not just mechanics.
git diff base-branch...HEAD -- path/to/file

理解:

- 变更内容(技术细节)
- 变更原因(意图)
- 变更在整体系统中的定位(上下文)

利用这些理解撰写有意义的标题和描述,传达价值而非仅技术细节。

Informal Tone

非正式语气

Generated content should be conversational and approachable:
Good:
This PR adds support for parsing YAML frontmatter in issue templates. Previously, we only supported markdown format, which meant users couldn't take advantage of GitHub's newer template features.
Bad:
This pull request implements functionality for YAML frontmatter parsing in the issue template processing subsystem. The implementation enhances the system's capabilities regarding template format support.
Write like a human talking to another human, not like a technical specification.
生成的内容应具有对话性和亲和力:
好示例:
此PR新增了对议题模板中YAML前置元数据的解析支持。此前我们仅支持Markdown格式,这意味着用户无法利用GitHub的新型模板功能。
坏示例:
此拉取请求在议题模板处理子系统中实现了YAML前置元数据解析功能。该实现增强了系统对模板格式的支持能力。
像人与人对话一样写作,而非撰写技术规范。

Error Handling

错误处理

When operations fail, provide clear context:
  • What was being attempted
  • What went wrong
  • What the user should do to fix it
Example:
Failed to create PR: current branch has no commits ahead of main.

Make sure you've committed your changes and that your branch differs from the base branch.
当操作失败时,提供清晰的上下文:
  • 尝试执行的操作
  • 失败原因
  • 用户应采取的修复措施
示例:
创建PR失败:当前分支相对于main分支无超前提交。

请确保你已提交变更,且当前分支与基础分支存在差异。

Confirmation and Feedback

确认与反馈

For destructive or significant operations:
  • Show what will happen before executing
  • Ask for confirmation when appropriate
  • Provide clear feedback after completion
For search operations with
--check
:
  • Display found items clearly
  • Let the user decide whether to proceed
  • Don't automatically skip creation if duplicates exist
对于破坏性或重要操作:
  • 执行前展示将进行的操作
  • 必要时请求确认
  • 完成后提供清晰反馈
对于使用
--check
的搜索操作:
  • 清晰显示找到的内容
  • 让用户决定是否继续
  • 若存在重复内容,不要自动跳过创建

Additional Resources

额外资源

For detailed workflows, examples, and edge case handling, refer to these reference documents:
  • references/create-pr.md
    - Complete pull request workflow including git state validation, semantic analysis strategies, template examples, and reviewer management
  • references/update-pr.md
    - Complete update PR workflow including argument parsing, semantic analysis, and title/description regeneration
  • references/create-issue.md
    - Complete issue creation workflow including template parsing, label application strategies, and duplicate detection
  • references/issue-claude-code.md
    - Claude Code-specific issue creation including all template formats, environment gathering scripts, and submission guidelines
  • references/issue-codex-cli.md
    - Codex CLI-specific issue creation including bug reports, feature requests, docs issues, and VS Code extension templates
  • references/issue-sablier.md
    - Sablier-specific issue creation for
    sablier-labs/*
    repos including label taxonomy, scope labels for command-center, and default template
  • references/issue-biome.md
    - Biome-specific issue creation including playground reproduction links, formatter/linter bug templates, and environment detection
  • references/create-discussion.md
    - GitHub discussions workflow including GraphQL queries, category selection logic, and search strategies
These references provide implementation details, code examples, and troubleshooting guidance for each workflow type.
如需详细的工作流、示例和边缘情况处理,请参考以下参考文档:
  • references/create-pr.md
    - 完整的拉取请求工作流,包括Git状态验证、语义分析策略、模板示例和评审者管理
  • references/update-pr.md
    - 完整的PR更新工作流,包括参数解析、语义分析和标题/描述重新生成
  • references/create-issue.md
    - 完整的议题创建工作流,包括模板解析、标签应用策略和重复检测
  • references/issue-claude-code.md
    - 针对Claude Code的议题创建,包括所有模板格式、环境收集脚本和提交指南
  • references/issue-codex-cli.md
    - 针对Codex CLI的议题创建,包括Bug报告、功能请求、文档问题和VS Code扩展模板
  • references/issue-sablier.md
    - 针对
    sablier-labs/*
    仓库的Sablier议题创建,包括标签分类、command-center的范围标签和默认模板
  • references/issue-biome.md
    - 针对Biome的议题创建,包括在线演示复现链接、格式化器/检查器Bug模板和环境检测
  • references/create-discussion.md
    - GitHub讨论工作流,包括GraphQL查询、分类选择逻辑和搜索策略
这些参考文档提供了每个工作流类型的实现细节、代码示例和故障排除指南。