Overview
The lint-and-validate skill provides mandatory quality control procedures that must be run after every code modification. It ensures syntax correctness, type safety, and adherence to project standards.What This Skill Provides
- Mandatory Validation: Quality checks required before completing tasks
- Ecosystem-Specific Tools: Node.js, Python, and other language support
- The Quality Loop: Write → Lint → Fix → Repeat workflow
- Error Handling: How to address linting and type errors
- Security Scanning: Vulnerability detection in dependencies
- Automated Scripts: Unified lint and type coverage tools
Core Principle
MANDATORY: Run appropriate validation tools after EVERY code change. Do not finish a task until the code is error-free.Validation 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
Use Cases
When to Use This Skill
- After every code modification
- Before committing code
- During code reviews
- In CI/CD pipelines
- When setting up new projects
Example Scenarios
- Post-Edit: “I just modified this file, now run lint checks”
- Pre-Commit: “Validate all code before committing”
- Type Safety: “Check TypeScript types across the project”
- Security: “Scan dependencies for vulnerabilities”
Error Handling
Lint Failures
- Fix style or syntax issues immediately
- Use
--fixflag for automatic corrections - Address remaining issues manually
TypeScript Failures
- Correct type mismatches
- Add proper type annotations
- Fix any type errors before proceeding
No Tool Configured
- Check project root for
.eslintrc,tsconfig.json,pyproject.toml - Suggest creating configuration if missing
- Set up appropriate tools for the project
Automated 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> |
Quality Standards
Mandatory Checks
- No lint errors
- No type errors
- No high-severity security vulnerabilities
- Code formatted according to project standards
Optional but Recommended
- High type coverage (>80%)
- No lint warnings
- All security vulnerabilities addressed
Language-Specific Tools
JavaScript/TypeScript
| Tool | Purpose |
|---|---|
| ESLint | Style and syntax linting |
| TypeScript | Type checking |
| Prettier | Code formatting |
| npm audit | Security scanning |
Python
| Tool | Purpose |
|---|---|
| Ruff | Fast linting and formatting |
| Bandit | Security vulnerability scanning |
| MyPy | Static type checking |
| Black | Code formatting |
Other Languages
- Rust:
cargo clippy+cargo fmt - Go:
golint+go vet - Java: Checkstyle + SpotBugs
CI/CD Integration
Pipeline Steps
- Install dependencies
- Run linter
- Run type checker
- Run security scanner
- Fail build if any errors
Pre-Commit Hooks
Anti-Patterns to Avoid
- ❌ Skipping validation before completing tasks
- ❌ Committing code with lint errors
- ❌ Ignoring type errors with
@ts-ignore - ❌ Disabling security warnings without investigation
- ❌ Not fixing auto-fixable issues
Related Skills
- clean-code: Code quality principles
- code-review-checklist: Review standards
- testing-patterns: Test quality validation
Which Agents Use This Skill
- test-engineer: Validates test code
- qa-automation-engineer: Ensures test quality
- orchestrator: Overall quality enforcement
- frontend-specialist: Frontend code validation
- backend-specialist: Backend code validation
- All agents: Should use for code they write
Configuration Files
ESLint (.eslintrc.json)
TypeScript (tsconfig.json)
Python (pyproject.toml)
Workflow Example
- Edit code in
src/user.ts - Run lint:
npm run lint - Check output: 3 errors found
- Auto-fix:
npm run lint -- --fix - Manual fix: Address remaining issues
- Run types:
npx tsc --noEmit - Fix types: Add proper type annotations
- Re-run: Verify no errors
- Complete: Task can now be marked done
Tools Available
- Read, Glob, Grep: For finding configuration files
- Bash: For running lint and validation commands
Strict Rule: No code should be committed or reported as “done” without passing these checks. This is non-negotiable.
