AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Setup Pre Commit

skill-boom-vitt-skills-thai-setup-pre-commit · by Boom-Vitt

ตั้งค่า Husky pre-commit hook พร้อม lint-staged (Prettier), type checking, และ test ใน repo ปัจจุบัน ใช้เมื่อผู้ใช้อยากเพิ่ม pre-commit hook, ตั้งค่า Husky, ตั้งค่า lint-staged หรือเพิ่มการ format/typecheck/test ตอน commit

No reviews yet
0 installs
9 views
0.0% view→install

Install

$ agentstack add skill-boom-vitt-skills-thai-setup-pre-commit

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-boom-vitt-skills-thai-setup-pre-commit)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
2mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Setup Pre Commit? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Setup Pre-Commit Hooks

สิ่งที่จะตั้งค่าให้

  • Husky pre-commit hook
  • lint-staged ที่รัน Prettier กับไฟล์ที่ stage ไว้ทั้งหมด
  • config ของ Prettier (ถ้ายังไม่มี)
  • script typecheck และ test ใน pre-commit hook

ขั้นตอน

1. ตรวจหา package manager

เช็กว่ามี package-lock.json (npm), pnpm-lock.yaml (pnpm), yarn.lock (yarn), bun.lockb (bun) ตัวไหนอยู่ก็ใช้ตัวนั้น ถ้าไม่ชัดให้ default เป็น npm

2. ติดตั้ง dependency

ติดตั้งเป็น devDependencies:

husky lint-staged prettier

3. เริ่มต้น Husky

npx husky init

คำสั่งนี้สร้างโฟลเดอร์ .husky/ และเพิ่ม prepare: "husky" ลง package.json

4. สร้าง .husky/pre-commit

เขียนไฟล์นี้ (Husky v9+ ไม่ต้องใส่ shebang):

npx lint-staged
npm run typecheck
npm run test

ปรับตามจริง: แทน npm ด้วย package manager ที่ตรวจเจอ ถ้า repo ไม่มี script typecheck หรือ test ใน package.json ให้ตัดบรรทัดนั้นออกแล้วบอกผู้ใช้

5. สร้าง .lintstagedrc

{
  "*": "prettier --ignore-unknown --write"
}

6. สร้าง .prettierrc (ถ้ายังไม่มี)

สร้างเฉพาะเมื่อยังไม่มี config ของ Prettier อยู่เลย ใช้ค่า default เหล่านี้:

{
  "useTabs": false,
  "tabWidth": 2,
  "printWidth": 80,
  "singleQuote": false,
  "trailingComma": "es5",
  "semi": true,
  "arrowParens": "always"
}

7. ตรวจสอบ

  • [ ] .husky/pre-commit มีอยู่และ execute ได้
  • [ ] .lintstagedrc มีอยู่
  • [ ] script prepare ใน package.json เป็น "husky"
  • [ ] config ของ prettier มีอยู่
  • [ ] รัน npx lint-staged เพื่อยืนยันว่าทำงานได้

8. Commit

Stage ไฟล์ที่แก้/สร้างทั้งหมด แล้ว commit ด้วยข้อความ: Add pre-commit hooks (husky + lint-staged + prettier)

การ commit นี้จะวิ่งผ่าน pre-commit hook ตัวใหม่ — เป็น smoke test ที่ดีว่าทุกอย่างทำงานจริง

หมายเหตุ

  • Husky v9+ ไม่ต้องใส่ shebang ในไฟล์ hook
  • prettier --ignore-unknown จะข้ามไฟล์ที่ Prettier parse ไม่ได้ (รูปภาพ ฯลฯ)
  • pre-commit รัน lint-staged ก่อน (เร็ว เฉพาะไฟล์ที่ stage) แล้วค่อยรัน typecheck กับ test เต็ม ๆ

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.