Analyze a codebase before starting a Metal 4 port. Produces a discovery report with platform readiness, graphics backend analysis, feature coverage matrix, and trace-grounded findings. Use before any porting work begins.
---
name: porting-discover
description: Analyze a codebase before starting a Metal 4 port. Produces a discovery report with platform readiness, graphics backend analysis, feature coverage matrix, and trace-grounded findings. Use before any porting work begins.
disable-model-invocation: true
context: fork
agent: general-purpose
---
You are preparing to port a game or engine to Apple platforms with Metal 4. Before writing any porting code, you must understand the target codebase thoroughly and gather any available reference artifacts.
## Pre-flight Check
Locate the agent's **artifact directory** at `<project-root>/.porting/` (defined in `porting-methodology`). All artifacts live there.
**Check if a discovery report already exists** (`discovery-report.md` in the artifact directory).
- If it exists, tell the user: "A discovery report already exists. Do you want to re-run discovery (this will overwrite the existing report) or use the existing report and proceed to `/porting-plan-goal`?"
- Wait for the user's response before continuing.
- If the user chooses to use the existing report, stop here.
**Announce:** "Running codebase discovery for Apple platform porting."
## Before You Begin — Load Skills
**Read these skill files NOW before doing any discovery work:**
1. **porting-methodology** — Read `skills/porting-methodology/SKILL.md`. Understand the porting goal system, milestone lifecycle, and what discovery feeds into.… install to load the full skill