cmd-setup-phoenix-duskmoon
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese/setup-phoenix-duskmoon
/setup-phoenix-duskmoon
Agent skill wrapper for the Claude command .
/setup-phoenix-duskmoonWhen the original command text references , , or named arguments, map them from the user's current request.
{{INPUT}}$1Claude命令的Agent技能封装。
/setup-phoenix-duskmoon当原始命令文本引用、或命名参数时,请从用户当前请求中映射对应内容。
{{INPUT}}$1Command Instructions
命令说明
Set up the DuskMoon UI system in the current Phoenix project. Use the skills , , , and as needed throughout these tasks.
duskmoon-dev-coreduskmoon-dev-css-artduskmoon-elementsphoenix-duskmoon-ui在当前Phoenix项目中搭建DuskMoon UI系统。在整个任务过程中,根据需要使用、、和技能。
duskmoon-dev-coreduskmoon-dev-css-artduskmoon-elementsphoenix-duskmoon-uiTasks
任务
1. Update CLAUDE.md with UI constitution
1. 用UI配置规范更新CLAUDE.md
Add or update a section in with the following constitution:
## UI Library./CLAUDE.mdmarkdown
undefined在中添加或更新章节,内容如下:
./CLAUDE.md## UI Librarymarkdown
undefinedUI Library
UI Library
This project uses the DuskMoon UI system:
- — Phoenix LiveView UI component library (primary web UI)
phoenix_duskmoon - — Core Tailwind CSS plugin and utilities
@duskmoon-dev/core - — CSS art utilities
@duskmoon-dev/css-art - — Base web components
@duskmoon-dev/elements - — Art/decorative web components
@duskmoon-dev/art-elements
Do NOT use DaisyUI or other CSS component libraries. Do NOT use — use components instead.
Use as the Tailwind CSS plugin.
core_components.exphoenix_duskmoon@duskmoon-dev/core/plugin本项目使用DuskMoon UI系统:
- — Phoenix LiveView UI组件库(主要网页UI)
phoenix_duskmoon - — 核心Tailwind CSS插件与工具集
@duskmoon-dev/core - — CSS艺术工具集
@duskmoon-dev/css-art - — 基础网页组件
@duskmoon-dev/elements - — 艺术/装饰性网页组件
@duskmoon-dev/art-elements
请勿使用DaisyUI或其他CSS组件库。请勿使用——请改用组件。
使用作为Tailwind CSS插件。
core_components.exphoenix_duskmoon@duskmoon-dev/core/pluginReporting issues or feature requests
问题反馈或功能请求
If you encounter missing features, bugs, or need functionality not yet available in any DuskMoon package, open a GitHub issue in the appropriate repository with the label :
internal request- — https://github.com/gsmlg-dev/phoenix_duskmoon/issues
phoenix_duskmoon - — https://github.com/gsmlg-dev/duskmoon-dev/issues
@duskmoon-dev/core - — https://github.com/gsmlg-dev/duskmoon-dev/issues
@duskmoon-dev/css-art - — https://github.com/gsmlg-dev/duskmoon-dev/issues
@duskmoon-dev/elements - — https://github.com/gsmlg-dev/duskmoon-dev/issues
@duskmoon-dev/art-elements
If `./CLAUDE.md` does not exist, create it with this section.如果遇到功能缺失、bug,或者需要任何DuskMoon包尚未提供的功能,请在对应仓库的GitHub Issues中创建带有标签的问题:
internal request- — https://github.com/gsmlg-dev/phoenix_duskmoon/issues
phoenix_duskmoon - — https://github.com/gsmlg-dev/duskmoon-dev/issues
@duskmoon-dev/core - — https://github.com/gsmlg-dev/duskmoon-dev/issues
@duskmoon-dev/css-art - — https://github.com/gsmlg-dev/duskmoon-dev/issues
@duskmoon-dev/elements - — https://github.com/gsmlg-dev/duskmoon-dev/issues
@duskmoon-dev/art-elements
如果`./CLAUDE.md`不存在,请创建该文件并添加此章节。2. Update CSS to Tailwind CSS v4 with DuskMoon
2. 将CSS更新为带有DuskMoon的Tailwind CSS v4
- Upgrade to Tailwind CSS v4 (remove v3 config if present)
- Remove DaisyUI from all config and dependencies if present
- Set as the primary Tailwind CSS plugin
@duskmoon-dev/core/plugin - Update the main CSS entry file to use Tailwind v4 syntax and import
@import "tailwindcss"@duskmoon-dev/core/plugin - Remove any /
tailwind.config.js(v3 config files); v4 is configured via CSStailwind.config.ts
- 升级至Tailwind CSS v4(如果存在v3配置则移除)
- 如果存在DaisyUI,请从所有配置和依赖中移除
- 将设置为主要Tailwind CSS插件
@duskmoon-dev/core/plugin - 更新主CSS入口文件,使用Tailwind v4的语法,并导入
@import "tailwindcss"@duskmoon-dev/core/plugin - 删除所有/
tailwind.config.js(v3配置文件);v4通过CSS进行配置tailwind.config.ts
3. Replace core_components.ex with phoenix_duskmoon
3. 用phoenix_duskmoon替换core_components.ex
- Add to
phoenix_duskmoondependencies if not already presentmix.exs - If exists anywhere in the project:
core_components.ex- Identify all callers of functions it exports
- Replace those calls with equivalent components (use the
phoenix_duskmoonskill to map the equivalents)phoenix-duskmoon-ui - Delete after migrating all references
core_components.ex
- Add (or the appropriate import) to the web module helpers so components are available everywhere
import PhoenixDuskmoon.Components - If you find components or patterns that does not yet support, open a GitHub issue at https://github.com/gsmlg-dev/phoenix_duskmoon/issues with the label
phoenix_duskmoondescribing the needed componentinternal request
- 如果尚未存在于
phoenix_duskmoon依赖中,请添加mix.exs - 如果项目中存在:
core_components.ex- 找出所有调用其导出函数的地方
- 将这些调用替换为等效的组件(使用
phoenix_duskmoon技能映射等效组件)phoenix-duskmoon-ui - 迁移所有引用后删除
core_components.ex
- 在Web模块助手类中添加(或适当的导入语句),以便组件在所有地方都可用
import PhoenixDuskmoon.Components - 如果发现尚不支持的组件或模式,请在https://github.com/gsmlg-dev/phoenix_duskmoon/issues创建带有`internal request`标签的GitHub Issue,描述所需组件
phoenix_duskmoon
4. Add bunfig.toml
4. 添加bunfig.toml
Check if exists at the project root.
bunfig.toml- If the project is an umbrella (has directory), add:
apps/toml[install] optional = true [workspaces] packages = ["apps/*"] - If the project is a standard Phoenix project, add a minimal :
bunfig.tomltoml[install] optional = true
检查项目根目录是否存在。
bunfig.toml- 如果项目是umbrella项目(包含目录),添加:
apps/toml[install] optional = true [workspaces] packages = ["apps/*"] - 如果是标准Phoenix项目,添加一个极简的:
bunfig.tomltoml[install] optional = true
5. Add root package.json if missing
5. 添加缺失的根目录package.json
Check if exists at the project root.
package.json- If the project is an umbrella, add a workspace-aware root :
package.jsonjson{ "private": true, "workspaces": ["apps/*"] } - If it is a standard Phoenix project and is missing at the root (assets may have one under
package.json), add one at the project root pointing to the assets workspace or leave it minimal as needed for bun to resolve packages.assets/
检查项目根目录是否存在。
package.json- 如果是umbrella项目,添加一个支持工作区的根目录:
package.jsonjson{ "private": true, "workspaces": ["apps/*"] } - 如果是标准Phoenix项目且根目录缺少(资源文件可能在
package.json目录下有一个),请在项目根目录添加一个指向资源工作区的assets/,或根据bun解析包的需要保留极简版本。package.json
6. Switch JS bundler from esbuild to bun + tailwind standalone CLI
6. 将JS打包工具从esbuild切换为bun + tailwind独立CLI
In deps, replace with:
mix.exs{:esbuild, ...}elixir
{:bun, "~> 1.4", runtime: Mix.env() == :dev},
{:tailwind, "~> 0.2", runtime: Mix.env() == :dev},In , replace the block with (use the actual app name, not ):
config/config.exsconfig :esbuildmy_appelixir
config :bun,
version: "1.3.4",
my_app: [
args: ~w(build assets/js/app.js --outdir=priv/static/assets --external /fonts/* --external /images/*),
cd: Path.expand("../", __DIR__)
]
config :tailwind,
version: "4.1.11",
my_app: [
args: ~w(--input=assets/css/app.css --output=priv/static/assets/app.css),
cd: Path.expand("../", __DIR__)
]For umbrella apps, use for .
Path.expand("../apps/my_app", __DIR__)cd:In , replace the esbuild watcher with:
config/dev.exselixir
watchers: [
tailwind: {Tailwind, :install_and_run, [:my_app, ~w(--watch)]},
bun: {Bun, :install_and_run, [:my_app, ~w(--sourcemap=inline --watch)]}
]Update aliases:
mix.exselixir
"assets.deploy": [
"phx.digest.clean",
"tailwind my_app --minify",
"bun my_app --minify",
"phx.digest"
]在依赖中,将替换为:
mix.exs{:esbuild, ...}elixir
{:bun, "~> 1.4", runtime: Mix.env() == :dev},
{:tailwind, "~> 0.2", runtime: Mix.env() == :dev},在中,将块替换为(使用实际应用名称,而非):
config/config.exsconfig :esbuildmy_appelixir
config :bun,
version: "1.3.4",
my_app: [
args: ~w(build assets/js/app.js --outdir=priv/static/assets --external /fonts/* --external /images/*),
cd: Path.expand("../", __DIR__)
]
config :tailwind,
version: "4.1.11",
my_app: [
args: ~w(--input=assets/css/app.css --output=priv/static/assets/app.css),
cd: Path.expand("../", __DIR__)
]对于umbrella应用,使用。
cd:Path.expand("../apps/my_app", __DIR__)在中,将esbuild监视器替换为:
config/dev.exselixir
watchers: [
tailwind: {Tailwind, :install_and_run, [:my_app, ~w(--watch)]},
bun: {Bun, :install_and_run, [:my_app, ~w(--sourcemap=inline --watch)]}
]更新中的别名:
mix.exselixir
"assets.deploy": [
"phx.digest.clean",
"tailwind my_app --minify",
"bun my_app --minify",
"phx.digest"
]7. Set NODE_PATH for Phoenix dependency resolution
7. 为Phoenix依赖解析设置NODE_PATH
Set to the project root's directory so Bun resolves Phoenix JS packages
(, , , etc.) directly from Elixir's without
needing .
NODE_PATHdeps/phoenixphoenix_htmlphoenix_live_viewdeps/npm installIn (if present), this is already set via:
devenv.nixnix
env.NODE_PATH = "${config.git.root}/deps";For non-devenv setups, export in shell or CI:
bash
export NODE_PATH="$(pwd)/deps"No or symlinks needed for Phoenix's own JS packages.
npm install将设置为项目根目录的目录,以便Bun直接从Elixir的中解析Phoenix JS包(、、等),无需执行。
NODE_PATHdeps/deps/phoenixphoenix_htmlphoenix_live_viewnpm install如果存在,已通过以下方式设置:
devenv.nixnix
env.NODE_PATH = "${config.git.root}/deps";对于非devenv环境,在shell或CI中导出:
bash
export NODE_PATH="$(pwd)/deps"无需为Phoenix自身的JS包执行或创建符号链接。
npm install8. Configure runtime.exs for devenv binary paths
8. 配置runtime.exs以使用devenv二进制路径
In , add so devenv-provided system binaries are used instead of downloaded ones:
config/runtime.exselixir
if System.get_env("MIX_BUN_PATH") do
config :bun, path: System.get_env("MIX_BUN_PATH")
end
if System.get_env("MIX_TAILWIND_PATH") do
config :tailwind, path: System.get_env("MIX_TAILWIND_PATH")
end在中添加以下内容,以便使用devenv提供的系统二进制文件,而非下载的版本:
config/runtime.exselixir
if System.get_env("MIX_BUN_PATH") do
config :bun, path: System.get_env("MIX_BUN_PATH")
end
if System.get_env("MIX_TAILWIND_PATH") do
config :tailwind, path: System.get_env("MIX_TAILWIND_PATH")
end9. Update assets/package.json for DuskMoon JS packages
9. 更新assets/package.json以添加DuskMoon JS包
Ensure (or the relevant workspace ) lists the DuskMoon packages as dependencies:
assets/package.jsonpackage.jsonjson
{
"dependencies": {
"@duskmoon-dev/core": "latest",
"@duskmoon-dev/css-art": "latest",
"@duskmoon-dev/elements": "latest",
"@duskmoon-dev/art-elements": "latest"
}
}Remove any or entries from the package.json.
esbuilddaisyui确保(或相关工作区的)将DuskMoon包列为依赖:
assets/package.jsonpackage.jsonjson
{
"dependencies": {
"@duskmoon-dev/core": "latest",
"@duskmoon-dev/css-art": "latest",
"@duskmoon-dev/elements": "latest",
"@duskmoon-dev/art-elements": "latest"
}
}从package.json中移除所有或条目。
esbuilddaisyui10. Install dependencies
10. 安装依赖
After all file changes are made:
- Run to fetch new hex packages
mix deps.get - Run (from project root) to install JS packages
bun install
完成所有文件修改后:
- 运行获取新的hex包
mix deps.get - 运行(从项目根目录)安装JS包
bun install
11. Report missing features as internal requests
11. 将缺失功能报告为内部请求
After completing the migration, review any gaps encountered:
- If a DuskMoon package is missing a feature, component, or has a bug that blocked or complicated this migration, open a GitHub issue in the relevant repository with the label :
internal request- issues → https://github.com/gsmlg-dev/phoenix_duskmoon/issues
phoenix_duskmoon - ,
@duskmoon-dev/core,@duskmoon-dev/css-art,@duskmoon-dev/elementsissues → https://github.com/gsmlg-dev/duskmoon-dev/issues@duskmoon-dev/art-elements
- Include in the issue: a clear description of the missing/broken functionality, the use case, and (if possible) a suggested API or workaround
完成迁移后,检查遇到的任何缺口:
- 如果某个DuskMoon包缺少功能、组件,或存在阻碍/复杂化本次迁移的bug,请在对应仓库的GitHub Issues中创建带有标签的问题:
internal request- 问题 → https://github.com/gsmlg-dev/phoenix_duskmoon/issues
phoenix_duskmoon - 、
@duskmoon-dev/core、@duskmoon-dev/css-art、@duskmoon-dev/elements问题 → https://github.com/gsmlg-dev/duskmoon-dev/issues@duskmoon-dev/art-elements
- 在问题中包含:缺失/损坏功能的清晰描述、使用场景,以及(如有可能)建议的API或解决方案
Important Notes
重要提示
- Always read files before modifying them
- Use the relevant DuskMoon skills for precise API details:
- for Tailwind plugin setup and core utilities
duskmoon-dev-core - for CSS art package usage
duskmoon-dev-css-art - for base web component APIs
duskmoon-elements - for Phoenix component mappings
phoenix-duskmoon-ui
- Preserve all existing business logic — only replace UI infrastructure
- After migration, do a project-wide search for any remaining references to ,
esbuild, orDaisyUIand clean them upCoreComponents
- 修改文件前请先阅读文件内容
- 使用相关DuskMoon技能获取精确的API细节:
- 用于Tailwind插件设置和核心工具
duskmoon-dev-core - 用于CSS art包的使用
duskmoon-dev-css-art - 用于基础网页组件API
duskmoon-elements - 用于Phoenix组件映射
phoenix-duskmoon-ui
- 保留所有现有业务逻辑——仅替换UI基础设施
- 迁移完成后,在项目范围内搜索所有剩余的、
esbuild或DaisyUI引用并清理CoreComponents