AI-powered code refactoring and modernization. Use this skill for code cleanup, technical debt reduction, framework migration, and improving code quality.
// Before ❌
function processOrder(order) {
// 50 lines of validation
// 30 lines of calculation
// 20 lines of formatting
}
// After ✅
function processOrder(order) {
const validated = validateOrder(order);
const calculated = calculateTotal(validated);
return formatOutput(calculated);
}
// Before ❌
if (user && user.role === 'admin' || user && user.role === 'superadmin') {
if (user.permissions && user.permissions.includes('write')) { ... }
}
// After ✅
const isAdmin = user?.role === 'admin' || user?.role === 'superadmin';
const canWrite = user?.permissions?.includes('write');
if (isAdmin && canWrite) { ... }
| Code Smell | Solution | |------------|----------| | Magic Numbers | Extract to named constants | | Long Parameters | Use object/options pattern | | Duplicate Code | Extract to shared function | | Dead Code | Delete unused code | | Deep Nesting | Early return pattern |
// Before (Class)
class Counter extends Component {
state = { count: 0 };
increment = () => this.setState({ count: this.state.count + 1 });
render() { return <button onClick={this.increment}>{this.state.count}</button> }
}
// After (Functional)
function Counter() {
const [count, setCount] = useState(0);
const increment = () => setCount(c => c + 1);
return <button onClick={increment}>{count}</button>;
}
// Before (CommonJS)
const fs = require('fs');
module.exports = { readFile };
// After (ESM)
import fs from 'fs';
export { readFile };
# Find duplicate code
npx jscpd ./src
# Find unused exports
npx ts-unused-exports tsconfig.json
# Check complexity
npx eslint --rule 'complexity: ["error", 10]' ./src
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer