You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do not scan source files when the answer is already in the manifest.
Finding a file or class? → Check file-tree.md FIRST.
Understanding a method signature? → Check the relevant api-*.md FIRST.
Understanding how subsystems interact? → Check data-flows.md FIRST.
Checking what framework or pattern to use? → Check tech-stack.md FIRST.
Checking naming or coding rules? → Check constraints.md FIRST.
Only then read source files for implementation details the manifest does not cover.
4. Failure Protocol & Decision Matrix
Scenario
Action
Priority
Ambiguous requirement
Use the most restrictive interpretation consistent with existing patterns.
MUST
Manifest contradicts source code
Trust the manifest. Flag the code as a potential bug.
MUST
Source code contradicts manifest
Verify via tests. If tests pass, flag the manifest for update.
MUST
Missing documentation for a class/method
Flag the gap explicitly. Do not invent documentation.
MUST
Adding a new country/locale/currency/timezone
Follow the existing class pattern exactly; clear class cache after.
MUST
Modifying a Canned class
Do NOT edit CannedCountries, CannedCurrencies, or CannedLocales directly — these are auto-generated. Modify the templates in src/Tools/Templates/ instead.
MUST
Untested code path
Proceed with caution. Add a test recommendation in your output.
SHOULD
PHP version ambiguity
Target PHP 8.4 syntax. Modern PHP features (union types, enums, readonly, etc.) are allowed.
MUST
Placeholder formatting in translations
Always use numbered sprintf placeholders (%1$s, %2$d). Never use positional %s.
MUST
Editor UI changes
The editor uses Bootstrap, Font Awesome, jQuery, and HTML_QuickForm2. Stay within those.
SHOULD
Locale alias edge case (uk/gb, en_UK/en_GB)
The system normalizes these automatically. Do not add special handling.
SHOULD
Static analysis fails
PHPStan must pass at level 8. Fix before committing. Config: phpstan.neon (project root).
MUST
5. Project Stats
Item
Value
Language / Runtime
PHP 8.4+, JavaScript (vanilla)
Architecture
Static facade (Localization), dynamic class loading via BaseClassLoaderCollection
Run PHPStan analysis, save output to phpstan-result.txt
composer analyze-clear
Clear PHPStan result cache
PHPUnit (Testing)
Agent note: The test-file, test-suite, test-filter and test-group
scripts use --no-progress to suppress progress bars, producing clean
line-based output suitable for automated parsing.
Command
Syntax
Description
composer test
composer test
Run the full test suite
composer test-file
composer test-file -- path/to/TestFile.php
Run all tests in a single file
composer test-suite
composer test-suite -- SuiteName
Run a named test suite (see phpunit.xml for suite names)