Agent capabilities

From diegosouzapw/awesome-omni-skill · View interactive version

Agent capabilities is an AI agent skill from the GitHub repository diegosouzapw/awesome-omni-skill. Comprehensive documentation of Claude's capabilities for visual regression testing, CI/CD integration, and quality assurance automation. Use when setting up testing infrastructure, implementing visual regression, or understanding agent testing capabilities. (project)

How to use this skill

Skill file

Agent Capabilities - Visual Regression Testing

This document outlines Claude's comprehensive capabilities for implementing and managing visual regression testing infrastructure in web applications.

Core Competencies

1. Visual Regression Testing Infrastructure

Claude can set up complete visual regression testing infrastructure following industry best practices from Ant Design, Argos CI, and other leading organizations.

Capabilities:

Implementation Reference:

2. CI/CD Integration

Claude can integrate visual regression testing into GitHub Actions workflows with automated PR checks, baseline updates, and artifact management.

Capabilities:

Implementation Reference:

3. Screenshot Management

Claude can implement sophisticated screenshot capture and management systems with support for dynamic content masking, animation freezing, and viewport control.

Capabilities:

Implementation Reference:

4. Comparison and Reporting

Claude can implement pixel-perfect comparison with configurable thresholds and generate comprehensive visual diff reports.

Capabilities:

Implementation Reference:

5. Cloud Storage Integration

Claude can integrate visual regression artifacts with cloud storage providers for long-term archival and sharing.

Capabilities:

Implementation Reference:

Workflow Patterns

Pattern 1: Initial Setup

When a user requests visual regression testing setup, Claude will:

  1. Create directory structure:

```

tests/shared/imageTest.tsx

scripts/visual-regression/

.github/workflows/visual-regression-*.yml

image_snapshots/baseline/

```

  1. Install dependencies:

```json

{

"devDependencies": {

"@playwright/test": "^1.40.0",

"playwright": "^1.40.0",

"jest-image-snapshot": "^6.2.0",

"pixelmatch": "^5.3.0",

"pngjs": "^7.0.0"

}

}

```

  1. Add npm scripts:

```json

{

"scripts": {

"visual:test": "playwright test",

"visual:baseline": "GENERATE_BASELINE=true playwright test --grep @baseline",

"visual:update-baseline": "npm run visual:baseline",

"visual:compare": "node scripts/visual-regression/compare-screenshots.ts",

"visual:report": "node scripts/visual-regression/generate-report.js",

"visual:upload": "node scripts/visual-regression/upload-to-storage.ts"

}

}

```

  1. Configure Playwright:

```typescript

// playwright.config.ts

export default {

testDir: './tests',

use: {

baseURL: 'http://localhost:5173',

screenshot: 'only-on-failure',

video: 'retain-on-failure',

},

projects: [

{ name: 'chromium', use: { ...devices['Desktop Chrome'] } },

],

};

```

Pattern 2: Component Testing

When adding visual tests for a new component:

  1. Create test file:

```typescript

import { test } from '@playwright/test';

import { runVisualTest, VIEWPORTS } from '../shared/imageTest';

test('button component - all variants', async ({ page }) => {

await runVisualTest(page, {

identifier: 'button-variants',

url: '/components/button',

viewport: VIEWPORTS.desktop,

threshold: 0.05,

});

});

```

  1. Generate baseline:

```bash

npm run visual:baseline

```

  1. Run in CI:

Pattern 3: Baseline Updates

When intentional visual changes are made:

  1. Review diff report:
  1. Update baselines:

```bash

npm run visual:update-baseline

git add image_snapshots/baseline/

git commit -m "chore: update visual baselines for button redesign"

```

  1. Push and re-test:

Pattern 4: Troubleshooting

When visual tests fail unexpectedly:

  1. Check for environmental differences:
  1. Adjust thresholds if needed:

```typescript

threshold: 0.1, // Increase from 0.05 to 0.1

```

  1. Mask dynamic content:

```typescript

hideSelectors: [

'[data-testid="timestamp"]',

'.loading-spinner',

],

```

Best Practices

1. What to Test

✅ Do test:

❌ Don't test:

2. Threshold Configuration

// Critical UI - strict comparison
threshold: 0.01  // 0.01% = ~10 pixels in 100k

// Standard components
threshold: 0.1   // 0.1% = ~100 pixels in 100k

// Charts/graphs with anti-aliasing
threshold: 0.5   // 0.5% = ~500 pixels in 100k

3. Performance Optimization

4. False Positive Reduction

Integration with Existing Tools

Visual regression testing integrates with:

Webapp Testing Skill

Reference: .claude/skills/webapp-testing/SKILL.md

CI/CD Pipelines

Reference: .github/workflows/visual-regression-pr.yml:1

Odoo Development

Real-World Examples

Example 1: Homepage Visual Test

import { test } from '@playwright/test';
import { runVisualTest, VIEWPORTS } from '../shared/imageTest';

test('homepage - responsive design', async ({ page }) => {
  for (const [name, viewport] of Object.entries(VIEWPORTS)) {
    await runVisualTest(page, {
      identifier: `homepage-${name}`,
      url: '/',
      viewport,
      fullPage: true,
      threshold: 0.1,
    });
  }
});

Example 2: Component Library Test

test('design system - all components', async ({ page }) => {
  const components = ['button', 'input', 'select', 'modal', 'table'];

  for (const component of components) {
    await runVisualTest(page, {
      identifier: `component-${component}`,
      url: `/components/${component}`,
      selector: `[data-testid="${component}-showcase"]`,
      threshold: 0.05,
    });
  }
});

Example 3: Theme Switching Test

test('dark mode - all pages', async ({ page }) => {
  const pages = ['/', '/about', '/contact'];

  for (const pagePath of pages) {
    // Test light mode
    await runVisualTest(page, {
      identifier: `${pagePath.replace(/\//g, '-')}-light`,
      url: pagePath,
      fullPage: true,
    });

    // Switch to dark mode
    await page.evaluate(() => {
      document.documentElement.setAttribute('data-theme', 'dark');
    });

    // Test dark mode
    await runVisualTest(page, {
      identifier: `${pagePath.replace(/\//g, '-')}-dark`,
      url: pagePath,
      fullPage: true,
    });
  }
});

Learning Resources

Official Documentation

Industry Tools

Implementation References

All code is available in this repository:

When to Use This Capability

Claude should proactively offer visual regression testing when:

  1. User mentions visual testing or regression
  1. Component development context
  1. CI/CD enhancement requests
  1. Debugging visual issues

Agent Decision Tree

User request → Contains visual/UI/screenshot keywords?
  ├─ Yes → Offer visual regression testing setup
  │   ├─ Already has visual tests? → Enhance/extend
  │   └─ No visual tests? → Full setup
  │
  └─ No → Monitor for component development
      └─ Creating UI components? → Suggest visual testing

Summary

Claude has comprehensive capabilities for implementing production-grade visual regression testing infrastructure. This includes:

All implementations follow proven patterns from leading design systems and are production-ready for immediate use.


Last Updated: 2025-11-13

Methodology Source: Ant Design Visual Regression Testing

Implementation Status: ✅ Complete and production-ready

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.