一键导入
component-authoring
Guidelines for authoring reusable UI components. Use when asked to create new frontend features, components, or design-adjacent tasks.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Guidelines for authoring reusable UI components. Use when asked to create new frontend features, components, or design-adjacent tasks.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use this skill when the user wants to set up a new TypeScript project or add standard tooling to an existing one. Triggers on phrases like "set up this repo", "initialize the project", "add linting", "scaffold this", "set up tooling", "configure typescript", or "sow".
Audit an API, CLI, or config surface for what it makes easy (affordances) and what it makes easy to get wrong (anti-affordances, footguns). Finds the pit-of-success versus the footgun, and the smell where the primary use is smooth but the secondary use is awkward. The principle: good design you act through without noticing; bad design makes you fight it. Use when designing or reviewing a public interface, library, SDK, or command surface. Triggers on "API ergonomics", "is this easy to misuse", "footgun", "pit of success", "review this interface", "review this CLI", "ergonomics".
Always use when user asks to create, generate, draw, or design a diagram, flowchart, architecture diagram, ER diagram, sequence diagram, class diagram, network diagram, mockup, wireframe, or UI sketch, or mentions draw.io, drawio, drawoi, .drawio files, or diagram export to PNG/SVG/PDF.
A code-review lens that flags cleverness for its own sake, fashion-driven choices, premature abstraction, and indirection that serves the author instead of the reader. Asks one question of every choice: who does this serve? Empathy over ego: ego-driven work never produces something humane. Use when reviewing a diff or PR, especially a clever or trendy one. Triggers on "review this", "is this over-engineered", "too clever", "code review", "is this abstraction worth it".
Export the current Pi or Claude Code conversation transcript to a standalone HTML file. Use whenever the user invokes this skill, says /export, asks to export/share/save the current agent session, or wants a transcript HTML without manually finding a JSONL path or installing devlog.
Verify WCAG 2.1.1 (Keyboard) compliance by testing fuzzy, property-based focus invariants against a live page. Use when auditing keyboard accessibility, testing focus management, validating tab order, or checking that interactive elements are reachable. Prefer Chrome MCP/devtools tools when available; CDP via curl is also supported. Framework-agnostic.
| name | component-authoring |
| description | Guidelines for authoring reusable UI components. Use when asked to create new frontend features, components, or design-adjacent tasks. |
| metadata | {"author":"Mark Anthony Cianfrani","version":"0.1"} |
A good reusable component is a boundary. Its primary function is to reduce cognitive load, NOT necessarily to prevent repetition. Most importantly, not every component should be reusable. If a component is not reusable, these principles need not apply.
model everything off of HTML. If your component doesn't feel like something the platform could have shipped, it's probably wrong, with the exception of . is such a terrible, bloated HTML element. HTML is a fine, battle-tested standard for creating composable elements.
You will spend more time and effort making a component reusable.
Layout is the parent's job. Components do not set their own margin, position, or placement. Parents use gap, spacing, flex — same way a <button> doesn't margin itself.
Slots over props. Children come in as slotted markup. Reach for props or attributes mostly as sugar for genuinely repeated config. This is almost always a trade-off between developer ergonomics and design flexibility. While it is easier to type "hasSearchIcon=true", it ultimately will become a burden when someone wants to add a new icon. Slots are the most flexible, most verbose. Props and attributes are the least flexible, least verbose. If your component has more than 6 props, you better have a good reason.
Stateless by default. A good component starts with no state. If state isn't shared with anything else, it can live inside. The moment a second consumer needs to read or mutate it, lift it out. Always consider how your component behaves in its default state.
CustomEvents for outward comms. dispatchEvent(new CustomEvent(…, { bubbles: true })). No callback props.
:host { margin: … } anywhere.withX, showY, hasZ piling up on one element.