> laravel-database-expert
Expert patterns for advanced queries, Redis caching, and database scalability. Use when optimizing Laravel queries, implementing Redis caching, or scaling databases. (triggers: config/database.php, database/migrations/*.php, join, aggregate, subquery, selectRaw, Cache)
curl "https://skillshub.wtf/HoangNguyen0403/agent-skills-standard/laravel-database-expert?format=md"Laravel Database Expert
Priority: P1 (HIGH)
Structure
config/
└── database.php # Connection & Cluster config
app/
└── Http/
└── Controllers/ # Query logic entry points
Implementation Guidelines
- Advanced Query Builder: Prefer
selectSub,joinSub, andwhereExistsover raw SQL. - Aggregates: Use
count(),sum(), andavg()directly via Eloquent/Builder. - Cache-Aside Pattern: Utilize
Cache::remember()for frequently accessed data. - Redis Tagging: Group related cache keys using
Cache::tags()for atomic flushing. - Read/Write Splitting: Configure master/slave connections in
config/database.php. - Vertical Partitioning: Decouple high-traffic tables to dedicated database instances.
- Indices: Ensure correct indexing for all aggregate and join columns.
Anti-Patterns
- Raw Concatenation: No String SQL: Always use bindings or Query Builder.
- Loop Queries: No queries in Loops: Use subqueries or aggregates.
- Global Cache Flush: No Cache::flush(): Use tags to target specific groups.
- Untracked Redis: No ungoverned Redis usage: Use standard Laravel wrappers.
References
> related_skills --same-repo
> typescript-tooling
Development tools, linting, and build config for TypeScript. Use when configuring ESLint, Prettier, Jest, Vitest, tsconfig, or any TS build tooling. (triggers: tsconfig.json, .eslintrc.*, jest.config.*, package.json, eslint, prettier, jest, vitest, build, compile, lint)
> typescript-security
Secure coding practices for TypeScript. Use when validating input, handling auth tokens, sanitizing data, or managing secrets and sensitive configuration. (triggers: **/*.ts, **/*.tsx, validate, sanitize, xss, injection, auth, password, secret, token)
> typescript-language
Modern TypeScript standards for type safety and maintainability. Use when working with types, interfaces, generics, enums, unions, or tsconfig settings. (triggers: **/*.ts, **/*.tsx, tsconfig.json, type, interface, generic, enum, union, intersection, readonly, const, namespace)
> typescript-best-practices
Idiomatic TypeScript patterns for clean, maintainable code. Use when writing or refactoring TypeScript classes, functions, modules, or async logic. (triggers: **/*.ts, **/*.tsx, class, function, module, import, export, async, promise)