php-dev

Configure secure PHP development environments for Slim, PDO, and Composer projects.

1|Updated Sep 16, 2025
One-click install
npx skills add https://github.com/sk8metalme/ai-agent-setup --skill php-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: php-dev
Source: https://github.com/sk8metalme/ai-agent-setup/tree/main/plugins/lang-php/skills/php
Command: npx skills add https://github.com/sk8metalme/ai-agent-setup --skill php-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PHP開発支援(Slim/API、PDOを使ったセキュアな実装、PSR-12準拠、PHPStanの活用)をガイドします。

Core Features & Use Cases

  • PSR-12準拁コード標準
  • PDOを使った安全なDBアクセス(MySQL/Oracle対応)
  • Slim Frameworkを用いたAPIエンドポイント設計
  • PHPUnit + Phakeによるテスト
  • Composerベースの依存関係管理

Quick Start

Quick Start: Create a new Slim API project, install dependencies with composer, and run tests.

Frequently Asked Questions about php-dev

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up a secure PHP API with Slim Framework and PDO?

Secure PHP API development with Slim and PDO involves configuring a Composer project with PSR-12 compliance, using prepared statements for database queries, implementing input validation, adding CSRF protection, and structuring endpoints with Slim's routing. This Skill guides you through project layout, dependency management, and deployment-ready configurations for MySQL and Oracle databases.

What's the best way to validate database queries and prevent SQL injection in PHP?

PDO prepared statements are the standard defense against SQL injection. This Skill covers configuring secure PDO connections, binding parameters correctly, and integrating input validation across your Slim API endpoints. Combined with PSR-12 coding standards and PHPStan static analysis, it ensures robust query safety.

How do I structure a PHP project with Composer and maintain code quality standards?

Composer manages dependencies and autoloading in PHP projects. This Skill walks you through project layout following PSR-12, configuring Composer for Slim and PDO packages, running PHPUnit and PHPStan for testing and static analysis, and setting up logging with Monolog for production-ready error handling.

Can I use Slim Framework for building REST APIs with database connectivity?

Yes. Slim Framework is purpose-built for API development. This Skill shows how to design REST endpoints with Slim, connect securely via PDO, implement proper HTTP methods and status codes, add authentication and CSRF protection, and optimize performance with OPcache and caching strategies.

What testing tools work with PHP API projects to ensure reliability?

PHPUnit is the standard testing framework for PHP, paired with Phake for mocking dependencies. This Skill includes test configuration, writing unit and integration tests for Slim routes and PDO queries, and integrating PHPStan for static type checking to catch errors before runtime.

How do I prepare a PHP Slim application for production deployment?

Production readiness includes enabling strict_types for type safety, configuring OPcache for performance, implementing error logging with Monolog, securing environment variables, testing with PHPUnit and PHPStan, and following PSR-12 standards. This Skill covers all deployment configuration steps for stable, secure APIs.