一键导入
cosmic-desktop-development
Best practices and guidelines for developing applications and applets for the COSMIC Desktop Environment.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Best practices and guidelines for developing applications and applets for the COSMIC Desktop Environment.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Best practices for using NixOS, Flakes, and direnv for reproducible development environments.
Guidelines, idioms, and best practices for writing high-quality Rust code.
| name | Cosmic Desktop Development |
| description | Best practices and guidelines for developing applications and applets for the COSMIC Desktop Environment. |
This skill provides guidelines and best practices for developing applications and applets for the System76 COSMIC Desktop Environment (COSMIC DE).
COSMIC applications are built using Rust and libcosmic.
libcosmic (Built on top of iced, a cross-platform GUI library inspired by Elm)Always start strict adherence to COSMIC standards by using official templates.
For standalone applications:
cargo generate --git https://github.com/pop-os/cosmic-app-template
For panel applets:
cargo generate --git https://github.com/pop-os/cosmic-applet-template
libcosmic (and iced) follows the Model-View-Update (MVU) pattern:
fn update(&mut state, message)) that modifies the state based on a message.fn view(&state) -> Element) that renders the UI based on the state.libcosmic Widgets: Always prefer libcosmic widgets over raw iced widgets when available to ensure consistent styling and integration with the desktop theme.update, view, and state logic. For complex apps, break components into sub-modules with their own MVU cycles.cosmic-config for handling user settings. This ensures your app's settings persist and respect system-wide overrides.cosmic-theme (e.g., theme.palette.primary, theme.palette.background). This ensures your app looks correct in both Light and Dark modes.cosmic-text: Advanced text shaping and rendering.cosmic-config: Type-safe configuration management.cosmic-theme: Access to system colors and metrics.cosmic-comp: The compositor (useful for reference if interacting with window management).examples/ in the libcosmic repo.libcosmic features enabled in Cargo.toml.Theme as an argument in your view function and passing it correctly.