CI/CD Integration

Documentation > Tutorials > CI/CD Integration

Tutorial: CI/CD Integration

Time: 10 minutes
Prerequisites: Skills validated and tested locally

Introduction

Integrating skill-creator into your CI/CD pipeline catches quality issues before they reach production. Automated validation ensures skills follow the official format, detects conflicts early, and verifies activation accuracy.

Step 1: Understand CI Capabilities

Command CI Use Case Exit Code Behavior
validate Check skill format Exit 1 if invalid
detect-conflicts Find semantic overlap Exit 1 if HIGH severity
test run Verify activation Exit 1 if failures or thresholds exceeded
benchmark Measure accuracy Exit 1 if correlation < 85%

Step 2: JSON Output Mode

CI pipelines require machine-readable output:

skill-creator detect-conflicts --json
skill-creator test run --all --json

Or use the environment variable:

export CI=true
skill-creator test run --all  # Automatically outputs JSON

Step 3: Create Basic Workflow

Create a GitHub Actions workflow at .github/workflows/skill-quality.yml:

name: Skill Quality

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'

      - name: Install skill-creator
        run: npm install -g skill-creator

      - name: Validate skills
        run: skill-creator validate --all

Step 4: Add Quality Gates

      - name: Check conflicts
        run: skill-creator detect-conflicts --json

      - name: Run activation tests
        run: skill-creator test run --all --min-accuracy=90 --max-false-positive=5
Quality Level Accuracy False Positive Use Case
Strict 95% 2% Production-critical skills
Standard 90% 5% Most projects
Permissive 80% 10% Early development

Step 5: Complete Working Example

name: Skill Quality

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'
      - name: Install dependencies
        run: npm ci
      - name: Install skill-creator
        run: npm install -g skill-creator
      - name: Validate skills
        run: skill-creator validate --all
      - name: Check conflicts
        run: skill-creator detect-conflicts --json
      - name: Run activation tests
        run: skill-creator test run --all --min-accuracy=90 --max-false-positive=5
      - name: Benchmark (optional)
        run: skill-creator benchmark
        continue-on-error: true

Step 6: Other CI Platforms

GitLab CI

skill-quality:
  image: node:20
  script:
    - npm install -g skill-creator
    - skill-creator validate --all
    - skill-creator detect-conflicts --json
    - skill-creator test run --all --min-accuracy=90

Jenkins

pipeline {
    agent { docker { image 'node:20' } }
    stages {
        stage('Quality') {
            steps {
                sh 'npm install -g skill-creator'
                sh 'skill-creator validate --all'
                sh 'skill-creator detect-conflicts --json'
                sh 'skill-creator test run --all --min-accuracy=90'
            }
        }
    }
}

Key Takeaways

  • Fail fast: Catch quality issues in CI before they affect production
  • Quality gates: Set accuracy thresholds appropriate for your project
  • Exit codes: All commands return 0/1 for CI integration
  • JSON output: Auto-enabled with CI=true environment variable