skills/practices/ci-testing-standard/SKILL.md
Ship every project with a working CI pipeline (test + lint + typecheck + build). Auto-detects platform (GitHub/GitLab/Bitbucket) and stack (Node/Python/Go/Swift/Rust). Apply after the first feature ships.
npx skillsauth add devjarus/coding-agent ci-testing-standardInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Every project the plugin builds must ship with a working CI pipeline. Tests that only run when the developer remembers to type npm test aren't tests in practice. The goal: push to main → CI runs → red/green within 5 minutes.
Do NOT apply during touch-up on projects that already have working CI.
The project must have a single command that runs all tests. Read package.json / Makefile / pyproject.toml / go.mod / Package.swift to find what exists.
| Stack | Test command | If missing, add |
|-------|-------------|----------------|
| Node/TS | npm test or pnpm test | Add "test": "vitest run" (or jest, mocha — match what the implementor used) |
| Python | pytest | Add [tool.pytest.ini_options] to pyproject.toml |
| Go | go test ./... | Already works if test files exist |
| Swift | swift test | Already works if test targets exist |
| Rust | cargo test | Already works if test files exist |
Auto-detect the git hosting platform and create the appropriate workflow:
.github/workflows/ci.yml:
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4 # adjust for stack
with:
node-version: 22
- name: Install
run: npm ci # or pnpm install --frozen-lockfile
- name: Typecheck
run: npm run typecheck # if tsc exists in scripts
- name: Lint
run: npm run lint # if lint script exists
- name: Test
run: npm test
- name: Build
run: npm run build # if build script exists
.gitlab-ci.yml:
test:
image: node:22
script:
- npm ci
- npm run typecheck
- npm run lint
- npm test
- npm run build
bitbucket-pipelines.yml:
pipelines:
default:
- step:
name: Test
caches: [node]
script:
- npm ci
- npm run typecheck
- npm run lint
- npm test
- npm run build
steps:
- run: npm ci # frozen lockfile
- run: npx tsc --noEmit # typecheck
- run: npm run lint # eslint/biome
- run: npm test # vitest/jest
- run: npm run build # next build / tsup / tsc
steps:
- run: pip install -e ".[dev]" # or pip install -r requirements-dev.txt
- run: ruff check . # lint
- run: mypy src/ # typecheck (if mypy configured)
- run: pytest # tests
steps:
- run: go vet ./... # lint
- run: go test ./... # tests
- run: go build ./... # build
steps:
- run: swift build # build
- run: swift test # tests
# OR for Xcode projects:
- run: xcodebuild test -scheme MyApp -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 16'
Fast local feedback before CI. Use the lightest-weight option for the stack:
| Stack | Tool | What it runs |
|-------|------|-------------|
| Node/TS | husky + lint-staged | On pre-commit: lint + format staged files only. Fast (<5s). |
| Python | pre-commit framework | On pre-commit: ruff, mypy on changed files. |
| Go | golangci-lint in pre-commit | On pre-commit: vet + lint changed packages. |
| Any | lefthook | Language-agnostic, config in lefthook.yml. |
Keep pre-commit fast (<10s). Run lint and format on staged files only. Run full tests in CI, not pre-commit.
Example husky + lint-staged setup for Node:
// package.json
{
"lint-staged": {
"*.{ts,tsx}": ["eslint --fix", "prettier --write"],
"*.{json,md,css}": ["prettier --write"]
}
}
# Install
npx husky init
echo "npx lint-staged" > .husky/pre-commit
At minimum, CI must run everything the evaluator checks:
Additional for web apps:
next build / vite build succeeds (catches runtime import errors that typecheck misses)Additional for libraries:
npx publint validates package.json exportsnpx attw --pack . validates TypeScript resolutionnpm test and npm run build, CI must run both. If CI runs fewer checks than the evaluator, the CI is incomplete.npm ci, pnpm install --frozen-lockfile, pip install -r requirements.txt — not npm install which can drift.testing
Multi-source research method — decompose a question, fan out parallel investigators, interleaved-think each result, verify claims adversarially, synthesize a cited answer. Use for breadth-heavy research, stack comparisons, "which approach wins" questions.
testing
Decide when to use unit vs integration vs e2e tests, and when to mock vs use the real thing per dependency. Dependency injection is the enabler — without it you end up monkey-patching imports. Apply when writing tests of any kind.
development
Test-driven development process — write failing test, implement to pass, refactor. Use when implementing any feature or fixing bugs.
development
Patterns for sharing types, API contracts, and validation schemas between frontend and backend. Use when multiple domains consume the same data shapes to prevent contract drift.