hp-review
Run 3-stage code review (SEO + quality + visual fidelity) on generated homepage code.
- License 许可
- MIT
- 最近更新
- 2026-11-13
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- hp-review
- description
- Run 3-stage code review (SEO + quality + visual fidelity) on generated homepage code.
- allowed-tools
- Read, Write, Edit, Glob, Grep, Bash, Workflow
- argument-hint
- [page-name]
- user-invocable
- true
03 SKILL.md 正文
Code Review Skill (3-Stage)
The homepage-plugin:hp-review-run workflow runs the reviewers in stages (SEO, then quality when SEO passes, then visual fidelity when both pass) and computes every score, verdict and page status. This skill owns what surrounds it: preconditions, locks, the report file, the progress file and the summary.
Conventions: ${CLAUDE_PLUGIN_ROOT}/skills/hp-shared/SKILL.md.
Instructions
Step 0: Read Configuration
Read .claude/homepage-plugin.json. If not found, exit with instruction to run /homepage-plugin:hp-init.
Read defaultLocale — all user-facing output in this language.
Check if docs/design-system/component-map.json exists. If it does, read it and check if any section has a non-empty sectionNodeId field OR a non-empty screenshotRef field that points to an existing file under docs/design-system/. Set hasVisualRefs = true if at least one valid reference exists.
Also read .claude/homepage-plugin.json for figmaFileKey. Read the Figma MCP tool prefix by checking which tools are available (mcp__figma__*, mcp__figma_desktop__*, or mcp__Figma__*). These are needed for the visual fidelity reviewer to fetch Figma designs directly.
Step 1: Validate Prerequisites
If [page-name] provided:
- Check
docs/pages/{page-name}/page-plan.jsonexists - Check
docs/pages/{page-name}/.progress/{page-name}.jsonexists
Check progress status:
- Accept:
generated,verified,verify-failed,reviewed,review-failed,fixing,escalated,done - Reject:
planned(no code yet) - Warn on demotion from
done→reviewed
If no argument: review all pages with generated code, each one on its own.
Step 2: Acquire Lock
Same lock protocol as hp-gen Step 3 (JSON format with lockedBy, lockedAt, pageName; 30-min stale threshold). Take it for every page in the run.
Lock file path: docs/pages/{page-name}/.implementation/homepage/.lock
- Write with
lockedBy: "hp-review" - Stale lock (>= 30 min) → auto-remove and proceed
- Active lock → release any lock this run took and exit with "Another homepage-plugin operation is in progress"
Step 3: Decide on the Visual Stage
A workflow cannot ask a question mid-run, so settle this before starting it.
If hasVisualRefs is false, the visual stage does not run.
Otherwise verify Playwright is available:
cd {projectRoot} && node -e "require('playwright')" 2>/dev/null
If the check fails (exit code !== 0), Playwright is not installed. Display a message to the user and wait for the answer:
Playwright is not installed. Visual Fidelity Review captures rendered screenshots with Playwright and compares them against Figma designs.
To install:
pnpm add -D playwright npx playwright install chromium
- Install and continue — installs Playwright, then runs the review with Visual Fidelity Review
- Skip this time — runs the review without Visual Fidelity Review
- If the user chooses Install and continue: run
pnpm add -D playwright && npx playwright install chromiumin{projectRoot}. If installation fails, display the error and skip the visual stage. - If the user chooses Skip this time: skip the visual stage.
Step 4: Run the Workflow
Call the Workflow tool with name: "homepage-plugin:hp-review-run" and args:
projectRoot— project rootpages—[{ pageName, planFile }], one entry per page, whereplanFileis the path to itspage-plan.jsonvisual—nullwhen the visual stage does not run, otherwise{ componentMapFile, fileKey, mcpToolPrefix }:componentMapFileisdocs/design-system/component-map.json,fileKeyis the Figma file key from the config, andmcpToolPrefixis the prefix found in Step 0
Tell the user which pages are being reviewed. The result arrives as a task notification; continue at Step 5 when it does. If the call is refused or fails, release the locks and report it.
Step 5: Save Results
For each entry in the result's pages:
status: "incomplete"— the reviewer named inmissingreturned nothing. Save no report and leave the progress file unchanged; the review is run again rather than judged on fewer reviewers.- Any other status — write
reportwith atimestampadded todocs/pages/{page-name}/.implementation/homepage/review-report.json, then updatedocs/pages/{page-name}/.progress/{page-name}.json:
{
"implementation": {
"status": "reviewed",
"review": {
"seoScore": 8.5,
"qualityScore": 8.0,
"visualFidelityScore": 7.5,
"verdict": "pass_with_warnings",
"reviewedAt": "2026-03-23T..."
}
}
}
status is the entry's status, the scores are report.seo.score, report.quality.score and report.visualFidelity.score, and verdict is report.overall.verdict. Omit visualFidelityScore when the report has no visualFidelity.
Release the lock of every page in the run, whatever the result.
Step 6: Display Results
Show an integrated review summary per page:
Review Results:
SEO Review: 8.5/10 (pass)
Quality Review: 8.0/10 (pass with warnings)
Visual Fidelity: 7.5/10 (pass with warnings) [4/5 sections compared]
Issues: 0 critical, 7 warnings, 3 info
Top warnings:
1. [responsive] Touch target too small — Header.astro:28
2. [i18n] Hardcoded string found — ContactSection.astro:15
3. [visual_fidelity] Hero background color differs from Figma — HeroSection.astro
...
Next step: Run /homepage-plugin:hp-fix to address warnings.
The Visual Fidelity line only appears when that stage ran. Show [N/M sections compared] from coverage, and show the entry's note when it has one.
Or if failed:
Review Results:
SEO Review: 5.5/10 (fail)
Critical: Missing <title> on 3 pages
...
Next step: Run /homepage-plugin:hp-fix to fix critical issues.
The next step depends on the status: done says the page is complete, and incomplete says to run /homepage-plugin:hp-review again.
Communication Language
Read defaultLocale from .claude/homepage-plugin.json for all user-facing output.
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.