Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问clear审计提醒

quality-assurance品质保证

Agent Skill

quality-assurance 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

12,229

周安装

396

GitHub Stars

26

下载量

2,578
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:quality-assurance(品质保证)
来源仓库:https://github.com/daffy0208/ai-dev-standards
仓库路径:skills/quality-assurance
安装命令:
npx skills add https://github.com/daffy0208/ai-dev-standards --skill 'Quality Assurance'
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/daffy0208/ai-dev-standards --skill 'Quality Assurance'

简介

quality-assurance 是整合测试策略、代码质量规范和阶段门禁验证的综合技能。

  • 确保代码在每次变更后都经过充分测试、符合标准并具备生产就绪条件。
  • 涵盖测试金字塔构建、代码审查标准和发布前质量检查三大核心职能。
  • 适用于新项目初始化测试基础设施或现有项目质量瓶颈诊断场景。
  • 提供自动化测试覆盖率、静态分析规则和部署前置条件的完整清单。

SKILL.md

Quality Assurance

Overview

Quality Assurance is a consolidated skill that combines three critical quality dimensions: comprehensive testing strategy, code quality enforcement, and phase-gate validation. It ensures your code is tested, maintainable, and ready for production at every stage.

Consolidated from:

  • testing-strategist - Test pyramid and comprehensive testing
  • code-quality-enforcer - Code standards and best practices
  • validation-gate-checker - Phase transition validation

When to Use This Skill

Use Quality Assurance when:

  • Setting up testing infrastructure for a project
  • Conducting code reviews
  • Validating readiness to move between project phases
  • Establishing quality standards for a team
  • Debugging quality issues in production
  • Improving code maintainability
  • Ensuring production readiness

Key Capabilities

Testing Strategy (from testing-strategist)

  • Design test pyramid with optimal coverage
  • Define unit, integration, and E2E test strategies
  • Set coverage targets and quality metrics
  • Choose testing frameworks and tools
  • Plan test automation and CI/CD integration

Code Quality (from code-quality-enforcer)

  • Enforce coding standards and best practices
  • Review code for readability and maintainability
  • Identify security vulnerabilities and anti-patterns
  • Ensure type safety and error handling
  • Refactor code to improve quality scores

Validation Gates (from validation-gate-checker)

  • Define phase transition criteria
  • Validate readiness for next phase
  • Ensure deliverables are complete
  • Check compliance with standards
  • Prevent premature phase transitions

Workflow

Part 1: Testing Strategy

The Test Pyramid

Structure:

        /\
       /E2E\      10% - End-to-End (Critical user flows)
      /------\
     /Integr-\   20% - Integration (Components, APIs, DB)
    /----------\
   /   Unit     \ 70% - Unit (Functions, classes, logic)
  /--------------\

Rationale:

  • Unit tests are fast, isolated, cheap to maintain
  • Integration tests catch component interaction issues
  • E2E tests validate critical user workflows, but are slow and brittle

Unit Tests (70% of tests)

Coverage Targets:

  • Critical code (auth, payments, security): 100%
  • Business logic: >90%
  • Overall codebase: >85%

What to Test:

  • Pure functions and business logic
  • Edge cases and error conditions
  • Input validation
  • State management
  • Utility functions

Best Practices:

  • One test file per source file
  • Fast execution (<1ms per test)
  • No external dependencies (mock/stub)
  • Descriptive test names
  • AAA pattern (Arrange, Act, Assert)

Example:

// Good: Fast, isolated, clear
describe('calculateDiscount', () => {
  it('applies 10% discount for orders over $100', () => {
    const result = calculateDiscount(150)
    expect(result).toBe(15)
  })

  it('returns 0 for orders under $100', () => {
    const result = calculateDiscount(50)
    expect(result).toBe(0)
  })

  it('throws error for negative amounts', () => {
    expect(() => calculateDiscount(-10)).toThrow()
  })
})

Integration Tests (20% of tests)

What to Test:

  • API endpoints with real database
  • Multiple components working together
  • Third-party service integrations (with mocks)
  • Database queries and transactions
  • File system operations

Best Practices:

  • Test database setup/teardown
  • Use test database or transactions
  • Mock external services
  • Test happy path + key error scenarios
  • <5 seconds per test

Example:

// Good: Real database, tests integration
describe('POST /api/users', () => {
  beforeEach(async () => {
    await db.users.deleteMany({})
  })

  it('creates user and returns 201', async () => {
    const response = await request(app)
      .post('/api/users')
      .send({ email: 'test@example.com', name: 'Test' })

    expect(response.status).toBe(201)
    expect(response.body.email).toBe('test@example.com')

    const user = await db.users.findOne({ email: 'test@example.com' })
    expect(user).toBeDefined()
  })

  it('returns 400 for duplicate email', async () => {
    await db.users.create({ email: 'test@example.com' })

    const response = await request(app)
      .post('/api/users')
      .send({ email: 'test@example.com', name: 'Test' })

    expect(response.status).toBe(400)
  })
})

E2E Tests (10% of tests)

What to Test:

  • Critical user workflows (signup, checkout, etc.)
  • Multi-page user journeys
  • UI interactions with backend
  • Cross-browser compatibility (if needed)

Best Practices:

  • Only test critical paths
  • Use page object pattern
  • Run in CI/CD before deployment
  • Accept slower execution (30s-2min per test)
  • Use headless browsers in CI

Example:

// Good: Tests complete user flow
describe('User Signup Flow', () => {
  it('allows new user to signup and access dashboard', async () => {
    await page.goto('/signup')

    await page.fill('input[name="email"]', 'newuser@example.com')
    await page.fill('input[name="password"]', 'SecurePass123!')
    await page.click('button[type="submit"]')

    await page.waitForURL('/dashboard')
    expect(await page.textContent('h1')).toContain('Welcome')
  })
})

Testing Tools Recommendations

JavaScript/TypeScript:

  • Unit: Jest or Vitest
  • Integration: Supertest (API) + Jest
  • E2E: Playwright or Cypress

Python:

  • Unit: pytest
  • Integration: pytest with fixtures
  • E2E: Selenium or Playwright

General:

  • Coverage: Istanbul (JS), Coverage.py (Python)
  • CI/CD: GitHub Actions, CircleCI, GitLab CI
  • Mocking: Jest (JS), unittest.mock (Python)

Part 2: Code Quality Enforcement

Code Quality Principles

1. Readability

  • Descriptive variable and function names
  • Single Responsibility Principle
  • Clear, consistent formatting
  • Comments for "why", not "what"

2. Maintainability

  • DRY (Don't Repeat Yourself)
  • SOLID principles
  • Type safety (TypeScript, type hints)
  • Error handling everywhere

3. Testing

  • Unit tests for all functions
  • Edge cases covered
  • Test names describe behavior

4. Security

  • No hardcoded secrets
  • Input validation
  • SQL injection prevention
  • XSS protection

Code Quality Checklist

Before Code Review:

  • No hardcoded secrets or API keys
  • Functions <50 lines (split if longer)
  • Error handling present (try/catch, null checks)
  • All tests passing
  • Type safety (TypeScript strict mode, Python type hints)
  • No console.log or debugging code
  • Descriptive variable names (no x, tmp, data)
  • Comments explain "why", not "what"
  • DRY - no copy-paste code
  • Security best practices (input validation, sanitization)

Code Review Guidelines

What to Look For:

Critical Issues (Must Fix):

  • Security vulnerabilities (SQL injection, XSS, secrets)
  • Breaking changes without migration
  • Missing error handling
  • Incorrect logic or algorithm
  • Performance bottlenecks

Important Issues (Should Fix):

  • Code duplication (DRY violations)
  • Poor naming or structure
  • Missing tests for new code
  • Type safety violations
  • Inconsistent formatting

Minor Issues (Nice to Fix):

  • Style inconsistencies
  • Over-commenting
  • Optimization opportunities
  • Documentation improvements

Code Quality Score

Scoring System (0-100):

Security (30 points):

  • No secrets in code (10 pts)
  • Input validation (10 pts)
  • Error handling (10 pts)

Readability (25 points):

  • Descriptive names (10 pts)
  • Clear structure (10 pts)
  • Appropriate comments (5 pts)

Testing (25 points):

  • Unit test coverage >85% (15 pts)
  • Tests for edge cases (10 pts)

Maintainability (20 points):

  • DRY compliance (10 pts)
  • Function size <50 lines (5 pts)
  • Type safety (5 pts)

Grading:

  • 90-100: Excellent
  • 80-89: Good
  • 70-79: Acceptable
  • <70: Needs improvement

Part 3: Validation Gates

Validation gates ensure each phase is complete before moving to the next.

Phase 1 → Phase 2 (Discovery → Design)

Gate Criteria:

  • PRP document complete and reviewed
  • Problem statement validated with users
  • Success criteria defined and measurable
  • User stories documented (Jobs-to-be-Done)
  • Stakeholder alignment on scope
  • Open questions documented with owners

Deliverables:

  • Product Requirements Prompt (PRP)
  • User research summary
  • Success metrics dashboard

Review Questions:

  • Do we understand the user problem?
  • Can we measure success?
  • Is scope clear and agreed upon?

Phase 2 → Phase 3 (Design → Development)

Gate Criteria:

  • Architecture documented (system diagram)
  • Data model designed (ERD or schema)
  • API contracts defined (if applicable)
  • Security threats identified (threat model)
  • Mitigations planned for critical threats
  • Technology stack approved
  • Infrastructure plan documented

Deliverables:

  • Architecture document
  • Data model / ERD
  • API specification (OpenAPI/Swagger)
  • Threat model with mitigations
  • Infrastructure diagram

Review Questions:

  • Is architecture sound and scalable?
  • Are security threats mitigated?
  • Do we have required infrastructure access?

Phase 3 → Phase 4 (Development → Testing)

Gate Criteria:

  • All P0 features complete
  • Unit test coverage >80%
  • Code review completed
  • Static analysis (SAST) passed
  • No critical or high severity issues
  • Error handling implemented
  • Logging and monitoring in place

Deliverables:

  • Working software (all P0 features)
  • Test coverage report
  • Code review sign-off
  • SAST scan results

Review Questions:

  • Are all MVP features complete?
  • Is code quality acceptable?
  • Are critical bugs resolved?

Phase 4 → Phase 5 (Testing → Deployment)

Gate Criteria:

  • All tests passing (unit, integration, E2E)
  • Test coverage >90%
  • User acceptance testing (UAT) completed
  • Security testing passed (DAST, penetration test)
  • Performance testing passed (load, stress)
  • Documentation complete (user + dev docs)
  • Rollback plan documented
  • Deployment runbook ready

Deliverables:

  • Test results (all green)
  • UAT sign-off
  • Security test report
  • Performance test results
  • Deployment runbook

Review Questions:

  • Are we confident in quality?
  • Can we roll back if needed?
  • Is production infrastructure ready?

Examples

Example 1: API Testing Strategy

Project: REST API for user management

Test Plan:

Unit Tests (70%):

  • Business logic (validation, permissions)
  • Data transformations
  • Utility functions
  • Error handling logic

Integration Tests (20%):

  • POST /users (creates user in DB)
  • GET /users/:id (retrieves from DB)
  • PUT /users/:id (updates in DB)
  • DELETE /users/:id (removes from DB)
  • Authentication middleware
  • Error responses (400, 401, 404, 500)

E2E Tests (10%):

  • Full signup flow (create user → verify email → login)
  • Password reset flow
  • Profile update flow

Tools:

  • Jest (unit)
  • Supertest (integration)
  • Playwright (E2E)

Coverage Target: 90% overall


Example 2: Code Quality Review

Before (Poor Quality - Score: 55/100):

// Bad: Hardcoded secret, no error handling, poor naming
function getData(x) {
  const result = fetch('https://api.example.com/data', {
    headers: { Authorization: 'Bearer sk_live_abc123' }
  })
  return result.json()
}

Issues:

  • Security: Hardcoded API key (-10 pts)
  • Error handling: None (-10 pts)
  • Naming: Poor variable names (-10 pts)
  • Testing: No tests (-15 pts)

After (Good Quality - Score: 95/100):

// Good: Secure, robust, clear
async function fetchUserData(userId: string): Promise<UserData> {
  try {
    const apiKey = process.env.API_KEY;
    if (!apiKey) {
      throw new Error('API_KEY environment variable not set');
    }

    const response = await fetch(`https://api.example.com/users/${userId}`, {
      headers: { 'Authorization': `Bearer ${apiKey}` }
    });

    if (!response.ok) {
      throw new Error(`API request failed: ${response.status}`);
    }

    return await response.json();
  } catch (error) {
    logger.error('Failed to fetch user data', { userId, error });
    throw new Error(`Failed to fetch user ${userId}`);
  }
}

// Tests
describe('fetchUserData', () => {
  it('fetches user successfully', async () => {
    // Test implementation
  });

  it('throws error if API_KEY not set', async () => {
    // Test implementation
  });
});

Example 3: Phase Gate Validation

Project: Customer Support Chatbot (Phase 3 → Phase 4)

Validation Check:

Requirements:

  • ✅ All P0 features complete (chat UI, AI responses, escalation)
  • ✅ Unit test coverage: 87%
  • ✅ Code review: Approved (2 reviewers)
  • ❌ SAST scan: 3 medium severity issues (FAIL)
  • ✅ Error handling: Implemented
  • ✅ Logging: Datadog integration complete

Decision: GATE FAILED - Must fix SAST issues before proceeding

Action Items:

  1. Fix 3 medium severity issues (input validation)
  2. Re-run SAST scan
  3. Re-review gate criteria

Estimated Time to Pass: 2 days


Best Practices

Testing

  1. Write tests first (TDD) - Clarifies requirements
  2. Keep tests independent - No shared state
  3. Test behavior, not implementation - Refactor-safe tests
  4. Use descriptive test names - Tests are documentation
  5. Fail fast - Run fast tests first

Code Quality

  1. Automate quality checks - ESLint, Prettier, type checking
  2. Review your own code first - Catch obvious issues
  3. Small, focused PRs - Easier to review thoroughly
  4. Fix root causes - Don't just patch symptoms
  5. Refactor continuously - Don't accumulate tech debt

Validation Gates

  1. Document criteria upfront - No surprises
  2. Be strict on critical gates - Security, production readiness
  3. Flexible on nice-to-haves - Don't block progress
  4. Track gate passage - Identify bottlenecks
  5. Automate checks - CI/CD enforcement

Common Pitfalls

1. Testing the Wrong Things

Antipattern: Test implementation details (private methods) Better: Test public API and behavior

2. Insufficient Coverage of Edge Cases

Antipattern: Only test happy path Better: Test nulls, empty arrays, errors, boundaries

3. Skipping Phase Gates

Antipattern: "We'll fix it after shipping" Result: Production bugs, security issues

Better: Enforce gates, delay if needed

4. Over-Engineering Quality

Antipattern: 100% coverage on everything, perfection paralysis Better: Pragmatic quality aligned with risk

5. Manual Quality Checks

Antipattern: Remember to run linter before commit Better: Automate in pre-commit hooks + CI/CD


Related Skills

  • testing-strategist - Original testing skill (now consolidated)
  • security-architect - Security testing and threat validation
  • deployment-advisor - Production readiness validation
  • performance-optimizer - Performance testing and optimization
  • framework-orchestrator - Uses validation gates for phase transitions

Deliverables

When using Quality Assurance, produce:

  1. Test Strategy Document

- Test pyramid breakdown - Coverage targets - Tools and frameworks - CI/CD integration plan

  1. Code Quality Standards

- Style guide - Linting rules - Review checklist - Quality score rubric

  1. Phase Gate Criteria

- Entry/exit criteria for each phase - Required deliverables - Review process - Sign-off authority

  1. Quality Dashboard

- Test coverage metrics - Code quality scores - Gate passage tracking - Trend analysis


Success Metrics

Quality Assurance is working when:

  • Test coverage consistently >85%
  • Production bugs <1% of releases
  • Code reviews catch issues before merge
  • Phase gates prevent premature transitions
  • Quality improves over time (not degrades)
  • Team follows standards without enforcement
  • CI/CD pipeline enforces quality automatically

Remember: Quality is not optional. It's the difference between sustainable software and technical bankruptcy.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

29.33%
按下载量换算756

OpenCode

20.85%
按下载量换算538

Antigravity

18.02%
按下载量换算465

Gemini CLI

12.78%
按下载量换算329

Codex

8.26%
按下载量换算213

Cursor

3.8%
按下载量换算98

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。来源字段存在多来源差异,先按来源优先级自动处理,无法消解时进入异常复核队列。

来源信息

继续浏览同类 Skills