cmd-check-phoenix-duskmoon-design
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese/check-phoenix-duskmoon-design
/check-phoenix-duskmoon-design
Agent skill wrapper for the Claude command .
/check-phoenix-duskmoon-designWhen the original command text references , , or named arguments, map them from the user's current request.
{{INPUT}}$1Claude命令的Agent技能封装。
/check-phoenix-duskmoon-design当原始命令文本引用、或命名参数时,从用户当前请求中映射这些参数。
{{INPUT}}$1Command Instructions
命令说明
Read skill first to understand all design rules, then audit this project for compliance. Report every violation with file path, line number, the offending code, and the correct fix.
phoenix-duskmoon-design首先阅读技能以了解所有设计规则,然后审核此项目的合规性。报告每一项违规内容,包括文件路径、行号、违规代码以及正确的修复方案。
phoenix-duskmoon-designChecks
检查项
1. Hardcoded Colors (Critical)
1. 硬编码颜色(严重)
Search , , , , files for:
.ex.exs.heex.css.js- Hex colors:
#[0-9a-fA-F]{3,8} - Color functions: ,
rgb(,rgba(,hsl((skip if insidehsla()var(-- - Named CSS colors in properties: ,
color: white, etc.background: black - Tailwind palette classes: ,
bg-blue-500,text-red-600, etc.border-gray-300
Exclude: comments, test files, skill reference files, version strings, SVG / using .
.claude/mix.exsfillstrokecurrentColor在、、、、文件中搜索:
.ex.exs.heex.css.js- 十六进制颜色:
#[0-9a-fA-F]{3,8} - 颜色函数:、
rgb(、rgba(、hsl((如果在hsla(内则跳过)var(-- - 属性中的CSS命名颜色:、
color: white等background: black - Tailwind调色板类:、
bg-blue-500、text-red-600等border-gray-300
排除:注释、测试文件、技能参考文件、版本字符串、使用的SVG /。
.claude/mix.exscurrentColorfillstroke2. Theme Setup
2. 主题配置
- CSS entry has and
@plugin "@duskmoon-dev/core/plugin"@import "phoenix_duskmoon/components" - Root layout has on
data-theme=element<html> - has
<body>or equivalentbg-surface text-on-surface
- CSS入口文件包含和
@plugin "@duskmoon-dev/core/plugin"@import "phoenix_duskmoon/components" - 根布局的元素带有
<html>属性data-theme= - 元素包含
<body>或等效类bg-surface text-on-surface
3. Appbar Uses Primary
3. 应用栏使用主色调
Find all and raw appbar HTML. Verify primary color convention:
<.dm_appbar- Phoenix component should render with class
appbar-primary - Raw HTML appbar should have
appbar appbar-primary appbar-sticky
Flag if appbar uses default surface or any other color.
查找所有和原生应用栏HTML。验证主色调约定:
<.dm_appbar>- Phoenix组件应渲染带有类
appbar-primary - 原生HTML应用栏应包含类
appbar appbar-primary appbar-sticky
如果应用栏使用默认表面色或其他任何颜色,则标记违规。
4. Sidebar & Drawer Use Secondary
4. 侧边栏与抽屉使用次色调
Find all , , , and sidebar containers. Verify they use secondary color:
<aside><.dm_left_menu><.dm_drawer>- Should have
bg-secondary text-secondary-content - Flag if sidebar uses or any surface token instead of secondary
bg-surface-container
查找所有、、和侧边栏容器。验证它们使用次色调:
<aside><.dm_left_menu><.dm_drawer>- 应包含类
bg-secondary text-secondary-content - 如果侧边栏使用或任何表面令牌而非次色调,则标记违规
bg-surface-container
5. Background-Text Pairing
5. 背景-文本颜色配对
Search for background color classes without their paired text color:
- without
bg-primarytext-primary-content - without
bg-secondarytext-secondary-content - without
bg-tertiarytext-tertiary-content - without
bg-errortext-error-content - without
bg-inverse-surfacetext-inverse-on-surface - without
bg-primary-containertext-on-primary-container
Flag as warnings (text may inherit from parent).
搜索未搭配对应文本颜色的背景色类:
- 未搭配
bg-primarytext-primary-content - 未搭配
bg-secondarytext-secondary-content - 未搭配
bg-tertiarytext-tertiary-content - 未搭配
bg-errortext-error-content - 未搭配
bg-inverse-surfacetext-inverse-on-surface - 未搭配
bg-primary-containertext-on-primary-container
标记为警告(文本可能从父元素继承颜色)。
6. Surface Elevation Order
6. 表面层级嵌套顺序
Check for nesting violations — higher-elevation surface containing lower:
- wrapping
surface-container-highestsurface-container-low - wrapping plain
surface-container-highsurface
检查嵌套违规——高层级表面包含低层级表面:
- 包裹
surface-container-highestsurface-container-low - 包裹普通
surface-container-highsurface
7. Semantic Color Misuse
7. 语义颜色误用
Flag or on — buttons use /////, not semantic state colors.
variant="success"variant="info"dm_btnprimarysecondarytertiaryerrorghostoutline标记上的或——按钮仅使用/////变体,不使用语义状态颜色。
dm_btnvariant="success"variant="info"primarysecondarytertiaryerrorghostoutline8. Multiple Primary Buttons Per View
8. 每个视图中多个主按钮
In each template, count on . Flag if more than one appears outside conditional blocks.
.heexvariant="primary"dm_btn在每个模板中,统计上的数量。如果在条件块外出现多个,则标记违规。
.heexdm_btnvariant="primary"9. Raw HTML Over Components
9. 原生HTML替代组件
Flag , , , in files where a equivalent exists. Exclude (component definitions) and .
<button><input><select><table>.heexdm_*lib/phoenix_duskmoon/type="hidden"在文件中标记存在等效组件却使用原生、、、的情况。排除(组件定义目录)和的元素。
.heexdm_*<button><input><select><table>lib/phoenix_duskmoon/type="hidden"10. Icon Color Override
10. 图标颜色覆盖
Flag or with explicit set to anything other than .
dm_mdidm_bsicolor="currentcolor"标记或中显式设置为以外值的情况。
dm_mdidm_bsicolor="currentcolor"11. Tailwind Color Scale
11. Tailwind颜色体系
Flag any Tailwind default color scale usage: , , , etc.
bg-blue-*text-slate-*border-zinc-*标记任何使用Tailwind默认颜色体系的情况:、、等。
bg-blue-*text-slate-*border-zinc-*12. Typography
12. 排版
- Check if project defines custom font variables (,
--font-display,--font-body) in CSS--font-mono - Flag if uses
<body>orfont-family: system-uiorInterwithout a project-specific overrideRoboto - Check headings use a display font class or variable, not the same as body text
- 检查项目是否在CSS中定义自定义字体变量(、
--font-display、--font-body)--font-mono - 如果使用
<body>或font-family: system-ui或Inter但未进行项目特定覆盖,则标记违规Roboto - 检查标题是否使用显示字体类或变量,而非与正文相同的字体
13. Layout Depth
13. 布局层级
- Check or primary content area uses
<main>bg-surface - Check sidebar/aside uses
bg-secondary text-secondary-content - Check drawer uses
bg-secondary text-secondary-content - Flag pages that are entirely flat (only one surface level used across the whole template)
- 检查或主内容区域是否使用
<main>bg-surface - 检查侧边栏/aside是否使用
bg-secondary text-secondary-content - 检查抽屉是否使用
bg-secondary text-secondary-content - 标记整个模板仅使用一个表面层级的扁平化页面
14. Spacing Consistency
14. 间距一致性
In each template, check gap/padding classes. Flag if a single template mixes more than 2 gap scales (e.g., , , in the same view suggests inconsistency).
.heexgap-2gap-4gap-8在每个模板中,检查间距/内边距类。如果单个模板混合使用超过2种间距尺度(例如同一视图中同时使用、、,表明不一致),则标记违规。
.heexgap-2gap-4gap-815. Reduced Motion
15. 减少动画
Check project CSS for rule. Flag as warning if absent and animations/transitions are used.
@media (prefers-reduced-motion: reduce)检查项目CSS中是否存在规则。如果存在动画/过渡效果但缺少该规则,则标记为警告。
@media (prefers-reduced-motion: reduce)Output
输出格式
Phoenix DuskMoon Design Compliance
====================================
[✓|✗] Hardcoded colors: N violations
[✓|✗] Theme setup: OK | missing X
[✓|✗] Appbar color: primary | wrong default
[✓|✗] Sidebar/drawer color: secondary | wrong default
[✓|⚠] BG-text pairing: N warnings
[✓|✗] Surface elevation: OK | N violations
[✓|✗] Semantic color misuse: N violations
[✓|⚠] Multiple primary btns: N warnings
[✓|✗] Raw HTML over components: N instances
[✓|⚠] Icon color override: N warnings
[✓|✗] Tailwind color scale: N violations
[✓|⚠] Typography: OK | N warnings
[✓|⚠] Layout depth: OK | N warnings
[✓|⚠] Spacing consistency: OK | N warnings
[✓|⚠] Reduced motion: OK | missing
Total: N errors, N warningsList each violation grouped by check with file:line, code snippet, and suggested fix.
Phoenix DuskMoon Design Compliance
====================================
[✓|✗] Hardcoded colors: N violations
[✓|✗] Theme setup: OK | missing X
[✓|✗] Appbar color: primary | wrong default
[✓|✗] Sidebar/drawer color: secondary | wrong default
[✓|⚠] BG-text pairing: N warnings
[✓|✗] Surface elevation: OK | N violations
[✓|✗] Semantic color misuse: N violations
[✓|⚠] Multiple primary btns: N warnings
[✓|✗] Raw HTML over components: N instances
[✓|⚠] Icon color override: N warnings
[✓|✗] Tailwind color scale: N violations
[✓|⚠] Typography: OK | N warnings
[✓|⚠] Layout depth: OK | N warnings
[✓|⚠] Spacing consistency: OK | N warnings
[✓|⚠] Reduced motion: OK | missing
Total: N errors, N warnings按检查项分组列出每一项违规内容,包含文件:行号、代码片段和建议修复方案。