testing-js

Hướng dẫn kiểm tra tệp JavaScript để tìm lỗi cú pháp

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

Thêm skills từ automattic

wp-phpstan
automattic
Sử dụng khi cấu hình, chạy hoặc sửa lỗi phân tích tĩnh PHPStan trong các dự án WordPress (plugin/giao diện/trang web): thiết lập phpstan.neon, baselines,…
official
wp-playground
automattic
Sử dụng cho quy trình làm việc WordPress Playground: các phiên bản WP nhanh, dùng một lần trong trình duyệt hoặc cục bộ qua @wp-playground/cli (server, run-blueprint, build-snapshot),…
official
wp-plugin-development
automattic
Sử dụng khi phát triển plugin WordPress: kiến trúc và hooks, kích hoạt/hủy kích hoạt/gỡ cài đặt, giao diện quản trị và Settings API, lưu trữ dữ liệu, cron/tác vụ, bảo mật…
official
wp-project-triage
automattic
Sử dụng khi bạn cần kiểm tra xác định một kho lưu trữ WordPress (plugin/theme/block theme/WP core/Gutenberg/full site) bao gồm công cụ/kiểm tra/phiên bản…
official
wp-rest-api
automattic
Sử dụng khi xây dựng, mở rộng hoặc gỡ lỗi các endpoint/route của WordPress REST API: register_rest_route, các lớp WP_REST_Controller/controller, schema/argument…
official
wp-wpcli-and-ops
automattic
Sử dụng khi làm việc với WP-CLI (wp) cho các thao tác WordPress: tìm kiếm-thay thế an toàn, xuất/nhập db, quản lý plugin/chủ đề/người dùng/nội dung, cron, xóa bộ nhớ đệm,…
official
wpds
automattic
Sử dụng khi xây dựng giao diện người dùng dựa trên Hệ thống Thiết kế WordPress (WPDS) và các thành phần, token, mẫu thiết kế của nó.
official
woocommerce-finalize
automattic
Kiểm tra sức khỏe mã nguồn và khả năng truy vết trước khi phát hành cho các plugin WooCommerce. Chạy sau khi đánh giá mã -- tập trung vào mã chết, trùng lặp, độ phức tạp cấu trúc, và…
official