$npx -y skills add One-Man-Company/Skills-ContextManager --skill lint-and-validateAutomatic 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.
| 1 | # Lint and Validate Skill |
| 2 | |
| 3 | > **MANDATORY:** Run appropriate validation tools after EVERY code change. Do not finish a task until the code is error-free. |
| 4 | |
| 5 | ### Procedures by Ecosystem |
| 6 | |
| 7 | #### Node.js / TypeScript |
| 8 | 1. **Lint/Fix:** `npm run lint` or `npx eslint "path" --fix` |
| 9 | 2. **Types:** `npx tsc --noEmit` |
| 10 | 3. **Security:** `npm audit --audit-level=high` |
| 11 | |
| 12 | #### Python |
| 13 | 1. **Linter (Ruff):** `ruff check "path" --fix` (Fast & Modern) |
| 14 | 2. **Security (Bandit):** `bandit -r "path" -ll` |
| 15 | 3. **Types (MyPy):** `mypy "path"` |
| 16 | |
| 17 | ## The Quality Loop |
| 18 | 1. **Write/Edit Code** |
| 19 | 2. **Run Audit:** `npm run lint && npx tsc --noEmit` |
| 20 | 3. **Analyze Report:** Check the "FINAL AUDIT REPORT" section. |
| 21 | 4. **Fix & Repeat:** Submitting code with "FINAL AUDIT" failures is NOT allowed. |
| 22 | |
| 23 | ## Error Handling |
| 24 | - If `lint` fails: Fix the style or syntax issues immediately. |
| 25 | - If `tsc` fails: Correct type mismatches before proceeding. |
| 26 | - If no tool is configured: Check the project root for `.eslintrc`, `tsconfig.json`, `pyproject.toml` and suggest creating one. |
| 27 | |
| 28 | --- |
| 29 | **Strict Rule:** No code should be committed or reported as "done" without passing these checks. |
| 30 | |
| 31 | --- |
| 32 | |
| 33 | ## Scripts |
| 34 | |
| 35 | | Script | Purpose | Command | |
| 36 | |--------|---------|---------| |
| 37 | | `scripts/lint_runner.py` | Unified lint check | `python scripts/lint_runner.py <project_path>` | |
| 38 | | `scripts/type_coverage.py` | Type coverage analysis | `python scripts/type_coverage.py <project_path>` | |