linting-engineer
Use this skill after every code change to run linting and type checking. Ensures code passes all lint checks, types are correct and consistent, and typing patterns match repo conventions. Trigger after writing or modifying code.
What this skill does
# Linting Engineer Protocol After every code change, run the linter and type checker. Fix what they catch. No exceptions. ## Core Principles - **Run after every change** - Not at the end, after each file/change - **Use repo's tools** - Don't add new linters or type checkers - **Strictest mode available** - If there's a strict flag, use it - **Fix, don't disable** - Never add ignore comments unless absolutely necessary - **Type everything** - All new code must be properly typed - **Be consistent** - Use the same typing patterns as the rest of the repo ## Step 1: Find the Repo's Linter Check for linting configuration in this order: ``` 1. package.json scripts (lint, lint:fix, check, format) 2. Config files: - .eslintrc.* / eslint.config.* - .prettierrc.* / prettier.config.* - pyproject.toml (ruff, black, flake8) - setup.cfg / .flake8 - .rubocop.yml - rustfmt.toml / .rustfmt.toml - .golangci.yml 3. Makefile targets (lint, check, fmt) 4. CI config (.github/workflows/*.yml) - see what CI runs ``` **Use what exists. Don't create new configs.** ## Step 2: Run Linting Run the linter command found in the repo: ```bash # Common patterns - use what the repo has npm run lint # JS/TS projects npm run lint:fix # With auto-fix pnpm lint # pnpm projects yarn lint # yarn projects ruff check . # Python (ruff) ruff check . --fix # Python with fix black --check . # Python (black) flake8 . # Python (flake8) cargo fmt --check # Rust cargo clippy # Rust go fmt ./... # Go golangci-lint run # Go ``` **If strict mode exists, use it:** ```bash npm run lint -- --max-warnings=0 ruff check . --strict cargo clippy -- -D warnings ``` ## Step 3: Run Type Checking Find and run the repo's type checker: ```bash # TypeScript tsc --noEmit npm run typecheck # Python mypy . pyright . python -m pyright # Check pyproject.toml or mypy.ini for config ``` **Use strict mode:** ```bash tsc --noEmit --strict mypy --strict . pyright --strict ``` ## Step 4: Ensure Type Consistency Before adding types, check how the repo does it: **Find the pattern:** ``` 1. Look at 3-5 similar files in the repo 2. Note which typing approach they use 3. Match exactly ``` **Consistency rules:** | If repo uses... | Then use... | Don't mix with... | |-----------------|-------------|-------------------| | TypeScript interfaces | interfaces | type aliases for objects | | TypeScript type aliases | type aliases | interfaces for same purpose | | Pydantic models | Pydantic | dataclasses or TypedDict | | Python dataclasses | dataclasses | Pydantic or attrs | | typing.TypedDict | TypedDict | Pydantic or dataclasses | | attrs | attrs | dataclasses or Pydantic | | Zod schemas | Zod | io-ts or yup | **Red flags:** - Mixing Pydantic and dataclasses in the same module - Using `Any` when a proper type exists - Inconsistent Optional vs Union[X, None] style - Different import styles (`from typing import` vs `typing.`) **Fix inconsistencies:** ```python # Bad - mixing styles from pydantic import BaseModel from dataclasses import dataclass class UserRequest(BaseModel): ... # Pydantic @dataclass class UserResponse: ... # dataclass - inconsistent! # Good - pick one, match repo from pydantic import BaseModel class UserRequest(BaseModel): ... class UserResponse(BaseModel): ... ``` ## Step 5: Fix All Violations For each lint or type violation: 1. **Read the error** - Understand what rule was violated 2. **Fix the code** - Change the code to comply 3. **Re-run linter** - Verify the fix worked 4. **Repeat** - Until clean **Never:** - Add `// eslint-disable` or `# noqa` to bypass - Modify linter config to make errors pass - Skip files with `--ignore-path` **Only exception:** If fixing would break functionality and the rule is genuinely wrong for this case, document why and get approval before disabling. ## Step 6: Verify After all fixes: ```bash # Run full lint check npm run lint # Run type check tsc --noEmit mypy . # Run formatter check if separate npm run format:check prettier --check . ``` All must pass with zero warnings and zero type errors. ## Response Format After running checks: ``` ## Lint & Type Check Results **Linter**: [command] | **Type checker**: [command] **Mode**: [strict/standard] **Initial violations**: [lint count] lint, [type count] type errors **Fixes applied**: - [file:line] - [what was fixed] **Type consistency**: [consistent / issues found] - [any inconsistencies noted] **Final status**: [PASS / FAIL] **Remaining issues** (if any): - [issue] - Why: [reason] ``` ## Common Fixes by Language **JavaScript/TypeScript:** - Missing semicolons → Add them (or remove if repo style) - Unused imports → Remove them - `any` types → Add proper types, never leave `any` - console.log → Remove or use proper logging - Missing return types → Add explicit return types - Implicit any in parameters → Add parameter types **Python:** - Import order → Let isort/ruff fix - Line length → Break lines appropriately - Unused variables → Remove or prefix with `_` - Missing type hints → Add them to all functions - `Any` usage → Replace with proper types - Inconsistent Optional → Match repo style (Optional[X] vs X | None) - Mixed typing patterns → Convert to repo's standard (Pydantic/dataclass/TypedDict) **Go:** - Formatting → `go fmt` handles it - Unused imports → Remove them - Error not checked → Handle the error **Rust:** - Warnings → Fix or explicitly allow with reason - Formatting → `cargo fmt` handles it - Clippy suggestions → Usually correct, apply them ## Calibration **Run early, run often.** Don't wait until you've written 500 lines to lint. **Fix immediately.** Don't accumulate lint debt. **Trust the linter.** If the repo configured a rule, there's a reason. Fix the code, don't fight the rule. **Stay in your lane.** Don't cover: - Whether the linting rules are correct (that's repo config) - Code logic issues (that's code review) - Test coverage (that's testing)
Related in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.