원클릭으로
add-wp-function
Add a WordPress function replacement. Full workflow from WP source to Rust implementation, testing, and registration.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Add a WordPress function replacement. Full workflow from WP source to Rust implementation, testing, and registration.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Benchmark a change to prove it is faster. Runs Criterion and PHP benchmarks before and after, compares results, and rejects regressions.
Debug when a Rust implementation produces different output than the WordPress fixture. Identifies the exact behavioral difference and fixes it.
Profile WordPress to identify functions suitable for Rust replacement.
Build the extension for PHP 8.3, install in the WordPress profiling stack, and verify it works end-to-end.
| name | add-wp-function |
| description | Add a WordPress function replacement. Full workflow from WP source to Rust implementation, testing, and registration. |
| disable-model-invocation | true |
| argument-hint | [function_name] |
Start the profiling stack, find and read the source:
cd profiling && docker compose up -d
docker compose exec php-fpm php -d memory_limit=512M -r "
require '/var/www/html/wp-load.php';
\$ref = new ReflectionFunction('$ARGUMENTS');
echo \$ref->getFileName() . ':' . \$ref->getStartLine() . '-' . \$ref->getEndLine();
"
Document: operations in order, whether it calls apply_filters (and filter name), whether pluggable, dependencies, edge cases.
Create php/fixture-generator/functions/$ARGUMENTS.php following the pattern of existing definitions.
Generate: docker compose -f profiling/docker-compose.yml exec php-fpm php -d memory_limit=512M /app/php/fixture-generator/generate.php --function=$ARGUMENTS --output=/app/fixtures/
Add to the appropriate module (escaping/, kses/, formatting/, sanitize/, pluggable/). Follow the patterns in existing implementations. Include a matches_wordpress_fixtures test.
Add #[php_function] + wrap_function!() in lib.rs. Follow existing function patterns:
patina_* version (always)_filtered version with apply_filters callback (if WP function uses filters)OVERRIDES if non-pluggablephp/tests/ extending FixtureTestCasefuzz/fuzz_targets/ + [[bin]] in fuzz/Cargo.tomlmake check
cargo +nightly fuzz run fuzz_$ARGUMENTS -- -max_total_time=30