Enforce strict type safety, accessibility standards, and code quality for TypeScript/JavaScript projects using Biome's formatter and linter. Use when writing, reviewing, or fixing TS/JS/TSX/JSX code, checking for a11y issues, linting errors, type safety problems, or when the user mentions code quality, formatting, accessibility, or best practices.
Enforces strict type safety, accessibility standards, and code quality for TypeScript/JavaScript using Biome's formatter and linter. Triggers when writing, reviewing, or fixing TS/JS/TSX/JSX code, or when users mention code quality, formatting, accessibility, or best practices.
/plugin marketplace add Tylerbryy/codewarden/plugin install codewarden@codewarden-marketplaceThis skill is limited to using the following tools:
Ultracite enforces strict type safety, accessibility standards, and consistent code quality for JavaScript/TypeScript projects using Biome's lightning-fast formatter and linter.
When writing or reviewing code, follow this checklist:
# Initialize Ultracite in your project
npx ultracite init
# Format and fix code automatically
npx ultracite fix
# Check for issues without fixing
npx ultracite check
When working with TypeScript/JavaScript code:
Critical accessibility requirements:
accessKey attribute on any HTML elementaria-hidden="true" on focusable elements<marquee> or <blink>type attribute for button elementslang attribute on the html elementtitle attribute for iframe elementsonClick with at least one of: onKeyUp, onKeyDown, or onKeyPressonMouseOver/onMouseOut with onFocus/onBlurtitle element for SVG elementsExample - Good Accessibility:
// ✅ Good: Proper button with type and accessible events
<button
type="button"
onClick={handleClick}
onKeyDown={handleKeyDown}
>
Submit
</button>
// ✅ Good: Accessible image with meaningful alt
<img src="/photo.jpg" alt="Team celebrating product launch" />
// ❌ Bad: Missing type, keyboard support, and poor alt text
<button onClick={handleClick}>Submit</button>
<img src="/photo.jpg" alt="image of photo" />
Critical React requirements:
children and dangerouslySetInnerHTML props<>...</> instead of <Fragment>...</Fragment>Example - Good React Patterns:
// ✅ Good: Component defined at top level with proper hooks
function UserList({ users }) {
const [selected, setSelected] = useState(null);
useEffect(() => {
// All dependencies listed
loadData();
}, [loadData]);
return (
<>
{users.map(user => (
<UserCard key={user.id} user={user} />
))}
</>
);
}
// ❌ Bad: Component defined inside, index as key, missing deps
function ParentComponent() {
function ChildComponent() { // Bad: nested component
useEffect(() => {
doSomething(); // Bad: missing dependency
}, []);
return <div>Child</div>;
}
return items.map((item, i) => (
<div key={i}>{item}</div> // Bad: index as key
));
}
Critical TypeScript requirements:
as const objects instead)any typeexport type for typesimport type for typesas const instead of literal types and type annotationsT[] or Array<T> consistentlyExample - Good TypeScript Patterns:
// ✅ Good: Use const objects instead of enums
const Status = {
PENDING: 'pending',
ACTIVE: 'active',
COMPLETED: 'completed'
} as const;
type Status = typeof Status[keyof typeof Status];
// ✅ Good: Import/export types properly
import type { User } from './types';
export type { User };
// ✅ Good: Specific types, no any
function processUser(user: User): Result<User> {
return { success: true, data: user };
}
// ❌ Bad: Using enum, any, and non-null assertion
enum Status { PENDING, ACTIVE } // Bad: use const object
function process(data: any) { // Bad: use specific type
return data!.value; // Bad: avoid non-null assertion
}
Critical correctness requirements:
arguments object (use rest parameters)for...of statements instead of Array.forEachExample - Good Code Quality:
// ✅ Good: Arrow functions, for-of, proper async handling
const processItems = async (items: Item[]) => {
const results = [];
for (const item of items) {
const result = await processItem(item);
results.push(result);
}
return results;
};
// ✅ Good: Optional chaining
const userName = user?.profile?.name ?? 'Anonymous';
// ❌ Bad: Function expression, forEach, await in loop
const processItems = function(items) {
const results = [];
items.forEach(async (item) => { // Bad: async in forEach
await processItem(item); // Bad: await in loop (via forEach)
});
return results;
};
Error handling best practices:
new when throwing an errorExample - Good Error Handling:
// ✅ Good: Comprehensive error handling
async function fetchData(url: string): Promise<Result<Data>> {
try {
const response = await fetch(url);
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
}
const data = await response.json();
return { success: true, data };
} catch (error) {
console.error('API call failed:', error);
return {
success: false,
error: error instanceof Error ? error.message : 'Unknown error'
};
}
}
// ❌ Bad: Swallowing errors, throwing strings
async function fetchData(url: string) {
try {
const response = await fetch(url);
return await response.json();
} catch (e) {
console.log(e); // Bad: just logging
throw 'Failed to fetch'; // Bad: throwing string
}
}
Key style requirements:
const declarations for variables that are only assigned once+=, -=, etc.)** operator instead of Math.pownew when throwing an errorvar (use const or let)Example - Good Style:
// ✅ Good: Modern, consistent style
const calculateTotal = (items: Item[]): number => {
let total = 0;
for (const item of items) {
total += item.price * item.quantity;
}
return total ** 2; // Use ** instead of Math.pow
};
const message = `Total: $${calculateTotal(items)}`; // Template literal
// ❌ Bad: Inconsistent, outdated style
function calculateTotal(items) {
var total = 0; // Bad: use const/let
for (var i = 0; i < items.length; i++) { // Bad: use for-of
total = total + items[i].price; // Bad: use +=
}
return Math.pow(total, 2); // Bad: use **
}
var message = 'Total: $' + calculateTotal(items); // Bad: use template literal
When working with Next.js:
<img> elements (use next/image instead)<head> elements (use next/head instead)next/document outside of pages/_document.jsxnext/head module in pages/_document.jsExample - Good Next.js Patterns:
// ✅ Good: Use Next.js Image component
import Image from 'next/image';
export default function Profile() {
return (
<Image
src="/profile.jpg"
alt="User profile"
width={500}
height={500}
/>
);
}
// ❌ Bad: Using native img tag
export default function Profile() {
return <img src="/profile.jpg" alt="User profile" />;
}
any type instead of specific typesFix 1: Replace var with const/let
// Before
var count = 0;
// After
let count = 0;
Fix 2: Replace any with specific types
// Before
function process(data: any) { }
// After
function process(data: User) { }
Fix 3: Replace enum with const object
// Before
enum Status { ACTIVE, INACTIVE }
// After
const Status = {
ACTIVE: 'active',
INACTIVE: 'inactive'
} as const;
type Status = typeof Status[keyof typeof Status];
Fix 4: Add proper error handling
// Before
async function fetchData() {
return await fetch('/api/data');
}
// After
async function fetchData(): Promise<Result<Data>> {
try {
const response = await fetch('/api/data');
if (!response.ok) {
throw new Error(`HTTP ${response.status}`);
}
const data = await response.json();
return { success: true, data };
} catch (error) {
console.error('Fetch failed:', error);
return { success: false, error };
}
}
Fix 5: Use proper keys in lists
// Before
items.map((item, i) => <div key={i}>{item}</div>)
// After
items.map(item => <div key={item.id}>{item.name}</div>)
Use this skill when:
For a complete list of all rules and detailed explanations, refer to the Biome documentation at https://biomejs.dev/linter/rules/
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.