Skip to content

Latest commit

 

History

History
48 lines (33 loc) · 2.5 KB

AGENTS.md

File metadata and controls

48 lines (33 loc) · 2.5 KB

AGENTS.md

Guidance for AI coding agents working in this repository.

Project

Minimalist Nette (PHP) web playground. No test suite, no frontend build. Keep it minimalist: do not add presenters, templates or components that are not strictly required by the task.

Commands

composer install                # install dependencies
composer start                  # dev server: php -S localhost:11000 -t www
php vendor/bin/phpstan analyse  # static analysis, level 8 — must stay green

nette/tester is a dev dependency but there is no tests/ directory — do not claim tests are run.

Project-scoped official Nette skills (the nette/claude-code set) live in .pi/skills/ — consult them for Nette/Latte/NEON specifics.

Architecture

  • www/index.php — front controller.
  • App\Bootstrap — Configurator: adds config/common.neon + config/services.neon, enables Tracy (logs to log/), registers a robot loader for app/.
  • App\Core\RouterFactory::createRouter() — the only route source.
  • Closure routes are executed by the built-in Nette:Micro presenter: a handler MUST return a Nette\Application\Responses\Response. echo in a handler is forbidden (PHPStan flags it).
  • Error handling is built into the framework: Tracy BlueScreen in debug mode, Nette:Error4xx/Nette:Error5xx (NetteModule\ErrorPresenter) in production. Do NOT set application.errorPresenter in NEON unless you also create the matching presenters under app/Presentation/Error/ — a dangling mapping silently breaks production.
  • config/services.neon auto-discovers *Facade, *Factory, *Repository, *Service classes in app/ — a new class with such a suffix is registered as a service automatically.
  • temp/ (DI container, caches) and log/ (Tracy) are runtime dirs, self-ignored by git — never commit their contents. The container regenerates automatically when config changes; no manual clearing needed.

Code style (Nette standard)

  • declare(strict_types=1); in every PHP file.
  • Tab indentation, no trailing whitespace.
  • final for classes not meant to be extended.
  • Two blank lines between class members; no blank line after the class opening brace.
  • Trailing commas in multi-line calls.
  • Docblocks only when they add information beyond the signature (imperative, no signature restating).
  • PSR-4: App\ → app/.

NEON

  • Tab indentation, no trailing commas, booleans as yes/no.

Git

  • .gitattributes: * text=auto (LF in the repo).
  • Keep diffs atomic; run PHPStan before committing.