clade-ci-integration

Test and validate Claude integrations in CI/CD pipelines — Use when working with ci-integration patterns. GitHub Actions, mocking strategies, and cost control. Trigger with "anthropic ci", "test claude in ci", "anthropic github actions", "claude automated testing".

25 stars

Best use case

clade-ci-integration is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Test and validate Claude integrations in CI/CD pipelines — Use when working with ci-integration patterns. GitHub Actions, mocking strategies, and cost control. Trigger with "anthropic ci", "test claude in ci", "anthropic github actions", "claude automated testing".

Teams using clade-ci-integration should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/clade-ci-integration/SKILL.md --create-dirs "https://raw.githubusercontent.com/ComeOnOliver/skillshub/main/skills/jeremylongshore/claude-code-plugins-plus-skills/clade-ci-integration/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/clade-ci-integration/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How clade-ci-integration Compares

Feature / Agentclade-ci-integrationStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Test and validate Claude integrations in CI/CD pipelines — Use when working with ci-integration patterns. GitHub Actions, mocking strategies, and cost control. Trigger with "anthropic ci", "test claude in ci", "anthropic github actions", "claude automated testing".

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Anthropic CI Integration

## Overview
Testing Claude integrations in CI requires handling API keys securely, mocking for unit tests, and making real calls only in integration tests.

## GitHub Actions Setup
```yaml
# .github/workflows/test.yml
name: Test Claude Integration
on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20

      - run: npm ci

      # Unit tests — no API key needed (mocked)
      - run: npm run test:unit

      # Integration tests — real API calls
      - run: npm run test:integration
        env:
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
```

## Mock Strategy for Unit Tests
```typescript
// tests/helpers/mock-anthropic.ts
import { vi } from 'vitest';

export function mockAnthropicClient() {
  return {
    messages: {
      create: vi.fn().mockResolvedValue({
        id: 'msg_mock',
        type: 'message',
        role: 'assistant',
        model: 'claude-sonnet-4-20250514',
        content: [{ type: 'text', text: 'Mock response' }],
        stop_reason: 'end_turn',
        usage: { input_tokens: 10, output_tokens: 5 },
      }),
      stream: vi.fn().mockReturnValue({
        async *[Symbol.asyncIterator]() {
          yield { type: 'content_block_delta', delta: { type: 'text_delta', text: 'Mock' } };
        },
        finalMessage: vi.fn().mockResolvedValue({ usage: { input_tokens: 10, output_tokens: 5 } }),
      }),
    },
  };
}

// In your test:
import { mockAnthropicClient } from './helpers/mock-anthropic';

test('summarize function returns text', async () => {
  const client = mockAnthropicClient();
  const result = await summarize(client, 'Some long text...');
  expect(result).toBe('Mock response');
  expect(client.messages.create).toHaveBeenCalledWith(
    expect.objectContaining({ model: 'claude-sonnet-4-20250514' })
  );
});
```

## Integration Test (Real API)
```typescript
// tests/integration/claude.test.ts
import Anthropic from '@claude-ai/sdk';
import { describe, test, expect } from 'vitest';

describe('Claude API Integration', () => {
  const client = new Anthropic(); // Uses ANTHROPIC_API_KEY env var

  test('messages.create returns valid response', async () => {
    const message = await client.messages.create({
      model: 'claude-haiku-4-5-20251001', // Cheapest for CI
      max_tokens: 50,
      messages: [{ role: 'user', content: 'Say "test passed" in 2 words.' }],
    });

    expect(message.content[0].type).toBe('text');
    expect(message.stop_reason).toBe('end_turn');
    expect(message.usage.output_tokens).toBeGreaterThan(0);
  }, 30_000); // 30s timeout for API calls
});
```

## Cost Control in CI
| Strategy | How |
|----------|-----|
| Use Haiku only | Cheapest model, fast |
| Limit max_tokens | `max_tokens: 50` for validation tests |
| Skip on PRs from forks | Don't expose API key to untrusted code |
| Run integration tests only on main | `if: github.ref == 'refs/heads/main'` |
| Budget cap | Set spending limits in Anthropic console |

## Output
- GitHub Actions workflow running unit tests (mocked, no API key needed)
- Integration tests making real Claude API calls on main branch
- Mock client returning realistic response shapes for unit tests
- CI costs controlled via Haiku model and tight max_tokens

## Error Handling
| Error | Cause | Solution |
|-------|-------|----------|
| API Error | Check error type and status code | See `clade-common-errors` |

## Examples
See GitHub Actions YAML, Mock Strategy with Vitest, Integration Test with real API, and Cost Control table above.

## Resources
- [GitHub Actions Secrets](https://docs.github.com/en/actions/security-for-github-actions/using-secrets-in-github-actions)
- [Anthropic SDK](https://github.com/anthropics/claude-sdk-typescript)

## Next Steps
See `clade-deploy-integration` for deploying to production.

## Prerequisites
- GitHub repository with Actions enabled
- `ANTHROPIC_API_KEY` stored as GitHub Actions secret
- Test framework installed (Vitest, Jest, or pytest)

## Instructions

### Step 1: Review the patterns below
Each section contains production-ready code examples. Copy and adapt them to your use case.

### Step 2: Apply to your codebase
Integrate the patterns that match your requirements. Test each change individually.

### Step 3: Verify
Run your test suite to confirm the integration works correctly.

Related Skills

zapier-integration-helper

25
from ComeOnOliver/skillshub

Zapier Integration Helper - Auto-activating skill for Business Automation. Triggers on: zapier integration helper, zapier integration helper Part of the Business Automation skill category.

integration-test-setup

25
from ComeOnOliver/skillshub

Integration Test Setup - Auto-activating skill for Test Automation. Triggers on: integration test setup, integration test setup Part of the Test Automation skill category.

running-integration-tests

25
from ComeOnOliver/skillshub

This skill enables Claude to run and manage integration test suites. It automates environment setup, database seeding, service orchestration, and cleanup. Use this skill when the user asks to "run integration tests", "execute integration tests", or any command that implies running integration tests for a project, including specifying particular test suites or options like code coverage. It is triggered by phrases such as "/run-integration", "/rit", or requests mentioning "integration tests". The plugin handles database creation, migrations, seeding, and dependent service management.

integration-test-generator

25
from ComeOnOliver/skillshub

Integration Test Generator - Auto-activating skill for API Integration. Triggers on: integration test generator, integration test generator Part of the API Integration skill category.

fathom-ci-integration

25
from ComeOnOliver/skillshub

Test Fathom integrations in CI/CD pipelines. Trigger with phrases like "fathom CI", "fathom github actions", "test fathom pipeline".

exa-deploy-integration

25
from ComeOnOliver/skillshub

Deploy Exa integrations to Vercel, Docker, and Cloud Run platforms. Use when deploying Exa-powered applications to production, configuring platform-specific secrets, or building search API endpoints. Trigger with phrases like "deploy exa", "exa Vercel", "exa production deploy", "exa Cloud Run", "exa Docker".

exa-ci-integration

25
from ComeOnOliver/skillshub

Configure Exa CI/CD integration with GitHub Actions and automated testing. Use when setting up automated testing for Exa integrations, configuring CI pipelines, or adding Exa health checks to builds. Trigger with phrases like "exa CI", "exa GitHub Actions", "exa automated tests", "CI exa", "exa pipeline".

evernote-deploy-integration

25
from ComeOnOliver/skillshub

Deploy Evernote integrations to production environments. Use when deploying to cloud platforms, configuring production, or setting up deployment pipelines. Trigger with phrases like "deploy evernote", "evernote production deploy", "release evernote", "evernote cloud deployment".

evernote-ci-integration

25
from ComeOnOliver/skillshub

Configure CI/CD pipelines for Evernote integrations. Use when setting up automated testing, continuous integration, or deployment pipelines for Evernote projects. Trigger with phrases like "evernote ci", "evernote github actions", "evernote pipeline", "automate evernote tests".

elevenlabs-deploy-integration

25
from ComeOnOliver/skillshub

Deploy ElevenLabs TTS applications to Vercel, Fly.io, and Cloud Run. Use when deploying ElevenLabs-powered apps to production, configuring platform-specific secrets, or setting up serverless TTS. Trigger: "deploy elevenlabs", "elevenlabs Vercel", "elevenlabs Cloud Run", "elevenlabs Fly.io", "elevenlabs serverless", "host TTS API".

elevenlabs-ci-integration

25
from ComeOnOliver/skillshub

Configure CI/CD pipelines for ElevenLabs with mocked unit tests and gated integration tests. Use when setting up GitHub Actions for TTS projects, configuring CI test strategies, or automating ElevenLabs integration validation. Trigger: "elevenlabs CI", "elevenlabs GitHub Actions", "elevenlabs automated tests", "CI elevenlabs", "elevenlabs pipeline".

documenso-deploy-integration

25
from ComeOnOliver/skillshub

Deploy Documenso integrations across different platforms and environments. Use when deploying to cloud platforms, containerizing applications, or setting up infrastructure for Documenso integrations. Trigger with phrases like "deploy documenso", "documenso docker", "documenso kubernetes", "documenso cloud deployment".