PHP and Drupal Engineering Profile
Use this profile only after repository discovery identifies the stack. Read focused checks when PHP- or Drupal-specific gates or hazards determine the result.
Workflow
- Discover Composer metadata and lockfiles, PHP constraints, Drupal core version, custom modules or themes, configuration synchronization paths, service definitions, routes, update hooks, frontend manifests, and repository scripts.
- Follow repository-defined commands, local development tooling, and pinned PHP, Composer, and Drupal versions before suggesting defaults.
- Review material PHP hazards, especially type coercion, loose comparisons, nullability, error handling, user-controlled input, output encoding, deserialization, filesystem access, sessions, and environment-specific configuration.
- Review Drupal-specific boundaries: access checks, entity queries, render arrays, cache tags and contexts, configuration versus state versus content, service lifetimes, plugins, update paths, queues, and request-scoped behavior.
- Select proportionate gates from repository formatting, static analysis, coding standards, unit, kernel, functional, browser, frontend, dependency, and build checks.
- Review compatibility across PHP and Drupal core versions, Composer constraints, contributed modules, database drivers, configuration schema, cache behavior, API deprecations, and content update order.
- Report every missing tool, skipped command, unavailable database, or unsupported runtime as incomplete rather than passing.
Boundaries
- Repository scripts and tests run code, and dependency checks can contact registries. Run a gate only when the user asked for checks and trusts the repository. Otherwise, name it as the next safe gate.
- Do not assume a global Composer, Drush, PHP, database, or local-environment command when the repository defines its own tooling.
- Do not install modules, update the lockfile, import configuration, run update hooks, alter content, deploy, or mutate shared state merely to run a gate.
- Separate static review, executed checks, local-site behavior, configuration import evidence, deployment, and live behavior.
Output
Lead with the answer. Use the shortest format that retains the required evidence and limits; expand when requested or needed. The items below describe required content, not mandatory headings.
Return Discovery, Hazards, Commands selected, Results, Compatibility, Missing evidence, and Next safe gate.
Example
Synthetic example; not an observed client result.
Input: A cached Drupal fragment varies by user but has no matching cache context.
Output: warning: inspect cache contexts and tags for user-specific content. A correct render in one session does not establish cache isolation.