Agent Skillsrommapp/romm › pre-pr-verification

pre-pr-verification

GitHub

PR提交前的综合验证技能,覆盖前后端静态检查、测试及UI手动验证。确保代码符合规范且CI通过,防止低级错误进入Review环节。

.claude/skills/pre-pr-verification/SKILL.md rommapp/romm

Trigger Scenarios

准备提交代码前 创建Pull Request前 向用户告知功能已完成时

Install

npx skills add rommapp/romm --skill pre-pr-verification -g -y
More Options

Non-standard path

npx skills add https://github.com/rommapp/romm/tree/master/.claude/skills/pre-pr-verification -g -y

Use without installing

npx skills use rommapp/romm@pre-pr-verification

指定 Agent (Claude Code)

npx skills add rommapp/romm --skill pre-pr-verification -a claude-code -g -y

安装 repo 全部 skill

npx skills add rommapp/romm --all -g -y

预览 repo 内 skill

npx skills add rommapp/romm --list

SKILL.md

Frontmatter
{
    "name": "pre-pr-verification",
    "description": "The before-handoff \/ before-PR verification gate for RomM, covering both stacks. Use right before committing, opening a PR, or telling the user a change is done — to run the right static checks, tests, and (for UI) manual browser\/theme\/input\/Storybook checks so CI stays green. Covers frontend (typecheck\/lint\/test\/build\/i18n\/tokens), backend (pytest\/alembic\/trunk), and the OpenAPI regen step. Trigger when wrapping up any change."
}

RomM — Verification Before Handoff

Run the checks that match what you touched. Static checks don't prove a feature works — when UI changed, also test it in the browser. Mirror the CI gates so review isn't the first place a failure shows up. Never --no-verify.

Order matters. Run the review-polish pass first, since it renames things, extracts helpers, and edits tests. Then run the stack checks below, and trunk fmt && trunk check last of all, so nothing lands unformatted. If polish changed behaviour rather than only shape, re-run the tests too.

Commit whatever trunk fmt rewrites. A "run fmt" commit landing on top of a PR is the single most common post-review fix in this repo. The recurring hits: import order (Vitest before Vue, component before its sibling module), Prettier joining a wrapped call or swapping quotes in a template string, ESLint's Vue rules on test mocks (vue/one-component-per-file, array-shorthand props), and mypy wanting explicit annotations on __init__ attributes (self.search_url: str = ..., Final[float]).


Frontend (frontend/)

Run from frontend/:

  1. npm run typecheck — zero errors (vue-tsc --noEmit).
  2. npm run lint (if present) / ESLint clean. Trunk also runs ESLint + Prettier in CI.
  3. npm run test — zero failures (Vitest + happy-dom; runs unit tests and every /lib story's play() via composeStories).
  4. npm run build — zero failures (CI sanity check).

If you touched the backend API: start the backend, run npm run generate, then re-typecheck.

If you touched tokens (src/v2/tokens/index.ts): npm run build:tokens (also auto-runs on predev/prebuild) and confirm tokens.css regenerated.

If you touched locales (src/locales/**): python3 frontend/src/locales/check_i18n_locales.py must pass with zero missing/extra keys. See the frontend-i18n skill.

UI manual pass (when changes are visible) — v2

With uiVersion = "v2":

  • Golden path + edge cases: empty, error, loading, no-permission, extreme data; plus nearby regressions.
  • Both themes: v2-dark and v2-light.
  • All four input modalities: mouse, touch, keyboard, gamepad — focus ring only on key/pad.
  • Responsive sweep: 320px → 4K across the useBreakpoint tiers; overlays full-bleed on xs.
  • Accessibility: contrast, keyboard reachability with no traps, aria-labels on icon-only controls.
  • Performance: lists/grids of 1000+ items stay smooth; every v-for has a stable :key.

Storybook (for /lib)

  • New primitive → mandatory story with controls + at least one variant per theme; interactive ones get a play().
  • Modified primitive → existing story still renders and interactions still pass.
  • Don't duplicate coverage between Vitest (pure logic) and Storybook play() (components).

Backend (backend/)

Run from backend/:

  1. uv run pytest [path/file] — zero failures (run the affected subset, or all with -vv).
  2. trunk fmt && trunk check — ruff/black/isort/mypy/bandit clean (CI enforces Trunk).
  3. If you added a migration: uv run alembic upgrade head then uv run alembic downgrade -1 to prove both directions; it must work on MariaDB and PostgreSQL (CI runs both).
  4. If a response schema or route signature changed: regenerate frontend types (npm run generate) and typecheck the frontend.

CI gates this mirrors

typecheck.yml (vue-tsc + lockfile lint), frontend.yml (vitest + build), i18n.yml (locale check), pytest.yml (pytest on MariaDB + PostgreSQL), migrations.yml (alembic on both DBs), trunk-check.yml (Trunk across the repo). Green locally → green in CI.

Don't

  • Open a PR without manually testing the UI when UI was touched.
  • --no-verify on commits.
  • Leave a locale key English-only, a token un-generated, or a migration one-directional.

Version History

  • 5b82462 Current 2026-08-29 04:27

    新增review-polish流程步骤,明确执行顺序;解决关于ephemeral state写入localStorage的指导矛盾,细化per-entity设备偏好配置说明。

  • 42e8043 2026-08-20 16:50

Same Skill Collection

.claude/skills/backend-development/SKILL.md
.claude/skills/frontend-i18n/SKILL.md
.claude/skills/frontend-v2-components/SKILL.md
.claude/skills/frontend-v2-input/SKILL.md
.claude/skills/frontend-v2-patterns/SKILL.md
.claude/skills/frontend-v2-theming/SKILL.md
.claude/skills/security-audit/SKILL.md
.claude/skills/review-polish/SKILL.md

Metadata

Files
0
Version
5b82462
Hash
a26c100f
Indexed
2026-08-20 16:50

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-30 05:51
浙ICP备14020137号-1 $Carte des visiteurs$