cmd-check-flutter-duskmoon-design
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese/check-flutter-duskmoon-design
/check-flutter-duskmoon-design
Agent skill wrapper for the Claude command .
/check-flutter-duskmoon-designWhen the original command text references , , or named arguments, map them from the user's current request.
{{INPUT}}$1Claude命令的Agent技能封装。
/check-flutter-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"在文件中标记存在、、、但有对应组件的情况。排除(组件定义目录)和的元素。
.heex<button><input><select><table>dm_*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按检查项分组列出每一项违规内容,包含文件:行号、代码片段及建议修复方案。