Code quality validation with linters, SOLID principles, error detection, and architecture compliance across all languages.
/plugin marketplace add fusengine/agents/plugin install fuse-ai-pilot@fusengine-pluginsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
PHASE 1: Exploration (explore-codebase) ā BLOCKER
PHASE 2: Documentation (research-expert) ā BLOCKER
PHASE 3: Impact Analysis (Grep usages) ā BLOCKER
PHASE 4: Error Detection (linters)
PHASE 5: Precision Correction (with docs + impact)
PHASE 6: Verification (re-run linters, tests)
CRITICAL: Phases 1-3 are BLOCKERS. Never skip them.
Launch explore-codebase agent FIRST:
> Use Task tool with subagent_type="explore-codebase"
Gather:
Launch research-expert agent:
> Use Task tool with subagent_type="research-expert"
> Request: Verify [library/framework] documentation for [error type]
> Request: Find [language] best practices for [specific issue]
Request for each error:
For EACH element to modify:
# TypeScript/JavaScript
grep -r "functionName" --include="*.{ts,tsx,js,jsx}"
# Python
grep -r "function_name" --include="*.py"
# Go
grep -r "FunctionName" --include="*.go"
| Risk | Criteria | Action |
|---|---|---|
| š¢ LOW | Internal, 0-1 usages | Proceed |
| š” MEDIUM | 2-5 usages, compatible | Proceed with care |
| š“ HIGH | 5+ usages OR breaking | Flag to user FIRST |
| Element | Usages Found | Risk | Files Affected |
|---------|--------------|------|----------------|
| signIn() | 3 files | š” | login.tsx, auth.ts, middleware.ts |
# Install
bun install --save-dev eslint prettier @typescript-eslint/parser @typescript-eslint/eslint-plugin
# Run
npx eslint . --fix
npx prettier --write .
npx tsc --noEmit
# Install
pip install pylint black flake8 mypy ruff isort
# Run
ruff check . --fix
black .
mypy .
isort .
# Install
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
# Run
go fmt ./...
go vet ./...
golangci-lint run
staticcheck ./...
# Install
composer require --dev phpstan/phpstan squizlabs/php_codesniffer friendsofphp/php-cs-fixer
# Run
./vendor/bin/phpstan analyse -l 8
./vendor/bin/phpcs
./vendor/bin/php-cs-fixer fix
cargo fmt
cargo clippy -- -D warnings
mvn checkstyle:check
mvn spotbugs:check
mvn pmd:check
gem install rubocop
rubocop -a
clang-format -i *.cpp *.h
cppcheck --enable=all .
| Priority | Type | Examples | Action |
|---|---|---|---|
| Critical | Security | SQL injection, XSS, CSRF, auth bypass | Fix IMMEDIATELY |
| High | Logic | SOLID violations, memory leaks, race conditions | Fix same session |
| Medium | Performance | N+1 queries, deprecated APIs, inefficient algorithms | Fix if time |
| Low | Style | Formatting, naming, missing docs | Fix if time |
Detection:
// ā VIOLATION: Component does too much
function UserDashboard() {
const [user, setUser] = useState()
const fetchUser = async () => { /* API call */ }
const validateForm = (data) => { /* validation */ }
const calculateMetrics = () => { /* business logic */ }
return <div>...</div>
}
// ā
FIXED: Separated concerns
// hooks/useUserDashboard.ts
export function useUserDashboard() {
const fetchUser = async () => {}
const validateForm = (data) => {}
const calculateMetrics = () => {}
return { fetchUser, validateForm, calculateMetrics }
}
// components/UserDashboard.tsx
function UserDashboard() {
const { fetchUser, calculateMetrics } = useUserDashboard()
return <div>...</div>
}
| Metric | Limit | Action |
|---|---|---|
| LoC (code only) | < 100 | ā OK |
| LoC >= 100, Total < 200 | ā OK (well-documented) | |
| Total >= 200 | ā SPLIT required |
LoC = Total lines - Comment lines - Blank lines
Comment patterns:
- JS/TS: //, /* */, /** */
- Python: #, """ """, ''' '''
- Go: //, /* */
- PHP: //, #, /* */
- Rust: //, /* */, ///
component.tsx (150 lines) ā SPLIT INTO:
āāā Component.tsx (40 lines) - orchestrator
āāā ComponentHeader.tsx (30 lines)
āāā ComponentContent.tsx (35 lines)
āāā useComponentLogic.ts (45 lines) - hook
āāā index.ts (5 lines) - barrel export
// ā VIOLATION: Interface in component
// components/UserCard.tsx
interface UserCardProps { name: string; email: string }
export function UserCard({ name, email }: UserCardProps) {}
// ā
FIXED: Interface in dedicated file
// interfaces/user-card.interface.ts
export interface UserCardProps { name: string; email: string }
// components/UserCard.tsx
import { UserCardProps } from '@/interfaces/user-card.interface'
export function UserCard({ name, email }: UserCardProps) {}
// ā VIOLATION: Logic in component
function ProductList() {
const [products, setProducts] = useState([])
const fetchProducts = async () => { /* API call */ }
const filterByCategory = (cat) => products.filter(p => p.category === cat)
const calculateTotal = () => products.reduce((a, b) => a + b.price, 0)
useEffect(() => { fetchProducts() }, [])
return <div>{products.map(p => <ProductCard key={p.id} {...p} />)}</div>
}
// ā
FIXED: Logic extracted to hook
// hooks/useProductList.ts
export function useProductList() {
const [products, setProducts] = useState([])
const fetchProducts = async () => { /* API call */ }
const filterByCategory = (cat) => products.filter(p => p.category === cat)
const calculateTotal = () => products.reduce((a, b) => a + b.price, 0)
useEffect(() => { fetchProducts() }, [])
return { products, filterByCategory, calculateTotal }
}
// components/ProductList.tsx
function ProductList() {
const { products, filterByCategory } = useProductList()
return <div>{products.map(p => <ProductCard key={p.id} {...p} />)}</div>
}
// ā VIOLATION: Shared state via props drilling
function App() {
const [user, setUser] = useState(null)
return <Layout user={user}><Dashboard user={user} setUser={setUser} /></Layout>
}
// ā
FIXED: Zustand store
// stores/user.store.ts
import { create } from 'zustand'
export const useUserStore = create((set) => ({
user: null,
setUser: (user) => set({ user }),
clearUser: () => set({ user: null })
}))
// components/Dashboard.tsx
function Dashboard() {
const { user, setUser } = useUserStore()
return <div>{user?.name}</div>
}
// ā VIOLATION: Monolithic component (150+ lines)
function Dashboard() {
// 50 lines of state/effects
// 100 lines of JSX with header, sidebar, content, footer
}
// ā
FIXED: Sectioned architecture
// components/Dashboard/Dashboard.tsx (40 lines)
function Dashboard() {
const { data, actions } = useDashboardLogic()
return (
<div>
<DashboardHeader user={data.user} />
<DashboardSidebar nav={data.nav} />
<DashboardContent data={data} actions={actions} />
<DashboardFooter />
</div>
)
}
// components/Dashboard/DashboardHeader.tsx (25 lines)
// components/Dashboard/DashboardSidebar.tsx (30 lines)
// components/Dashboard/DashboardContent.tsx (35 lines)
// hooks/useDashboardLogic.ts (50 lines)
src/
āāā app/ # Next.js App Router pages
āāā components/ # React components (NO interfaces, NO logic)
ā āāā Dashboard/
ā āāā Dashboard.tsx
ā āāā DashboardHeader.tsx
ā āāā index.ts
āāā interfaces/ # ALL TypeScript interfaces/types
ā āāā dashboard.interface.ts
āāā hooks/ # Custom hooks (ALL business logic)
ā āāā useDashboardLogic.ts
āāā stores/ # Zustand stores (global state)
ā āāā user.store.ts
āāā lib/ # Utilities, helpers
āāā services/ # API calls, external services
project/
āāā src/
ā āāā domain/ # Business logic, entities
ā āāā application/ # Use cases, services
ā āāā infrastructure/ # DB, external APIs
ā āāā interfaces/ # Adapters, controllers
āāā tests/
āāā pyproject.toml
Rules:
def func(x: int) -> str:from abc import ABC, abstractmethodproject/
āāā cmd/ # Entry points (main.go)
āāā internal/ # Private code (not importable)
ā āāā domain/
ā āāā usecase/
ā āāā repository/
āāā pkg/ # Public libraries
āāā go.mod
Rules:
internal/ for private codeif err != nil { return err }src/
āāā Domain/ # Entities, value objects
āāā Application/ # Use cases, services
āāā Infrastructure/ # Repositories, external
āāā Presentation/ # Controllers, views
Rules:
public function get(int $id): Usersrc/main/java/com/company/
āāā domain/ # Entities
āāā application/ # Services
āāā infrastructure/ # Repositories
āāā interfaces/ # Controllers, DTOs
Rules:
@Autowired, @Injectsrc/
āāā lib.rs # Library entry
āāā main.rs # Binary entry
āāā domain/
āāā application/
āāā infrastructure/
Rules:
pub(crate) for internal visibilityResult<T, E> for errors## šÆ Sniper Validation Report
### PHASE 1: Architecture (via explore-codebase)
- **Language**: TypeScript
- **Framework**: Next.js 16 (App Router)
- **Architecture**: Clean Architecture
- **State Management**: Zustand
- **Interface Location**: src/interfaces/
- **File Sizes**: ā
All <100 LoC
### PHASE 2: Documentation (via research-expert)
- **Research Agent Used**: ā
YES
- **Libraries Researched**:
- TypeScript@5.3: Function overload syntax
- Next.js@16: Server Actions patterns
- Zustand@4: Store best practices
### PHASE 3: Impact Analysis
| Element | Usages | Risk | Action |
|---------|--------|------|--------|
| signIn() | 3 files | š” MEDIUM | Fix with care |
| useAuth | 5 files | š“ HIGH | Flag to user |
| validateToken | 1 file | š¢ LOW | Fix directly |
### PHASE 4-5: Errors Fixed
- **Critical**: 0
- **High**: 2 (SOLID violations)
- **Medium**: 5 (deprecated APIs)
- **Low**: 3 (formatting)
### Architectural Fixes
- **Interfaces Moved**: 3 files (components ā interfaces/)
- **Logic Extracted**: 2 hooks created
- **Stores Created**: 1 Zustand store
- **Files Split**: 2 (>100 LoC ā multiple files)
### PHASE 6: Verification
- ā
Linters: 0 errors
- ā
TypeScript: tsc --noEmit passed
- ā
Tests: All passing
- ā
Architecture: SOLID compliant
### SOLID Compliance
- ā
S: One purpose per file
- ā
O: Extensible via interfaces
- ā
L: Subtypes replaceable
- ā
I: Small interfaces
- ā
D: Depends on abstractions
Request: "Fix all TypeScript errors in auth module"
> Launch explore-codebase agent
Result:
- Language: TypeScript
- Framework: Next.js 16
- Auth module: src/modules/auth/
- Interfaces: src/interfaces/
- State: Zustand in src/stores/
> Launch research-expert agent
> Request: "TypeScript 5.x function overload syntax"
> Request: "Next.js 16 Server Actions authentication"
Result:
- TypeScript 5.3 docs: Function overloads
- Next.js 16 docs: useSearchParams is now async
- Best practice: Zod for validation
> Grep all files importing auth functions
Files found:
1. src/app/login/page.tsx (imports signIn)
2. src/app/dashboard/layout.tsx (imports useAuth)
3. src/middleware.ts (imports validateToken)
Risk Assessment:
- signIn: š” MEDIUM (2 usages)
- useAuth: š“ HIGH (3 usages, refactor needed)
- validateToken: š¢ LOW (internal only)
ā ļø FLAG TO USER: useAuth needs refactoring (3 files affected)
Errors found:
- src/modules/auth/signIn.ts:45 - TS2345 type mismatch
- src/hooks/useAuth.ts:12 - Missing dependency
- src/modules/auth/validateToken.ts:23 - TS2322 null safety
Fix 1: signIn.ts:45
- Error: TS2345
- Research: TypeScript overload docs
- Impact: 2 usages compatible
- Fix: Add type annotation
- ā
Applied
Fix 2: useAuth.ts:12 (HIGH RISK)
- Error: Missing dependency
- Research: React 19 useEffect docs
- Impact: š“ 3 files affected
- ā ļø USER APPROVAL: Approved
- Fix: Extract to useAuthState.ts
- ā
Applied + updated 3 files
Fix 3: validateToken.ts:23
- Error: TS2322 null
- Impact: Internal only
- Fix: Add null guard
- ā
Applied
ā
tsc --noEmit: 0 errors
ā
ESLint: 0 errors, 0 warnings
ā
npm test: All passing
ā
Architecture: Compliant
ā
File sizes: All <100 LoC
šÆ MISSION COMPLETE: 3 errors fixed, 0 code broken
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.