Copilot Cloud Agent — Default Parallel Strategy
Why cloud-first
Git-worktree parallel workers are powerful but pay a heavy local cost: compute, disk, cognitive overhead, and correlation of state between branches. GitHub Copilot Cloud Agent inverts this tradeoff — issues are dispatched to GitHub's infrastructure, each one opens a PR, and the loop closes via PR review. The machine coordinating the work does no heavy lifting.
This skill is the default path for Phase 6 implementation work. Local parallel-workers is reserved for tasks that genuinely need local environment access.
Contract
Inputs
spec_slug— the feature slug under.specify/specs/<slug>/tasks_filter(optional) — only dispatch tasks with specific IDs orparallelization_hint: copilot_cloud_agent
Outputs
.project/issue-mapping.yml— TASK-NNN → issue number + PR number- Issues on the repo, assigned to
@copilot, labeledsdlc:phase-6,type:task,complexity:<level> - PRs authored by Copilot, each targeting the current feature branch
- Loki logs with the metrics listed above
Invariants
- No task dispatched without a context bundle. Each TASK-NNN has a
.specify/specs/<slug>/tasks/TASK-NNN-*.md(story-context document). The issue body IS that document — verbatim. Paraphrasing breaks Principle IX. - No PR merged automatically. Human review +
code-revieweragent review are both required. Auto-merge is opt-in per repo policy. - No task dispatched with
parallelization_hint: human_only. Those bypass this skill entirely and go through GitHub project board. - No secrets in task bodies or comments. The dispatcher scans for
patterns matching
*_KEY|*_SECRET|*_TOKEN|*_PASSWORDand blocks.
Phase 6 workflow with this skill
delivery-planner (/tasks)
→ produces .specify/specs/<slug>/tasks/TASK-NNN-*.md
→ produces .specify/specs/<slug>/strategy.yml
/phase-6-start
→ copilot-cloud-agent.dispatcher.py
→ for each TASK with parallelization_hint == copilot_cloud_agent:
create issue with TASK-NNN-*.md as body
assign @copilot
record in .project/issue-mapping.yml
→ parallel-workers handles parallelization_hint == local_worker (fallback)
→ human_only tasks routed to GitHub project board
copilot (GitHub Cloud)
→ opens draft PR on branch copilot/<issue-number>-<slug>
→ runs CI
copilot-cloud-agent.status_tracker.py (periodic)
→ polls get_copilot_job_status
→ watches PR CI signals
copilot-cloud-agent.review_relay.py (on PR ready)
→ invokes code-reviewer agent on the PR diff
→ invokes security-scanner (SAST/SCA)
→ if issues found: @copilot is replied with structured feedback
→ if clean: request human review (gate: Principle VII)
human + code-reviewer approval
→ PR merges into feature branch
→ issue closes
→ .project/issue-mapping.yml updated
phase-6-to-7 gate
→ gate-evaluator checks all issues closed, all PRs merged
→ proceeds to Phase 7 (Quality)
Issue body template
Issues created by this skill carry a disciplined shape so Copilot has the context it needs.
<!-- Generated by copilot-cloud-agent — do not edit the header -->
## Task
<one-sentence imperative>
## Acceptance criteria
<verbatim from story-context.md>
## Context bundle
<verbatim Files, ADRs, Patterns, Anti-patterns, Data, Security sections>
## Test plan
<verbatim from story-context.md>
## Out of scope
<verbatim>
## Definition of done
<verbatim>
---
**spec**: `.specify/specs/<slug>/spec.md`
**plan**: `.specify/specs/<slug>/plan.md`
**task**: `.specify/specs/<slug>/tasks/TASK-NNN-*.md`
**constitution**: v1.0.0 — Principles II, III, IV, VII apply
Review relay protocol
When Copilot opens a PR, this skill runs review_relay.py which:
- Fetches the PR diff via
pull_request_read. - Invokes
code-reviewer(local agent) with the diff + the TASK context. - Invokes
security-scanner(SAST + SCA). - Aggregates findings by severity:
- CRITICAL / HIGH → post structured comment via
add_comment_to_pending_review, tag@copilotin the body so the cloud agent sees it and retries. - MEDIUM → post as review comment, do not tag.
- LOW → post as threaded comment.
- CRITICAL / HIGH → post structured comment via
- If CRITICAL/HIGH, the PR is NOT marked ready for human review. Copilot
retries. A retry counter is incremented in
issue-mapping.yml. - Cap at 3 automated retries. On the 4th rejection, escalate to human and unassign Copilot.
Metrics promoted to SLOs
| Metric | SLO |
|---|---|
tasks_dispatched daily |
budget-bound (see ADR-XXX) |
wallclock_minutes_per_task |
P95 < 90 min |
agent_retry_count per task |
P95 <= 1 |
tasks_rejected_by_review |
< 20% of dispatched |
review_round_count per task |
P95 <= 2 |
Burn rate alerts fire via observability-engineer Grafana dashboard.
Pre-flight checks (dispatcher)
Before any issue is created, the dispatcher verifies:
gh auth statussucceeds- Target repo has Copilot coding agent enabled:
gh api repos/OWNER/REPO --jq '.allow_copilot_coding_agent'→ true - The feature branch exists on origin
.specify/specs/<slug>/strategy.ymldesignatescopilot_cloud_agentas primary for these tasks- Each TASK-NNN file passes secret scan
- Daily dispatch quota not exceeded (budget-bound)
A failure in any of these blocks dispatch with a specific remediation.
When NOT to use this skill
- Task requires local-only credentials or infra access
→ use
parallel-workers(worktrees) - Task is Level 0 (bug fix, typo) → use
/quick-fixdirectly - Task is exploratory / spike / research → assign to human
- Task touches the Constitution or a framework meta-file → human only
Failure handling (resilience hooks)
The dispatcher wraps every MCP call with the resilience layer
(.claude/lib/python/resilience.py):
- 3 retries with exponential backoff on 5xx
- 15s timeout per call
- Circuit-breaker opens at 50% error rate across 10 calls
- On open circuit: pause dispatch, alert, fall back to parallel-workers
References
- GitHub Copilot coding agent: https://docs.github.com/en/copilot/how-tos/use-copilot-agents/cloud-agent
- Existing command:
.claude/commands/sdlc-create-issues.md - Companion script:
.claude/skills/copilot-cloud-agent/scripts/dispatcher.py - Constitution:
.specify/memory/constitution.md(Principle X) - ADR to be authored: "Copilot Cloud Agent as default Phase 6 strategy"