skills/frontend/SKILL.md
## SolidJS Component Structure ### Rules 1. Every UI component lives in its own file under `src/components/` — one default-exported component per file, named to match the file (e.g. `LeftNav.tsx` exports `LeftNav`). 2. `App.tsx` is strictly a composition root: it imports top-level components, wires up resources/signals, and returns a shallow JSX tree. No markup beyond layout wrappers and `<Show>`/`<Switch>` control flow belongs here. 3. Co-locate a component's CSS in a file alongside it (`Comp
npx skillsauth add theprimeagen/skills skills/frontendInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
src/components/ — one default-exported component per file, named to match the file (e.g. LeftNav.tsx exports LeftNav).App.tsx is strictly a composition root: it imports top-level components, wires up resources/signals, and returns a shallow JSX tree. No markup beyond layout wrappers and <Show>/<Switch> control flow belongs here.ComponentName.css) and import it from the component file. Shared/global styles stay in src/App.css.src/components/ and import it — prefer many small files over one large file.// src/App.tsx
import { createResource, Show } from "solid-js";
import { AuthGate } from "./components/AuthGate";
import { LeftNav } from "./components/LeftNav";
import { MainContent } from "./components/MainContent";
import "./App.css";
const App = () => {
const [me, { refetch }] = createResource(fetchMe);
const handleLogout = async () => { await authClient.signOut(); refetch(); };
return (
<Show when={!me.loading} fallback={<div class="loading" />}>
<AuthGate me={me} onLogout={handleLogout}>
<div class="layout">
<LeftNav user={me()!.user!} onLogout={handleLogout} />
<MainContent />
</div>
</AuthGate>
</Show>
);
};
export default App;
// src/components/LeftNav.tsx
import { createSignal, Show } from "solid-js";
import { ProfilePopup } from "./ProfilePopup";
import "./LeftNav.css";
interface LeftNavProps {
user: { name: string; image: string | null };
onLogout: () => void;
}
export function LeftNav(props: LeftNavProps) {
const [showPopup, setShowPopup] = createSignal(false);
return (
<nav class="nav">
<div class="nav-spacer" />
<div class="profile-area">
<button class="profile-button" onClick={() => setShowPopup(!showPopup())}>
<Show when={props.user.image}>
<img src={props.user.image!} alt={props.user.name} class="profile-avatar" />
</Show>
<span class="profile-name">{props.user.name}</span>
</button>
<Show when={showPopup()}>
<ProfilePopup onLogout={props.onLogout} />
</Show>
</div>
</nav>
);
}
tools
# Neovim Lua API Reference This document contains type stubs and API references for Neovim's Lua API. Use this as a reference when writing Neovim plugins or configurations in Lua. --- ## api The following are type stubs for all the functions available on `vim.api.*`. Prefer these functions where possible. ```lua vim.api = {} vim.api.nvim__buf_debug_extmarks(buffer, keys, dot) vim.api.nvim__buf_stats(buffer) vim.api.nvim__complete_set(index, opts) vim.api.nvim__get_lib_dir() vim.api.nvim
development
# Neovim Treesitter API Reference This document contains type stubs and API references for Neovim's treesitter Lua API. Use this as a reference when working with treesitter in Neovim Lua. --- ## tsnode TSNode methods - represents a specific element in a parsed syntax tree. Use these methods to navigate and inspect nodes. ```lua function TSNode:parent() end function TSNode:next_sibling() end function TSNode:prev_sibling() end function TSNode:next_named_sibling() end function TSNode:prev_name
tools
# Neovim LSP API Reference This document contains function definitions from Neovim's LSP help docs. Use this as a reference when working with LSP in Neovim Lua. --- ## lsp Functions extracted from `lsp.txt`. ```lua vim.lsp.buf_attach_client({bufnr}, {client_id}) vim.lsp.buf_detach_client({bufnr}, {client_id}) vim.lsp.buf_is_attached({bufnr}, {client_id}) vim.lsp.buf_notify({bufnr}, {method}, {params}) vim.lsp.buf_request_all({bufnr}, {method}, {params}, {handler}) vim.lsp.buf_request_sync({
tools
# Neovim Diagnostics API Reference This document contains function definitions for Neovim's diagnostics Lua API. Use this as a reference when working with diagnostics in Neovim Lua. --- ## diagnostic vim.diagnostic APIs, types, and helpers. ```lua function get_qf_id_for_title(title) function __newindex(t, name, handler) function __index(t, bufnr) function callback() function to_severity(severity) function severity_predicate(severity) function filter_by_severity(severity, diagnostics) functi