AI SummaryDux Lite provides a unified development ruleset for PHP backend, template, and controller code—enforcing naming conventions, parameter handling, and data output patterns. Teams using the Dux framework or similar PHP architectures benefit from standardized practices that improve readability and maintainability.
Install
Copy this and paste it into Claude Code, Cursor, or any AI assistant:
I want to install the "dux-lite" skill in my project. Please run this command in my terminal: # Install skill into the correct directory mkdir -p .claude/skills/dux-lite && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/dux-lite/SKILL.md "https://raw.githubusercontent.com/duxweb/dux-lite/v2/SKILL.md" Then restart Claude Code (or reload the window in Cursor) so the skill is picked up.
Description
Dux Lite 项目开发规则模板(基于 dux-php-admin 规范去重整理)。
Dux Lite 项目开发规则
> 用于统一后端与模板/视图开发习惯,保持可读与可执行。
适用范围
• 后端 PHP、模板/视图、控制器与 Service 改动
基础规范(必须)
• declare(strict_types=1); • if/else 必须 {},不允许单行省略 • 函数小驼峰、类大驼峰、命名空间 App\模块名\... • PSR-4 结构 • 中间件洋葱模型:自定义在外层,认证在内层
参数处理(必须)
• 先补默认键再使用:$params = $request->getQueryParams() + ['keyword' => null]; • 直接用 $params['keyword'],不做 trim/??/?: 二次兜底 • 避免 ?:(会把 0 当空值) • format() 只做映射与最小强转,校验放 validator() • validator() 规则用二维数组结构 • format() 不做空值归一,数值字段直接强转 • 空值判断风格:if ($params['field'])
Discussion
Health Signals
My Fox Den
Community Rating
Sign in to rate this booster