fo-analyze
Analyze the V2 implementation(s) of a screen that the spec reuses — prepare a checkout of the monorepo (at the frozen commit, or at the head of the baseline branch under delta tracking), start legacy-analyzer on the PC and mobile route bodies, and write <screenDir>/analysis.json with permalinked behaviors, API calls, failure paths and PC/mobile differences. Re-run on a drifted screen to update the analysis and list what changed. Use before fo-plan on reused screens.
- License 许可
- MIT
- 最近更新
- 2026-11-13
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- fo-analyze
- description
- Analyze the V2 implementation(s) of a screen that the spec reuses — prepare a checkout of the monorepo (at the frozen commit, or at the head of the baseline branch under delta tracking), start legacy-analyzer on the PC and mobile route bodies, and write <screenDir>/analysis.json with permalinked behaviors, API calls, failure paths and PC/mobile differences. Re-run on a drifted screen to update the analysis and list what changed. Use before fo-plan on reused screens.
- allowed-tools
- Read, Write, Glob, Grep, Bash, Agent
- argument-hint
- --app <name> --screen <id> [--target <archive path>]... [--at <commit>]
- user-invocable
- true
03 SKILL.md 正文
fo-analyze — read the V2 answer key
Reused screens are rebuilt (view from Figma, logic from V2 hooks — decision 8). The V2 code is not
in this repo (D9: no archive/), so this command reads it from the monorepo and leaves permalinks.
One legacy-analyzer agent per run.
Conventions: ${CLAUDE_PLUGIN_ROOT}/skills/fo-shared/SKILL.md.
Step 0 — Preconditions and the commit to read
Config with apps[].answerKeys.legacySource (archiveRepo, apps[], optional localPath — a local
clone of the monorepo — and tracking, "frozen" when absent). Spec snapshot present for the screen.
Lock analyze.lock.
tracking: "frozen"—commit=frozenCommit.TBD→ the freeze has not happened, and analysis against a moving tree is not an answer key in this mode. Say so and stop.tracking: "delta"— the monorepo keeps moving and every screen records the commit it was read at.commit=--at <sha>when given, otherwise the head oforigin/<baselineBranch>(defaultmaster) after a fetch.
analysisFile = <screenDir>/analysis.json. Mode:
fullwhen it is absent, under frozen tracking, or a v0.1 file (frozenCommit, nocommit).updateunder delta tracking when it records an oldercommit. ThenfromCommit= that commit, andpreviousAnalysis= the existing file. A plan whoselegacy.commitis notfromCommithas not taken in the previous analysis yet: say so, release the lock, and point atfo-plan.- When it already records
commit, there is nothing to do. Say so, release the lock, and point atfo-plan.
Step 1 — Archive checkout
Reuse .claude/frontend-ohmyhotel/archive/ when it is a worktree at commit (git -C … rev-parse HEAD).
Otherwise, create it or move it:
- With
localPath:git -C <localPath> fetch -q, thengit -C <localPath> worktree add --detach <repo>/.claude/frontend-ohmyhotel/archive <commit>. When the worktree already exists, usegit -C <archive> checkout -q --detach <commit>instead. - Without
localPath:git clone --filter=blob:none -q https://github.com/<archiveRepo> …, thengit checkout -q <commit>.
In update mode fromCommit must also be present in that repository, because the agent diffs the two.
The directory is ignored (.claude/frontend-ohmyhotel/ is in .gitignore).
Step 2 — Targets
From the spec snapshot (the screen's "As-Is" or reuse statements) and the archive's route tables, list
the V2 files for this screen in each legacy app: the route module, its page body, the hooks it calls,
the services behind them (including the packages/shared-* files they import). Paths are
repo-relative (apps/web-pc/app/routes/…). --target overrides. In update mode, start from
previousAnalysis.targets and add any file the diff shows the screen now depends on. Show the list
before starting the agent.
Step 3 — Run and wait
Start one Agent with subagent_type: frontend-ohmyhotel-plugin:legacy-analyzer and its inputs:
mode, app, screen, config, archiveDir, archiveRepo, commit, targets, specDir,
outPath: <screenDir>/analysis.json, and in update mode previousAnalysis and fromCommit. Wait for
the completion notification.
Step 4 — Record, report, next
Record in the tracker:
fo-progress-set --app <app> --screen <screen> --set analysis --json '{"recordedAt":…,"commit":…,"tracking":…,"targets":[…],"counts":{…}}'
Under delta tracking add --unset legacyStale in a second call (the script applies --set before
--unset). Release the lock.
Report:
- the counts per section
- the PC/mobile differences (these become plan decisions)
- shared-package candidates (→
fo-extract) - open questions (→ the planning team or an ADR)
- in update mode,
legacyChanges[], grouped add / modify / remove
Suggest the commit: analysis(<screen>): V2 behaviors at <commit[:7]>, or in update mode
analysis(<screen>): V2 delta <fromCommit[:7]>..<commit[:7]>. Then name the next command:
- shared candidates not yet in a package →
/frontend-ohmyhotel-plugin:fo-extract --app <app> --screen <screen> - otherwise →
/frontend-ohmyhotel-plugin:fo-plan --app <app> --screen <screen>. When a plan exists, itslegacy.commitnow lags the analysis, sofo-planruns in delta mode. WhenlegacyChangesis empty,fo-planonly advances the plan's commit.
Done when analysis.json is written, the tracker is updated, the lock is released and the next
command is named.
04 同仓库更多 Skills
hp-shared
Shared conventions for every homepage-plugin agent and skill — stack, code conventions, state-file writes, check commands and how to report them. Preloaded into agents through their `skills:` frontmatter; not meant to be invoked by hand.
fe-shared
Shared conventions for every frontend-react-plugin agent and skill — code conventions, state files and locks, accepted deviations, design principles, build working directory, router-mode command matrix, TypeScript check. Preloaded into agents through their `skills:` frontmatter; not meant to be invoked by hand.
be-spring-shared
Shared conventions for every backend-springboot-plugin agent and skill — tech stack, CQRS architecture, naming, coding standards, TDD, commit and build rules, state files. Preloaded into agents through their `skills:` frontmatter; not meant to be invoked by hand.
pp-translate
Use after directly editing the working language spec to sync changes to other supported languages.
pp-sync-stitch
Use when wireframes were manually edited on the Stitch website and need to be re-fetched to the local project.
pp-sync-notion
Use when a specification needs to be published or re-synced to Notion after finalization or manual edits.