innhold/AGENT.md
Ruben fcddc9af93 Add podman compose requirement to development workflow
Clarify PHP environment dependency and port usage
for development site access
2026-01-16 21:44:35 +01:00

2.1 KiB

Philosophy

Minimal PHP for modern conveniences. Prioritize longevity (decade-scale maintainability) by avoiding volatile dependencies. Strictly add only what's essential—readable, simple, and future-proof.

Edit instructions

All edits to this AGENT.md file should be done in a compressed shortform for LLM consumption.

Core Constraints

Minimalism: Only essential tech (HTML, PHP 8.4+, CSS). No JS, frameworks, build tools, or package managers. Comments only for major sections.

Frontend:

  • Classless, semantic HTML5
  • Modern CSS: nesting, oklch(), grid, clamp(), logical props
  • Responsive via fluid typography + flexible layouts

Security:

  • Path validation blocks traversal
  • Files restricted to document root
  • Strict MIME types + no direct user-input execution

Code Style

PHP: Modern syntax (arrow functions, null coalescing, match). Type hints where practical. Ternary for simple conditionals. Single-purpose functions.

CSS: Variables, native nesting, grid layouts. clamp() over @media. Relative units > pixels.

Templates: Escape output (htmlspecialchars() for UGC). Short echo tags (<?= $var ?>).

Development Environment and workflow

The host does not have PHP, always use podman compose with the compose.yaml configuration when interacting with the app through CLI. Check localhost:4040 when you need to look at the development site to check your changes.

LLM Agent Testing Protocol: Container isolation: ALL test data (CSV, temp files, generated content) MUST remain inside container filesystem (not mounted volumes) Testing website:* curl localhost:4040/path to fetch pages, test forms with curl -X POST -d "field=value" localhost:4040/path

  • Test data paths: Use /tmp/ or /var/test/ inside container—never write to /var/www/html or mounted dirs during tests Running tests: podman exec stopplidelsen.no php /path/to/test.php or podman-compose run --rm custom php /tmp/test-script.php Syntax checks: podman exec stopplidelsen.no php -l /var/www/custom/file.php Cleanup: podman-compose down && podman-compose up -d between test runs