mistral-ci-integration
Configure Mistral AI CI/CD integration with GitHub Actions and prompt testing. Use when setting up automated testing, prompt regression suites, or integrating Mistral AI quality gates into your build process. Trigger with phrases like "mistral CI", "mistral GitHub Actions", "mistral automated tests", "CI mistral", "prompt testing".
Best use case
mistral-ci-integration is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Configure Mistral AI CI/CD integration with GitHub Actions and prompt testing. Use when setting up automated testing, prompt regression suites, or integrating Mistral AI quality gates into your build process. Trigger with phrases like "mistral CI", "mistral GitHub Actions", "mistral automated tests", "CI mistral", "prompt testing".
Teams using mistral-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
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/mistral-ci-integration/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How mistral-ci-integration Compares
| Feature / Agent | mistral-ci-integration | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Configure Mistral AI CI/CD integration with GitHub Actions and prompt testing. Use when setting up automated testing, prompt regression suites, or integrating Mistral AI quality gates into your build process. Trigger with phrases like "mistral CI", "mistral GitHub Actions", "mistral automated tests", "CI mistral", "prompt 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.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
SKILL.md Source
# Mistral CI Integration
## Overview
Integrate Mistral AI validation into CI/CD pipelines: prompt regression tests, model response quality checks, cost estimation in PR comments, and deployment gates for prompt changes. Uses GitHub Actions with `MISTRAL_API_KEY` stored as a repository secret.
## Prerequisites
- `MISTRAL_API_KEY` stored as GitHub repository secret
- GitHub Actions configured
- Test framework (Vitest recommended)
## Instructions
### Step 1: GitHub Actions Workflow
```yaml
# .github/workflows/mistral-tests.yml
name: Mistral AI Tests
on:
pull_request:
paths:
- 'src/prompts/**'
- 'src/ai/**'
- 'tests/ai/**'
jobs:
prompt-tests:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- name: Run prompt regression tests
env:
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
run: npx vitest run tests/ai/ --reporter=verbose
- name: Cost estimation
env:
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
run: npx tsx scripts/estimate-costs.ts >> $GITHUB_STEP_SUMMARY
```
### Step 2: Prompt Regression Tests
```typescript
// tests/ai/mistral-prompts.test.ts
import { describe, it, expect } from 'vitest';
import { Mistral } from '@mistralai/mistralai';
const apiKey = process.env.MISTRAL_API_KEY;
describe.skipIf(!apiKey)('Mistral Prompt Regression', () => {
const client = new Mistral({ apiKey: apiKey! });
it('summarization produces 2-3 sentences', async () => {
const result = await client.chat.complete({
model: 'mistral-small-latest',
messages: [
{ role: 'system', content: 'Summarize in 2-3 sentences.' },
{ role: 'user', content: 'TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. It adds optional static typing and class-based OOP.' },
],
maxTokens: 150,
temperature: 0, // Deterministic for regression
});
const content = result.choices?.[0]?.message?.content ?? '';
expect(content.length).toBeGreaterThan(20);
expect(content.split(/[.!?]+/).filter(Boolean).length).toBeGreaterThanOrEqual(2);
}, 15_000);
it('classification returns valid category', async () => {
const result = await client.chat.complete({
model: 'mistral-small-latest',
messages: [
{ role: 'system', content: 'Classify as: bug, feature, question. Reply with one word only.' },
{ role: 'user', content: 'The login page crashes on mobile devices' },
],
maxTokens: 10,
temperature: 0,
});
const category = result.choices?.[0]?.message?.content?.trim().toLowerCase();
expect(['bug', 'feature', 'question']).toContain(category);
}, 15_000);
it('JSON mode returns valid JSON', async () => {
const result = await client.chat.complete({
model: 'mistral-small-latest',
messages: [{ role: 'user', content: 'Return {"status": "ok"} as JSON' }],
responseFormat: { type: 'json_object' },
maxTokens: 50,
temperature: 0,
});
const content = result.choices?.[0]?.message?.content ?? '';
expect(() => JSON.parse(content)).not.toThrow();
}, 15_000);
it('respects maxTokens limit', async () => {
const result = await client.chat.complete({
model: 'mistral-small-latest',
messages: [{ role: 'user', content: 'Write a long essay about AI' }],
maxTokens: 50,
});
expect(result.usage?.completionTokens).toBeLessThanOrEqual(50);
}, 15_000);
});
```
### Step 3: Cost Estimation Script
```typescript
// scripts/estimate-costs.ts
import { readdirSync, readFileSync } from 'fs';
import { join } from 'path';
const PRICING: Record<string, { input: number; output: number }> = {
'mistral-small-latest': { input: 0.1, output: 0.3 },
'mistral-large-latest': { input: 0.5, output: 1.5 },
'codestral-latest': { input: 0.3, output: 0.9 },
'mistral-embed': { input: 0.1, output: 0 },
};
console.log('## Prompt Cost Estimates\n');
console.log('| File | Est. Tokens | Cost/call (small) | Cost/call (large) |');
console.log('|------|-------------|-------------------|-------------------|');
const promptDir = join(process.cwd(), 'src/prompts');
if (readdirSync(promptDir, { withFileTypes: true })) {
for (const file of readdirSync(promptDir)) {
const content = readFileSync(join(promptDir, file), 'utf-8');
const tokens = Math.ceil(content.length / 4);
const smallCost = (tokens / 1e6) * PRICING['mistral-small-latest'].input;
const largeCost = (tokens / 1e6) * PRICING['mistral-large-latest'].input;
console.log(`| ${file} | ~${tokens} | $${smallCost.toFixed(6)} | $${largeCost.toFixed(6)} |`);
}
}
```
### Step 4: Model Validation Gate
```yaml
# .github/workflows/model-gate.yml
name: AI Model Gate
on:
pull_request:
paths: ['src/ai/**', 'src/prompts/**']
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: '20', cache: 'npm' }
- run: npm ci
- name: Validate model references
run: |
echo "## Model References" >> $GITHUB_STEP_SUMMARY
grep -rn "mistral-\|codestral-\|pixtral-" src/ --include="*.ts" | \
grep -oP "(mistral|codestral|pixtral)-[\w-]+" | sort -u | while read model; do
echo "- \`$model\`" >> $GITHUB_STEP_SUMMARY
done
- name: Check for deprecated models
run: |
DEPRECATED="open-mistral-7b open-mixtral-8x7b mistral-tiny mistral-medium"
for model in $DEPRECATED; do
if grep -rq "$model" src/ --include="*.ts"; then
echo "::warning::Deprecated model found: $model"
fi
done
```
## Error Handling
| Issue | Cause | Solution |
|-------|-------|----------|
| Tests fail in CI | Missing API key secret | Add `MISTRAL_API_KEY` to repo Settings > Secrets |
| Flaky prompt tests | Non-deterministic output | Set `temperature: 0` for regression tests |
| High CI costs | Running on every push | Only trigger on prompt/AI file changes via `paths:` |
| Test timeout | Slow API response | Set generous timeout (15s) per test |
## Examples
### Minimal Smoke Test
```yaml
- name: Mistral smoke test
env:
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
run: |
curl -sf -X POST https://api.mistral.ai/v1/chat/completions \
-H "Authorization: Bearer $MISTRAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"mistral-small-latest","messages":[{"role":"user","content":"ping"}],"max_tokens":5}' \
| jq '.choices[0].message.content'
```
## Resources
- [Mistral API Reference](https://docs.mistral.ai/api/)
- [GitHub Actions Secrets](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions)
## Output
- GitHub Actions workflow for prompt testing
- Regression test suite with deterministic assertions
- Cost estimation in PR summaries
- Model validation gate catching deprecated referencesRelated Skills
running-integration-tests
Execute integration tests validating component interactions and system integration. Use when performing specialized testing. Trigger with phrases like "run integration tests", "test integration", or "validate component interactions".
workhuman-deploy-integration
Workhuman deploy integration for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman deploy integration".
workhuman-ci-integration
Workhuman ci integration for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman ci integration".
wispr-deploy-integration
Wispr Flow deploy integration for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr deploy integration".
wispr-ci-integration
Wispr Flow ci integration for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr ci integration".
windsurf-ci-integration
Integrate Windsurf Cascade workflows into CI/CD pipelines and team automation. Use when automating Cascade tasks in GitHub Actions, enforcing AI code quality gates, or setting up Windsurf config validation in CI. Trigger with phrases like "windsurf CI", "windsurf GitHub Actions", "windsurf automation", "cascade CI", "windsurf pipeline".
webflow-deploy-integration
Deploy Webflow-powered applications to Vercel, Fly.io, and Google Cloud Run with proper secrets management and Webflow-specific health checks. Trigger with phrases like "deploy webflow", "webflow Vercel", "webflow production deploy", "webflow Cloud Run", "webflow Fly.io".
webflow-ci-integration
Configure Webflow CI/CD with GitHub Actions — automated CMS validation, integration tests with test tokens, and publish-on-merge workflows. Use when setting up automated testing or CI pipelines for Webflow integrations. Trigger with phrases like "webflow CI", "webflow GitHub Actions", "webflow automated tests", "CI webflow", "webflow pipeline".
vercel-deploy-integration
Deploy and manage Vercel production deployments with promotion, rollback, and multi-region strategies. Use when deploying to production, configuring deployment regions, or setting up blue-green deployment patterns on Vercel. Trigger with phrases like "deploy vercel", "vercel production deploy", "vercel promote", "vercel rollback", "vercel regions".
veeva-deploy-integration
Veeva Vault deploy integration for REST API and clinical operations. Use when working with Veeva Vault document management and CRM. Trigger: "veeva deploy integration".
veeva-ci-integration
Veeva Vault ci integration for REST API and clinical operations. Use when working with Veeva Vault document management and CRM. Trigger: "veeva ci integration".
vastai-deploy-integration
Deploy ML training jobs and inference services on Vast.ai GPU cloud. Use when deploying GPU workloads, configuring Docker images, or setting up automated deployment scripts. Trigger with phrases like "deploy vastai", "vastai deployment", "vastai docker", "vastai production deploy".