testing-js

โดย automattic

แนวทางสำหรับการตรวจสอบไฟล์ JavaScript เพื่อหาข้อผิดพลาดทางไวยากรณ์

npx skills add https://github.com/automattic/data-liberation-agent --skill testing-js

When to use me

Use this skill when validating JavaScript files for syntax errors. Do not use this skill for PHP validation.

Step 1: Identify JavaScript files

Find all JS files in the project, excluding node_modules/, build/, and dist/ directories:

find . -name "*.js" -not -path "*/node_modules/*" -not -path "*/build/*" -not -path "*/dist/*"

Step 2: Check syntax

Use Node to check each JS file for syntax errors:

node --check <file>
  • A file with valid syntax exits 0 with no output.
  • A file with syntax errors prints the error with line number and exits non-zero.
  • Fix any syntax errors found by editing the file, then re-check.

Rules

  • Syntax only: This skill checks for JavaScript syntax errors. Do not run ESLint or other coding standard tools.
  • Max 3 cycles: Run at most 3 fix-then-retest cycles per file. If issues remain after 3 cycles, report them as unresolved.
  • Never modify business logic: Only fix syntax errors. Do not change how the code works.
  • Report format: After testing, report results as:
    • PASS: No syntax errors
    • FAIL: List remaining errors with file, line, and message

Skills เพิ่มเติมจาก automattic

wp-phpstan
automattic
ใช้เมื่อกำหนดค่า เรียกใช้ หรือแก้ไขการวิเคราะห์แบบสแตติกของ PHPStan ในโปรเจกต์ WordPress (ปลั๊กอิน/ธีม/ไซต์): การตั้งค่า phpstan.neon, เบสไลน์,…
official
wp-playground
automattic
ใช้สำหรับเวิร์กโฟลว์ของ WordPress Playground: อินสแตนซ์ WP แบบใช้แล้วทิ้งที่รวดเร็วในเบราว์เซอร์หรือในเครื่องผ่าน @wp-playground/cli (server, run-blueprint, build-snapshot),…
official
wp-plugin-development
automattic
ใช้เมื่อพัฒนา WordPress plugins: สถาปัตยกรรมและ hooks, การเปิดใช้งาน/ปิดใช้งาน/ถอนการติดตั้ง, UI สำหรับผู้ดูแลระบบและ Settings API, การจัดเก็บข้อมูล, cron/งาน, ความปลอดภัย…
official
wp-project-triage
automattic
ใช้เมื่อคุณต้องการตรวจสอบที่เก็บ WordPress (ปลั๊กอิน/ธีม/ธีมบล็อก/WP core/Gutenberg/ทั้งไซต์) อย่างแน่นอน รวมถึงเครื่องมือ/การทดสอบ/เวอร์ชัน…
official
wp-rest-api
automattic
ใช้เมื่อสร้าง ขยาย หรือดีบักเอนด์พอยต์/เส้นทางของ WordPress REST API: register_rest_route, คลาส WP_REST_Controller/controller, schema/argument…
official
wp-wpcli-and-ops
automattic
ใช้เมื่อทำงานกับ WP-CLI (wp) สำหรับการดำเนินการ WordPress: การค้นหาและแทนที่อย่างปลอดภัย, การส่งออก/นำเข้าฐานข้อมูล, การจัดการปลั๊กอิน/ธีม/ผู้ใช้/เนื้อหา, cron, การล้างแคช,…
official
wpds
automattic
ใช้เมื่อสร้าง UI ที่ใช้ประโยชน์จาก WordPress Design System (WPDS) และส่วนประกอบ โทเค็น รูปแบบ ฯลฯ
official
woocommerce-finalize
automattic
การตรวจสอบสุขภาพโค้ดและความสามารถในการตรวจสอบย้อนกลับก่อนเผยแพร่สำหรับปลั๊กอิน WooCommerce ดำเนินการหลังจากการตรวจสอบโค้ด -- เน้นที่โค้ดที่ไม่ได้ใช้ การซ้ำซ้อน ความซับซ้อนเชิงโครงสร้าง และ...
official