Skip to documentation

Design system / Sources & standards

Current repository source

SKILL.md

.opencode/skills/quality-gate/SKILL.md

This view contains the escaped source read during the deployment build. Code and policy text are unchanged. Markdown is shown as source, not rendered as a document. A new deployment refreshes the content.

---
name: quality-gate
description: Select and run CreativeXHub's risk-based tests, UI verification, and ADR compliance scan. Use after feature functionality is complete, during PR review, or before /shipit.
metadata:
  author: creativexhub
  version: "1.1"
---

# Quality Gate

Follow ADR-0033 and ADR-0011. Run this after implementation is functionally complete and before shipping.

## Baseline

1. Inspect the complete diff and classify changed behavior, not just files.
2. Run `git diff --check`.
3. Run `npm run test:migrations`, `npm run test`, `npm run test:guardrails`, and `npm run build`.
4. When staged, unstaged, or untracked changes affect `src/db/schema/`, `src/db/migrations/*.sql`, `src/db/migrations/meta/`, or the replay check itself, run `npm run test:migrations:replay` using local PostgreSQL. When schema source changes, verify a matching migration/snapshot or explain why none is needed. Treat an unavailable local database or unexplained snapshot difference as a merge blocker; do not target AWS or a shared database.
5. Scan the diff for architectural impact. Load `architecture-decision-log-entry` when it changes a contributor-facing baseline, trust boundary, runtime policy, persistence model, or deployment policy.
6. Review tracked, staged, and untracked changes for unnecessary Amplify/AWS environment disclosure. Flag credentials, tokens, private keys, generated outputs, account IDs, resource ARNs, app/stack IDs, internal endpoints, and sandbox-specific names. Each retained value must be necessary, secret-free, and safe for its server or browser boundary.

## Risk-based additions

- For an interactive organism or product instance, test affected loading, empty, success, and error states through Testing Library.
- For a hook that owns effects, subscriptions, async mutation, or coordinated transitions, test its state transitions independently.
- For authentication, redirects, uploads, navigation across routes, browser permissions, or another user-critical cross-boundary flow, add or run focused Playwright coverage unless lower-level tests prove the full behavior.
- Local E2E tests may rely on the documented demo tenant, user, and event fixtures. If a fixture is missing, report the failure and restore or diagnose that fixture; do not block implementation on preemptive fixture provisioning or cleanup.
- For controller, domain, authorization, persistence, or migration changes, test successful and failure/denial paths at the closest meaningful boundary.
- Do not require a test for static copy or style-only changes unless behavior, accessibility, or responsive layout changed.

## Frontend guideline and documentation check

For every frontend component addition, change or refactor, load `frontend-component-architecture` and verify its **Component change workflow**. This applies to visual-only changes and affected parent compositions, not just new components.

- Check implementation compliance with applicable ADRs, theming rules and frontend development guidance.
- Compare public design-system pages, live examples and usage contracts with the actual implementation. Do not accept the author's completion claim as evidence by itself.
- Load `asd-ste100` to review authored documentation. Use any additional writing skill required by applicable project guidance.
- Verify the workflow's per-component report: documentation paths/routes, writing skills used, and **Updated**, **Already accurate**, or **Not applicable** with reasons.
- Mark this required check failed when architectural/theming violations, materially stale examples, missing required documentation or material writing-guide violations remain. These block completion and merge even when tests pass. Minor wording suggestions alone do not fail the check.

Keep the detailed authoring requirements in `frontend-component-architecture`; do not maintain a second checklist here. Select documentation/example tests according to changed behavior and risk, not merely because prose changed.

## Review output

Report:

- Changed risk areas and selected tests.
- Commands run and their results.
- Missing tests or ADR implications as merge blockers.
- Frontend guideline/documentation check status, per-component evidence, and any unmet requirement as an explicit completion/merge blocker.
- Amplify/AWS disclosure review outcome, including any retained environment-specific values and their necessity.
- Any exception as: command, reason, risk, owner/follow-up, and "merge blocked until green."

Never silently skip an applicable local gate. An unresolved Amplify/AWS disclosure concern blocks opening and merging the PR. A failed or unavailable local gate may be disclosed in a PR, but it blocks merge. A green local gate is sufficient to merge into `dev`; the `dev` deployment is the next-environment validation step.
All sources and standards
Current components and theme tokens. Fictional example data. Source views refresh on deployment; authors maintain contract notes.