- 利用提早返回(early returns)来提高代码可读性。
- 使用 Tailwind 类来为 HTML 元素设置样式,而不是使用 CSS 或
<style>标签。 - 在
class标签中,尽可能使用class:指令而不是三元运算符。 - 使用描述性的变量和函数/常量名,并为事件函数添加"handle"前缀,例如
onClick使用handleClick,onKeyDown使用handleKeyDown。 - 在元素上实现无障碍功能,包括为
<button>等标签添加tabindex="0"、aria-label、on:click、on:keydown等类似属性。 - 使用常量(consts)代替函数,并尽可能定义类型。
- 使用 Tailwind 类来为 HTML 元素设置样式,而不是使用 CSS 或
Sveltekit Tailwind Typescript Guide General Code Guidelines
Use when working with SvelteKit — code guidelines, Tailwind styling, accessibility, naming
Sveltekit Tailwind Typescript Guide General Code Guidelines by liaosw97 · 72234c6
npx skillmds@latest add liaosw97/sveltekit-tailwind-typescript-guide-general-code-guidelines File contents
---name: sveltekit-tailwind-typescript-guide-general-code-guidelinesdescription: Use when working with SvelteKit — code guidelines, Tailwind styling, accessibility, naming---- 利用提早返回(early returns)来提高代码可读性。 - 使用 Tailwind 类来为 HTML 元素设置样式,而不是使用 CSS 或 `<style>` 标签。 - 在 `class` 标签中,尽可能使用 `class:` 指令而不是三元运算符。 - 使用描述性的变量和函数/常量名,并为事件函数添加"handle"前缀,例如 `onClick` 使用 `handleClick`,`onKeyDown` 使用 `handleKeyDown`。 - 在元素上实现无障碍功能,包括为 `<button>` 等标签添加 `tabindex="0"`、`aria-label`、`on:click`、`on:keydown` 等类似属性。 - 使用常量(consts)代替函数,并尽可能定义类型。
liaosw97/awesome-rules-skills/tree/main/plugins/sveltekit-tailwind/skills/sveltekit-tailwind-typescript-guide-general-code-guidelines commit 72234c6fe0
Frequently asked questions
Run npx skillmds@latest add liaosw97/sveltekit-tailwind-typescript-guide-general-code-guidelines in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Use when working with SvelteKit — code guidelines, Tailwind styling, accessibility, naming It is listed under Web & Frontend on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Capability flags: docs only. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
liaosw97 (@liaosw97) published this skill. Their other Agent Skills are listed on their SkillMD profile.