fo-gen
Generate one screen from its approved implementation plan through the fo-gen-run workflow (foundation → api-tdd → component-tdd → page-tdd → integration, TDD with recorded evidence), resume a stopped run, or apply a delta plan to an existing screen. Use after fo-plan is approved; follow with fo-verify.
- License 许可
- MIT
- 最近更新
- 2026-11-13
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- fo-gen
- description
- Generate one screen from its approved implementation plan through the fo-gen-run workflow (foundation → api-tdd → component-tdd → page-tdd → integration, TDD with recorded evidence), resume a stopped run, or apply a delta plan to an existing screen. Use after fo-plan is approved; follow with fo-verify.
- allowed-tools
- Read, Write, Edit, Glob, Grep, Bash, Workflow, Agent
- argument-hint
- --app <name> --screen <id> [--resume] [--delta] [--from <stage>]
- user-invocable
- true
03 SKILL.md 正文
fo-gen — generate a screen
The workflow frontend-ohmyhotel-plugin:fo-gen-run runs the five stages in order and stops at the first
failure; this skill owns everything around it: preconditions, the lock, the state file, the stage
list, the report and the tracker. --delta applies a delta plan with one agent instead.
Conventions: ${CLAUDE_PLUGIN_ROOT}/skills/fo-shared/SKILL.md.
Step 0 — Config, arguments, plan
Read the config (missing → fo-init), resolve --app/--screen, derive screenDir, planFile,
stateFile (.claude/frontend-ohmyhotel/<app>/<screen>/generation-state.json), specDir.
Read the plan and <gates.evidenceDir>/<app>/progress.json:
- no plan →
fo-planfirst - plan not approved (
progress.jsonplan.approvedfalse) → stop; generation builds on an approved plan, otherwise the approval step means nothing - without
--delta:plan.spec.contentHash≠ the manifest row's 12-hex content hash → the spec moved since planning; point atfo-plan(delta) and stop. Under delta legacy tracking, likewise when the plan'slegacy.commit≠ the commit in<screenDir>/analysis.json— the V2 answer key moved since planning - with
--delta: the plan is expected to lag the spec. Check instead thatdelta-plan.jsonspec.fromContentHashmatches the plan'sspec.contentHashandspec.toContentHashmatches the manifest row (12-hex prefixes); when the delta carrieslegacy, itsfromCommitmust equal the plan'slegacy.commitand itstoCommitthe analysis commit; a mismatch means the delta was planned against a different pair →fo-planagain openApprovals[]withstatus: pending→ list them; continue (they block nothing here) and carry them into the report so they are not forgottensourceHashStatusnotcomputed→ warn: a later delta cannot compare those entries
--delta requires <screenDir>/delta-plan.json; --resume requires an existing stateFile;
--from <stage> names the stage to restart at (defaults to the first stage not done).
Step 1 — Harness preflight
Once per app, before the first generation, check the repo can run what the stages run; report what is missing and stop if anything on the first line is absent:
node_modulespresent,npx vitest --version,npx tsc --version,npx react-router --versionnpx playwright --versionand browsers (fo-e2eneeds them later; report only)- the design-system package installed (
node_modules/<designSystem.package>) — absent → stop: the component stage would guess every import <appDir>/root.tsxpresent — absent → stop: the app shell is Phase 0 work, not a screen's
Step 2 — Lock and state
Take .claude/frontend-ohmyhotel/<app>/<screen>/gen.lock. Create or read stateFile:
{ "app": "www", "screen": "01-main-page", "planVersion": 1, "startedAt": "…",
"phases": { "foundation": { "status": "pending" }, "api-tdd": { "status": "pending" },
"component-tdd": { "status": "pending" }, "page-tdd": { "status": "pending" },
"integration": { "status": "pending" } } }
Build stages[] from plan.buildOrder: enabled = the stage has files (or test files); on
--resume set resumeFrom to the first stage whose status is not done (or --from). A done
stage is trusted on resume — the documented path to --resume is "fix the cause, then resume", so
the screen hash will have moved and must not be the reason to redo finished stages. The hash recorded
per stage is informational (fo-progress shows it); fo-verify is the check that the whole screen
still holds together after the fix.
Step 3 — Run
Call the Workflow tool with name: "frontend-ohmyhotel-plugin:fo-gen-run" and
args: { app, screen, planFile, stateFile, specDir, config, stages, resumeFrom, effort? } (effort
is optional per-stage overrides { foundation, tdd, integration }; omit to inherit the session effort). Tell the user which
stages will run and that the result arrives as a task notification; then wait for it. Do not end the
turn after announcing the run, do not poll, do not start agents of your own while it runs.
--delta instead starts one Agent with subagent_type: frontend-ohmyhotel-plugin:delta-modifier
and the inputs its file lists, and waits for its completion notification the same way.
Step 4 — After the run
From the workflow result (ok, stoppedAt, stages[]) and stateFile:
- record
treeHash(fo-screen-hash --app <app> --screen <screen>) on every stage that finisheddonein this run - on
--deltasuccess:fo-plan-hash --plan <planFile> --spec-dir <specDir> --write(the tracker'sdeltakey is removed in the next bullet) - record in the tracker:
fo-progress-set --app <app> --screen <screen> --set gen --json '{"status":"done|partial","stoppedAt":…,"resumeFrom":…,"planVersion":…,"finishedAt":…}'—partialwhenever the run stopped before integration, whatever stage it stopped at (fo-progressthen offers--resume); on--deltasuccess also--unset delta - fill block 5 of
<Screen>.spec.mdwith the evidence paths that now exist (the gate rows stay—untilfo-verifyand the later gates run)
Release the lock.
Step 5 — Report and next
In the user's language: a stage table (status, files written, runs recorded, mutation checks), the
first failure with its evidence when there is one, pending approvals carried from the plan, the
machine-translated i18n review file when integration wrote one, and the suggested commit
(feat(<screen>): generate from plan v<n> — the user commits). Next command:
- all stages done →
/frontend-ohmyhotel-plugin:fo-verify --app <app> --screen <screen> - stopped at a stage → fix the cause (the evidence names it) and
/frontend-ohmyhotel-plugin:fo-gen … --resume - a stage failed inside a file another stage owns →
/frontend-ohmyhotel-plugin:fo-fixonce review exists, or--resume --from <that stage>after a manual fix
Done when the workflow (or the delta agent) has returned, the state, tracker and spec block are updated, the lock is released and the next command is named. A run that stopped at a stage is reported as stopped, with the stage and its evidence, not as done.
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.