# Copilot Sdk

> Delegate to Copilot via the official Go SDK (github.com/github/copilot-sdk/go). Source ships under scripts/; first invocation builds bin/runner. Sibling of /copilot-cli (JSONL) and /copilot-acp (ACP).

- Skill: `asw101/copilot-sdk` (Agent Skill, multi-file: 7 files)
- Install (CLI): `npx skillmds@latest add asw101/copilot-sdk`
- Raw SKILL.md: https://api.skillmd.com/api/skills/asw101/copilot-sdk/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: asw101 (https://skillmd.com/u/asw101)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/asw101/copilot-sdk

---


You are the `/copilot-sdk` skill. You delegate to GitHub Copilot using the official Go SDK (`github.com/github/copilot-sdk/go`).

Why this skill exists alongside `/copilot-cli` and `/copilot-acp`:

- The SDK is the **officially supported integration surface**. It shields you from CLI flag churn.
- The SDK speaks JSON-RPC to the bundled CLI under the hood — same wire as `/copilot-acp`, but with typed events instead of raw envelopes.
- This skill is a comparison harness: run the same task through `/copilot-cli`, `/copilot-acp`, and `/copilot-sdk` to see which integration style works best for your use case.

## Source distribution

The Go source lives in `scripts/`:

```
.agents/skills/copilot-sdk/
├── SKILL.md
├── run.sh           # entrypoint
├── build.sh         # builds scripts/main.go → bin/runner
├── scripts/
│   ├── go.mod
│   └── main.go      # imports github.com/github/copilot-sdk/go
└── bin/runner       # built on first use (gitignored)
```

`bin/runner` is built on first invocation via `go build`. Subsequent runs reuse the built binary; the build is skipped when binary mtime is newer than source.

## Invocation patterns

| User input | What to do |
|---|---|
| `/copilot-sdk --bootstrap` | Run shared copilot bootstrap + build the Go runner. |
| `/copilot-sdk <task>` | Sync SDK run. |
| `/copilot-sdk --model claude-opus-5 <task>` | Override model. |
| `/copilot-sdk-check <run-id>` | Use shared check.sh (same as `/copilot-cli-check`). |
| `/copilot-sdk-cancel <run-id>` | Use shared cancel.sh. |

## On every invocation

1. **Bootstrap.** `bash .agents/skills/copilot-sdk/run.sh --bootstrap` — runs the shared copilot installer/auth check, then builds the Go runner.
2. **Sync.** `bash .agents/skills/copilot-sdk/run.sh [--model X] "<task>"`. If the binary isn't built yet, run.sh auto-builds.
3. **Check / cancel.** Use `bash .agents/skills/copilot-cli/check.sh` and `cancel.sh` — the shared run-files protocol means they work uniformly.

## Run files

Identical layout to the sibling skills, run-id prefixed with `-sdk-`:

- `.jsonl` — raw event dump from SDK callbacks (the SDK abstracts away the wire, so the JSONL is best-effort serialization of typed event payloads).
- `.md` — rendered transcript.
- `.session` — Copilot session id.
- `.status`, `.task` — shared protocol.

## Defaults

- **Model**: `gpt-5.6-sol` (override with `--model` or `COPILOT_MODEL`; `claude-opus-5` remains fully supported).
- **Permission handler**: `PermissionHandler.ApproveAll` (auto-approves tool requests). Swap this in `scripts/main.go` if you want manual control.
- **Reasoning effort**: `high` (env: `COPILOT_REASONING_EFFORT`, flag: `--effort`). Passed through `SessionConfig.ReasoningEffort`, which documents `low/medium/high/xhigh/max`.
- **Context tier**: `long_context` (1M) via `SessionConfig.ContextTier` (env: `COPILOT_CONTEXT_TIER`, flag: `--context`).
- **Timeout**: 1 hour wall-clock cap on `SessionIdle` (env: `COPILOT_TIMEOUT_S`, flag: `--timeout`; set `0` to disable).

## Status: public preview

The `copilot-sdk` is GitHub's official public preview as of this writing. Expect API churn. The skill builds from source, so when the SDK updates we'll catch breakage at build time, not runtime.

