fo-spec-sync
Import a planning-spec attachment (Jira zip or extracted folder) into specs/<screen>/ as an immutable snapshot, update specs/MANIFEST.md (ticket, version, status, sha256, content hash, date), and report which screens now have a plan older than their spec. Use when the planning team delivers a new or updated spec.
- License 许可
- MIT
- 最近更新
- 2026-11-13
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- fo-spec-sync
- description
- Import a planning-spec attachment (Jira zip or extracted folder) into specs/<screen>/ as an immutable snapshot, update specs/MANIFEST.md (ticket, version, status, sha256, content hash, date), and report which screens now have a plan older than their spec. Use when the planning team delivers a new or updated spec.
- allowed-tools
- Read, Write, Edit, Glob, Grep, Bash
- argument-hint
- <screen> <zip-or-dir> --ticket <OMH-nnn> [--app <name>] [--extra <path>]... [--note "..."]
- user-invocable
- true
03 SKILL.md 正文
fo-spec-sync — bring a spec snapshot into the repo
The planning team's attachments are the functional source of truth for a screen. This command places
one of them under specs/<screen>/ exactly as delivered, records it in the ledger, and tells you which
plans are now stale. It never edits a spec and never merges two versions — a new version replaces the
folder, and git history keeps the old one.
Conventions: ${CLAUDE_PLUGIN_ROOT}/skills/fo-shared/SKILL.md.
Step 1 — Arguments and preconditions
<screen>— the screen id used across the repo (01-main-page,02a-admin-hotel-recommendation, …); a directory underscreensDirwhen the code exists, otherwise a new id (the spec arrives before the code).--appselects the app (the only one when there is one) — itsanswerKeys.spec.diris the specs folder and itsprogress.jsonrecords stale plans.<zip-or-dir>— the attachment as downloaded from Jira (*-spec_v<ver>_<yyyymmdd>.zip) or an extracted folder withko/ en/ vi/at its top.--ticket— the Jira issue the attachment came from. Required: the ledger is only useful if a row can be traced back to the comment it was taken from. Ask for it when it is missing.--extra— a second attachment to place inside the snapshot (a prototype delivered separately).--note— free text for the ledger row (e.g. "afternoon re-upload; FR-012 modal rules").
Read .claude/frontend-ohmyhotel-plugin.json; stop with the fo-init hint if it is missing. Confirm
specs/MANIFEST.md exists (fo-init creates it).
Step 2 — Dry run and show the delta
Run the importer once with --dry-run:
fo-spec-import --screen <screen> --from <path> --ticket <ticket> --specs-dir <answerKeys.spec.dir> [--extra ...] [--note "..."] --dry-run --stage-dir .claude/frontend-ohmyhotel/stage/<screen>
It prints a JSON object: header metadata read from the spec (status, version, lastUpdated —
a version embedded in the status line is split out; attachments that wrap ko/ en/ vi/ in one folder
are hoisted; a package-level version that only appears in the zip name goes into --note), the
attachment sha256, the markdown contentHash, previousContentHash for the current snapshot, and
changed. Show the user the prospective ledger row and, when a previous snapshot exists:
changed: false→ say the content is identical (only the attachment or its name differs); still record the row if the ticket or file name is new, otherwise stop here.changed: true→ list what differs at file level (diff -rq <stage-dir> specs/<screen>— the staged tree is kept at--stage-dir, already normalised and hoisted), and run a quick comparison of theko/*-spec_ko.mdheaders and section headings so the user sees whether this is a re-upload or a real revision. Do not attempt a semantic diff of requirements here; that isfo-plan's delta step.
A status other than FINALIZED (e.g. DRAFT) is imported like any other but flagged in the report:
plans built on a draft are expected to change.
Step 3 — Import
Run the same command without --dry-run. The importer replaces specs/<screen>/ wholesale and
rewrites the screen's row in specs/MANIFEST.md (rows sorted by screen id).
Then stage the result for the user to commit — do not commit on their behalf:
git add specs/<screen> specs/MANIFEST.md
Step 4 — Stale plans
For the screen just imported, read <screensDir>/<screen>/implementation-plan.json if it exists and
compare its spec.contentHash (the 12-hex prefix the manifest records) with the first 12 characters
of the new contentHash. Different → the plan is stale:
fo-progress-set --app <app> --screen <screen> --set specStale --json 'true' --set specStaleHashes --json '{"plan":"…","spec":"…"}',
so fo-progress shows it and fo-plan knows to produce a delta instead of a fresh plan.
Also check every other screen in the manifest the same way (cheap: hashes only) so a backlog of un-synced specs surfaces here rather than at gate time.
Step 5 — Report
In the user's language: the ledger row as written, whether content changed, draft/final status, the
list of stale plans, the suggested commit message
(specs: <screen> v<version> (<ticket>) — <note>), and the next command:
- plan exists and is stale →
/frontend-ohmyhotel-plugin:fo-plan --app <app> --screen <screen>(delta) - no plan yet → the same command (fresh plan)
- content unchanged → nothing to do
Tagging the snapshot set (specs/<date>) at the start of a screen group is the team's release
convention, not this command's job; mention the tag command when the user asks.
Done when the snapshot and the manifest are written and staged, progress.json records stale flags,
and the report names the next command.
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.