mit einem Klick
preflight
// Pre-PR validation — license headers, format, lint, TypeScript check, build, and protected file check. Use before submitting any PR, to check if code is ready, validate changes, or verify a branch before review.
// Pre-PR validation — license headers, format, lint, TypeScript check, build, and protected file check. Use before submitting any PR, to check if code is ready, validate changes, or verify a branch before review.
| name | preflight |
| description | Pre-PR validation — license headers, format, lint, TypeScript check, build, and protected file check. Use before submitting any PR, to check if code is ready, validate changes, or verify a branch before review. |
| allowed-tools | Bash, Read, Glob, Grep, AskUserQuestion |
You are running a comprehensive validation before submitting a pull request. Run each check in order, report results clearly, and help fix any issues found.
All script commands run from the frontend/ directory unless otherwise noted.
Before running any validation, check the state of the working tree:
git status
git diff --stat origin/main...HEAD
git log --format="%h %s%n%b" origin/main...HEAD
Evaluate:
IN- references inline in the description.--signoff? — Flag any commits without Signed-off-by: lines.Resolve any issues before proceeding.
Every source file (.ts, .vue, .js, .scss) must have the copyright header. Check for files missing it:
# From repo root
find frontend/app frontend/server -type f \( -name "*.ts" -o -name "*.vue" -o -name "*.js" -o -name "*.scss" \) | \
xargs grep -rL "Copyright" 2>/dev/null | grep -v node_modules | grep -v ".nuxt" | head -20
The correct headers are:
// Copyright (c) 2025 The Linux Foundation and each contributor. + // SPDX-License-Identifier: MIT<!--\nCopyright (c) 2025 The Linux Foundation and each contributor.\nSPDX-License-Identifier: MIT\n-->If any files are missing headers, add them using the scripts/add-license.js script or manually.
cd frontend && pnpm format
This applies Prettier formatting. Run format before lint to eliminate whitespace noise from the lint step.
If files were modified, stage them:
git add -p
cd frontend && pnpm lint
If there are lint errors, fix them. Common issues:
If any fixes were applied in Checks 1–3, re-run lint to confirm fixes are clean:
cd frontend && pnpm lint
cd frontend && pnpm tsc-check
Fix any type errors before proceeding. Common issues:
cd frontend && pnpm build
The build must succeed. If it fails:
tsc-checkThe authoritative list of protected files is maintained in .claude/hooks/guard-protected-files.sh. Cross-reference the diff against that hook — do not rely on any hardcoded list here, which may be stale.
# Get changed files
git diff --name-only origin/main...HEAD
# Extract the protected path patterns from the hook
grep -E "^\s+(frontend/|\.husky/|eslint|\.prettier|CLAUDE|\.claude/|scripts/|COPYRIGHT|package\.json|pnpm-lock)" .claude/hooks/guard-protected-files.sh
For each changed file, check whether it matches any case pattern or glob ([[ ... == glob ]]) in the hook. If it does, flag it — those files should NOT be modified without code owner approval.
If protected files appear in the diff, warn the contributor and ask them to revert or get code owner approval.
git status
git log --format="%h %s%n%b" origin/main...HEAD
type: description format per commit-workflow.md. Scope is optional. Valid types include feat, fix, docs, chore, refactor, build, etc.--signoff on all commits? — Every commit must have Signed-off-by:.IN- references inline in the description.Generate a summary of all changes for the PR description:
git diff --stat origin/main...HEAD
List:
server/api/Present a clear report:
PREFLIGHT RESULTS
─────────────────────────────────
✓ Working tree — Clean, N commits ahead of main
✓ License headers — All files have headers
✓ Formatting — Applied
✓ Linting — No errors
✓ TypeScript — No errors
✓ Build — Succeeded
✓ Protected files — None modified
✓ Commits — Conventions followed, signed off
─────────────────────────────────
READY FOR PR
Or if there are issues:
PREFLIGHT RESULTS
─────────────────────────────────
✓ Working tree — Clean, N commits ahead of main
✗ License headers — 2 files missing headers (see above)
✓ Formatting — Applied
✗ Linting — 3 errors (see above)
✓ TypeScript — No errors
✗ Build — Failed (see above)
✓ Protected files — None modified
✓ Commits — Conventions followed, signed off
─────────────────────────────────
ISSUES FOUND — Fix before submitting
Suggest creating the PR:
"All preflight checks passed! Ready to create a PR. Would you like me to create it with
gh pr create?"
Record an architecture decision as an ADR in docs/adr/. Use when choosing between frameworks, libraries, databases, or architectural patterns; stating a decision with reasoning ("we decided X instead of Y because..."); or querying past decisions ("why did we choose X?").
Generate a commit message and commit staged changes using git commit -s -S.
Review a pull request against Insights architecture standards — fetches PR diff, verifies previous comments are addressed, validates PR metadata (title, branch, JIRA, size), runs a code-standards check against every file in `.claude/rules/` and `.claude/hooks/guard-protected-files.sh`, and drafts inline review comments with suggested fixes. NEVER auto-posts comments or submits reviews — always presents a draft in the terminal for user approval before any comment lands on the PR. Use when reviewing PRs, checking PR quality, validating code changes, or when the user says "review", "check this PR", or "audit code".
Run the docs site, blog, or Storybook locally. Use when contributing to documentation, previewing blog posts, or developing UI components in isolation. Not needed for regular frontend development.
Full development environment setup from scratch — prerequisites, dependencies, .env file, optional local PostgreSQL database (for auth/collections/chat work), and dev server. Use for first-time setup, broken environments, missing env vars, or when the app won't start.