home / skills / sickn33 / antigravity-awesome-skills / lint-and-validate

lint-and-validate skill

/skills/lint-and-validate

This skill enforces automatic quality control by linting, type checking, and static analysis after every code change to ensure correctness.

This is most likely a fork of the lint-and-validate skill from xfstudio
npx playbooks add skill sickn33/antigravity-awesome-skills --skill lint-and-validate

Review the files below or copy the command above to add this skill to your agents.

Files (3)
SKILL.md
1.7 KB
---
name: lint-and-validate
description: "Automatic quality control, linting, and static analysis procedures. Use after every code modification to ensure syntax correctness and project standards. Triggers onKeywords: lint, format, check, validate, types, static analysis."
allowed-tools: Read, Glob, Grep, Bash
---

# Lint and Validate Skill

> **MANDATORY:** Run appropriate validation tools after EVERY code change. Do not finish a task until the code is error-free.

### Procedures by Ecosystem

#### Node.js / TypeScript
1. **Lint/Fix:** `npm run lint` or `npx eslint "path" --fix`
2. **Types:** `npx tsc --noEmit`
3. **Security:** `npm audit --audit-level=high`

#### Python
1. **Linter (Ruff):** `ruff check "path" --fix` (Fast & Modern)
2. **Security (Bandit):** `bandit -r "path" -ll`
3. **Types (MyPy):** `mypy "path"`

## The Quality Loop
1. **Write/Edit Code**
2. **Run Audit:** `npm run lint && npx tsc --noEmit`
3. **Analyze Report:** Check the "FINAL AUDIT REPORT" section.
4. **Fix & Repeat:** Submitting code with "FINAL AUDIT" failures is NOT allowed.

## Error Handling
- If `lint` fails: Fix the style or syntax issues immediately.
- If `tsc` fails: Correct type mismatches before proceeding.
- If no tool is configured: Check the project root for `.eslintrc`, `tsconfig.json`, `pyproject.toml` and suggest creating one.

---
**Strict Rule:** No code should be committed or reported as "done" without passing these checks.

---

## Scripts

| Script | Purpose | Command |
|--------|---------|---------|
| `scripts/lint_runner.py` | Unified lint check | `python scripts/lint_runner.py <project_path>` |
| `scripts/type_coverage.py` | Type coverage analysis | `python scripts/type_coverage.py <project_path>` |

Overview

This skill enforces automatic quality control, linting, and static analysis after every code change. It prevents finishing tasks until code passes syntax, style, type, and basic security checks. The goal is zero-known-defect commits by integrating fast linters, type checkers, and security scanners into the development loop.

How this skill works

The skill runs ecosystem-specific tools (ESLint/TypeScript for Node, Ruff/MyPy/Bandit for Python) or a unified runner script to validate the project path. It analyzes reports, surfaces failures as a FINAL AUDIT that must be resolved, and repeats the loop until all checks pass. If no config files are present, it recommends creating standard configs and refuses to mark work as done until validation succeeds.

When to use it

  • After every code modification or before creating a PR
  • When merging branches to ensure no regressions reach main
  • During CI pipelines to gate deployments on quality checks
  • When adding dependencies or updating project configs
  • On codebases that require strict type and security guarantees

Best practices

  • Run lint and type checks locally before committing to catch issues early
  • Use --fix options where available to auto-correct style problems
  • Treat security findings with priority; triage high/critical issues immediately
  • Keep configuration files (eslintrc, tsconfig, pyproject.toml) in project root
  • Automate the unified runner script in pre-commit hooks or CI jobs

Example use cases

  • Node/TypeScript feature branch: run npm run lint && npx tsc --noEmit to validate style and types
  • Python bugfix: ruff check --fix, mypy path, and bandit -r path -ll before pushing
  • CI pipeline: call scripts/lint_runner.py to enforce consistent checks across languages
  • Repository onboarding: detect missing lint/type configs and suggest standard templates
  • Release gating: block merges until FINAL AUDIT report is clean

FAQ

What happens if the project has no config files?

The skill checks for standard config files in the project root and will recommend creating them; it refuses to mark work done until a validation strategy is established.

Can auto-fixable issues be fixed automatically?

Yes. Use fix flags (ESLint --fix, Ruff --fix) to auto-correct style problems, but re-run type and security checks afterward.