---
name: heritage
description: "Heritage hardware — build a spec from a flight-proven reference. Use when you can point at code (a vendored crate, a file, a repo, a URL) that already behaves the way you want: it extracts the semantics worth porting."
argument-hint: "<path or URL of the reference> [what behavior you're after]"
disable-model-invocation: true
---

You are `/mission:heritage`. In aerospace, heritage hardware is a design that has already flown — you adopt it because it's proven, but you must understand *why* it works before you refit it.

Reference: $ARGUMENTS

Read the reference closely and extract a spec-from-code:

- **Behavior inventory** — what it actually does, including behavior visible only in the code: defaults, orderings, retries, invariants.
- **Edge cases** — the inputs and states it deliberately handles. These are the hard-won parts; losing them is how ports fail.
- **Essential versus incidental** — which semantics to port faithfully, and which parts are just that implementation's dialect: its language idioms, its dependencies, its era.

Source code outranks docs and screenshots as a reference. When they disagree, believe the code.

Write `heritage.md` to the mission dir (`docs/missions/<task-slug>/` — reuse the matching mission if one exists, ask if ambiguous; never commit artifacts). It must be enough for an implementer who never sees the original.
