testing-php

Panduan untuk menjalankan linting PHP guna menangkap kesalahan sintaks

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

When to use me

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

Step 1: Identify PHP files

Find all PHP files in the project, excluding vendor/, node_modules/, and build/ directories:

find . -name "*.php" -not -path "*/vendor/*" -not -path "*/node_modules/*" -not -path "*/build/*"

Step 2: Run PHP syntax check

Check each PHP file for syntax errors using php -l:

php -l <file>
  • A file with valid syntax prints No syntax errors detected in <file> and exits 0.
  • A file with syntax errors prints the error message with line number and exits non-zero.
  • Fix any syntax errors found by editing the file, then re-run php -l to confirm.

Rules

  • Syntax only: This skill checks for PHP syntax errors. Do not run PHPCS 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

Lebih banyak skill dari automattic

wp-phpstan
automattic
Gunakan saat mengonfigurasi, menjalankan, atau memperbaiki analisis statis PHPStan di proyek WordPress (plugin/tema/situs): pengaturan phpstan.neon, baseline,…
official
wp-playground
automattic
Gunakan untuk alur kerja WordPress Playground: instance WP cepat yang dapat dibuang di browser atau secara lokal melalui @wp-playground/cli (server, run-blueprint, build-snapshot),…
official
wp-plugin-development
automattic
Gunakan saat mengembangkan plugin WordPress: arsitektur dan hooks, aktivasi/deaktivasi/pencopotan, antarmuka admin dan API Pengaturan, penyimpanan data, cron/tugas, keamanan…
official
wp-project-triage
automattic
Gunakan saat Anda memerlukan inspeksi deterministik terhadap repositori WordPress (plugin/tema/tema blok/WP inti/Gutenberg/situs penuh) termasuk perkakas/pengujian/versi…
official
wp-rest-api
automattic
Gunakan saat membangun, memperluas, atau men-debug endpoint/rute REST API WordPress: register_rest_route, kelas WP_REST_Controller/controller, skema/argumen…
official
wp-wpcli-and-ops
automattic
Gunakan saat bekerja dengan WP-CLI (wp) untuk operasi WordPress: pencarian-pengganti yang aman, ekspor/impor db, manajemen plugin/tema/pengguna/konten, cron, pembersihan cache,…
official
wpds
automattic
Gunakan saat membangun antarmuka pengguna yang memanfaatkan WordPress Design System (WPDS) dan komponen, token, pola, dll.
official
woocommerce-finalize
automattic
Audit kesehatan kode dan ketertelusuran pra-rilis untuk plugin WooCommerce. Dijalankan setelah tinjauan kode -- berfokus pada kode mati, duplikasi, kompleksitas struktural, dan…
official