Skip to main content

setup-quality-gate

Add quality:gate package.json script for fast local/CI quality checks (biome + tsgo + related tests), GitHub Actions workflow, and Stop hook for type checking. Use when setting up quality gates, CI pipelines, or pre-push validation.

来源信息

仓库
redpanda-data/ui-harness
最近来源活动
2026年5月8日 11:21
检测到的 SKILL.md 语言
英语
星标
34
分支
4

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

文件资源管理器
7 个文件

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
setup-quality-gate
description
Add quality:gate package.json script for fast local/CI quality checks (biome + tsgo + related tests), GitHub Actions workflow, and Stop hook for type checking. Use when setting up quality gates, CI pipelines, or pre-push validation.
# Setup Quality Gate ## What This Sets Up - `quality:gate` script -- lint + type check + related tests in <5s - GitHub Actions workflow w/ formatting integrity (`git diff --exit-code`) - Stop hook: tsgo + related tests before finish - Bundle guard hook: warn on heavy deps (moment, lodash, jquery, core-js, classnames) - Test perf audit hook: surface duration regressions >30% - CI status check + `@claude review` trigger - Optional: `/codex:review` cross-model review ## Steps ### 1. Package.json scripts ```json { "scripts": { "lint": "biome check .", "lint:fix": "biome check --write .", "type:check": "tsgo", "test": "vitest --run", "test:related": "vitest --run --related", "quality:gate": "biome check . && tsgo && vitest --run --related $(git diff --name-only HEAD)" } } ``` ### 2. Asset type declarations Create `src/types/assets.d.ts` from [REFERENCE.md](REFERENCE.md) -- tsgo need for .svg/.css/.png imports. ### 3. GitHub Actions Write `.github/workflows/quality-gate.yml` from [REFERENCE.md](REFERENCE.md). Run on PR + push to main. ### 4. Hook scripts Copy into `.claude/hooks/`, `chmod +x`: - `scripts/typecheck-stop.sh` -> Stop - `scripts/bundle-guard.sh` -> PostToolUse (Edit|Write) - `scripts/test-perf-stop.sh` -> Stop ### 5. Verify - [ ] `bun run quality:gate` work - [ ] `.github/workflows/quality-gate.yml` exist - [ ] `src/types/assets.d.ts` exist - [ ] All hook scripts executable + configured
在 GitHub 查看