new-typescript-guidelines

Installation
SKILL.md

TypeScript Guidelines (Next.js App Router)

This skill outlines the TypeScript style guide, folder structure, and coding conventions for the KruChiron project. Adhere to these principles to ensure type safety, consistency, and clean code across the codebase.

Core Principles

  • ใช้ type แทน interface ตามแนวทางโปรเจกต์
  • เปิด strict mode ใน tsconfig.json
  • หลีกเลี่ยง any ทุกกรณี ใช้ unknown หากจำเป็น
  • ใช้ readonly กับค่าที่ไม่ควรแก้ไข
  • ใช้ as const กับตัวแปรคงที่ที่ใช้ซ้ำหลายจุด

Folder Structure

  • เก็บ type กลางไว้ที่ src/types
  • API response types อยู่ใน src/types/api
  • Component props แยกเป็นไฟล์ เช่น [component-name].types.ts
  • Domain-specific types จัดกลุ่มตาม feature module
  • แยก type สำหรับ server และ client หากมี dependency ต่างกัน
Installs
8
First Seen
Jul 6, 2026
new-typescript-guidelines — choonewza-pro/agent-skills-choonewza