copilot-coding-agent

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

GitHub Copilot Coding Agent — Issue → Draft PR 자동화

GitHub Copilot Coding Agent — Issue → Draft PR 自动化

이슈에
ai-copilot
라벨을 붙이면 GitHub Actions가 자동으로 Copilot에 할당하고, Copilot이 브랜치 생성 → 코드 작성 → Draft PR 생성까지 수행합니다.
为Issue添加
ai-copilot
标签后,GitHub Actions会自动将其分配给Copilot, Copilot将完成从创建分支 → 编写代码 → 生成Draft PR的全流程。

When to use this skill

适用场景

  • PM/디자이너가 이슈 작성 → 개발자 없이 Copilot이 자동 구현 시작할 때
  • 백로그 이슈(리팩터링/문서화/테스트 추가)를 Copilot에게 offload할 때
  • Vibe Kanban / Conductor로 생성된 후속 작업을 Copilot에게 위임할 때
  • Jira 등 외부 시스템 → GitHub Issue → Copilot PR 자동화 파이프라인

  • 产品经理/设计师创建Issue后,无需开发人员介入,Copilot自动启动实现工作时
  • 将待办事项(重构/文档编写/添加测试)委托给Copilot处理时
  • 将Vibe Kanban / Conductor生成的后续任务委托给Copilot处理时
  • 构建从Jira等外部系统 → GitHub Issue → Copilot PR的自动化流水线时

전제 조건

前提条件

  • GitHub 플랜: Copilot Pro+, Business, 또는 Enterprise
  • Copilot Coding Agent 활성화: 레포 설정에서 활성화 필요
  • gh CLI: 인증 완료
  • PAT:
    repo
    scope를 가진 Personal Access Token

  • GitHub 方案:Copilot Pro+、Business或Enterprise
  • Copilot Coding Agent 启用:需在仓库设置中启用
  • gh CLI:已完成认证
  • PAT:拥有
    repo
    权限范围的Personal Access Token

최초 1회 셋업

首次一键设置

bash
undefined
bash
undefined

원클릭 셋업 (토큰 등록 + 워크플로 배포 + 라벨 생성)

원클릭 셋업 (토큰 등록 + 워크플로 배포 + 라벨 생성)

bash scripts/copilot-setup-workflow.sh

이 스크립트가 수행하는 작업:
1. `COPILOT_ASSIGN_TOKEN` 레포 시크릿 등록
2. `.github/workflows/assign-to-copilot.yml` 배포
3. `ai-copilot` 라벨 생성

---
bash scripts/copilot-setup-workflow.sh

该脚本将完成以下操作:
1. 注册`COPILOT_ASSIGN_TOKEN`仓库密钥
2. 部署`.github/workflows/assign-to-copilot.yml`工作流
3. 创建`ai-copilot`标签

---

사용 방법

使用方法

방법 1: GitHub Actions 자동 (권장)

方法1:GitHub Actions 自动触发(推荐)

bash
undefined
bash
undefined

이슈 생성 + ai-copilot 라벨 → Copilot 자동 할당

이슈 생성 + ai-copilot 라벨 → Copilot 자동 할당

gh issue create
--label ai-copilot
--title "Add user authentication"
--body "Implement JWT-based auth with refresh tokens. Include login, logout, refresh endpoints."
undefined
gh issue create
--label ai-copilot
--title "Add user authentication"
--body "Implement JWT-based auth with refresh tokens. Include login, logout, refresh endpoints."
undefined

방법 2: 기존 이슈에 라벨 추가

方法2:为现有Issue添加标签

bash
undefined
bash
undefined

이슈 번호 42에 라벨 추가 → Actions 트리거

이슈 번호 42에 라벨 추가 → Actions 트리거

gh issue edit 42 --add-label ai-copilot
undefined
gh issue edit 42 --add-label ai-copilot
undefined

방법 3: 스크립트로 직접 할당

方法3:通过脚本直接分配

bash
export COPILOT_ASSIGN_TOKEN=<your-pat>
bash scripts/copilot-assign-issue.sh 42

bash
export COPILOT_ASSIGN_TOKEN=<your-pat>
bash scripts/copilot-assign-issue.sh 42

동작 원리 (기술)

技术原理

이슈 생성/라벨링
GitHub Actions 트리거 (assign-to-copilot.yml)
GraphQL로 Copilot bot ID 조회
replaceActorsForAssignable → Copilot을 assignee로 설정
Copilot Coding Agent 이슈 처리 시작
브랜치 생성 → 코드 작성 → Draft PR 오픈
당신을 PR 리뷰어로 자동 지정
필수 GraphQL 헤더:
GraphQL-Features: issues_copilot_assignment_api_support,coding_agent_model_selection

创建/标记Issue
触发GitHub Actions (assign-to-copilot.yml)
通过GraphQL查询Copilot bot ID
调用replaceActorsForAssignable将Copilot设为经办人
Copilot Coding Agent开始处理Issue
创建分支 → 编写代码 → 打开Draft PR
自动将你设为PR审核人
必填GraphQL请求头:
GraphQL-Features: issues_copilot_assignment_api_support,coding_agent_model_selection

GitHub Actions 워크플로우

GitHub Actions 工作流

워크플로트리거목적
assign-to-copilot.yml
이슈에
ai-copilot
라벨
Copilot에 자동 할당
copilot-pr-ci.yml
PR 오픈/업데이트CI (빌드 + 테스트) 실행

工作流触发条件用途
assign-to-copilot.yml
为Issue添加
ai-copilot
标签
自动分配给Copilot
copilot-pr-ci.yml
PR创建/更新执行CI(构建 + 测试)

Copilot PR 제약 사항

Copilot PR 限制条件

Copilot은 외부 기여자처럼 취급됩니다.
  • PR은 기본적으로 Draft 상태로 생성
  • 첫 번째 Actions 실행 전 write 권한자의 수동 승인 필요
  • 승인 후
    copilot-pr-ci.yml
    CI가 정상 실행
bash
undefined
Copilot会被视为外部贡献者
  • PR默认以Draft状态创建
  • 首次执行Actions前,需要拥有写入权限的用户手动批准
  • 批准后
    copilot-pr-ci.yml
    CI将正常运行
bash
undefined

수동 승인 후 CI 확인

수동 승인 후 CI 확인

gh pr list --search 'head:copilot/' gh pr view <pr-number>

---
gh pr list --search 'head:copilot/' gh pr view <pr-number>

---

planno(plannotator) 통합 — 선택사항

planno(plannotator) 集成 — 可选

Copilot에 할당 전 이슈 스펙을 planno로 검토 (독립 스킬, 필수 아님):
text
planno로 이 이슈 스펙을 검토하고 승인해줘
승인 후
ai-copilot
라벨 부착 → Actions 트리거.

在分配给Copilot前,使用planno审核Issue规格(独立功能,非必需):
text
请用planno审核并批准该Issue的规格
批准后添加
ai-copilot
标签 → 触发Actions。

대표 사용 케이스

典型使用场景

1. 라벨 기반 Copilot 큐

1. 基于标签的Copilot任务队列

PM이 이슈 작성 → ai-copilot 라벨 부착
→ Actions 자동 할당 → Copilot Draft PR 생성
→ 팀이 PR 리뷰만 수행
产品经理创建Issue → 添加ai-copilot标签
→ Actions自动分配 → Copilot生成Draft PR
→ 团队仅需进行PR审核

2. Vibe Kanban / Conductor와 결합

2. 与Vibe Kanban / Conductor结合

Vibe Kanban으로 생성된 후속 이슈:
  리팩터링/문서 정리/테스트 추가
  → ai-copilot 라벨 → Copilot 처리
→ 팀은 메인 기능 개발에 집중
Vibe Kanban生成的后续Issue:
  重构/文档整理/添加测试
  → 添加ai-copilot标签 → 由Copilot处理
→ 团队可专注于核心功能开发

3. 외부 시스템 연동

3. 与外部系统联动

Jira 이슈 → Zapier/웹훅 → GitHub Issue 자동 생성
→ ai-copilot 라벨 → Copilot PR
→ 완전 자동화 파이프라인
Jira Issue → Zapier/ Webhook → 自动创建GitHub Issue
→ 添加ai-copilot标签 → Copilot生成PR
→ 全自动化流水线

4. 리팩터링 백로그 처리

4. 处理重构待办事项

bash
undefined
bash
undefined

백로그 이슈들에 라벨 일괄 추가

백로그 이슈들에 라벨 일괄 추가

gh issue list --label "tech-debt" --json number
| jq '.[].number'
| xargs -I{} gh issue edit {} --add-label ai-copilot

---
gh issue list --label "tech-debt" --json number
| jq '.[].number'
| xargs -I{} gh issue edit {} --add-label ai-copilot

---

결과 확인

结果查询

bash
undefined
bash
undefined

Copilot이 생성한 PR 목록

查看Copilot生成的PR列表

gh pr list --search 'head:copilot/'
gh pr list --search 'head:copilot/'

특정 이슈 상태

查看特定Issue状态

gh issue view 42
gh issue view 42

PR CI 상태

查看PR的CI状态

gh pr checks <pr-number>

---
gh pr checks <pr-number>

---

참고 레퍼런스

参考链接

Quick Reference

快速参考

=== 셋업 ===
bash scripts/copilot-setup-workflow.sh   최초 1회 설정

=== 이슈 할당 ===
gh issue create --label ai-copilot ...  새 이슈 + 자동 할당
gh issue edit <num> --add-label ai-copilot  기존 이슈
bash scripts/copilot-assign-issue.sh <num>  직접 할당

=== 결과 확인 ===
gh pr list --search 'head:copilot/'    Copilot PR 목록
gh pr view <num>                        PR 상세
gh pr checks <num>                      CI 상태

=== 제약 ===
Copilot Pro+/Business/Enterprise 필요
첫 PR은 수동 승인 필요 (외부 기여자 취급)
PAT: repo scope 필요
=== 设置 ===
bash scripts/copilot-setup-workflow.sh   首次一键设置

=== Issue分配 ===
gh issue create --label ai-copilot ...  创建新Issue并自动分配
gh issue edit <num> --add-label ai-copilot  为现有Issue分配
bash scripts/copilot-assign-issue.sh <num>  直接通过脚本分配

=== 结果查询 ===
gh pr list --search 'head:copilot/'    查看Copilot生成的PR列表
gh pr view <num>                        查看PR详情
gh pr checks <num>                      查看PR的CI状态

=== 限制条件 ===
需Copilot Pro+/Business/Enterprise方案
首个PR需手动批准(被视为外部贡献者)
PAT需拥有repo权限范围