fm-extract

Extracts shared logic from legacy Angular apps into framework-agnostic packages with tests.

1|Updated Feb 19, 2026
One-click install
npx skills add https://github.com/ohmyhotelco/hare-cc-plugins --skill fm-extract-ohmyhotelco
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: fm-extract
Source: https://github.com/ohmyhotelco/hare-cc-plugins/tree/main/frontend-migration-plugin/skills/fm-extract
Command: npx skills add https://github.com/ohmyhotelco/hare-cc-plugins --skill fm-extract-ohmyhotelco

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Migrating three divergent legacy Angular apps (PC, Mobile, Hana) means the same business logic exists in three copies. This Skill lifts that shared logic into framework-agnostic packages/shared-* modules with tests, reconciling cross-app divergence and enforcing the shared-domain secret boundary before any page-level migration begins. ## Core Features & Use Cases - TDD Package Extraction: Runs a package-extractor agent that moves candidates into packages/shared-* with test-first development, then verifies with tsc and vitest. - Contract-Authoritative Schemas: When a contractsDir is configured, shared-types and shared-data transcribe authoritative zod schemas from contract Markdown instead of reverse-engineering legacy any DTOs. - Concurrency-Safe State Management: Acquires package and tracker locks, refuses runs when dependents have in-flight flag flips, and invalidates gate evidence on every page importing a rewritten package. - Use Case: During Phase 0 of an Angular-to-React migration, extract UtilDateService and other shared candidates into shared-domain so all three apps import one tested implementation before per-page generation starts. ## Quick Start Run /frontend-migration-plugin:fm-extract shared-domain --app pc to extract the shared domain package from the legacy PC app with tests.

Frequently Asked Questions about fm-extract

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract shared logic from legacy Angular apps during a migration?▼

Run fm-extract with a candidate name or target package, optionally scoped with --app pc, mobile, or hana. It launches a package-extractor agent that moves the logic into packages/shared-* test-first, then verifies with tsc and vitest.

How do I use zod contracts as the schema source instead of legacy DTOs?▼

Set contractsDir in .claude/frontend-migration-plugin.json with responses/ and requests/ subdirectories. For shared-types and shared-data, the agent transcribes the zod schemas from the contract Markdown code fences rather than reverse-engineering legacy any DTOs.

Why does fm-extract stop and ask for fm-route --revert?▼

It stops when a dependent page has flipPrOpenedAt set, meaning a flag flip PR is in flight against the old package version. Rewriting the package would let that flip reach production untested, so you must revert the flip on each named page first.

What happens to pages that import a package after it is rewritten?▼

Their gate evidence, verified timestamps, route preparation, and cascade records are cleared, and pages at verified or passed statuses are demoted back to generated. This prevents gates from passing against package version A while version B is live.

What are the limitations of the shared-domain extraction?▼

Pieces touching payment secrets or hash builders are rejected by the secret boundary and deferred to the fm-secret-audit skill instead of being extracted. They are recorded under deferredToSecretAudit in the tracker.