Summary
ใช้ skill นี้เมื่อตั้งค่าโปรเจค Frontend ใหม่, ถามเรื่องโครงสร้าง folder ของ React, เครื่องมือที่ต้องติดตั้ง, naming conventions สำหรับ TypeScript/React, หรือ environment variables ของ SSD
pratchaya0/ssd-agent-skills · Archived
ใช้ skill นี้เมื่อตั้งค่าโปรเจค Frontend ใหม่, ถามเรื่องโครงสร้าง folder ของ React, เครื่องมือที่ต้องติดตั้ง, naming conventions สำหรับ TypeScript/React, หรือ environment variables ของ SSD
npx skills add pratchaya0/ssd-agent-skills --skill ssd-frontend-setup
ใช้ skill นี้เมื่อตั้งค่าโปรเจค Frontend ใหม่, ถามเรื่องโครงสร้าง folder ของ React, เครื่องมือที่ต้องติดตั้ง, naming conventions สำหรับ TypeScript/React, หรือ environment variables ของ SSD
This repository is archived — consider an actively maintained alternative.
มาตรฐานการพัฒนาซอฟต์แวร์ของทีม SSD: React/TypeScript, .NET Core, Python, Git — ใช้เมื่อเขียนโค้…
37 installsใช้ skill นี้เมื่อใช้งาน Redux ใน React, สร้าง slice, ตั้งค่า rootReducer, หรือ dispatch/subscr…
2 installsใช้ skill นี้เมื่อสร้าง form ใน React ด้วย Formik, ต้องการ validation, ปรับแต่ง MUI component ใ…
2 installsใช้ skill นี้เมื่อเขียน React component, กำหนด Props type, ใช้ Refs/Fragments, ตั้งชื่อ compone…
2 installsRelated neighbors and high-traction skills in the same topics — useful to compare before installing.
Use when doing ANY task involving Supabase. Triggers: Supabase products (Database, Auth, Edge F…
263K installsGuidance for distinctive, intentional visual design when building new UI or reshaping an existi…
866.4K installsOther skills from pratchaya0/ssd-agent-skills.
npx skills add pratchaya0/ssd-agent-skills
Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.
main
Parsed from SKILL.md frontmatter.
Files included with this skill beyond the listing page.
SKILL.md
7,824 B
SUMMARY.md
386 B
Frontend ของ SSD ใช้ React + TypeScript (TSX) เป็นหลัก โดยมี Template มาตรฐานที่ดาวน์โหลดได้จาก GitHub Organization ของ SSD ทุกโปรเจคต้องใช้ Template เดียวกันและ Package ชุดเดียวกัน
VS Code Extensions:
Chrome Extensions:
Prettier Config (ตั้งค่าใน .prettierrc):
{
"trailingComma": "es5",
"tabWidth": 4,
"semi": true,
"singleQuote": false,
"printWidth": 120,
"editorconfig": false,
"eslintIntegration": true,
"stylelintIntegration": true,
"endOfLine": "crlf"
}
ต้องใช้:
ควรใช้ตามความเหมาะสม:
src/app/
├── layout/ # Template layout (ไม่ควรแก้ไข)
├── api/ # API client files
│ ├── orderApi.client.ts # สร้างจาก NSwag
│ ├── orderApi.ts # เขียนเอง
│ └── order.query.ts # React Query hooks
├── modules/ # UI screens และ components
│ ├── _common/ # Shared components (Template, ไม่ควรแก้)
│ ├── _auth/ # Auth components (Template, ไม่ควรแก้)
│ └── Order/ # ชื่อ Module ต้องขึ้นต้นด้วยตัวใหญ่
│ ├── components/
│ │ ├── OrderTable.tsx
│ │ ├── OrderTable.hook.tsx
│ │ └── index.ts
│ ├── pages/
│ │ ├── IndexPage.tsx # หน้าแรกของ module ต้องชื่อนี้
│ │ ├── OrderPage.tsx # ทุก page ต้องลงท้ายด้วย Page
│ │ └── index.ts
│ └── orderSlice.ts
├── routes/
│ ├── Routes.tsx # Route configuration
│ └── ASideMenuList.tsx # Sidebar menu
└── redux/ # Redux store configuration
src/
├── const.ts # Constants และ environment variables
└── vite-env.d.ts # Type definitions สำหรับ env vars
| รูปแบบ | ใช้กับ |
|---|---|
PascalCase |
class, interface, type, enum, component functions, TSX |
camelCase |
variable, parameter, function, method, property |
CONSTANT_CASE |
global constants, enum values |
DTO, API, HTMLId, Doc, Custany type — ให้ใช้ unknown หรือ type ที่ชัดเจน{} type — ให้ใช้ Record<string, T> แทน.tsx เสมอReservationCard.tsxindex.tsxPageContainer, View, Card, Form, Table, List, Item- แทน spaceinterface ImportMetaEnv {
readonly VITE_API_URL: string;
readonly VITE_SSO_ISSUER: string;
// ชื่อ config ต้องขึ้นต้นด้วย VITE_ เสมอ
}
VITE_APP_NAME = "ชื่อระบบ"
VITE_APP_VERSION = "1.0.0"
VITE_BASE_URL = "https://..."
VITE_API_URL = "https://...api..."
VITE_SSO_ISSUER = "https://...sso..."
VITE_SSO_CLIENT_ID = "..."
VITE_SSO_SCOPE = "openid profile roles email ..."
| ไฟล์ | ใช้กับ |
|---|---|
.env |
ค่าพื้นฐาน |
.env.production |
Production |
.env.uat |
UAT |
.env.dev |
Development |
.env.local |
เครื่องตัวเอง |
// /src/const.ts
export { VITE_BASE_URL, VITE_API_URL } = window.__CONST__ENV__;
// เรียกใช้ใน Component
import { API_URL } from '../Const';
ห้ามใช้
import.meta.envโดยตรง ให้ใช้window.CONSTENV__หรือผ่าน const.ts
เพื่อให้ component สามารถทดสอบด้วย RPA และ automation test ได้:
namenameid