/lang:code-quality-standardsfrom lang
Enforces language-specific code quality standards including linting, formatting, type safety, naming conventions, and complexity limits. Use when writing, refactoring, or reviewing code.
Ships in lang. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
MANDATORY: All code must adhere to language-specific quality standards verified through Context7 best practices.
Ensure consistent, maintainable, and high-quality code across all programming languages by enforcing:
Type Hints (MANDATORY):
# ✅ CORRECT - Use latest type hints
from typing import AsyncIterator, ParamSpec, TypeIs, TYPE_CHECKING
from collections.abc import Sequence
# AsyncIterator for async generators
async def infinite_stream(start: int) -> AsyncIterator[int]:
while True:
yield start
start = await increment(start)
# ParamSpec for type-safe decorators
P = ParamSpec('P')
R = TypeVar('R')
def decorator(f: Callable[P, R]) -> Callable[P, R]:
def inner(*args: P.args, **kwargs: P.kwargs) -> R:
return f(*args, **kwargs)
return inner
# TypeIs for type narrowing
def is_str_list(val: list[object]) -> TypeIs[list[str]]:
return all(isinstance(x, str) for x in val)
# TYPE_CHECKING for conditional imports
if TYPE_CHECKING:
import expensive_mod
# ❌ INCORRECT - Old-style or missing type hints
def process(data): # Missing return type
pass
def old_style(items: List[str]): # Use list[str] instead
pass
Linting Tools:
Configuration:
# pyproject.toml
[tool.ruff]
target-version = "py311"
line-length = 100
select = ["E", "F", "I", "N", "W", "UP", "B", "A", "C4", "DTZ", "T10", "EM", "ISC", "ICN", "PIE", "PYI", "PT", "Q", "RET", "SIM", "TID", "ARG", "PTH", "PD", "PGH", "PL", "TRY", "NPY", "RUF"]
[tool.mypy]
python_version = "3.11"
strict = true
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
[tool.black]
line-length = 100
target-version = ['py311']
Code Complexity:
ES6 Standards (MANDATORY):
// ✅ CORRECT - ES6 best practices
// Default parameters
function handleThings(opts = {}) {
// ...
}
// Object property shorthand
const lukeSkywalker = 'Luke Skywalker';
const obj = { lukeSkywalker };
// Object method shorthand
const atom = {
value: 1,
addValue(value) {
return atom.value + value;
},
};
// Spread operator
const original = { a: 1, b: 2 };
const copy = { ...original, c: 3 };
// Destructuring
const { firstName, lastName } = user;
const [first, ...rest] = array;
// Arrow functions
const items = [1, 2, 3].map(x => x * 2);
// ❌ INCORRECT - Old patterns
// No default parameters
function handleThings(opts) {
opts = opts || {};
}
// Long form object
const obj = { lukeSkywalker: lukeSkywalker };
// Function expression instead of arrow
const items = [1, 2, 3].map(function(x) {
return x * 2;
});
Linting Tools:
Configuration:
// .eslintrc.json
{
"extends": ["airbnb-base", "prettier"],
"parserOptions": {
"ecmaVersion": 2022,
"sourceType": "module"
},
"rules": {
"no-console": "warn",
"prefer-const": "error",
"prefer-arrow-callback": "error",
"prefer-template": "error",
"prefer-destructuring": "error",
"object-shorthand": "error"
}
}
// .prettierrc
{
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"printWidth": 100
}
Async Patterns (MANDATORY):
// ✅ CORRECT - Modern async patterns
// Async iteration with for await...of
import * as readline from 'node:readline';
async function processLineByLine() {
const rl = readline.createInterface({
input: fs.createReadStream('file.txt'),
crlfDelay: Infinity,
});
for await (const line of rl) {
// Process line
}
}
// AbortSignal for cancellation
const ac = new AbortController();
const { signal } = ac;
setTimeout(() => ac.abort(), 5000);
for await (const event of on(ee, 'foo', { signal })) {
console.log(event);
}
// Symbol.asyncIterator for custom iterators
const asyncIterable = {
async *[Symbol.asyncIterator]() {
yield 1;
yield 2;
yield 3;
},
};
// ❌ INCORRECT - Old patterns
// Using callbacks instead of async/await
fs.readFile('file.txt', (err, data) => {
if (err) throw err;
console.log(data);
});
// No AbortSignal for cancellation
// No Symbol.asyncIterator for iterables
Event Loop Optimization:
setImmediate() for I/O callbacksError Handling (MANDATORY):
#!/usr/bin/env bash
# ✅ CORRECT - Proper error handling
# Exit on error, undefined variable, pipe failure
set -euo pipefail
# Logging function
log() {
echo "[$(date +'%Y-%m-%d %H:%M:%S')] $*"
}
# Error handling function
error_exit() {
echo "ERROR: $1" >&2
exit 1
}
# Cleanup function
cleanup() {
log "Cleaning up..."
# Cleanup code
}
# Register cleanup on exit
trap cleanup EXIT
# Well-documented function
#######################################
# Description: Calculate sum
# Globals: None
# Arguments: $1 - First number, $2 - Second number
# Outputs: Sum of the two numbers
# Returns: 0 if successful
#######################################
sum() {
local result=$(( $1 + $2 ))
echo "$result"
}
# ❌ INCORRECT - No error handling
#!/bin/bash
# No set -e
# No error handlers
# No cleanup
# No function documentation
Linting Tools:
Configuration:
# .shellcheckrc
enable=all
shell=bash
severity=style
# shfmt options
# -i 4 : indent with 4 spaces
# -bn : binary ops like && and | may start a line
# -ci : switch cases will be indented
# -sr : redirect operators followed by a space
Function/Method Documentation:
Code Comments:
Minimum Coverage:
Test Quality:
Input Validation:
Secrets Management:
Code Performance:
Memory Management:
# Python
ruff check .
mypy .
black --check .
# JavaScript/TypeScript
npm run lint
npm run type-check
npm run format:check
# Bash
shellcheck **/*.sh
shfmt -d .
# Quality gates
- lint: MUST pass
- type-check: MUST pass
- format-check: MUST pass
- tests: MUST pass with >80% coverage
- security-scan: MUST have no high/critical vulnerabilities
VSCode:
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.organizeImports": true
},
"python.linting.ruffEnabled": true,
"python.linting.mypyEnabled": true,
"python.formatting.provider": "black",
"eslint.validate": ["javascript", "typescript"],
"prettier.enable": true
}
{
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"pre-push": "npm test"
}
},
"lint-staged": {
"*.py": ["ruff check", "black", "mypy"],
"*.{js,ts}": ["eslint --fix", "prettier --write"],
"*.sh": ["shellcheck", "shfmt -w"]
}
}
Quality standards may be relaxed for:
All exceptions MUST:
Quality Metrics:
Regular Audits:
.claude/rules/context7-required.md)Enforcement Level: MANDATORY Review Frequency: Every commit Last Updated: 2025-01-15 Context7 Verified: ✅ All patterns verified against latest documentation
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Python, TypeScript, JavaScript, Ruff, mypy, ESLint, Prettier
linting, formatting, type-safety, code-review, code-complexity
2 skills in this plugin
npx claudepluginhub lagowski/claudeautopm --plugin langOther plugins' skills for the same job