lint-and-validate
npx machina-cli add skill vudovn/antigravity-kit/lint-and-validate --openclawLint 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
- Lint/Fix:
npm run lintornpx eslint "path" --fix - Types:
npx tsc --noEmit - Security:
npm audit --audit-level=high
Python
- Linter (Ruff):
ruff check "path" --fix(Fast & Modern) - Security (Bandit):
bandit -r "path" -ll - Types (MyPy):
mypy "path"
The Quality Loop
- Write/Edit Code
- Run Audit:
npm run lint && npx tsc --noEmit - Analyze Report: Check the "FINAL AUDIT REPORT" section.
- Fix & Repeat: Submitting code with "FINAL AUDIT" failures is NOT allowed.
Error Handling
- If
lintfails: Fix the style or syntax issues immediately. - If
tscfails: Correct type mismatches before proceeding. - If no tool is configured: Check the project root for
.eslintrc,tsconfig.json,pyproject.tomland 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> |
Source
git clone https://github.com/vudovn/antigravity-kit/blob/main/.agent/skills/lint-and-validate/SKILL.mdView on GitHub Overview
Lint-and-Validate enforces automatic quality control after every code modification. It supports Node.js/TypeScript and Python by running linting, type checks, and security analyses to uphold syntax correctness and project standards. Strict rule: no code is committed or reported as done until it passes the FINAL AUDIT REPORT.
How This Skill Works
When code changes are made, the skill runs ecosystem-specific checks: Node.js/TypeScript uses lint/fix, type checks, and security scans; Python uses Ruff, Bandit, and MyPy. It delegates work to the unified scripts lint_runner.py and type_coverage.py to produce a FINAL AUDIT REPORT. If any tool reports failures, you must fix issues before proceeding.
When to Use It
- After every code modification to ensure correctness
- Before committing or delivering code to a branch or release
- When starting work on a Node.js/TypeScript or Python project to establish quality gates
- If a FINAL AUDIT REPORT indicates failures, to fix issues before continuing
- When a project lacks ESLint, tsconfig.json, or pyproject.toml and needs configuration guidance
Quick Start
- Step 1: Edit code as usual
- Step 2: Run ecosystem checks (Node/TypeScript: npm run lint, npx eslint path --fix, npx tsc --noEmit; Python: Ruff, Bandit, MyPy)
- Step 3: Review the FINAL AUDIT REPORT and fix any issues; re-run until all checks pass
Best Practices
- Run the ecosystem checks after every code change
- Never finish or commit until the FINAL AUDIT REPORT shows all checks pass
- For Node/TypeScript: npm run lint, npx eslint path --fix, npx tsc --noEmit, and npm audit --audit-level=high
- For Python: Ruff linter, Bandit security scan, and MyPy type checks (ruff check path --fix; bandit -r path -ll; mypy path)
- Ensure project config files exist (.eslintrc, tsconfig.json, pyproject.toml); if missing, create or adjust them and re-run lint
Example Use Cases
- A Node.js/TypeScript project running npm run lint, npx tsc --noEmit, and npm audit
- A Python project using Ruff, Bandit, and MyPy on a feature branch
- A commit gate that blocks merging until the FINAL AUDIT REPORT is clean
- Starting a new project where you verify eslint/tsconfig/pyproject presence and configuration
- Pre-deployment checks that catch static analysis issues before release