code-quality
Code quality validation with linters, SOLID principles, DRY detection, error detection, and architecture compliance across all languages.
What this skill does
# Code Quality Skill ## ๐จ MANDATORY 7-PHASE WORKFLOW ``` PHASE 1: Exploration (explore-codebase) โ BLOCKER PHASE 2: Documentation (research-expert) โ BLOCKER PHASE 3: Impact Analysis (Grep usages) โ BLOCKER PHASE 3.5: DRY Detection (jscpd duplication) โ NON-BLOCKING PHASE 4: Error Detection (linters) PHASE 5: Precision Correction (with docs + impact + DRY) PHASE 6: Verification (re-run linters, tests, duplication) ``` **CRITICAL**: Phases 1-3 are BLOCKERS. Never skip them. **DRY**: Phase 3.5 is non-blocking but findings inform Phase 5 corrections. --- ## PHASE 1: Architecture Exploration **Launch explore-codebase agent FIRST**: ``` > Agent(subagent_type="fuse-ai-pilot:explore-codebase", prompt="...") ``` **Gather**: 1. Programming language(s) detected 2. Existing linter configs (.eslintrc, .prettierrc, pyproject.toml) 3. Package managers and installed linters 4. Project structure and conventions 5. Framework versions (package.json, go.mod, Cargo.toml) 6. Architecture patterns (Clean, Hexagonal, MVC) 7. State management (Zustand, Redux, Context) 8. Interface/types directories location --- ## PHASE 2: Documentation Research **Launch research-expert agent**: ``` > Agent(subagent_type="fuse-ai-pilot:research-expert", prompt="Verify [library/framework] documentation for [error type]. Find [language] best practices for [specific issue].") ``` **Request for each error**: - Official API documentation - Current syntax and deprecations - Best practices for error patterns - Version-specific breaking changes - Security advisories - Language-specific SOLID patterns --- ## PHASE 3: Impact Analysis **For EACH element to modify**: Grep usages โ assess risk โ document impact. | 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 | --- ## PHASE 3.5: Code Duplication Detection (DRY) **Tool**: `jscpd` โ 150+ languages โ `npx jscpd ./src --threshold 5 --reporters console,json` | Level | Threshold | Action | |-------|-----------|--------| | ๐ข Excellent | < 3% | No action needed | | ๐ก Good | 3-5% | Document, fix if time | | ๐ Acceptable | 5-10% | Extract shared logic | | ๐ด Critical | > 10% | Mandatory refactoring | See [references/duplication-thresholds.md](references/duplication-thresholds.md) for per-language thresholds, config, and extraction patterns. See [references/linter-commands.md](references/linter-commands.md) for language-specific jscpd commands. --- ## Linter Commands See [references/linter-commands.md](references/linter-commands.md) for language-specific commands. --- ## Error Priority Matrix | 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 | | **High** | DRY | Code duplication > 10%, copy-paste logic blocks | Mandatory refactoring | | **Medium** | DRY | Code duplication 5-10%, repeated patterns | Extract shared logic | | **Medium** | Performance | N+1 queries, deprecated APIs, inefficient algorithms | Fix if time | | **Low** | Style | Formatting, naming, missing docs | Fix if time | --- ## SOLID Validation See [references/solid-validation.md](references/solid-validation.md) for S-O-L-I-D detection patterns and fix examples. --- ## File Size Rules See [references/file-size-rules.md](references/file-size-rules.md) for LoC limits, calculation, and split strategies. --- ## Architecture Rules See [references/architecture-patterns.md](references/architecture-patterns.md) for project structures and patterns. --- ## Validation Report Format See [references/validation-report.md](references/validation-report.md) for the complete sniper report template. --- ## Complete Workflow Example See [references/examples.md](references/examples.md) for detailed walkthrough. --- ## Forbidden Behaviors ### Workflow Violations - โ Skip PHASE 1 (explore-codebase) - โ Skip PHASE 2 (research-expert) - โ Skip PHASE 3 (impact analysis) - โ Skip PHASE 3.5 (DRY detection) - โ Jump to corrections without completing Phases 1-3 - โ Proceed when BLOCKER is active ### Code Quality Violations - โ Leave ANY linter errors unfixed - โ Apply fixes that introduce new errors - โ Ignore SOLID violations - โ Ignore DRY violations > 5% duplication - โ Copy-paste code instead of extracting shared logic - โ Create tests if project has none ### Architecture Violations - โ Interfaces in component files (ZERO TOLERANCE) - โ Business logic in components (must be in hooks) - โ Monolithic components (must section) - โ Files >100 LoC without split - โ Local state for global data (use stores) ### Safety Violations - โ High-risk changes without user approval - โ Breaking backwards compatibility silently - โ Modifying public APIs without deprecation
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.