quality-code

Review TypeScript code for type safety and testing best practices.

1|Updated Feb 1, 2026
One-click install
npx skills add https://github.com/safzanpirani/pi-config --skill quality-code-safzanpirani
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: quality-code
Source: https://github.com/safzanpirani/pi-config/tree/main/skills/quality-code
Command: npx skills add https://github.com/safzanpirani/pi-config --skill quality-code-safzanpirani

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill helps developers write and review TypeScript code by enforcing best practices and providing guidelines for code quality and maintainability.

Core Features & Use Cases

  • Type Safety: Encourages the use of branded types and discriminant unions to prevent invalid states.
  • End-to-End Types: Promotes the use of end-to-end type tools to maintain type consistency across the application.
  • Real Tests: Encourages the use of real services for testing over mocks.
  • Observability: Recommends the use of OpenTelemetry for logging and observability.
  • Abstractions: Guides on choosing the right abstractions to avoid premature optimization.
  • Use Case: A developer uses this Skill to review a codebase and apply the guidelines to improve type safety and maintainability.

Quick Start

Run the quality-code skill on your TypeScript codebase to ensure adherence to best practices.

Frequently Asked Questions about quality-code

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

FAQPage Schema
How do I enforce type safety and prevent invalid states in TypeScript?

You can enforce type safety in TypeScript by using branded types and discriminant unions to prevent invalid states. This approach ensures end-to-end type consistency across your application and improves overall code maintainability.

What's the best way to maintain end-to-end type consistency across a full-stack TypeScript application?

Maintaining end-to-end type consistency across a full-stack TypeScript application is achieved by using end-to-end type tools. These tools enforce type safety and ensure that data structures remain consistent across the entire development workflow.

Should I use mocks or real services for testing TypeScript applications?

You should use real services for testing TypeScript applications rather than mocks. Relying on real services provides more accurate test coverage and validates actual behavior, ensuring your code quality guidelines are met effectively.

How does OpenTelemetry improve observability and logging in TypeScript codebases?

OpenTelemetry improves observability and logging in TypeScript codebases by providing standardized instrumentation. Integrating OpenTelemetry allows developers to monitor application performance and trace issues effectively, which enhances overall code maintainability.

When should I introduce abstractions to avoid premature optimization in TypeScript?

You should introduce abstractions in TypeScript only when necessary to avoid premature optimization. Choosing the right abstractions requires evaluating your specific use case to ensure the code remains maintainable without adding unnecessary complexity.

Can I review an existing TypeScript codebase for maintainability and best practices?

Yes, you can review an existing TypeScript codebase for maintainability and best practices. Running a quality-code review helps enforce type safety, evaluate testing strategies, and apply observability guidelines to improve the overall structure.