boneyard-skeleton-loading
```markdown
What this skill does
```markdown
---
name: boneyard-skeleton-loading
description: Auto-generated pixel-perfect skeleton loading screens extracted from real DOM using boneyard-js
triggers:
- add skeleton loading to my component
- generate skeleton screens automatically
- show loading placeholder while data fetches
- use boneyard for skeleton UI
- pixel perfect skeleton loading
- auto generate loading skeletons
- wrap component with skeleton loader
- boneyard skeleton setup
---
# Boneyard Skeleton Loading
> Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection.
Boneyard (`boneyard-js`) generates pixel-perfect skeleton loading screens by snapshotting your real DOM — no manual measurement or hand-tuned placeholders needed.
## How It Works
1. Wrap a component with `<Skeleton name="...">` and a `loading` prop
2. Run `npx boneyard-js build` — it launches your dev server, snapshots the DOM, and writes bones files
3. Import the generated registry once in your app root
4. Every `<Skeleton name="...">` auto-resolves its layout from the registry
## Installation
```bash
npm install boneyard-js
```
## Quick Setup
### 1. Wrap your component
```tsx
import { Skeleton } from 'boneyard-js/react'
function BlogPage() {
const { data, isLoading } = useFetch('/api/post')
return (
<Skeleton name="blog-card" loading={isLoading}>
{data && <BlogCard data={data} />}
</Skeleton>
)
}
```
### 2. Build the bones
```bash
npx boneyard-js build
# or specify your dev server URL
npx boneyard-js build http://localhost:3000
```
### 3. Import the registry once (e.g. in `app/layout.tsx`)
```tsx
import './bones/registry'
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>{children}</body>
</html>
)
}
```
## Component API
### `<Skeleton>` Props
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `name` | `string` | required | Unique identifier matching a built bones file |
| `loading` | `boolean` | required | When `true`, renders skeleton; when `false`, renders children |
| `color` | `string` | `#e0e0e0` | Fill color for bones (hex, rgb, etc.) |
| `animate` | `boolean` | `true` | Enable pulse shimmer animation |
| `snapshotConfig` | `object` | — | Control which elements are captured |
## CLI Commands
```bash
# Auto-detect dev server and build all skeletons
npx boneyard-js build
# Target a specific dev server URL
npx boneyard-js build http://localhost:3000
# Custom breakpoints and output directory
npx boneyard-js build --breakpoints 390,820,1440 --out ./public/bones
# Default breakpoints: 375px, 768px, 1280px
```
## Code Examples
### Basic data-fetching skeleton
```tsx
import { Skeleton } from 'boneyard-js/react'
function UserProfile({ userId }: { userId: string }) {
const [user, setUser] = useState(null)
const [loading, setLoading] = useState(true)
useEffect(() => {
fetch(`/api/users/${userId}`)
.then(res => res.json())
.then(data => {
setUser(data)
setLoading(false)
})
}, [userId])
return (
<Skeleton name="user-profile" loading={loading}>
{user && (
<div className="profile">
<img src={user.avatar} alt={user.name} />
<h2>{user.name}</h2>
<p>{user.bio}</p>
</div>
)}
</Skeleton>
)
}
```
### With React Query
```tsx
import { Skeleton } from 'boneyard-js/react'
import { useQuery } from '@tanstack/react-query'
function ProductCard({ productId }: { productId: string }) {
const { data, isLoading } = useQuery({
queryKey: ['product', productId],
queryFn: () => fetch(`/api/products/${productId}`).then(r => r.json()),
})
return (
<Skeleton name="product-card" loading={isLoading} color="#f0f0f0">
{data && (
<div className="product">
<img src={data.image} alt={data.title} />
<h3>{data.title}</h3>
<span>${data.price}</span>
</div>
)}
</Skeleton>
)
}
```
### List of skeletons
```tsx
import { Skeleton } from 'boneyard-js/react'
function PostList() {
const { data: posts, isLoading } = usePosts()
// Show multiple skeleton placeholders while loading
if (isLoading) {
return (
<div className="post-list">
{Array.from({ length: 5 }).map((_, i) => (
<Skeleton key={i} name="post-list-item" loading={true}>
{null}
</Skeleton>
))}
</div>
)
}
return (
<div className="post-list">
{posts.map(post => (
<Skeleton key={post.id} name="post-list-item" loading={false}>
<PostItem post={post} />
</Skeleton>
))}
</div>
)
}
```
### Custom color and no animation
```tsx
<Skeleton
name="dashboard-chart"
loading={isLoading}
color="#d4d4d4"
animate={false}
>
{data && <Chart data={data} />}
</Skeleton>
```
### Snapshot config — exclude certain elements
```tsx
<Skeleton
name="nav-header"
loading={isLoading}
snapshotConfig={{
exclude: ['button', '[data-no-skeleton]'],
minWidth: 8,
minHeight: 8,
}}
>
{data && <Header data={data} />}
</Skeleton>
```
## Project Structure After Build
```
bones/
registry.ts ← import this once in app root
blog-card.bones.json
user-profile.bones.json
product-card.bones.json
```
Each `.bones.json` stores a flat array of `{ x, y, w, h, r }` rectangles captured at each breakpoint. The `<Skeleton>` component reads these at runtime and renders matching gray rectangles.
## Next.js App Router Integration
```tsx
// app/layout.tsx
import '../bones/registry'
import type { Metadata } from 'next'
export const metadata: Metadata = {
title: 'My App',
}
export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<html lang="en">
<body>{children}</body>
</html>
)
}
```
## Next.js Pages Router Integration
```tsx
// pages/_app.tsx
import '../bones/registry'
import type { AppProps } from 'next/app'
export default function App({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />
}
```
## Workflow for New Skeletons
1. Add `<Skeleton name="my-new-component" loading={...}>` around your component
2. Make sure your dev server is running (`npm run dev`)
3. Run `npx boneyard-js build`
4. Commit the updated `bones/` directory
## Common Patterns
### Conditional loading state with SWR
```tsx
import useSWR from 'swr'
import { Skeleton } from 'boneyard-js/react'
const fetcher = (url: string) => fetch(url).then(r => r.json())
function ArticleView({ slug }: { slug: string }) {
const { data, isLoading } = useSWR(`/api/articles/${slug}`, fetcher)
return (
<Skeleton name="article-view" loading={isLoading}>
{data && (
<article>
<h1>{data.title}</h1>
<p className="byline">By {data.author}</p>
<div dangerouslySetInnerHTML={{ __html: data.content }} />
</article>
)}
</Skeleton>
)
}
```
### Dashboard with multiple skeleton zones
```tsx
import { Skeleton } from 'boneyard-js/react'
function Dashboard() {
const { stats, statsLoading } = useStats()
const { chart, chartLoading } = useChartData()
const { activity, activityLoading } = useActivity()
return (
<div className="dashboard">
<Skeleton name="stats-row" loading={statsLoading}>
{stats && <StatsRow stats={stats} />}
</Skeleton>
<Skeleton name="main-chart" loading={chartLoading}>
{chart && <MainChart data={chart} />}
</Skeleton>
<Skeleton name="activity-feed" loading={activityLoading}>
{activity && <ActivityFeed items={activity} />}
</Skeleton>
</div>
)
}
```
## Troubleshooting
### Skeleton name not found / blank skeleton shows
- Run `npx boneyard-js build` — the bones file for that name hasn't been generated yet
- Ensure the `name` prop exactly matches the one used during build
- Confirm `bones/registry` is imporRelated in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.