platform-first
Platform-first: when writing browser styles, layout, animation or UI behaviour (dialogs, popovers, scroll, hover, forms), use CSS and HTML before JS or a library. Also when choosing JS syntax and built-in APIs, so code uses current built-ins over outdated habits.
- License 许可
- MIT
- 最近更新
- 2026-11-13
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- platform-first
- description
- Platform-first: when writing browser styles, layout, animation or UI behaviour (dialogs, popovers, scroll, hover, forms), use CSS and HTML before JS or a library. Also when choosing JS syntax and built-in APIs, so code uses current built-ins over outdated habits.
02 资源文件 3
- 参考文档agents/openai.yaml125 B
- 参考文档reference/CSS.md6.4 KB
- 参考文档reference/JS.md5.8 KB
03 SKILL.md 正文
Platform-first: the web platform (CSS, HTML, built-in JS) already does most of what agents reach for a script or a library to do. Training data is full of legacy patterns, so the first idea is often the outdated one. Pick the laziest fix that works.
Process
1. Read the target
Read the project's browser target before choosing any feature: browserslist (or a baseline widely available on <date> query), package.json engines, tsconfig target and lib, framework and bundler config (for example Vite build.target). Server code (Node, Deno, Bun) follows engines, because Baseline covers browsers only.
Done when the target is recorded: one line naming the source and its value. No target found: record "none, assume Baseline Widely".
2. Climb the laziest-fix ladder
Take the first rung that solves the problem:
- Existing repo helper
- Standard library
- Native platform feature (CSS, HTML, built-in JS)
- Already-installed dependency
- One line
- New code
Done when you name the rung and why each rung above it does not fit.
3. Find the platform feature
Open the reference file for the branch you are on:
- Styles, layout, animation, UI behaviour (dialogs, popovers, scroll, hover, forms): reference/CSS.md
- JS syntax and built-in APIs, dependencies, lint rules: reference/JS.md
Done when the need matches a table row, or you record "no row" and move to the next ladder rung.
4. Check availability against the target
A reference row gives a tier: Widely, Newly, or Limited. Tiers move, so when a row is stale or unsure, verify the feature on MDN or web.dev (Baseline badge, per-browser support) before writing code.
- Available in the target: use it, no polyfill.
- Not available in the target: ship it as progressive enhancement (
@supports, feature detection, the row's fallback) where the unenhanced result is complete. Where it is not complete, keep the existing approach.
Done when each used feature has a tier recorded against the target, plus a fallback for every feature outside it.
5. Run the repo's checks
Run the repo's lint and type-check. When it has use-baseline rules (see reference/JS.md), run them on the changed files.
Done when the checks pass and no new dependency was added for something a table row covers.
04 同仓库更多 Skills
wait-what
Stop. That last message did not land: re-pitch it.
to-questionnaire
Turn a decision you can't fully answer into a questionnaire for someone else to fill in.
teach
Teach the user a new skill or concept, within this workspace.
research
Investigate a question against high-trust primary sources and capture the findings as a Markdown file in the repo. Use when the user wants a topic researched, docs or API facts gathered, or reading legwork delegated to a background agent.
prototype
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
grilling
Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.