/mk:xia.
Extract, compare, port, or adapt a feature from any GitHub repository or local repo path — without dragging the rest of the codebase along with it.
Four ways to borrow, one rule: never blindly.
Pick the mode that matches your intent. If intent is ambiguous, xia defaults to --compare before recommending any implementation work.
Side by side
Architectural diff and trade-off report. No plan, no code — just clarity.
Transplant
Bring the feature in with the minimum adaptation needed to compile.
Refactor in flight
Copy, then refactor for the local codebase. Replace anti-patterns on entry.
Idiomatic rewrite
Translate into the local stack's idioms. Behavior preserved, shape redrawn.
Six phases. One hard gate.
Recon, map, analyze, challenge, plan, deliver. Phase 4 must complete before Phase 5 — confront the trade-offs before you draw the plan.
Locate
Pack the source with repomix, read the README, map the local integration surface.
Dissect
Inventory components. Build a dependency matrix: EXISTS, NEW, CONFLICT.
Trace why
Walk execution paths, name implicit contracts, mark transaction boundaries.
Confront
Five questions, minimum. Source answer, local answer, risk if wrong.
Hard gateHand off
Delegate to /mk:plan with manifest, matrices, decisions, risk score.
Front door
Xia produces the analysis. Implementation handoff goes to /mk:cook.
Do not plan implementation before confronting trade-offs. xia is a front door — not a second orchestration stack.
Five questions you must answer.
Before any plan is drawn, xia produces five challenge questions and a decision matrix. Each one names a source answer, a local answer, and the risk if the assumption is wrong.
- NecessityDoes the project need this feature, or is it scope creep dressed in a pull request?
- Simpler alternativeIs there a smaller path — a flag, a config, a 30-line helper — that solves 80% of the same problem?
- Existing overlapWhat in the local codebase already solves part of this? What gets deprecated, what stays?
- Maintenance burdenWho owns this code in three months? Does the team have the context to debug it cold?
- Dependency chainWhat new packages, runtimes, or services come along for the ride? What breaks on update?
| Decision | Source | Local | Recommendation |
|---|---|---|---|
| Auth | Their auth stack | Existing auth | Prefer local |
| Persistence | Their schema | Existing schema | Adapt |
| Streaming | SSE + custom | WebSocket | Port idiom |
One line in. A plan out.
Point xia at a GitHub URL, an owner/repo, or a local path. Add a feature hint to narrow scope. Pick a mode, or let intent detection choose.
Examples # compare two queue implementations
/mk:xia bullmq/bullmq "retry strategy" --compare
# port streaming idiomatically
/mk:xia https://github.com/vercel/ai streaming --port
# skip approval gates, keep workflow
/mk:xia ../sister-repo "webhook signing" --improve --auto
"Xia is a front door, not a second orchestration stack. Keep planning and delivery where they belong."
For
Feature extraction · cross-stack porting · implementation comparison · architectural adaptation.
Not for
Full project cloning · simple file copy · package installation.