code-quality

Provides refactoring patterns and guidelines for JavaScript/TypeScript projects.

Updated Feb 22, 2026
One-click install
npx skills add https://github.com/ps-carvalho/cortex-agents --skill code-quality-ps-carvalho
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-quality
Source: https://github.com/ps-carvalho/cortex-agents/tree/main/.opencode/skills/code-quality
Command: npx skills add https://github.com/ps-carvalho/cortex-agents --skill code-quality-ps-carvalho

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This section helps development teams produce cleaner, more maintainable code by applying established refactoring patterns and coding practices, reducing technical debt and errors.

Core Features & Use Cases

  • Refactoring patterns and practical guidelines for writing clean code
  • Principles: SOLID, DRY, KISS, YAGNI
  • Guidance for code organization, reviews, and maintainability
  • Use Case: When refactoring a legacy module, apply Extract Method, Replace Conditional with Polymorphism, and modularization to improve readability and testability.

Quick Start

Provide a TypeScript module you want refactored and I will generate a concrete plan.

Frequently Asked Questions about code-quality

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I apply refactoring patterns to improve code quality in a TypeScript module?

Code quality refactoring patterns like Extract Method and Replace Conditional with Polymorphism reduce technical debt by improving readability and enforce coding standards during legacy module restructuring.

What is the best way to enforce SOLID, DRY, and KISS principles during a code review?

The best way to enforce SOLID, DRY, and KISS principles during a code review is to apply established maintainability guidelines and language-agnostic code organization rules to identify areas for cleaner, more maintainable code.

How do I refactor a legacy JavaScript module to improve readability and testability?

Refactor legacy JavaScript modules by applying modularization and patterns like Extract Method to restructure code into cleaner, more maintainable components that improve readability and testability.

Does this refactoring guidance work for both JavaScript and TypeScript projects?

Yes, this refactoring guidance applies language-agnostic code organization rules and maintainability guidelines to enhance code quality across both JavaScript and TypeScript projects during architecture discussions.

When should I use Replace Conditional with Polymorphism during refactoring?

Use Replace Conditional with Polymorphism during refactoring when complex conditional logic reduces maintainability, shifting behavior into modular structures to improve readability and testability.

How do I generate a concrete refactoring plan for an existing TypeScript module?

Generate a concrete refactoring plan for a TypeScript module by providing the code to be refactored, applying established patterns like Extract Method to produce actionable steps that improve readability and reduce debt.