testing-php

Diretrizes para executar linting em PHP para capturar erros de sintaxe

npx skills add https://github.com/automattic/studio --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

Mais skills de automattic

wp-phpstan
automattic
Use ao configurar, executar ou corrigir a análise estática do PHPStan em projetos WordPress (plugins/temas/sites): configuração do phpstan.neon, baselines,…
official
wp-playground
automattic
Use para fluxos de trabalho do WordPress Playground: instâncias WP descartáveis e rápidas no navegador ou localmente via @wp-playground/cli (server, run-blueprint, build-snapshot),…
official
wp-plugin-development
automattic
Use ao desenvolver plugins WordPress: arquitetura e hooks, ativação/desativação/desinstalação, interface administrativa e Settings API, armazenamento de dados, cron/tarefas, segurança…
official
wp-project-triage
automattic
Use quando precisar de uma inspeção determinística de um repositório WordPress (plugin/tema/tema de bloco/WP core/Gutenberg/site completo) incluindo ferramentas/testes/versão…
official
wp-rest-api
automattic
Use ao construir, estender ou depurar endpoints/rotas da REST API do WordPress: register_rest_route, classes WP_REST_Controller/controller, schema/argumentos…
official
wp-wpcli-and-ops
automattic
Use ao trabalhar com WP-CLI (wp) para operações no WordPress: substituição segura de texto, exportação/importação de banco de dados, gerenciamento de plugins/temas/usuários/conteúdo, cron, limpeza de cache,…
official
wpds
automattic
Use ao construir UIs que utilizam o WordPress Design System (WPDS) e seus componentes, tokens, padrões, etc.
official
woocommerce-finalize
automattic
Auditoria de saúde de código e rastreabilidade de pré-lançamento para plugins WooCommerce. Executada após a revisão de código — foca em código morto, duplicação, complexidade estrutural e…
official