Markdown Converter
Agent skill for markdown-converter
These instructions are for GitHub Copilot to understand and follow specific rules when working with this project.
Sign in to like and favorite skills
These instructions are for GitHub Copilot to understand and follow specific rules when working with this project.
resources/lang/{locale}/{section}.phpresources/lang/en/home.php - for the home pageresources/lang/bg/global.php - for global translationsnpm run build or npm run dev, except if very necessaryphp artisan serve<script setup> when possibleref() and reactive()inject() for global dependencies like $t for translations$t('section.key') syntaxresources/js/components/resources/js/stores/resources/lang/When working with this project, always consult these instructions. If you have doubts about any rule, ask the user for clarification. These instructions can be updated over time according to project needs.
When working with building-level logic (houses, banks, hospitals, etc.), always prefer the central cached aggregate instead of running ad-hoc SUM queries. This project maintains a per-user, per-object-type cache table called
aggregated_object_levels and a helper service App\Services\ObjectLevelService.
Key rules:
ObjectLevelService::getCachedAggregateRow($userId, $objectType) (returns object_level_sum, tool_sum, total_level).ObjectLevelService::recomputeAndStore($userId, $objectType) to recompute and persist the cache — but prefer updating cache on change rather than recomputing on reads.CityObject or Tool (create/update/delete). Use recomputeAndStore for the affected object_type and user_id.recomputeAndStore(..., 'bank') will also trigger MarketService::recomputeUserFee($userId) so market fees are updated immediately.Implementation references:
app/Services/ObjectLevelService.phpaggregated_object_levels (created via migrations)app/Services/MarketService.phpToolController, CityController, ToolsDecay command, and population cron PopulationBirths (these examples show how to call recomputeAndStore after changes).Recommendation:
Tool and CityObject (created/updated/deleted) to call recomputeAndStore automatically. This ensures the cache stays correct regardless of which code path modifies models (controllers, seeds, imports, artisan scripts).