Fix lint and static analysis warnings one at a time with proper prioritization
/plugin marketplace add teliha/dev-workflows/plugin install dev-workflows@dev-workflowsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
README.mdThis skill automatically activates when:
foundry.tomlforge fmt --checkforge buildnpx solhint 'contracts/**/*.sol'Cargo.tomlcargo clippy --all-targets --all-features -- -W clippy::allcargo fmt --checkpackage.jsonnpm run lint or eslint .tsc --noEmitnext.config.js or next.config.tsnpm run lint (Next.js built-in ESLint)Run the linter to get all warnings:
# ESLint
npm run lint 2>&1
# Clippy
cargo clippy --all-targets 2>&1
# Foundry
forge build 2>&1
forge fmt --check 2>&1
Fix warnings in this priority order:
Security Issues (Highest)
Correctness Issues
Performance Issues
Code Quality
Style Issues (Lowest)
Important: Fix only ONE warning per invocation for controlled changes.
// Warning: 'x' is defined but never used
const x = getValue(); // Remove if truly unused
// Or prefix with underscore if intentionally unused
const _x = getValue();
// Warning: Promises must be awaited
async function process() {
fetchData(); // Missing await
}
// Fix
async function process() {
await fetchData();
}
// Warning: 'x' is never reassigned
let x = 5;
// Fix
const x = 5;
// Warning: redundant clone
let s = str.clone();
// Fix: Remove clone if not needed
let s = str;
// Warning: unused variable
let x = 5;
// Fix: Prefix with underscore
let _x = 5;
// Warning: unneeded `return` statement
fn foo() -> i32 {
return 5;
}
// Fix
fn foo() -> i32 {
5
}
// Warning: Imported name "Foo" is not used
import {Foo, Bar} from "./contracts.sol";
// Fix: Remove unused
import {Bar} from "./contracts.sol";
// Warning: Function state mutability can be restricted to view
function getValue() public returns (uint256) {
return value;
}
// Fix
function getValue() public view returns (uint256) {
return value;
}
// Warning: Function visibility not set
function foo() {
// ...
}
// Fix
function foo() internal {
// ...
}
After fixing:
# Re-run the linter
npm run lint # ESLint
cargo clippy # Rust
forge build # Solidity
# Verify the specific warning is gone
# Run tests to ensure no regression
npm test
cargo test
forge test
After fixing a warning:
## Lint Fix Summary
### Warning Fixed
**Type**: [Security/Correctness/Performance/Quality/Style]
**Linter**: [ESLint/Clippy/Solhint/Forge]
**Rule**: [rule-name]
### Location
**File**: `path/to/file.ts`
**Line**: 42
### Original Warning
[Exact warning message from linter]
### Fix Applied
```diff
- const x = getValue();
+ const _x = getValue();
[Why this fix is appropriate]
git add path/to/file.ts
git commit -m "fix(lint): [description of fix]"
## Integration with CI/CD
```yaml
name: Fix Lint
on:
workflow_dispatch:
jobs:
fix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: npm ci
- uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
prompt: /fix-lint
Sometimes suppression is appropriate:
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const data: any = externalLib.getData(); // Third-party returns any
Only suppress when:
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.