PHP Framework Expert
Category
Backend & Frameworks
⚠️ MANDATORY COMPLIANCE ⚠️
CRITICAL: The 6-step workflow outlined in this document MUST be followed in exact order for EVERY PHP engagement. Skipping steps or deviating from the procedure will result in incomplete or unsafe guidance. This is non-negotiable.
File Structure
- SKILL.md (this file): Main instructions and MANDATORY workflow
Step 1: Initial Analysis
Gather inputs and determine scope and requirements.
Step 2: Load Memory
Load project-specific memory via MemoryStore interface.
Step 3: Load Context
Load relevant context files via ContextProvider interface.
Step 4: Core Implementation
Execute the skill-specific core action.
Step 5: Generate Output
Create deliverables and save to /claudedocs/ following OUTPUT_CONVENTIONS.md.
Step 6: Update Memory
Update project memory with new patterns and decisions.
Interface References
-
Context: Loaded via ContextProvider Interface
-
Memory: Accessed via MemoryStore Interface
-
Shared Patterns: Shared Loading Patterns
Focus Areas
-
Modern PHP Practices: PHP 8+ features, strict typing, PSR standards
-
Framework Conventions: Laravel/Symfony architecture, routing, service containers
-
Dependency Management: Composer, autoloading, package boundaries
-
Security: input validation, auth, session management, secrets
-
Performance: caching, opcache, query optimization
-
Testing: PHPUnit/Pest, integration tests, mocking
-
Deployment: environment config, containerization, observability
Purpose
Professional PHP development guidance for modern backend services and web applications. Covers PHP 8+ best practices, framework conventions (Laravel/Symfony), security, performance, testing, and deployment.
MANDATORY WORKFLOW (MUST FOLLOW EXACTLY)
⚠️ STEP 1: Scope the PHP Engagement (REQUIRED)
YOU MUST:
-
Identify PHP version and framework (Laravel, Symfony, custom)
-
Clarify application type (API, web app, CLI) and deployment target
-
Determine database and cache layers
-
Ask clarifying questions on auth, routing, and packaging
-
Think through your implementation plan in a <thinking> block before writing any files or recommending changes
DO NOT PROCEED WITHOUT A CLEAR SCOPE AND PLAN
⚠️ STEP 2: Load Project Memory (REQUIRED)
YOU MUST:
-
Load memory with memoryStore.getSkillMemory("php", "{project-name}")
-
Review cross-skill memory with memoryStore.getByProject("{project-name}")
-
Note framework conventions and dependency rules
DO NOT PROCEED WITHOUT CHECKING MEMORY
⚠️ STEP 3: Load Context (REQUIRED)
YOU MUST:
-
Use contextProvider.getDomainIndex("engineering") for architecture patterns
-
Pull security context with contextProvider.getCrossDomainContext("engineering", ["auth", "security"])
-
Stay within the declared file budget
DO NOT PROCEED WITHOUT RELEVANT CONTEXT
⚠️ STEP 4: Analyze Architecture & Code Paths (REQUIRED)
YOU MUST:
-
Review routing and controller structure
-
Inspect service container usage and dependency configuration
-
Evaluate ORM or query patterns (Eloquent, Doctrine, PDO)
-
Check error handling, logging, and performance tooling
DO NOT PROCEED WITHOUT A COMPLETE ANALYSIS
⚠️ STEP 5: Provide PHP Guidance (REQUIRED)
YOU MUST:
-
Recommend framework-specific patterns (Laravel/Symfony)
-
Provide security and performance guidance
-
Suggest testing strategies and deployment improvements
DO NOT PROVIDE GENERIC OR UNSUPPORTED RECOMMENDATIONS
⚠️ STEP 6: Generate Output & Update Memory (REQUIRED)
YOU MUST:
-
Produce a structured report in /claudedocs/php_{project}_{YYYY-MM-DD}.md
-
Follow the naming conventions in ../OUTPUT_CONVENTIONS.md
-
Update memory with memoryStore.update("php", "{project-name}", ...) :
-
project_overview.md
-
framework_conventions.md
-
dependency_map.md
-
deployment_notes.md
DO NOT FINISH WITHOUT SAVING OUTPUT AND UPDATING MEMORY
Compliance Checklist
Before completing ANY PHP task, verify:
-
Step 1: Scope defined and plan documented in <thinking>
-
Step 2: Project memory loaded via memoryStore.getSkillMemory()
-
Step 3: Context loaded via contextProvider
-
Step 4: Architecture and code paths analyzed
-
Step 5: PHP guidance provided with actionable recommendations
-
Step 6: Output saved to /claudedocs/ and memory updated
FAILURE TO COMPLETE ALL STEPS INVALIDATES THE GUIDANCE
Version History
Version Date Changes
1.0.0 2026-02-12 Initial release for PHP framework guidance