Summary
ใช้ skill นี้เมื่อต้องการตรวจสอบ code React/TypeScript (.tsx/.ts) ว่าตรงมาตรฐาน SSD หรือไม่ — ครอบคลุม naming, component structure, TypeScript types, Formik, Redux, React Query, และ environment variables
pratchaya0/ssd-agent-skills · Archived
ใช้ skill นี้เมื่อต้องการตรวจสอบ code React/TypeScript (.tsx/.ts) ว่าตรงมาตรฐาน SSD หรือไม่ — ครอบคลุม naming, component structure, TypeScript types, Formik, Redux, React Query, และ environment variables
npx skills add pratchaya0/ssd-agent-skills --skill ssd-frontend-review
ใช้ skill นี้เมื่อต้องการตรวจสอบ code React/TypeScript (.tsx/.ts) ว่าตรงมาตรฐาน SSD หรือไม่ — ครอบคลุม naming, component structure, TypeScript types, Formik, Redux, React Query, และ environment variables
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.
Browser automation CLI for AI agents. Use when the user needs to interact with websites, includ…
810.4K installsReview UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "chec…
617.3K 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,054 B
SUMMARY.md
344 B
ใช้ skill นี้เพื่อ audit code frontend ก่อน PR หรือก่อน refactor เพื่อให้ได้รายงาน violations ที่ชัดเจน ใช้ร่วมกับ ssd-frontend-refactor เพื่อแก้ไขสิ่งที่พบ
| กฎ | ถูก | ผิด |
|---|---|---|
ห้ามใช้ any |
unknown, Record<string, T> |
any |
ห้ามใช้ {} เป็น type |
Record<string, unknown> |
{} |
ห้ามใช้ as any |
type guard หรือ as unknown as T |
as any |
| สิ่ง | รูปแบบที่ถูก | ตัวอย่างที่ผิด |
|---|---|---|
| Component | PascalCase, max 3 คำ | orderPageComponent |
| Props type | [ComponentName]Props |
Props, IProps, OrderProps (ถ้า component ไม่ชื่อ Order) |
| Page component | ลงท้ายด้วย Page |
OrderList, OrderScreen |
| Route path | lowercase kebab-case | /orderList, /Order_List |
| Variable/function | camelCase | OrderName, order_name |
| Global constant | CONSTANT_CASE |
baseUrl, BaseUrl |
| Custom hook file | ลงท้ายด้วย .hook.tsx |
useOrder.ts, order.hook.ts |
| กฎ | ถูก | ผิด |
|---|---|---|
| 1 component ต่อ 1 ไฟล์ | ไฟล์แยกกัน | 2 exported components ในไฟล์เดียว |
| Fragment syntax | <>...</> |
<React.Fragment>...</React.Fragment> |
ห้าม React.createElement |
JSX เสมอ | React.createElement('div', ...) |
| Event handler | arrow function | function handleClick() {} |
| Boolean prop | ไม่ต้องใส่ ={true} |
<Button disabled={true}> |
| ห้าม DOM prop เป็น prop ชื่อ | ชื่อ prop ที่สื่อความหมาย | prop ชื่อ className, style |
| กฎ | ถูก | ผิด |
|---|---|---|
| ห้ามใช้ index เป็น key | unique id จาก data | key={index} |
| กฎ | ถูก | ผิด |
|---|---|---|
ห้ามใช้ import.meta.env ตรงๆ |
window.CONSTENV__.VAR_NAME |
import.meta.env.VITEAPIURL |
Env var ต้องขึ้นต้นด้วย VITE_ |
VITEAPIURL |
API_URL (ใน .env file) |
| กฎ | ถูก | ผิด |
|---|---|---|
| Form ต้องใช้ Formik | useFormik<T>() หรือ <Formik> |
useState + onChange สำหรับ form |
| Validation ต้องใช้ Yup หรือ validate function | validationSchema: Yup.object(...) |
manual validation ใน submit handler |
| กฎ | ถูก | ผิด |
|---|---|---|
Redux ต้องใช้ createSlice |
createSlice({ name, initialState, reducers }) |
createReducer, manual switch |
| ใช้ typed hooks | useAppSelector, useAppDispatch จาก redux/hook.ts |
useSelector, useDispatch โดยตรง |
| กฎ | ถูก | ผิด |
|---|---|---|
| ห้าม axios ใน component โดยตรง | useQuery, useMutation จาก React Query |
axios.get() ใน useEffect หรือ component body |
Query key ต้องใช้ queryKeys object |
queryKeys.orders.list() |
['orders', 'list'] แบบ inline |
| Element | กฎ |
|---|---|
<Button> |
ต้องมี name attribute |
<Label> / <Typography> ที่แสดงข้อมูล |
ต้องมี name attribute |
| Dynamic render (list items, conditional) | ต้องมี id attribute |
# ถามหรือตรวจสอบว่าจะ review ไฟล์ไหน
# ตัวอย่าง scope:
# - ทั้ง src/modules/Order/
# - เฉพาะไฟล์ที่เปลี่ยนใน PR นี้
# - ทุก .tsx ใน src/
อ่านทีละไฟล์ ตรวจทุก category ด้านบน บันทึก violations พร้อม line number
ออก report ในรูปแบบนี้:
## Frontend Review Report
### ❌ Violations (ต้องแก้ไข)
| File | Line | Category | ปัญหา | แนวทางแก้ไข |
|------|------|----------|-------|-------------|
| src/modules/Order/OrderForm.tsx | 12 | Types | ใช้ `any` | เปลี่ยนเป็น `unknown` หรือระบุ type ชัดเจน |
| src/modules/Order/OrderList.tsx | 45 | Lists | ใช้ index เป็น key | ใช้ `order.orderId` แทน |
### ⚠️ Warnings (ควรแก้ไข)
| File | Line | Category | ข้อสังเกต |
|------|------|----------|----------|
| src/modules/Order/OrderCard.tsx | 8 | Testing | ไม่มี `name` attribute บน Button |
### ✅ ผ่าน
- Naming conventions: ผ่านทุก component และ page
- Fragment syntax: ใช้ `<>` ถูกต้องทุกที่
- Environment variables: ไม่พบการใช้ `import.meta.env`
### สรุป
- Violations: X รายการ ใน Y ไฟล์
- Warnings: X รายการ
- พร้อม refactor ด้วย `ssd-frontend-refactor`: ใช่ / ต้องพิจารณา Tier 4 ก่อน