Get the FREE Ultimate OpenClaw Setup Guide โ†’

Quality Assurance Standards

Scanned
npx machina-cli add skill hoangnguyen0403/agent-skills-standard/quality-assurance --openclaw
Files (1)
SKILL.md
3.1 KB

Quality Assurance - High-Density Standards

Standards for maintaining code hygiene, automated checks, and testing integrity.

Priority: P1 (MAINTENANCE)

Standards for maintaining code quality, automated checks, and testing integrity.

๐Ÿ” Code Quality & Linting

  • Zero Tolerance: Treat all linter warnings/infos as fatal errors in CI.
  • Automated Formatting: Enforce strict formatting on every commit using hooks.
  • Type Safety: Never use any or dynamic unless absolutely necessary. Use specific interfaces/types for all data boundaries.
  • Dead Code: Proactively remove unused imports, variables, and deprecated methods.

๐Ÿงช Testing & TDD

  • F-I-R-S-T: Test must be Fast, Independent, Repeatable, Self-Validating, and Timely.
  • TDD (Red-Green-Refactor): See our dedicated TDD Skill for strict cycle enforcement.
  • Edge Cases: Always test null/empty states, boundary limits, and error conditions.
  • Mock Dependencies: Isolate code by mocking external systems (APIs, DBs) to ensure deterministic results.

๐Ÿ”บ The Test Pyramid

  • Unit Tests (70%): Fast, isolated, test individual functions/classes. (TDD focus).
  • Integration Tests (20%): Test interactions between modules (e.g., Service + DB).
  • E2E Tests (10%): Slow, realistic, test user flows from UI to Backend.

๐ŸŽฏ Risk-Based Testing

  • Prioritize Critical Paths: Login, Payments, Data Integrity must have the highest coverage.
  • Impact Analysis: Ask "What happens if this fails?" If the answer is "Data Loss", test it thoroughly.

๐Ÿ›  Refactoring & Code Reviews

  • Code Smells: Proactively refactor duplicated code, long methods (>20 lines), and "god classes".
  • Incremental Changes: Perform small, behavior-preserving transformations (Extract Method, Rename Variable).
  • Quality Gate: Use peer reviews to share knowledge and catch logic errors before merging.
  • Constructive Feedback: Critique the code, not the author. Explain the "why" behind suggestions.

๐Ÿ›  Automation & Hooks

  • Pre-commit Hooks: Validate linting, formatting, and unit tests before every push.
  • Documentation: Keep public APIs documented. Use triple-slash/JSDoc.
  • Strict Dependencies: Lock versions in pubspec.lock / package-lock.json / pnpm-lock.yaml.

๐Ÿšซ Anti-Patterns

  • Broken Window: **No Ignoring Warnings**: Leaving "small" lint errors leads to codebase rot.
  • Testing Implementation: **No Testing Internals**: Changes to private methods shouldn't break tests.
  • Manual QA Dependency: **No "Test-Last"**: Verification must be automated and continuous, not a final manual gate.
  • Magic Strings: **No Hardcoded IDs**: Use constants or generated keys for accessibility/test IDs.

๐Ÿ“š References

Source

git clone https://github.com/hoangnguyen0403/agent-skills-standard/blob/develop/.github/skills/common/quality-assurance/SKILL.mdView on GitHub

Overview

This skill codifies standards for maintaining code hygiene, automated checks, and testing integrity. It codifies practices around linting, formatting, type safety, refactoring, and thorough testing to prevent regressions. Adopting these standards helps teams deliver reliable software faster.

How This Skill Works

Code quality is enforced via strict linting, automated formatting, and type-safe interfaces. Tests are structured around a TDD cycle, mock external dependencies, and a defined Test Pyramid (units, integration, E2E) to ensure fast, reliable feedback.

When to Use It

  • Onboard a new project to establish baseline QA standards and expectations.
  • In CI to fail builds on any lint or test failure, ensuring code health before integration.
  • During refactoring to prevent regression and confirm behavior remains correct.
  • When implementing critical paths (e.g., login, payments, data integrity) to ensure adequate coverage.
  • Before merging, using peer reviews and automated checks as a quality gate.

Quick Start

  1. Step 1: Enable linting, formatting, and pre-commit hooks; wire them into CI.
  2. Step 2: Implement a TDD workflow and map tests to the Test Pyramid.
  3. Step 3: Identify critical paths and enforce risk-based testing with peer reviews.

Best Practices

  • Enforce zero tolerance for linter warnings in CI and treat them as errors.
  • Automate formatting and linting with pre-commit hooks and CI checks.
  • Use explicit types and avoid dynamic any/d values to preserve data boundaries.
  • Adopt TDD with Red-Green-Refactor and reference the dedicated TDD skill when available.
  • Follow the Test Pyramid (Unit 70%, Integration 20%, E2E 10%) and prioritize risk-based testing.

Example Use Cases

  • CI gates enforce linting and tests before merge, ensuring code health in every PR.
  • Refactor a module using Extract Method and add targeted unit tests to preserve behavior.
  • Team adopts a strict TDD cycle, writing tests before implementation and refactoring when needed.
  • Pre-commit hooks validate formatting, linting, and unit tests on every commit.
  • Public APIs are documented with triple-slash/JSDoc to improve maintainability and usability.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers โ†—