Back to Brain Lab Skill · Convert to Copilot · convert-to-copilot/
Skill Claude

Convert to Copilot

convert-to-copilot/

4 views 0 downloads

Port a Claude Code agent, with its command and skills, to one GitHub Copilot agent. Maps tools, models and sub-agent calls, validates the result and ships scripts for both directions.

Convert to Copilot: Brain Lab skill for Claude Code

Port a Claude Code agent, with its command and skills, to one GitHub Copilot agent that works the same way.

Why use it

  • Your team uses both Claude Code and GitHub Copilot, and every agent has to be written twice.
  • Copilot has no skills or commands: a straight copy loses the knowledge and the triggers the agent depends on.
  • Hand-ported agents drift, wrong tool aliases (fetch instead of web), dead file paths, task tracking that fails silently.

What it does

  • Merges the agent + its launch command into one .github/agents/{name}.agent.md, with the command's trigger phrases in the description.
  • Splits every skill into .copilot_utils/{name}/context/ (what to use) and trees/ (how to decide), and rewrites each skill reference to a file path.
  • Maps tools, models and frontmatter: WebFetch → web, TaskCreate → manage_todo_list, opus → Claude Opus 4.5, drops color / memory / isolation / skills / allowed-tools.
  • Converts sub-agent calls to handoffs (VS Code) or runSubagent() (GitHub Copilot).
  • Validates the result, every referenced path exists, aliases are correct, body under 30,000 characters, and prints a conversion report.
  • Ships scaffold scripts for both directions (claude-to-copilot, copilot-to-claude) and a full worked example.

Benefits

  • Write the agent once. Claude Code stays the source; Copilot gets a faithful port.
  • No lost knowledge. Skills become referenced context files, not a pasted wall of text.
  • Correct on the first run. The tool and model tables catch the aliases that break Copilot agents.
  • Reviewable. Each phase writes its output to .copilot-convert-results/, so you can see every decision.

Install

Download this skill and copy the convert-to-copilot folder to .claude/skills/convert-to-copilot/ in your project, or to ~/.claude/skills/convert-to-copilot/ to use it in every project. Claude Code finds it on its own; you can also call it with /convert-to-copilot.

Part of the Agent Engineering bundle. To get the whole set as a Claude Code plugin: /plugin marketplace add endorphin-ai/hasbrains-agent-kit, then /plugin install agent-engineering@hasbrains-agent-kit.

Source: endorphin-ai/hasbrains-agent-kit. License: MIT.

Files (17)

Files

advanced-patterns.md
# Advanced Copilot Agent Patterns

See also: `advanced-subagents.md` — handoffs, runSubagent, parallel, return format

---

## Reference Syntax in Agent Body

The agent body NEVER embeds knowledge or decision logic inline — it references files.

| When to use          | Syntax                                                    | Example                 |
| -------------------- | --------------------------------------------------------- | ----------------------- |
| Making a decision    | `**Apply tree:** .copilot_utils/{agent}/trees/{file}.md`  | Choosing project path   |
| Using reference info | `**Reference:** .copilot_utils/{agent}/context/{file}.md` | Anti-patterns, patterns |

### Single reference

```markdown
**Apply tree:** `.copilot_utils/{agent_name}/trees/project-selection.md`
```

### Multiple references

```markdown
**Reference:**

- `.copilot_utils/{agent_name}/context/anti-patterns.md`
- `.copilot_utils/{agent_name}/context/setup-patterns.md`
```

### Conditional reference mapping

```markdown
**Reference mapping:**

inputType → Knowledge File:
├─ type_a → .copilot_utils/{agent_name}/context/guide-a.md
└─ type_b → .copilot_utils/{agent_name}/context/guide-b.md
```

---

## Decision Tree File Format

Decision trees live in `.copilot_utils/{agent_name}/trees/`. Use this syntax:

```markdown
## Decision Tree Name

Input condition:
├─ "pattern-a", "keyword-a"
│ → result_a/
├─ "pattern-b", "keyword-b"
│ → result_b/
└─ Unknown
→ Use semantic_search() to determine

**Output:** `VARIABLE_NAME`
```

### With knowledge mapping

```markdown
## Selection Decision Tree

Input contains:
├─ "keyword_a" → path/option_a/
└─ Unknown → Use default or ask user

**Knowledge mapping:**
option_a → .copilot_utils/{agent_name}/context/guide-a.md
```

---

## Dynamic Parameters Section

Add at top of agent body, after Role:

```markdown
## Dynamic Parameters

- **VARIABLE_NAME**: Description
    - **Type:** string | boolean | list
    - **Pattern:** `regex or format hint`
    - **Example:** `example/value.ext`
    - **Required:** Yes | No
    - **Constraints:** Must exist on filesystem / must match pattern X
```

### Variable Extraction Strategy (follows Dynamic Parameters)

```markdown
## Variable Extraction Strategy

Extract variables from user input using these patterns:

1. **VARIABLE_NAME**: Look for [description]
2. **OTHER_VAR**: If user says "move to integration", infer integration path

**Error Handling:**

- If file doesn't exist: "Error: Source file not found at ${SOURCE_FILE}"
```

---

## Variable Flow Between Phases

For agents with 3+ phases and data flowing between them:

```markdown
| Phase   | Input Variables          | Output Variables              |
| ------- | ------------------------ | ----------------------------- |
| PHASE 1 | `sourceFile` (from user) | `targetFile`, `sessionId`     |
| PHASE 2 | `targetFile`             | `testCategory`, `needsFix`    |
| PHASE 3 | `targetFile`, `category` | `finalFilePath`, `testPassed` |
```

Variable syntax in prompts: `${variableName}` (camelCase).

---

## Execution Strategy with Flow Diagram

For agents with conditional branching or retry loops:

```markdown
## Execution Strategy

**Type:** Sequential with conditional branching

**Flow:**

PHASE 1: Initial action
↓
PHASE 2: Classification
↓
├─ Condition A? ──────────────► PHASE 4: Direct path
│
├─ Condition B? ──────────────► PHASE 3: Transform
│ ↓
│ PHASE 4: Continue
└─ Condition C? ──────────────► PHASE 3: Alternative
```