endorphin-ai/hasbrains-agent-kit / agent-engineering/skills/convert-to-copilot
convert-to-copilot
VerifiedThis skill should be used when converting a Claude Code agent (+ its launch command + its skills) into a single GitHub Copilot agent (.github/agents/*.agent.md) with supporting context files under .copilot_utils/{agent_name}/. Load when someone says 'convert to copilot', 'make copilot agent', 'copilot version of this agent', 'port this agent to copilot', or when /convert-to-copilot is invoked with an agent file path.
| File | Kind | Size |
|---|---|---|
| README.md | markdown | 1.9 KB |
| SKILL.md | skill md | 11.3 KB |
| assets/copilot-agent-template.md | markdown | 1.6 KB |
| examples/pr-reviewer.md | markdown | 5.2 KB |
| references/advanced-patterns.md | markdown | 3.6 KB |
| references/advanced-subagents.md | markdown | 4.0 KB |
| references/conversion-body.md | markdown | 4.4 KB |
| references/conversion-output.md | markdown | 3.1 KB |
| references/conversion-phases.md | markdown | 4.6 KB |
| references/tool-mapping.md | markdown | 6.1 KB |
| scripts/claude-to-copilot.sh | script | 4.6 KB |
| scripts/convert-agents.sh | script | 1.3 KB |
| scripts/copilot-to-claude.sh | script | 5.6 KB |
| scripts/lib-extract.sh | script | 1.8 KB |
references/advanced-patterns.md
View on GitHub# 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
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |