Skip to content

endorphin-ai/hasbrains-agent-kit / agent-engineering/skills/convert-to-copilot

convert-to-copilot

Verified

This 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.

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
```
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: 471kUpdated Claude CodeCodexVerifiedInstall
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: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
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 availableStars: 322kUpdated Claude CodeCodexVerifiedInstall