lint-and-typecheck
Skill0 starsChanged 2 months agoMITView on GitHub
Guides agents through discovering, executing, and resolving linter and static type-checker errors without suppressing warnings with ignore comments.
In this repository49 other files it gives its agents.
- bug-reproducerSkill
- claim-checkerSkill
- command-failure-diagnoserSkill
- config-risk-reviewerSkill
- csv-validatorSkill
- deployment-checklist-makerSkill
- diff-reviewerSkill
- factual-summarizerSkill
- field-extractorSkill
- api-contract-testerSkill
- database-migration-helperSkill
- security-vulnerability-fixerSkill
- git-commit-stagerSkill
- git-conflict-resolverSkill
- github-actions-debuggerSkill
- github-issue-triagerSkill
- github-pr-creatorSkill
- github-pr-reviewerSkill
- go-code-qualitySkill
- go-lint-and-vetSkill
- go-testingSkill
- json-schema-converterSkill
- meaning-preserving-editorSkill
- meeting-notes-to-actionsSkill
- minimal-bug-fixSkill
- option-comparatorSkill
- py-code-qualitySkill
- py-lint-and-typecheckSkill
- py-testingSkill
- readme-writerSkill
- regression-test-writerSkill
- release-notes-drafterSkill
- repo-inspectorSkill
- research-briefSkill
- reversible-cleanup-plannerSkill
- rust-clippy-checkSkill
- rust-code-qualitySkill
- rust-testingSkill
- small-refactorSkill
- status-updateSkill
- step-by-step-tutorialSkill
- step-decomposerSkill
- tabular-analyzerSkill
- task-briefSkill
- test-runner-debuggerSkill
- ts-code-qualitySkill
- ts-lint-and-typecheckSkill
- ts-testingSkill
- skill-templateSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 5 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
Ensure code adheres to codebase static typing and style standards before committing.
- Distinctive: line 14
Use this skill when:
- Very specific: line 20
Do not use to run functional or unit tests.
- Very specific: line 21
Do not use to review architectural diffs for security risks.
- Very specific: line 22
Do not use to refactor working code when no lint errors exist.
- Distinctive: line 29
If no target files are specified: inspect git status --porcelain to identify changed files.
- Very specific: line 30
If tool configuration is unknown: inspect manifests (package.json, pyproject.toml, go.mod, Cargo.toml) to identify configured linter and …
- Very specific: line 31
Strict Prohibition: Never resolve a lint or type error by adding @ts-ignore, @ts-expect-error, eslint-disable, # noqa, # type: ignore, or …
- Distinctive: line 34
Follow these numbered actions:
- Very specific: line 41
Run type-checker (e.g., npx tsc --noEmit or mypy <files>).
- Very specific: line 44
Run linter command (e.g., npm run lint or ruff check .).
- Very specific: line 54
If safe auto-fix is available (e.g., eslint --fix or ruff check --fix): run auto-fix for formatting/whitespace, then manually fix remaining …
- Very specific: line 55
If a type error is caused by a missing library type definition: check if @types/<pkg> is required in devDependencies.
- Distinctive: line 56
If an import is unused: delete the unused import statement.
- Distinctive: line 92
Stop and ask the user when:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Lint and Type-Check
Guides agents through discovering, executing, and resolving linter and static type-checker errors. Strictly forbids suppressing issues with @ts-ignore, eslint-disable, # noqa, or # type: ignore.
1. Purpose
Ensure code adheres to codebase static typing and style standards before committing. "Type-checking" verifies type safety without runtime execution (e.g. tsc --noEmit, mypy). "Linting" identifies stylistic defects, unused imports, syntax hazards, and antipatterns (e.g. eslint, ruff, golangci-lint).
2. When to Use
Use this skill when:
- Finishing a code change before opening a pull request or declaring task completion.
- Investigating pre-commit hook failures or CI lint pipeline failures.
- User requests: "Lint the project", "Run type checks", or "Fix lint errors".
3. When Not to Use
- Do not use to run functional or unit tests; use
test-runner-debugger. - Do not use to review architectural diffs for security risks; use
diff-reviewer. - Do not use to refactor working code when no lint errors exist; use
small-refactor.
4. Required Inputs
workspace_root: Directory containing the project (default: current working directory).target_files: Optional specific files modified (e.g.src/auth.ts).
5. Missing-Input Behavior
- If no target files are specified: inspect
git status --porcelainto identify changed files. - If tool configuration is unknown: inspect manifests (
package.json,pyproject.toml,go.mod,Cargo.toml) to identify configured linter and type-checker commands. - Strict Prohibition: Never resolve a lint or type error by adding
@ts-ignore,@ts-expect-error,eslint-disable,# noqa,# type: ignore, oranyunless explicitly instructed by the user.
6. Procedure
Follow these numbered actions:
- Action 1: Identify Configured Tools
- Node/TypeScript: Check
package.jsonscripts (lint,typecheck,check),tsconfig.json,.eslintrc*,biome.json. - Python: Check
ruff check,flake8,mypy,pyright,black --check. - Go: Check
golangci-lint run,go vet ./.... - Rust: Check
cargo clippy -- -D warnings.
- Node/TypeScript: Check
- Action 2: Execute Type-Check First
- Run type-checker (e.g.,
npx tsc --noEmitormypy <files>). - Fix type errors before linting, as types often eliminate underlying logic hazards.
- Run type-checker (e.g.,
- Action 3: Execute Linter
- Run linter command (e.g.,
npm run lintorruff check .). - Parse output: extract file path, line number, column, rule name, and error description.
- Run linter command (e.g.,
- Action 4: Apply Root-Cause Fixes
- Address the root cause (e.g., add missing return type, remove unused variable, handle null case).
- Action 5: Re-Verify Clean Exit
- Re-run type-checker and linter until exit code is 0 with zero errors and zero warnings.
- Action 6: Emit Summary Report
- Format per Section 8.
7. Decision Rules
- If safe auto-fix is available (e.g.,
eslint --fixorruff check --fix): run auto-fix for formatting/whitespace, then manually fix remaining logical errors. - If a type error is caused by a missing library type definition: check if
@types/<pkg>is required indevDependencies. - If an import is unused: delete the unused import statement; do not comment it out.
8. Output Format
Emit the report using this template:
### Lint & Type-Check Verification
- **Type Checker**: `[Command, e.g., npx tsc --noEmit]` -> [PASS | FAIL]
- **Linter**: `[Command, e.g., npm run lint]` -> [PASS | FAIL]
- **Files Checked**: [Count or file list]
- **Issues Resolved**: [Count]
#### Resolved Issues
| File | Line | Rule / Error Code | Root Cause & Resolution |
| :--- | :--- | :--- | :--- |
| `[file]` | `[line]` | `[e.g., TS2345]` | [Fixed type mismatch by casting or guard] |
| `[file]` | `[line]` | `[e.g., no-unused-vars]` | [Removed unused import variable] |
#### Final Verification Status
- Clean exit code `0` confirmed across all tools.9. Verification Checklist
- Type-checker exited with code 0.
- Linter exited with code 0.
- Zero
@ts-ignoreor# noqasuppression comments were introduced. - No unrelated files were reformatted.
10. Common Failures and Recovery
| Failure Symptom | Cause | Recovery Action |
tsc passes but eslint fails | Separate rule sets | Run both commands sequentially; never assume one covers the other. |
Agent adds @ts-ignore | Lazy shortcut | Reject suppression; inspect function definition and provide proper types. |
| Global reformat modifies 100 files | Running linter on entire monorepo | Pass specific file paths to linter (npx eslint src/auth.ts). |
11. Stop or Escalation Conditions
Stop and ask the user when:
- Resolving a type error requires changing a public library API signature shared across external packages.
12. Examples
Example 1: Successful Execution
Input:
Target file: src/user.ts
Error: TS2322: Type 'string | null' is not assignable to type 'string'.
Line: 18: const username: string = user.getName();Output:
### Lint & Type-Check Verification
- **Type Checker**: `npx tsc --noEmit` -> PASS
- **Linter**: `npm run lint` -> PASS
- **Files Checked**: 1 (`src/user.ts`)
- **Issues Resolved**: 1
#### Resolved Issues
| File | Line | Rule / Error Code | Root Cause & Resolution |
| :--- | :--- | :--- | :--- |
| `src/user.ts` | 18 | `TS2322` | `getName()` returns `string \| null`. Added nullish coalescing default: `const username: string = user.getName() ?? 'Guest';`. |
#### Final Verification Status
- Clean exit code `0` confirmed across all tools.Example 2: Ambiguous or Missing Input
Input:
Lint the code.
Context: No manifest in directory.Output:
### Lint & Type-Check: Halted - No Configuration Found
- **Status**: Halted
No linter or type-checker configuration was detected in the workspace (no `package.json`, `tsconfig.json`, `pyproject.toml`, or `.golangci.yml`).
Please specify:
1. The programming language and tools used.
2. The specific command you use to lint or check types.Example 3: Expected Final Output
Output:
### Lint & Type-Check Verification
- **Type Checker**: `mypy src/` -> PASS
- **Linter**: `ruff check src/` -> PASS
- **Files Checked**: 3
- **Issues Resolved**: 2
#### Resolved Issues
| File | Line | Rule / Error Code | Root Cause & Resolution |
| :--- | :--- | :--- | :--- |
| `src/api.py` | 12 | `F401` | Removed unused import `import sys`. |
| `src/client.py` | 44 | `arg-type` | Corrected timeout parameter type from `float` to `Optional[float]`. |
#### Final Verification Status
- Clean exit code `0` confirmed across all tools.Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

