···11+---
22+name: copywriting
33+version: 1.0.0
44+description: When the user wants to write, rewrite, or improve marketing copy for any page — including homepage, landing pages, pricing pages, feature pages, about pages, or product pages. Also use when the user says "write copy for," "improve this copy," "rewrite this page," "marketing copy," "headline help," or "CTA copy." For email copy, see email-sequence. For popup copy, see popup-cro.
55+---
66+77+# Copywriting
88+99+You are an expert conversion copywriter. Your goal is to write marketing copy that is clear, compelling, and drives action.
1010+1111+## Before Writing
1212+1313+**Check for product marketing context first:**
1414+If `.claude/product-marketing-context.md` exists, read it before asking questions. Use that context and only ask for information not already covered or specific to this task.
1515+1616+Gather this context (ask if not provided):
1717+1818+### 1. Page Purpose
1919+- What type of page? (homepage, landing page, pricing, feature, about)
2020+- What is the ONE primary action you want visitors to take?
2121+2222+### 2. Audience
2323+- Who is the ideal customer?
2424+- What problem are they trying to solve?
2525+- What objections or hesitations do they have?
2626+- What language do they use to describe their problem?
2727+2828+### 3. Product/Offer
2929+- What are you selling or offering?
3030+- What makes it different from alternatives?
3131+- What's the key transformation or outcome?
3232+- Any proof points (numbers, testimonials, case studies)?
3333+3434+### 4. Context
3535+- Where is traffic coming from? (ads, organic, email)
3636+- What do visitors already know before arriving?
3737+3838+---
3939+4040+## Copywriting Principles
4141+4242+### Clarity Over Cleverness
4343+If you have to choose between clear and creative, choose clear.
4444+4545+### Benefits Over Features
4646+Features: What it does. Benefits: What that means for the customer.
4747+4848+### Specificity Over Vagueness
4949+- Vague: "Save time on your workflow"
5050+- Specific: "Cut your weekly reporting from 4 hours to 15 minutes"
5151+5252+### Customer Language Over Company Language
5353+Use words your customers use. Mirror voice-of-customer from reviews, interviews, support tickets.
5454+5555+### One Idea Per Section
5656+Each section should advance one argument. Build a logical flow down the page.
5757+5858+---
5959+6060+## Writing Style Rules
6161+6262+### Core Principles
6363+6464+1. **Simple over complex** — "Use" not "utilize," "help" not "facilitate"
6565+2. **Specific over vague** — Avoid "streamline," "optimize," "innovative"
6666+3. **Active over passive** — "We generate reports" not "Reports are generated"
6767+4. **Confident over qualified** — Remove "almost," "very," "really"
6868+5. **Show over tell** — Describe the outcome instead of using adverbs
6969+6. **Honest over sensational** — Never fabricate statistics or testimonials
7070+7171+### Quick Quality Check
7272+7373+- Jargon that could confuse outsiders?
7474+- Sentences trying to do too much?
7575+- Passive voice constructions?
7676+- Exclamation points? (remove them)
7777+- Marketing buzzwords without substance?
7878+7979+For thorough line-by-line review, use the **copy-editing** skill after your draft.
8080+8181+---
8282+8383+## Best Practices
8484+8585+### Be Direct
8686+Get to the point. Don't bury the value in qualifications.
8787+8888+❌ Slack lets you share files instantly, from documents to images, directly in your conversations
8989+9090+✅ Need to share a screenshot? Send as many documents, images, and audio files as your heart desires.
9191+9292+### Use Rhetorical Questions
9393+Questions engage readers and make them think about their own situation.
9494+- "Hate returning stuff to Amazon?"
9595+- "Tired of chasing approvals?"
9696+9797+### Use Analogies When Helpful
9898+Analogies make abstract concepts concrete and memorable.
9999+100100+### Pepper in Humor (When Appropriate)
101101+Puns and wit make copy memorable—but only if it fits the brand and doesn't undermine clarity.
102102+103103+---
104104+105105+## Page Structure Framework
106106+107107+### Above the Fold
108108+109109+**Headline**
110110+- Your single most important message
111111+- Communicate core value proposition
112112+- Specific > generic
113113+114114+**Example formulas:**
115115+- "{Achieve outcome} without {pain point}"
116116+- "The {category} for {audience}"
117117+- "Never {unpleasant event} again"
118118+- "{Question highlighting main pain point}"
119119+120120+**For comprehensive headline formulas**: See [references/copy-frameworks.md](references/copy-frameworks.md)
121121+122122+**For natural transition phrases**: See [references/natural-transitions.md](references/natural-transitions.md)
123123+124124+**Subheadline**
125125+- Expands on headline
126126+- Adds specificity
127127+- 1-2 sentences max
128128+129129+**Primary CTA**
130130+- Action-oriented button text
131131+- Communicate what they get: "Start Free Trial" > "Sign Up"
132132+133133+### Core Sections
134134+135135+| Section | Purpose |
136136+|---------|---------|
137137+| Social Proof | Build credibility (logos, stats, testimonials) |
138138+| Problem/Pain | Show you understand their situation |
139139+| Solution/Benefits | Connect to outcomes (3-5 key benefits) |
140140+| How It Works | Reduce perceived complexity (3-4 steps) |
141141+| Objection Handling | FAQ, comparisons, guarantees |
142142+| Final CTA | Recap value, repeat CTA, risk reversal |
143143+144144+**For detailed section types and page templates**: See [references/copy-frameworks.md](references/copy-frameworks.md)
145145+146146+---
147147+148148+## CTA Copy Guidelines
149149+150150+**Weak CTAs (avoid):**
151151+- Submit, Sign Up, Learn More, Click Here, Get Started
152152+153153+**Strong CTAs (use):**
154154+- Start Free Trial
155155+- Get [Specific Thing]
156156+- See [Product] in Action
157157+- Create Your First [Thing]
158158+- Download the Guide
159159+160160+**Formula:** [Action Verb] + [What They Get] + [Qualifier if needed]
161161+162162+Examples:
163163+- "Start My Free Trial"
164164+- "Get the Complete Checklist"
165165+- "See Pricing for My Team"
166166+167167+---
168168+169169+## Page-Specific Guidance
170170+171171+### Homepage
172172+- Serve multiple audiences without being generic
173173+- Lead with broadest value proposition
174174+- Provide clear paths for different visitor intents
175175+176176+### Landing Page
177177+- Single message, single CTA
178178+- Match headline to ad/traffic source
179179+- Complete argument on one page
180180+181181+### Pricing Page
182182+- Help visitors choose the right plan
183183+- Address "which is right for me?" anxiety
184184+- Make recommended plan obvious
185185+186186+### Feature Page
187187+- Connect feature → benefit → outcome
188188+- Show use cases and examples
189189+- Clear path to try or buy
190190+191191+### About Page
192192+- Tell the story of why you exist
193193+- Connect mission to customer benefit
194194+- Still include a CTA
195195+196196+---
197197+198198+## Voice and Tone
199199+200200+Before writing, establish:
201201+202202+**Formality level:**
203203+- Casual/conversational
204204+- Professional but friendly
205205+- Formal/enterprise
206206+207207+**Brand personality:**
208208+- Playful or serious?
209209+- Bold or understated?
210210+- Technical or accessible?
211211+212212+Maintain consistency, but adjust intensity:
213213+- Headlines can be bolder
214214+- Body copy should be clearer
215215+- CTAs should be action-oriented
216216+217217+---
218218+219219+## Output Format
220220+221221+When writing copy, provide:
222222+223223+### Page Copy
224224+Organized by section:
225225+- Headline, Subheadline, CTA
226226+- Section headers and body copy
227227+- Secondary CTAs
228228+229229+### Annotations
230230+For key elements, explain:
231231+- Why you made this choice
232232+- What principle it applies
233233+234234+### Alternatives
235235+For headlines and CTAs, provide 2-3 options:
236236+- Option A: [copy] — [rationale]
237237+- Option B: [copy] — [rationale]
238238+239239+### Meta Content (if relevant)
240240+- Page title (for SEO)
241241+- Meta description
242242+243243+---
244244+245245+## Related Skills
246246+247247+- **copy-editing**: For polishing existing copy (use after your draft)
248248+- **page-cro**: If page structure/strategy needs work, not just copy
249249+- **email-sequence**: For email copywriting
250250+- **popup-cro**: For popup and modal copy
251251+- **ab-test-setup**: To test copy variations
···11+# Copy Frameworks Reference
22+33+Headline formulas, page section types, and structural templates.
44+55+## Headline Formulas
66+77+### Outcome-Focused
88+99+**{Achieve desirable outcome} without {pain point}**
1010+> Understand how users are really experiencing your site without drowning in numbers
1111+1212+**{Achieve desirable outcome} by {how product makes it possible}**
1313+> Generate more leads by seeing which companies visit your site
1414+1515+**Turn {input} into {outcome}**
1616+> Turn your hard-earned sales into repeat customers
1717+1818+**[Achieve outcome] in [timeframe]**
1919+> Get your tax refund in 10 days
2020+2121+---
2222+2323+### Problem-Focused
2424+2525+**Never {unpleasant event} again**
2626+> Never miss a sales opportunity again
2727+2828+**{Question highlighting the main pain point}**
2929+> Hate returning stuff to Amazon?
3030+3131+**Stop [pain]. Start [pleasure].**
3232+> Stop chasing invoices. Start getting paid on time.
3333+3434+---
3535+3636+### Audience-Focused
3737+3838+**{Key feature/product type} for {target audience}**
3939+> Advanced analytics for Shopify e-commerce
4040+4141+**{Key feature/product type} for {target audience} to {what it's used for}**
4242+> An online whiteboard for teams to ideate and brainstorm together
4343+4444+**You don't have to {skills or resources} to {achieve desirable outcome}**
4545+> With Ahrefs, you don't have to be an SEO pro to rank higher and get more traffic
4646+4747+---
4848+4949+### Differentiation-Focused
5050+5151+**The {opposite of usual process} way to {achieve desirable outcome}**
5252+> The easiest way to turn your passion into income
5353+5454+**The [category] that [key differentiator]**
5555+> The CRM that updates itself
5656+5757+---
5858+5959+### Proof-Focused
6060+6161+**[Number] [people] use [product] to [outcome]**
6262+> 50,000 marketers use Drip to send better emails
6363+6464+**{Key benefit of your product}**
6565+> Sound clear in online meetings
6666+6767+---
6868+6969+### Additional Formulas
7070+7171+**The simple way to {outcome}**
7272+> The simple way to track your time
7373+7474+**Finally, {category} that {benefit}**
7575+> Finally, accounting software that doesn't suck
7676+7777+**{Outcome} without {common pain}**
7878+> Build your website without writing code
7979+8080+**Get {benefit} from your {thing}**
8181+> Get more revenue from your existing traffic
8282+8383+**{Action verb} your {thing} like {admirable example}**
8484+> Market your SaaS like a Fortune 500
8585+8686+**What if you could {desirable outcome}?**
8787+> What if you could close deals 30% faster?
8888+8989+**Everything you need to {outcome}**
9090+> Everything you need to launch your course
9191+9292+**The {adjective} {category} built for {audience}**
9393+> The lightweight CRM built for startups
9494+9595+---
9696+9797+## Landing Page Section Types
9898+9999+### Core Sections
100100+101101+**Hero (Above the Fold)**
102102+- Headline + subheadline
103103+- Primary CTA
104104+- Supporting visual (product screenshot, hero image)
105105+- Optional: Social proof bar
106106+107107+**Social Proof Bar**
108108+- Customer logos (recognizable > many)
109109+- Key metric ("10,000+ teams")
110110+- Star rating with review count
111111+- Short testimonial snippet
112112+113113+**Problem/Pain Section**
114114+- Articulate their problem better than they can
115115+- Create recognition ("that's exactly my situation")
116116+- Hint at cost of not solving it
117117+118118+**Solution/Benefits Section**
119119+- Bridge from problem to your solution
120120+- 3-5 key benefits (not 10)
121121+- Each: headline + explanation + proof if available
122122+123123+**How It Works**
124124+- 3-4 numbered steps
125125+- Reduces perceived complexity
126126+- Each step: action + outcome
127127+128128+**Final CTA Section**
129129+- Recap value proposition
130130+- Repeat primary CTA
131131+- Risk reversal (guarantee, free trial)
132132+133133+---
134134+135135+### Supporting Sections
136136+137137+**Testimonials**
138138+- Full quotes with names, roles, companies
139139+- Photos when possible
140140+- Specific results over vague praise
141141+- Formats: quote cards, video, tweet embeds
142142+143143+**Case Studies**
144144+- Problem → Solution → Results
145145+- Specific metrics and outcomes
146146+- Customer name and context
147147+- Can be snippets with "Read more" links
148148+149149+**Use Cases**
150150+- Different ways product is used
151151+- Helps visitors self-identify
152152+- "For marketers who need X" format
153153+154154+**Personas / "Built For" Sections**
155155+- Explicitly call out target audience
156156+- "Perfect for [role]" blocks
157157+- Addresses "Is this for me?" question
158158+159159+**FAQ Section**
160160+- Address common objections
161161+- Good for SEO
162162+- Reduces support burden
163163+- 5-10 most common questions
164164+165165+**Comparison Section**
166166+- vs. competitors (name them or don't)
167167+- vs. status quo (spreadsheets, manual processes)
168168+- Tables or side-by-side format
169169+170170+**Integrations / Partners**
171171+- Logos of tools you connect with
172172+- "Works with your stack" messaging
173173+- Builds credibility
174174+175175+**Founder Story / Manifesto**
176176+- Why you built this
177177+- What you believe
178178+- Emotional connection
179179+- Differentiates from faceless competitors
180180+181181+**Demo / Product Tour**
182182+- Interactive demos
183183+- Video walkthroughs
184184+- GIF previews
185185+- Shows product in action
186186+187187+**Pricing Preview**
188188+- Teaser even on non-pricing pages
189189+- Starting price or "from $X/mo"
190190+- Moves decision-makers forward
191191+192192+**Guarantee / Risk Reversal**
193193+- Money-back guarantee
194194+- Free trial terms
195195+- "Cancel anytime"
196196+- Reduces friction
197197+198198+**Stats Section**
199199+- Key metrics that build credibility
200200+- "10,000+ customers"
201201+- "4.9/5 rating"
202202+- "$2M saved for customers"
203203+204204+---
205205+206206+## Page Structure Templates
207207+208208+### Feature-Heavy Page (Weak)
209209+210210+```
211211+1. Hero
212212+2. Feature 1
213213+3. Feature 2
214214+4. Feature 3
215215+5. Feature 4
216216+6. CTA
217217+```
218218+219219+This is a list, not a persuasive narrative.
220220+221221+---
222222+223223+### Varied, Engaging Page (Strong)
224224+225225+```
226226+1. Hero with clear value prop
227227+2. Social proof bar (logos or stats)
228228+3. Problem/pain section
229229+4. How it works (3 steps)
230230+5. Key benefits (2-3, not 10)
231231+6. Testimonial
232232+7. Use cases or personas
233233+8. Comparison to alternatives
234234+9. Case study snippet
235235+10. FAQ
236236+11. Final CTA with guarantee
237237+```
238238+239239+This tells a story and addresses objections.
240240+241241+---
242242+243243+### Compact Landing Page
244244+245245+```
246246+1. Hero (headline, subhead, CTA, image)
247247+2. Social proof bar
248248+3. 3 key benefits with icons
249249+4. Testimonial
250250+5. How it works (3 steps)
251251+6. Final CTA with guarantee
252252+```
253253+254254+Good for ad landing pages where brevity matters.
255255+256256+---
257257+258258+### Enterprise/B2B Landing Page
259259+260260+```
261261+1. Hero (outcome-focused headline)
262262+2. Logo bar (recognizable companies)
263263+3. Problem section (business pain)
264264+4. Solution overview
265265+5. Use cases by role/department
266266+6. Security/compliance section
267267+7. Integration logos
268268+8. Case study with metrics
269269+9. ROI/value section
270270+10. Contact/demo CTA
271271+```
272272+273273+Addresses enterprise buyer concerns.
274274+275275+---
276276+277277+### Product Launch Page
278278+279279+```
280280+1. Hero with launch announcement
281281+2. Video demo or walkthrough
282282+3. Feature highlights (3-5)
283283+4. Before/after comparison
284284+5. Early testimonials
285285+6. Launch pricing or early access offer
286286+7. CTA with urgency
287287+```
288288+289289+Good for ProductHunt, launches, or announcements.
290290+291291+---
292292+293293+## Section Writing Tips
294294+295295+### Problem Section
296296+297297+Start with phrases like:
298298+- "You know the feeling..."
299299+- "If you're like most [role]..."
300300+- "Every day, [audience] struggles with..."
301301+- "We've all been there..."
302302+303303+Then describe:
304304+- The specific frustration
305305+- The time/money wasted
306306+- The impact on their work/life
307307+308308+### Benefits Section
309309+310310+For each benefit, include:
311311+- **Headline**: The outcome they get
312312+- **Body**: How it works (1-2 sentences)
313313+- **Proof**: Number, testimonial, or example (optional)
314314+315315+### How It Works Section
316316+317317+Each step should be:
318318+- **Numbered**: Creates sense of progress
319319+- **Simple verb**: "Connect," "Set up," "Get"
320320+- **Outcome-oriented**: What they get from this step
321321+322322+Example:
323323+1. Connect your tools (takes 2 minutes)
324324+2. Set your preferences
325325+3. Get automated reports every Monday
326326+327327+### Testimonial Selection
328328+329329+Best testimonials include:
330330+- Specific results ("increased conversions by 32%")
331331+- Before/after context ("We used to spend hours...")
332332+- Role + company for credibility
333333+- Something quotable and specific
334334+335335+Avoid testimonials that just say:
336336+- "Great product!"
337337+- "Love it!"
338338+- "Easy to use!"
···11+# Natural Transitions
22+33+Transitional phrases to guide readers through your content. Good signposting improves readability, user engagement, and helps search engines understand content structure.
44+55+Adapted from: University of Manchester Academic Phrasebank (2023), Plain English Campaign, web content best practices
66+77+---
88+99+## Previewing Content Structure
1010+1111+Use to orient readers and set expectations:
1212+1313+- Here's what we'll cover...
1414+- This guide walks you through...
1515+- Below, you'll find...
1616+- We'll start with X, then move to Y...
1717+- First, let's look at...
1818+- Let's break this down step by step.
1919+- The sections below explain...
2020+2121+---
2222+2323+## Introducing a New Topic
2424+2525+- When it comes to X,...
2626+- Regarding X,...
2727+- Speaking of X,...
2828+- Now let's talk about X.
2929+- Another key factor is...
3030+- X is worth exploring because...
3131+3232+---
3333+3434+## Referring Back
3535+3636+Use to connect ideas and reinforce key points:
3737+3838+- As mentioned earlier,...
3939+- As we covered above,...
4040+- Remember when we discussed X?
4141+- Building on that point,...
4242+- Going back to X,...
4343+- Earlier, we explained that...
4444+4545+---
4646+4747+## Moving Between Sections
4848+4949+- Now let's look at...
5050+- Next up:...
5151+- Moving on to...
5252+- With that covered, let's turn to...
5353+- Now that you understand X, here's Y.
5454+- That brings us to...
5555+5656+---
5757+5858+## Indicating Addition
5959+6060+- Also,...
6161+- Plus,...
6262+- On top of that,...
6363+- What's more,...
6464+- Another benefit is...
6565+- Beyond that,...
6666+- In addition,...
6767+- There's also...
6868+6969+**Note:** Use "moreover" and "furthermore" sparingly. They can sound AI-generated when overused.
7070+7171+---
7272+7373+## Indicating Contrast
7474+7575+- However,...
7676+- But,...
7777+- That said,...
7878+- On the flip side,...
7979+- In contrast,...
8080+- Unlike X, Y...
8181+- While X is true, Y...
8282+- Despite this,...
8383+8484+---
8585+8686+## Indicating Similarity
8787+8888+- Similarly,...
8989+- Likewise,...
9090+- In the same way,...
9191+- Just like X, Y also...
9292+- This mirrors...
9393+- The same applies to...
9494+9595+---
9696+9797+## Indicating Cause and Effect
9898+9999+- So,...
100100+- This means...
101101+- As a result,...
102102+- That's why...
103103+- Because of this,...
104104+- This leads to...
105105+- The outcome?...
106106+- Here's what happens:...
107107+108108+---
109109+110110+## Giving Examples
111111+112112+- For example,...
113113+- For instance,...
114114+- Here's an example:...
115115+- Take X, for instance.
116116+- Consider this:...
117117+- A good example is...
118118+- To illustrate,...
119119+- Like when...
120120+- Say you want to...
121121+122122+---
123123+124124+## Emphasising Key Points
125125+126126+- Here's the key takeaway:...
127127+- The important thing is...
128128+- What matters most is...
129129+- Don't miss this:...
130130+- Pay attention to...
131131+- This is critical:...
132132+- The bottom line?...
133133+134134+---
135135+136136+## Providing Evidence
137137+138138+Use when citing sources, data, or expert opinions:
139139+140140+### Neutral attribution
141141+- According to [Source],...
142142+- [Source] reports that...
143143+- Research shows that...
144144+- Data from [Source] indicates...
145145+- A study by [Source] found...
146146+147147+### Expert quotes
148148+- As [Expert] puts it,...
149149+- [Expert] explains,...
150150+- In the words of [Expert],...
151151+- [Expert] notes that...
152152+153153+### Supporting claims
154154+- This is backed by...
155155+- Evidence suggests...
156156+- The numbers confirm...
157157+- This aligns with findings from...
158158+159159+---
160160+161161+## Summarising Sections
162162+163163+- To recap,...
164164+- Here's the short version:...
165165+- In short,...
166166+- The takeaway?...
167167+- So what does this mean?...
168168+- Let's pull this together:...
169169+- Quick summary:...
170170+171171+---
172172+173173+## Concluding Content
174174+175175+- Wrapping up,...
176176+- The bottom line is...
177177+- Here's what to do next:...
178178+- To sum up,...
179179+- Final thoughts:...
180180+- Ready to get started?...
181181+- Now it's your turn.
182182+183183+**Note:** Avoid "In conclusion" at the start of a paragraph. It's overused and signals AI writing.
184184+185185+---
186186+187187+## Question-Based Transitions
188188+189189+Useful for conversational tone and featured snippet optimization:
190190+191191+- So what does this mean for you?
192192+- But why does this matter?
193193+- How do you actually do this?
194194+- What's the catch?
195195+- Sound complicated? It's not.
196196+- Wondering where to start?
197197+- Still not sure? Here's the breakdown.
198198+199199+---
200200+201201+## List Introductions
202202+203203+For numbered lists and step-by-step content:
204204+205205+- Here's how to do it:
206206+- Follow these steps:
207207+- The process is straightforward:
208208+- Here's what you need to know:
209209+- Key things to consider:
210210+- The main factors are:
211211+212212+---
213213+214214+## Hedging Language
215215+216216+For claims that need qualification or aren't absolute:
217217+218218+- may, might, could
219219+- tends to, generally
220220+- often, usually, typically
221221+- in most cases
222222+- it appears that
223223+- evidence suggests
224224+- this can help
225225+- many experts believe
226226+227227+---
228228+229229+## Best Practice Guidelines
230230+231231+1. **Match tone to audience**: B2B content can be slightly more formal; B2C often benefits from conversational transitions
232232+2. **Vary your transitions**: Repeating the same phrase gets noticed (and not in a good way)
233233+3. **Don't over-signpost**: Trust your reader; every sentence doesn't need a transition
234234+4. **Use for scannability**: Transitions at paragraph starts help skimmers navigate
235235+5. **Keep it natural**: Read aloud; if it sounds forced, simplify
236236+6. **Front-load key info**: Put the important word or phrase early in the transition
237237+238238+---
239239+240240+## Transitions to Avoid (AI Tells)
241241+242242+These phrases are overused in AI-generated content:
243243+244244+- "That being said,..."
245245+- "It's worth noting that..."
246246+- "At its core,..."
247247+- "In today's digital landscape,..."
248248+- "When it comes to the realm of..."
249249+- "This begs the question..."
250250+- "Let's delve into..."
251251+252252+See the seo-audit skill's `references/ai-writing-detection.md` for a complete list of AI writing tells.
+133
.agents/skills/find-skills/SKILL.md
···11+---
22+name: find-skills
33+description: Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
44+---
55+66+# Find Skills
77+88+This skill helps you discover and install skills from the open agent skills ecosystem.
99+1010+## When to Use This Skill
1111+1212+Use this skill when the user:
1313+1414+- Asks "how do I do X" where X might be a common task with an existing skill
1515+- Says "find a skill for X" or "is there a skill for X"
1616+- Asks "can you do X" where X is a specialized capability
1717+- Expresses interest in extending agent capabilities
1818+- Wants to search for tools, templates, or workflows
1919+- Mentions they wish they had help with a specific domain (design, testing, deployment, etc.)
2020+2121+## What is the Skills CLI?
2222+2323+The Skills CLI (`npx skills`) is the package manager for the open agent skills ecosystem. Skills are modular packages that extend agent capabilities with specialized knowledge, workflows, and tools.
2424+2525+**Key commands:**
2626+2727+- `npx skills find [query]` - Search for skills interactively or by keyword
2828+- `npx skills add <package>` - Install a skill from GitHub or other sources
2929+- `npx skills check` - Check for skill updates
3030+- `npx skills update` - Update all installed skills
3131+3232+**Browse skills at:** https://skills.sh/
3333+3434+## How to Help Users Find Skills
3535+3636+### Step 1: Understand What They Need
3737+3838+When a user asks for help with something, identify:
3939+4040+1. The domain (e.g., React, testing, design, deployment)
4141+2. The specific task (e.g., writing tests, creating animations, reviewing PRs)
4242+3. Whether this is a common enough task that a skill likely exists
4343+4444+### Step 2: Search for Skills
4545+4646+Run the find command with a relevant query:
4747+4848+```bash
4949+npx skills find [query]
5050+```
5151+5252+For example:
5353+5454+- User asks "how do I make my React app faster?" → `npx skills find react performance`
5555+- User asks "can you help me with PR reviews?" → `npx skills find pr review`
5656+- User asks "I need to create a changelog" → `npx skills find changelog`
5757+5858+The command will return results like:
5959+6060+```
6161+Install with npx skills add <owner/repo@skill>
6262+6363+vercel-labs/agent-skills@vercel-react-best-practices
6464+└ https://skills.sh/vercel-labs/agent-skills/vercel-react-best-practices
6565+```
6666+6767+### Step 3: Present Options to the User
6868+6969+When you find relevant skills, present them to the user with:
7070+7171+1. The skill name and what it does
7272+2. The install command they can run
7373+3. A link to learn more at skills.sh
7474+7575+Example response:
7676+7777+```
7878+I found a skill that might help! The "vercel-react-best-practices" skill provides
7979+React and Next.js performance optimization guidelines from Vercel Engineering.
8080+8181+To install it:
8282+npx skills add vercel-labs/agent-skills@vercel-react-best-practices
8383+8484+Learn more: https://skills.sh/vercel-labs/agent-skills/vercel-react-best-practices
8585+```
8686+8787+### Step 4: Offer to Install
8888+8989+If the user wants to proceed, you can install the skill for them:
9090+9191+```bash
9292+npx skills add <owner/repo@skill> -g -y
9393+```
9494+9595+The `-g` flag installs globally (user-level) and `-y` skips confirmation prompts.
9696+9797+## Common Skill Categories
9898+9999+When searching, consider these common categories:
100100+101101+| Category | Example Queries |
102102+| --------------- | ---------------------------------------- |
103103+| Web Development | react, nextjs, typescript, css, tailwind |
104104+| Testing | testing, jest, playwright, e2e |
105105+| DevOps | deploy, docker, kubernetes, ci-cd |
106106+| Documentation | docs, readme, changelog, api-docs |
107107+| Code Quality | review, lint, refactor, best-practices |
108108+| Design | ui, ux, design-system, accessibility |
109109+| Productivity | workflow, automation, git |
110110+111111+## Tips for Effective Searches
112112+113113+1. **Use specific keywords**: "react testing" is better than just "testing"
114114+2. **Try alternative terms**: If "deploy" doesn't work, try "deployment" or "ci-cd"
115115+3. **Check popular sources**: Many skills come from `vercel-labs/agent-skills` or `ComposioHQ/awesome-claude-skills`
116116+117117+## When No Skills Are Found
118118+119119+If no relevant skills exist:
120120+121121+1. Acknowledge that no existing skill was found
122122+2. Offer to help with the task directly using your general capabilities
123123+3. Suggest the user could create their own skill with `npx skills init`
124124+125125+Example:
126126+127127+```
128128+I searched for skills related to "xyz" but didn't find any matches.
129129+I can still help you with this task directly! Would you like me to proceed?
130130+131131+If this is something you do often, you could create your own skill:
132132+npx skills init my-xyz-skill
133133+```
+90
.agents/skills/hono/SKILL.md
···11+---
22+name: hono
33+description: Efficiently develop Hono applications using Hono CLI. Supports documentation search, API reference lookup, request testing, and bundle optimization.
44+---
55+66+# Hono Skill
77+88+Develop Hono applications efficiently using Hono CLI (`@hono/cli`).
99+1010+## Setup
1111+1212+You can use Hono CLI without global installation via npx:
1313+1414+```bash
1515+npx @hono/cli <command>
1616+```
1717+1818+Or install globally (optional):
1919+2020+```bash
2121+npm install -g @hono/cli
2222+```
2323+2424+## Commands for AI
2525+2626+### 1. Search Documentation
2727+2828+```bash
2929+hono search "<query>" --pretty
3030+```
3131+3232+Search for Hono APIs and features. Use `--pretty` for human-readable output.
3333+3434+### 2. View Documentation
3535+3636+```bash
3737+hono docs [path]
3838+```
3939+4040+Display detailed documentation for a specific path found in search results.
4141+4242+**Examples:**
4343+4444+```bash
4545+hono docs /docs/api/context
4646+hono docs /docs/api/hono
4747+hono docs /docs/helpers/factory
4848+```
4949+5050+### 3. Request Testing
5151+5252+```bash
5353+# GET request
5454+hono request [file] -P /path
5555+5656+# POST request
5757+hono request [file] -X POST -P /api/users -d '{"name": "test"}'
5858+5959+# Request with headers
6060+hono request [file] -H "Authorization: Bearer token" -P /api/protected
6161+```
6262+6363+Uses `app.request()` internally, so no server startup required for testing.
6464+6565+### 4. Optimization & Bundling
6666+6767+```bash
6868+# Bundle optimization
6969+hono optimize [entry] -o dist/index.js
7070+7171+# With minification
7272+hono optimize [entry] -o dist/index.js --minify
7373+7474+# Specify target (cloudflare-workers, deno, etc.)
7575+hono optimize [entry] -t cloudflare-workers
7676+```
7777+7878+## Development Workflow
7979+8080+1. **Research**: Use `hono search` → `hono docs` to investigate APIs and features
8181+2. **Implement**: Write the code
8282+3. **Test**: Use `hono request` to test endpoints
8383+4. **Optimize**: Use `hono optimize` for production builds when needed
8484+8585+## Guidelines
8686+8787+- Always search with `hono search` before implementing unfamiliar APIs
8888+- Use `--pretty` flag with `hono search` (default output is JSON)
8989+- `hono request` works without starting an HTTP server
9090+- Search for middleware usage with `hono search "middleware name"`
+202
.agents/skills/skill-creator/LICENSE.txt
···11+22+ Apache License
33+ Version 2.0, January 2004
44+ http://www.apache.org/licenses/
55+66+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
77+88+ 1. Definitions.
99+1010+ "License" shall mean the terms and conditions for use, reproduction,
1111+ and distribution as defined by Sections 1 through 9 of this document.
1212+1313+ "Licensor" shall mean the copyright owner or entity authorized by
1414+ the copyright owner that is granting the License.
1515+1616+ "Legal Entity" shall mean the union of the acting entity and all
1717+ other entities that control, are controlled by, or are under common
1818+ control with that entity. For the purposes of this definition,
1919+ "control" means (i) the power, direct or indirect, to cause the
2020+ direction or management of such entity, whether by contract or
2121+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
2222+ outstanding shares, or (iii) beneficial ownership of such entity.
2323+2424+ "You" (or "Your") shall mean an individual or Legal Entity
2525+ exercising permissions granted by this License.
2626+2727+ "Source" form shall mean the preferred form for making modifications,
2828+ including but not limited to software source code, documentation
2929+ source, and configuration files.
3030+3131+ "Object" form shall mean any form resulting from mechanical
3232+ transformation or translation of a Source form, including but
3333+ not limited to compiled object code, generated documentation,
3434+ and conversions to other media types.
3535+3636+ "Work" shall mean the work of authorship, whether in Source or
3737+ Object form, made available under the License, as indicated by a
3838+ copyright notice that is included in or attached to the work
3939+ (an example is provided in the Appendix below).
4040+4141+ "Derivative Works" shall mean any work, whether in Source or Object
4242+ form, that is based on (or derived from) the Work and for which the
4343+ editorial revisions, annotations, elaborations, or other modifications
4444+ represent, as a whole, an original work of authorship. For the purposes
4545+ of this License, Derivative Works shall not include works that remain
4646+ separable from, or merely link (or bind by name) to the interfaces of,
4747+ the Work and Derivative Works thereof.
4848+4949+ "Contribution" shall mean any work of authorship, including
5050+ the original version of the Work and any modifications or additions
5151+ to that Work or Derivative Works thereof, that is intentionally
5252+ submitted to Licensor for inclusion in the Work by the copyright owner
5353+ or by an individual or Legal Entity authorized to submit on behalf of
5454+ the copyright owner. For the purposes of this definition, "submitted"
5555+ means any form of electronic, verbal, or written communication sent
5656+ to the Licensor or its representatives, including but not limited to
5757+ communication on electronic mailing lists, source code control systems,
5858+ and issue tracking systems that are managed by, or on behalf of, the
5959+ Licensor for the purpose of discussing and improving the Work, but
6060+ excluding communication that is conspicuously marked or otherwise
6161+ designated in writing by the copyright owner as "Not a Contribution."
6262+6363+ "Contributor" shall mean Licensor and any individual or Legal Entity
6464+ on behalf of whom a Contribution has been received by Licensor and
6565+ subsequently incorporated within the Work.
6666+6767+ 2. Grant of Copyright License. Subject to the terms and conditions of
6868+ this License, each Contributor hereby grants to You a perpetual,
6969+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
7070+ copyright license to reproduce, prepare Derivative Works of,
7171+ publicly display, publicly perform, sublicense, and distribute the
7272+ Work and such Derivative Works in Source or Object form.
7373+7474+ 3. Grant of Patent License. Subject to the terms and conditions of
7575+ this License, each Contributor hereby grants to You a perpetual,
7676+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
7777+ (except as stated in this section) patent license to make, have made,
7878+ use, offer to sell, sell, import, and otherwise transfer the Work,
7979+ where such license applies only to those patent claims licensable
8080+ by such Contributor that are necessarily infringed by their
8181+ Contribution(s) alone or by combination of their Contribution(s)
8282+ with the Work to which such Contribution(s) was submitted. If You
8383+ institute patent litigation against any entity (including a
8484+ cross-claim or counterclaim in a lawsuit) alleging that the Work
8585+ or a Contribution incorporated within the Work constitutes direct
8686+ or contributory patent infringement, then any patent licenses
8787+ granted to You under this License for that Work shall terminate
8888+ as of the date such litigation is filed.
8989+9090+ 4. Redistribution. You may reproduce and distribute copies of the
9191+ Work or Derivative Works thereof in any medium, with or without
9292+ modifications, and in Source or Object form, provided that You
9393+ meet the following conditions:
9494+9595+ (a) You must give any other recipients of the Work or
9696+ Derivative Works a copy of this License; and
9797+9898+ (b) You must cause any modified files to carry prominent notices
9999+ stating that You changed the files; and
100100+101101+ (c) You must retain, in the Source form of any Derivative Works
102102+ that You distribute, all copyright, patent, trademark, and
103103+ attribution notices from the Source form of the Work,
104104+ excluding those notices that do not pertain to any part of
105105+ the Derivative Works; and
106106+107107+ (d) If the Work includes a "NOTICE" text file as part of its
108108+ distribution, then any Derivative Works that You distribute must
109109+ include a readable copy of the attribution notices contained
110110+ within such NOTICE file, excluding those notices that do not
111111+ pertain to any part of the Derivative Works, in at least one
112112+ of the following places: within a NOTICE text file distributed
113113+ as part of the Derivative Works; within the Source form or
114114+ documentation, if provided along with the Derivative Works; or,
115115+ within a display generated by the Derivative Works, if and
116116+ wherever such third-party notices normally appear. The contents
117117+ of the NOTICE file are for informational purposes only and
118118+ do not modify the License. You may add Your own attribution
119119+ notices within Derivative Works that You distribute, alongside
120120+ or as an addendum to the NOTICE text from the Work, provided
121121+ that such additional attribution notices cannot be construed
122122+ as modifying the License.
123123+124124+ You may add Your own copyright statement to Your modifications and
125125+ may provide additional or different license terms and conditions
126126+ for use, reproduction, or distribution of Your modifications, or
127127+ for any such Derivative Works as a whole, provided Your use,
128128+ reproduction, and distribution of the Work otherwise complies with
129129+ the conditions stated in this License.
130130+131131+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132132+ any Contribution intentionally submitted for inclusion in the Work
133133+ by You to the Licensor shall be under the terms and conditions of
134134+ this License, without any additional terms or conditions.
135135+ Notwithstanding the above, nothing herein shall supersede or modify
136136+ the terms of any separate license agreement you may have executed
137137+ with Licensor regarding such Contributions.
138138+139139+ 6. Trademarks. This License does not grant permission to use the trade
140140+ names, trademarks, service marks, or product names of the Licensor,
141141+ except as required for reasonable and customary use in describing the
142142+ origin of the Work and reproducing the content of the NOTICE file.
143143+144144+ 7. Disclaimer of Warranty. Unless required by applicable law or
145145+ agreed to in writing, Licensor provides the Work (and each
146146+ Contributor provides its Contributions) on an "AS IS" BASIS,
147147+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148148+ implied, including, without limitation, any warranties or conditions
149149+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150150+ PARTICULAR PURPOSE. You are solely responsible for determining the
151151+ appropriateness of using or redistributing the Work and assume any
152152+ risks associated with Your exercise of permissions under this License.
153153+154154+ 8. Limitation of Liability. In no event and under no legal theory,
155155+ whether in tort (including negligence), contract, or otherwise,
156156+ unless required by applicable law (such as deliberate and grossly
157157+ negligent acts) or agreed to in writing, shall any Contributor be
158158+ liable to You for damages, including any direct, indirect, special,
159159+ incidental, or consequential damages of any character arising as a
160160+ result of this License or out of the use or inability to use the
161161+ Work (including but not limited to damages for loss of goodwill,
162162+ work stoppage, computer failure or malfunction, or any and all
163163+ other commercial damages or losses), even if such Contributor
164164+ has been advised of the possibility of such damages.
165165+166166+ 9. Accepting Warranty or Additional Liability. While redistributing
167167+ the Work or Derivative Works thereof, You may choose to offer,
168168+ and charge a fee for, acceptance of support, warranty, indemnity,
169169+ or other liability obligations and/or rights consistent with this
170170+ License. However, in accepting such obligations, You may act only
171171+ on Your own behalf and on Your sole responsibility, not on behalf
172172+ of any other Contributor, and only if You agree to indemnify,
173173+ defend, and hold each Contributor harmless for any liability
174174+ incurred by, or claims asserted against, such Contributor by reason
175175+ of your accepting any such warranty or additional liability.
176176+177177+ END OF TERMS AND CONDITIONS
178178+179179+ APPENDIX: How to apply the Apache License to your work.
180180+181181+ To apply the Apache License to your work, attach the following
182182+ boilerplate notice, with the fields enclosed by brackets "[]"
183183+ replaced with your own identifying information. (Don't include
184184+ the brackets!) The text should be enclosed in the appropriate
185185+ comment syntax for the file format. We also recommend that a
186186+ file or class name and description of purpose be included on the
187187+ same "printed page" as the copyright notice for easier
188188+ identification within third-party archives.
189189+190190+ Copyright [yyyy] [name of copyright owner]
191191+192192+ Licensed under the Apache License, Version 2.0 (the "License");
193193+ you may not use this file except in compliance with the License.
194194+ You may obtain a copy of the License at
195195+196196+ http://www.apache.org/licenses/LICENSE-2.0
197197+198198+ Unless required by applicable law or agreed to in writing, software
199199+ distributed under the License is distributed on an "AS IS" BASIS,
200200+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201201+ See the License for the specific language governing permissions and
202202+ limitations under the License.
+356
.agents/skills/skill-creator/SKILL.md
···11+---
22+name: skill-creator
33+description: Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
44+license: Complete terms in LICENSE.txt
55+---
66+77+# Skill Creator
88+99+This skill provides guidance for creating effective skills.
1010+1111+## About Skills
1212+1313+Skills are modular, self-contained packages that extend Claude's capabilities by providing
1414+specialized knowledge, workflows, and tools. Think of them as "onboarding guides" for specific
1515+domains or tasks—they transform Claude from a general-purpose agent into a specialized agent
1616+equipped with procedural knowledge that no model can fully possess.
1717+1818+### What Skills Provide
1919+2020+1. Specialized workflows - Multi-step procedures for specific domains
2121+2. Tool integrations - Instructions for working with specific file formats or APIs
2222+3. Domain expertise - Company-specific knowledge, schemas, business logic
2323+4. Bundled resources - Scripts, references, and assets for complex and repetitive tasks
2424+2525+## Core Principles
2626+2727+### Concise is Key
2828+2929+The context window is a public good. Skills share the context window with everything else Claude needs: system prompt, conversation history, other Skills' metadata, and the actual user request.
3030+3131+**Default assumption: Claude is already very smart.** Only add context Claude doesn't already have. Challenge each piece of information: "Does Claude really need this explanation?" and "Does this paragraph justify its token cost?"
3232+3333+Prefer concise examples over verbose explanations.
3434+3535+### Set Appropriate Degrees of Freedom
3636+3737+Match the level of specificity to the task's fragility and variability:
3838+3939+**High freedom (text-based instructions)**: Use when multiple approaches are valid, decisions depend on context, or heuristics guide the approach.
4040+4141+**Medium freedom (pseudocode or scripts with parameters)**: Use when a preferred pattern exists, some variation is acceptable, or configuration affects behavior.
4242+4343+**Low freedom (specific scripts, few parameters)**: Use when operations are fragile and error-prone, consistency is critical, or a specific sequence must be followed.
4444+4545+Think of Claude as exploring a path: a narrow bridge with cliffs needs specific guardrails (low freedom), while an open field allows many routes (high freedom).
4646+4747+### Anatomy of a Skill
4848+4949+Every skill consists of a required SKILL.md file and optional bundled resources:
5050+5151+```
5252+skill-name/
5353+├── SKILL.md (required)
5454+│ ├── YAML frontmatter metadata (required)
5555+│ │ ├── name: (required)
5656+│ │ └── description: (required)
5757+│ └── Markdown instructions (required)
5858+└── Bundled Resources (optional)
5959+ ├── scripts/ - Executable code (Python/Bash/etc.)
6060+ ├── references/ - Documentation intended to be loaded into context as needed
6161+ └── assets/ - Files used in output (templates, icons, fonts, etc.)
6262+```
6363+6464+#### SKILL.md (required)
6565+6666+Every SKILL.md consists of:
6767+6868+- **Frontmatter** (YAML): Contains `name` and `description` fields. These are the only fields that Claude reads to determine when the skill gets used, thus it is very important to be clear and comprehensive in describing what the skill is, and when it should be used.
6969+- **Body** (Markdown): Instructions and guidance for using the skill. Only loaded AFTER the skill triggers (if at all).
7070+7171+#### Bundled Resources (optional)
7272+7373+##### Scripts (`scripts/`)
7474+7575+Executable code (Python/Bash/etc.) for tasks that require deterministic reliability or are repeatedly rewritten.
7676+7777+- **When to include**: When the same code is being rewritten repeatedly or deterministic reliability is needed
7878+- **Example**: `scripts/rotate_pdf.py` for PDF rotation tasks
7979+- **Benefits**: Token efficient, deterministic, may be executed without loading into context
8080+- **Note**: Scripts may still need to be read by Claude for patching or environment-specific adjustments
8181+8282+##### References (`references/`)
8383+8484+Documentation and reference material intended to be loaded as needed into context to inform Claude's process and thinking.
8585+8686+- **When to include**: For documentation that Claude should reference while working
8787+- **Examples**: `references/finance.md` for financial schemas, `references/mnda.md` for company NDA template, `references/policies.md` for company policies, `references/api_docs.md` for API specifications
8888+- **Use cases**: Database schemas, API documentation, domain knowledge, company policies, detailed workflow guides
8989+- **Benefits**: Keeps SKILL.md lean, loaded only when Claude determines it's needed
9090+- **Best practice**: If files are large (>10k words), include grep search patterns in SKILL.md
9191+- **Avoid duplication**: Information should live in either SKILL.md or references files, not both. Prefer references files for detailed information unless it's truly core to the skill—this keeps SKILL.md lean while making information discoverable without hogging the context window. Keep only essential procedural instructions and workflow guidance in SKILL.md; move detailed reference material, schemas, and examples to references files.
9292+9393+##### Assets (`assets/`)
9494+9595+Files not intended to be loaded into context, but rather used within the output Claude produces.
9696+9797+- **When to include**: When the skill needs files that will be used in the final output
9898+- **Examples**: `assets/logo.png` for brand assets, `assets/slides.pptx` for PowerPoint templates, `assets/frontend-template/` for HTML/React boilerplate, `assets/font.ttf` for typography
9999+- **Use cases**: Templates, images, icons, boilerplate code, fonts, sample documents that get copied or modified
100100+- **Benefits**: Separates output resources from documentation, enables Claude to use files without loading them into context
101101+102102+#### What to Not Include in a Skill
103103+104104+A skill should only contain essential files that directly support its functionality. Do NOT create extraneous documentation or auxiliary files, including:
105105+106106+- README.md
107107+- INSTALLATION_GUIDE.md
108108+- QUICK_REFERENCE.md
109109+- CHANGELOG.md
110110+- etc.
111111+112112+The skill should only contain the information needed for an AI agent to do the job at hand. It should not contain auxilary context about the process that went into creating it, setup and testing procedures, user-facing documentation, etc. Creating additional documentation files just adds clutter and confusion.
113113+114114+### Progressive Disclosure Design Principle
115115+116116+Skills use a three-level loading system to manage context efficiently:
117117+118118+1. **Metadata (name + description)** - Always in context (~100 words)
119119+2. **SKILL.md body** - When skill triggers (<5k words)
120120+3. **Bundled resources** - As needed by Claude (Unlimited because scripts can be executed without reading into context window)
121121+122122+#### Progressive Disclosure Patterns
123123+124124+Keep SKILL.md body to the essentials and under 500 lines to minimize context bloat. Split content into separate files when approaching this limit. When splitting out content into other files, it is very important to reference them from SKILL.md and describe clearly when to read them, to ensure the reader of the skill knows they exist and when to use them.
125125+126126+**Key principle:** When a skill supports multiple variations, frameworks, or options, keep only the core workflow and selection guidance in SKILL.md. Move variant-specific details (patterns, examples, configuration) into separate reference files.
127127+128128+**Pattern 1: High-level guide with references**
129129+130130+```markdown
131131+# PDF Processing
132132+133133+## Quick start
134134+135135+Extract text with pdfplumber:
136136+[code example]
137137+138138+## Advanced features
139139+140140+- **Form filling**: See [FORMS.md](FORMS.md) for complete guide
141141+- **API reference**: See [REFERENCE.md](REFERENCE.md) for all methods
142142+- **Examples**: See [EXAMPLES.md](EXAMPLES.md) for common patterns
143143+```
144144+145145+Claude loads FORMS.md, REFERENCE.md, or EXAMPLES.md only when needed.
146146+147147+**Pattern 2: Domain-specific organization**
148148+149149+For Skills with multiple domains, organize content by domain to avoid loading irrelevant context:
150150+151151+```
152152+bigquery-skill/
153153+├── SKILL.md (overview and navigation)
154154+└── reference/
155155+ ├── finance.md (revenue, billing metrics)
156156+ ├── sales.md (opportunities, pipeline)
157157+ ├── product.md (API usage, features)
158158+ └── marketing.md (campaigns, attribution)
159159+```
160160+161161+When a user asks about sales metrics, Claude only reads sales.md.
162162+163163+Similarly, for skills supporting multiple frameworks or variants, organize by variant:
164164+165165+```
166166+cloud-deploy/
167167+├── SKILL.md (workflow + provider selection)
168168+└── references/
169169+ ├── aws.md (AWS deployment patterns)
170170+ ├── gcp.md (GCP deployment patterns)
171171+ └── azure.md (Azure deployment patterns)
172172+```
173173+174174+When the user chooses AWS, Claude only reads aws.md.
175175+176176+**Pattern 3: Conditional details**
177177+178178+Show basic content, link to advanced content:
179179+180180+```markdown
181181+# DOCX Processing
182182+183183+## Creating documents
184184+185185+Use docx-js for new documents. See [DOCX-JS.md](DOCX-JS.md).
186186+187187+## Editing documents
188188+189189+For simple edits, modify the XML directly.
190190+191191+**For tracked changes**: See [REDLINING.md](REDLINING.md)
192192+**For OOXML details**: See [OOXML.md](OOXML.md)
193193+```
194194+195195+Claude reads REDLINING.md or OOXML.md only when the user needs those features.
196196+197197+**Important guidelines:**
198198+199199+- **Avoid deeply nested references** - Keep references one level deep from SKILL.md. All reference files should link directly from SKILL.md.
200200+- **Structure longer reference files** - For files longer than 100 lines, include a table of contents at the top so Claude can see the full scope when previewing.
201201+202202+## Skill Creation Process
203203+204204+Skill creation involves these steps:
205205+206206+1. Understand the skill with concrete examples
207207+2. Plan reusable skill contents (scripts, references, assets)
208208+3. Initialize the skill (run init_skill.py)
209209+4. Edit the skill (implement resources and write SKILL.md)
210210+5. Package the skill (run package_skill.py)
211211+6. Iterate based on real usage
212212+213213+Follow these steps in order, skipping only if there is a clear reason why they are not applicable.
214214+215215+### Step 1: Understanding the Skill with Concrete Examples
216216+217217+Skip this step only when the skill's usage patterns are already clearly understood. It remains valuable even when working with an existing skill.
218218+219219+To create an effective skill, clearly understand concrete examples of how the skill will be used. This understanding can come from either direct user examples or generated examples that are validated with user feedback.
220220+221221+For example, when building an image-editor skill, relevant questions include:
222222+223223+- "What functionality should the image-editor skill support? Editing, rotating, anything else?"
224224+- "Can you give some examples of how this skill would be used?"
225225+- "I can imagine users asking for things like 'Remove the red-eye from this image' or 'Rotate this image'. Are there other ways you imagine this skill being used?"
226226+- "What would a user say that should trigger this skill?"
227227+228228+To avoid overwhelming users, avoid asking too many questions in a single message. Start with the most important questions and follow up as needed for better effectiveness.
229229+230230+Conclude this step when there is a clear sense of the functionality the skill should support.
231231+232232+### Step 2: Planning the Reusable Skill Contents
233233+234234+To turn concrete examples into an effective skill, analyze each example by:
235235+236236+1. Considering how to execute on the example from scratch
237237+2. Identifying what scripts, references, and assets would be helpful when executing these workflows repeatedly
238238+239239+Example: When building a `pdf-editor` skill to handle queries like "Help me rotate this PDF," the analysis shows:
240240+241241+1. Rotating a PDF requires re-writing the same code each time
242242+2. A `scripts/rotate_pdf.py` script would be helpful to store in the skill
243243+244244+Example: When designing a `frontend-webapp-builder` skill for queries like "Build me a todo app" or "Build me a dashboard to track my steps," the analysis shows:
245245+246246+1. Writing a frontend webapp requires the same boilerplate HTML/React each time
247247+2. An `assets/hello-world/` template containing the boilerplate HTML/React project files would be helpful to store in the skill
248248+249249+Example: When building a `big-query` skill to handle queries like "How many users have logged in today?" the analysis shows:
250250+251251+1. Querying BigQuery requires re-discovering the table schemas and relationships each time
252252+2. A `references/schema.md` file documenting the table schemas would be helpful to store in the skill
253253+254254+To establish the skill's contents, analyze each concrete example to create a list of the reusable resources to include: scripts, references, and assets.
255255+256256+### Step 3: Initializing the Skill
257257+258258+At this point, it is time to actually create the skill.
259259+260260+Skip this step only if the skill being developed already exists, and iteration or packaging is needed. In this case, continue to the next step.
261261+262262+When creating a new skill from scratch, always run the `init_skill.py` script. The script conveniently generates a new template skill directory that automatically includes everything a skill requires, making the skill creation process much more efficient and reliable.
263263+264264+Usage:
265265+266266+```bash
267267+scripts/init_skill.py <skill-name> --path <output-directory>
268268+```
269269+270270+The script:
271271+272272+- Creates the skill directory at the specified path
273273+- Generates a SKILL.md template with proper frontmatter and TODO placeholders
274274+- Creates example resource directories: `scripts/`, `references/`, and `assets/`
275275+- Adds example files in each directory that can be customized or deleted
276276+277277+After initialization, customize or remove the generated SKILL.md and example files as needed.
278278+279279+### Step 4: Edit the Skill
280280+281281+When editing the (newly-generated or existing) skill, remember that the skill is being created for another instance of Claude to use. Include information that would be beneficial and non-obvious to Claude. Consider what procedural knowledge, domain-specific details, or reusable assets would help another Claude instance execute these tasks more effectively.
282282+283283+#### Learn Proven Design Patterns
284284+285285+Consult these helpful guides based on your skill's needs:
286286+287287+- **Multi-step processes**: See references/workflows.md for sequential workflows and conditional logic
288288+- **Specific output formats or quality standards**: See references/output-patterns.md for template and example patterns
289289+290290+These files contain established best practices for effective skill design.
291291+292292+#### Start with Reusable Skill Contents
293293+294294+To begin implementation, start with the reusable resources identified above: `scripts/`, `references/`, and `assets/` files. Note that this step may require user input. For example, when implementing a `brand-guidelines` skill, the user may need to provide brand assets or templates to store in `assets/`, or documentation to store in `references/`.
295295+296296+Added scripts must be tested by actually running them to ensure there are no bugs and that the output matches what is expected. If there are many similar scripts, only a representative sample needs to be tested to ensure confidence that they all work while balancing time to completion.
297297+298298+Any example files and directories not needed for the skill should be deleted. The initialization script creates example files in `scripts/`, `references/`, and `assets/` to demonstrate structure, but most skills won't need all of them.
299299+300300+#### Update SKILL.md
301301+302302+**Writing Guidelines:** Always use imperative/infinitive form.
303303+304304+##### Frontmatter
305305+306306+Write the YAML frontmatter with `name` and `description`:
307307+308308+- `name`: The skill name
309309+- `description`: This is the primary triggering mechanism for your skill, and helps Claude understand when to use the skill.
310310+ - Include both what the Skill does and specific triggers/contexts for when to use it.
311311+ - Include all "when to use" information here - Not in the body. The body is only loaded after triggering, so "When to Use This Skill" sections in the body are not helpful to Claude.
312312+ - Example description for a `docx` skill: "Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. Use when Claude needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks"
313313+314314+Do not include any other fields in YAML frontmatter.
315315+316316+##### Body
317317+318318+Write instructions for using the skill and its bundled resources.
319319+320320+### Step 5: Packaging a Skill
321321+322322+Once development of the skill is complete, it must be packaged into a distributable .skill file that gets shared with the user. The packaging process automatically validates the skill first to ensure it meets all requirements:
323323+324324+```bash
325325+scripts/package_skill.py <path/to/skill-folder>
326326+```
327327+328328+Optional output directory specification:
329329+330330+```bash
331331+scripts/package_skill.py <path/to/skill-folder> ./dist
332332+```
333333+334334+The packaging script will:
335335+336336+1. **Validate** the skill automatically, checking:
337337+338338+ - YAML frontmatter format and required fields
339339+ - Skill naming conventions and directory structure
340340+ - Description completeness and quality
341341+ - File organization and resource references
342342+343343+2. **Package** the skill if validation passes, creating a .skill file named after the skill (e.g., `my-skill.skill`) that includes all files and maintains the proper directory structure for distribution. The .skill file is a zip file with a .skill extension.
344344+345345+If validation fails, the script will report the errors and exit without creating a package. Fix any validation errors and run the packaging command again.
346346+347347+### Step 6: Iterate
348348+349349+After testing the skill, users may request improvements. Often this happens right after using the skill, with fresh context of how the skill performed.
350350+351351+**Iteration workflow:**
352352+353353+1. Use the skill on real tasks
354354+2. Notice struggles or inefficiencies
355355+3. Identify how SKILL.md or bundled resources should be updated
356356+4. Implement changes and test again
···11+# Output Patterns
22+33+Use these patterns when skills need to produce consistent, high-quality output.
44+55+## Template Pattern
66+77+Provide templates for output format. Match the level of strictness to your needs.
88+99+**For strict requirements (like API responses or data formats):**
1010+1111+```markdown
1212+## Report structure
1313+1414+ALWAYS use this exact template structure:
1515+1616+# [Analysis Title]
1717+1818+## Executive summary
1919+[One-paragraph overview of key findings]
2020+2121+## Key findings
2222+- Finding 1 with supporting data
2323+- Finding 2 with supporting data
2424+- Finding 3 with supporting data
2525+2626+## Recommendations
2727+1. Specific actionable recommendation
2828+2. Specific actionable recommendation
2929+```
3030+3131+**For flexible guidance (when adaptation is useful):**
3232+3333+```markdown
3434+## Report structure
3535+3636+Here is a sensible default format, but use your best judgment:
3737+3838+# [Analysis Title]
3939+4040+## Executive summary
4141+[Overview]
4242+4343+## Key findings
4444+[Adapt sections based on what you discover]
4545+4646+## Recommendations
4747+[Tailor to the specific context]
4848+4949+Adjust sections as needed for the specific analysis type.
5050+```
5151+5252+## Examples Pattern
5353+5454+For skills where output quality depends on seeing examples, provide input/output pairs:
5555+5656+```markdown
5757+## Commit message format
5858+5959+Generate commit messages following these examples:
6060+6161+**Example 1:**
6262+Input: Added user authentication with JWT tokens
6363+Output:
6464+```
6565+feat(auth): implement JWT-based authentication
6666+6767+Add login endpoint and token validation middleware
6868+```
6969+7070+**Example 2:**
7171+Input: Fixed bug where dates displayed incorrectly in reports
7272+Output:
7373+```
7474+fix(reports): correct date formatting in timezone conversion
7575+7676+Use UTC timestamps consistently across report generation
7777+```
7878+7979+Follow this style: type(scope): brief description, then detailed explanation.
8080+```
8181+8282+Examples help Claude understand the desired style and level of detail more clearly than descriptions alone.
···11+# Workflow Patterns
22+33+## Sequential Workflows
44+55+For complex tasks, break operations into clear, sequential steps. It is often helpful to give Claude an overview of the process towards the beginning of SKILL.md:
66+77+```markdown
88+Filling a PDF form involves these steps:
99+1010+1. Analyze the form (run analyze_form.py)
1111+2. Create field mapping (edit fields.json)
1212+3. Validate mapping (run validate_fields.py)
1313+4. Fill the form (run fill_form.py)
1414+5. Verify output (run verify_output.py)
1515+```
1616+1717+## Conditional Workflows
1818+1919+For tasks with branching logic, guide Claude through decision points:
2020+2121+```markdown
2222+1. Determine the modification type:
2323+ **Creating new content?** → Follow "Creation workflow" below
2424+ **Editing existing content?** → Follow "Editing workflow" below
2525+2626+2. Creation workflow: [steps]
2727+3. Editing workflow: [steps]
2828+```
···11+#!/usr/bin/env python3
22+"""
33+Skill Initializer - Creates a new skill from template
44+55+Usage:
66+ init_skill.py <skill-name> --path <path>
77+88+Examples:
99+ init_skill.py my-new-skill --path skills/public
1010+ init_skill.py my-api-helper --path skills/private
1111+ init_skill.py custom-skill --path /custom/location
1212+"""
1313+1414+import sys
1515+from pathlib import Path
1616+1717+1818+SKILL_TEMPLATE = """---
1919+name: {skill_name}
2020+description: [TODO: Complete and informative explanation of what the skill does and when to use it. Include WHEN to use this skill - specific scenarios, file types, or tasks that trigger it.]
2121+---
2222+2323+# {skill_title}
2424+2525+## Overview
2626+2727+[TODO: 1-2 sentences explaining what this skill enables]
2828+2929+## Structuring This Skill
3030+3131+[TODO: Choose the structure that best fits this skill's purpose. Common patterns:
3232+3333+**1. Workflow-Based** (best for sequential processes)
3434+- Works well when there are clear step-by-step procedures
3535+- Example: DOCX skill with "Workflow Decision Tree" → "Reading" → "Creating" → "Editing"
3636+- Structure: ## Overview → ## Workflow Decision Tree → ## Step 1 → ## Step 2...
3737+3838+**2. Task-Based** (best for tool collections)
3939+- Works well when the skill offers different operations/capabilities
4040+- Example: PDF skill with "Quick Start" → "Merge PDFs" → "Split PDFs" → "Extract Text"
4141+- Structure: ## Overview → ## Quick Start → ## Task Category 1 → ## Task Category 2...
4242+4343+**3. Reference/Guidelines** (best for standards or specifications)
4444+- Works well for brand guidelines, coding standards, or requirements
4545+- Example: Brand styling with "Brand Guidelines" → "Colors" → "Typography" → "Features"
4646+- Structure: ## Overview → ## Guidelines → ## Specifications → ## Usage...
4747+4848+**4. Capabilities-Based** (best for integrated systems)
4949+- Works well when the skill provides multiple interrelated features
5050+- Example: Product Management with "Core Capabilities" → numbered capability list
5151+- Structure: ## Overview → ## Core Capabilities → ### 1. Feature → ### 2. Feature...
5252+5353+Patterns can be mixed and matched as needed. Most skills combine patterns (e.g., start with task-based, add workflow for complex operations).
5454+5555+Delete this entire "Structuring This Skill" section when done - it's just guidance.]
5656+5757+## [TODO: Replace with the first main section based on chosen structure]
5858+5959+[TODO: Add content here. See examples in existing skills:
6060+- Code samples for technical skills
6161+- Decision trees for complex workflows
6262+- Concrete examples with realistic user requests
6363+- References to scripts/templates/references as needed]
6464+6565+## Resources
6666+6767+This skill includes example resource directories that demonstrate how to organize different types of bundled resources:
6868+6969+### scripts/
7070+Executable code (Python/Bash/etc.) that can be run directly to perform specific operations.
7171+7272+**Examples from other skills:**
7373+- PDF skill: `fill_fillable_fields.py`, `extract_form_field_info.py` - utilities for PDF manipulation
7474+- DOCX skill: `document.py`, `utilities.py` - Python modules for document processing
7575+7676+**Appropriate for:** Python scripts, shell scripts, or any executable code that performs automation, data processing, or specific operations.
7777+7878+**Note:** Scripts may be executed without loading into context, but can still be read by Claude for patching or environment adjustments.
7979+8080+### references/
8181+Documentation and reference material intended to be loaded into context to inform Claude's process and thinking.
8282+8383+**Examples from other skills:**
8484+- Product management: `communication.md`, `context_building.md` - detailed workflow guides
8585+- BigQuery: API reference documentation and query examples
8686+- Finance: Schema documentation, company policies
8787+8888+**Appropriate for:** In-depth documentation, API references, database schemas, comprehensive guides, or any detailed information that Claude should reference while working.
8989+9090+### assets/
9191+Files not intended to be loaded into context, but rather used within the output Claude produces.
9292+9393+**Examples from other skills:**
9494+- Brand styling: PowerPoint template files (.pptx), logo files
9595+- Frontend builder: HTML/React boilerplate project directories
9696+- Typography: Font files (.ttf, .woff2)
9797+9898+**Appropriate for:** Templates, boilerplate code, document templates, images, icons, fonts, or any files meant to be copied or used in the final output.
9999+100100+---
101101+102102+**Any unneeded directories can be deleted.** Not every skill requires all three types of resources.
103103+"""
104104+105105+EXAMPLE_SCRIPT = '''#!/usr/bin/env python3
106106+"""
107107+Example helper script for {skill_name}
108108+109109+This is a placeholder script that can be executed directly.
110110+Replace with actual implementation or delete if not needed.
111111+112112+Example real scripts from other skills:
113113+- pdf/scripts/fill_fillable_fields.py - Fills PDF form fields
114114+- pdf/scripts/convert_pdf_to_images.py - Converts PDF pages to images
115115+"""
116116+117117+def main():
118118+ print("This is an example script for {skill_name}")
119119+ # TODO: Add actual script logic here
120120+ # This could be data processing, file conversion, API calls, etc.
121121+122122+if __name__ == "__main__":
123123+ main()
124124+'''
125125+126126+EXAMPLE_REFERENCE = """# Reference Documentation for {skill_title}
127127+128128+This is a placeholder for detailed reference documentation.
129129+Replace with actual reference content or delete if not needed.
130130+131131+Example real reference docs from other skills:
132132+- product-management/references/communication.md - Comprehensive guide for status updates
133133+- product-management/references/context_building.md - Deep-dive on gathering context
134134+- bigquery/references/ - API references and query examples
135135+136136+## When Reference Docs Are Useful
137137+138138+Reference docs are ideal for:
139139+- Comprehensive API documentation
140140+- Detailed workflow guides
141141+- Complex multi-step processes
142142+- Information too lengthy for main SKILL.md
143143+- Content that's only needed for specific use cases
144144+145145+## Structure Suggestions
146146+147147+### API Reference Example
148148+- Overview
149149+- Authentication
150150+- Endpoints with examples
151151+- Error codes
152152+- Rate limits
153153+154154+### Workflow Guide Example
155155+- Prerequisites
156156+- Step-by-step instructions
157157+- Common patterns
158158+- Troubleshooting
159159+- Best practices
160160+"""
161161+162162+EXAMPLE_ASSET = """# Example Asset File
163163+164164+This placeholder represents where asset files would be stored.
165165+Replace with actual asset files (templates, images, fonts, etc.) or delete if not needed.
166166+167167+Asset files are NOT intended to be loaded into context, but rather used within
168168+the output Claude produces.
169169+170170+Example asset files from other skills:
171171+- Brand guidelines: logo.png, slides_template.pptx
172172+- Frontend builder: hello-world/ directory with HTML/React boilerplate
173173+- Typography: custom-font.ttf, font-family.woff2
174174+- Data: sample_data.csv, test_dataset.json
175175+176176+## Common Asset Types
177177+178178+- Templates: .pptx, .docx, boilerplate directories
179179+- Images: .png, .jpg, .svg, .gif
180180+- Fonts: .ttf, .otf, .woff, .woff2
181181+- Boilerplate code: Project directories, starter files
182182+- Icons: .ico, .svg
183183+- Data files: .csv, .json, .xml, .yaml
184184+185185+Note: This is a text placeholder. Actual assets can be any file type.
186186+"""
187187+188188+189189+def title_case_skill_name(skill_name):
190190+ """Convert hyphenated skill name to Title Case for display."""
191191+ return ' '.join(word.capitalize() for word in skill_name.split('-'))
192192+193193+194194+def init_skill(skill_name, path):
195195+ """
196196+ Initialize a new skill directory with template SKILL.md.
197197+198198+ Args:
199199+ skill_name: Name of the skill
200200+ path: Path where the skill directory should be created
201201+202202+ Returns:
203203+ Path to created skill directory, or None if error
204204+ """
205205+ # Determine skill directory path
206206+ skill_dir = Path(path).resolve() / skill_name
207207+208208+ # Check if directory already exists
209209+ if skill_dir.exists():
210210+ print(f"❌ Error: Skill directory already exists: {skill_dir}")
211211+ return None
212212+213213+ # Create skill directory
214214+ try:
215215+ skill_dir.mkdir(parents=True, exist_ok=False)
216216+ print(f"✅ Created skill directory: {skill_dir}")
217217+ except Exception as e:
218218+ print(f"❌ Error creating directory: {e}")
219219+ return None
220220+221221+ # Create SKILL.md from template
222222+ skill_title = title_case_skill_name(skill_name)
223223+ skill_content = SKILL_TEMPLATE.format(
224224+ skill_name=skill_name,
225225+ skill_title=skill_title
226226+ )
227227+228228+ skill_md_path = skill_dir / 'SKILL.md'
229229+ try:
230230+ skill_md_path.write_text(skill_content)
231231+ print("✅ Created SKILL.md")
232232+ except Exception as e:
233233+ print(f"❌ Error creating SKILL.md: {e}")
234234+ return None
235235+236236+ # Create resource directories with example files
237237+ try:
238238+ # Create scripts/ directory with example script
239239+ scripts_dir = skill_dir / 'scripts'
240240+ scripts_dir.mkdir(exist_ok=True)
241241+ example_script = scripts_dir / 'example.py'
242242+ example_script.write_text(EXAMPLE_SCRIPT.format(skill_name=skill_name))
243243+ example_script.chmod(0o755)
244244+ print("✅ Created scripts/example.py")
245245+246246+ # Create references/ directory with example reference doc
247247+ references_dir = skill_dir / 'references'
248248+ references_dir.mkdir(exist_ok=True)
249249+ example_reference = references_dir / 'api_reference.md'
250250+ example_reference.write_text(EXAMPLE_REFERENCE.format(skill_title=skill_title))
251251+ print("✅ Created references/api_reference.md")
252252+253253+ # Create assets/ directory with example asset placeholder
254254+ assets_dir = skill_dir / 'assets'
255255+ assets_dir.mkdir(exist_ok=True)
256256+ example_asset = assets_dir / 'example_asset.txt'
257257+ example_asset.write_text(EXAMPLE_ASSET)
258258+ print("✅ Created assets/example_asset.txt")
259259+ except Exception as e:
260260+ print(f"❌ Error creating resource directories: {e}")
261261+ return None
262262+263263+ # Print next steps
264264+ print(f"\n✅ Skill '{skill_name}' initialized successfully at {skill_dir}")
265265+ print("\nNext steps:")
266266+ print("1. Edit SKILL.md to complete the TODO items and update the description")
267267+ print("2. Customize or delete the example files in scripts/, references/, and assets/")
268268+ print("3. Run the validator when ready to check the skill structure")
269269+270270+ return skill_dir
271271+272272+273273+def main():
274274+ if len(sys.argv) < 4 or sys.argv[2] != '--path':
275275+ print("Usage: init_skill.py <skill-name> --path <path>")
276276+ print("\nSkill name requirements:")
277277+ print(" - Hyphen-case identifier (e.g., 'data-analyzer')")
278278+ print(" - Lowercase letters, digits, and hyphens only")
279279+ print(" - Max 40 characters")
280280+ print(" - Must match directory name exactly")
281281+ print("\nExamples:")
282282+ print(" init_skill.py my-new-skill --path skills/public")
283283+ print(" init_skill.py my-api-helper --path skills/private")
284284+ print(" init_skill.py custom-skill --path /custom/location")
285285+ sys.exit(1)
286286+287287+ skill_name = sys.argv[1]
288288+ path = sys.argv[3]
289289+290290+ print(f"🚀 Initializing skill: {skill_name}")
291291+ print(f" Location: {path}")
292292+ print()
293293+294294+ result = init_skill(skill_name, path)
295295+296296+ if result:
297297+ sys.exit(0)
298298+ else:
299299+ sys.exit(1)
300300+301301+302302+if __name__ == "__main__":
303303+ main()
···11+---
22+name: vercel-composition-patterns
33+description:
44+ React composition patterns that scale. Use when refactoring components with
55+ boolean prop proliferation, building flexible component libraries, or
66+ designing reusable APIs. Triggers on tasks involving compound components,
77+ render props, context providers, or component architecture. Includes React 19
88+ API changes.
99+license: MIT
1010+metadata:
1111+ author: vercel
1212+ version: '1.0.0'
1313+---
1414+1515+# React Composition Patterns
1616+1717+Composition patterns for building flexible, maintainable React components. Avoid
1818+boolean prop proliferation by using compound components, lifting state, and
1919+composing internals. These patterns make codebases easier for both humans and AI
2020+agents to work with as they scale.
2121+2222+## When to Apply
2323+2424+Reference these guidelines when:
2525+2626+- Refactoring components with many boolean props
2727+- Building reusable component libraries
2828+- Designing flexible component APIs
2929+- Reviewing component architecture
3030+- Working with compound components or context providers
3131+3232+## Rule Categories by Priority
3333+3434+| Priority | Category | Impact | Prefix |
3535+| -------- | ----------------------- | ------ | --------------- |
3636+| 1 | Component Architecture | HIGH | `architecture-` |
3737+| 2 | State Management | MEDIUM | `state-` |
3838+| 3 | Implementation Patterns | MEDIUM | `patterns-` |
3939+| 4 | React 19 APIs | MEDIUM | `react19-` |
4040+4141+## Quick Reference
4242+4343+### 1. Component Architecture (HIGH)
4444+4545+- `architecture-avoid-boolean-props` - Don't add boolean props to customize
4646+ behavior; use composition
4747+- `architecture-compound-components` - Structure complex components with shared
4848+ context
4949+5050+### 2. State Management (MEDIUM)
5151+5252+- `state-decouple-implementation` - Provider is the only place that knows how
5353+ state is managed
5454+- `state-context-interface` - Define generic interface with state, actions, meta
5555+ for dependency injection
5656+- `state-lift-state` - Move state into provider components for sibling access
5757+5858+### 3. Implementation Patterns (MEDIUM)
5959+6060+- `patterns-explicit-variants` - Create explicit variant components instead of
6161+ boolean modes
6262+- `patterns-children-over-render-props` - Use children for composition instead
6363+ of renderX props
6464+6565+### 4. React 19 APIs (MEDIUM)
6666+6767+> **⚠️ React 19+ only.** Skip this section if using React 18 or earlier.
6868+6969+- `react19-no-forwardref` - Don't use `forwardRef`; use `use()` instead of `useContext()`
7070+7171+## How to Use
7272+7373+Read individual rule files for detailed explanations and code examples:
7474+7575+```
7676+rules/architecture-avoid-boolean-props.md
7777+rules/state-context-interface.md
7878+```
7979+8080+Each rule file contains:
8181+8282+- Brief explanation of why it matters
8383+- Incorrect code example with explanation
8484+- Correct code example with explanation
8585+- Additional context and references
8686+8787+## Full Compiled Document
8888+8989+For the complete guide with all rules expanded: `AGENTS.md`
···11+---
22+title: Initialize App Once, Not Per Mount
33+impact: LOW-MEDIUM
44+impactDescription: avoids duplicate init in development
55+tags: initialization, useEffect, app-startup, side-effects
66+---
77+88+## Initialize App Once, Not Per Mount
99+1010+Do not put app-wide initialization that must run once per app load inside `useEffect([])` of a component. Components can remount and effects will re-run. Use a module-level guard or top-level init in the entry module instead.
1111+1212+**Incorrect (runs twice in dev, re-runs on remount):**
1313+1414+```tsx
1515+function Comp() {
1616+ useEffect(() => {
1717+ loadFromStorage()
1818+ checkAuthToken()
1919+ }, [])
2020+2121+ // ...
2222+}
2323+```
2424+2525+**Correct (once per app load):**
2626+2727+```tsx
2828+let didInit = false
2929+3030+function Comp() {
3131+ useEffect(() => {
3232+ if (didInit) return
3333+ didInit = true
3434+ loadFromStorage()
3535+ checkAuthToken()
3636+ }, [])
3737+3838+ // ...
3939+}
4040+```
4141+4242+Reference: [Initializing the application](https://react.dev/learn/you-might-not-need-an-effect#initializing-the-application)
···11+---
22+title: Avoid Barrel File Imports
33+impact: CRITICAL
44+impactDescription: 200-800ms import cost, slow builds
55+tags: bundle, imports, tree-shaking, barrel-files, performance
66+---
77+88+## Avoid Barrel File Imports
99+1010+Import directly from source files instead of barrel files to avoid loading thousands of unused modules. **Barrel files** are entry points that re-export multiple modules (e.g., `index.js` that does `export * from './module'`).
1111+1212+Popular icon and component libraries can have **up to 10,000 re-exports** in their entry file. For many React packages, **it takes 200-800ms just to import them**, affecting both development speed and production cold starts.
1313+1414+**Why tree-shaking doesn't help:** When a library is marked as external (not bundled), the bundler can't optimize it. If you bundle it to enable tree-shaking, builds become substantially slower analyzing the entire module graph.
1515+1616+**Incorrect (imports entire library):**
1717+1818+```tsx
1919+import { Check, X, Menu } from 'lucide-react'
2020+// Loads 1,583 modules, takes ~2.8s extra in dev
2121+// Runtime cost: 200-800ms on every cold start
2222+2323+import { Button, TextField } from '@mui/material'
2424+// Loads 2,225 modules, takes ~4.2s extra in dev
2525+```
2626+2727+**Correct (imports only what you need):**
2828+2929+```tsx
3030+import Check from 'lucide-react/dist/esm/icons/check'
3131+import X from 'lucide-react/dist/esm/icons/x'
3232+import Menu from 'lucide-react/dist/esm/icons/menu'
3333+// Loads only 3 modules (~2KB vs ~1MB)
3434+3535+import Button from '@mui/material/Button'
3636+import TextField from '@mui/material/TextField'
3737+// Loads only what you use
3838+```
3939+4040+**Alternative (Next.js 13.5+):**
4141+4242+```js
4343+// next.config.js - use optimizePackageImports
4444+module.exports = {
4545+ experimental: {
4646+ optimizePackageImports: ['lucide-react', '@mui/material']
4747+ }
4848+}
4949+5050+// Then you can keep the ergonomic barrel imports:
5151+import { Check, X, Menu } from 'lucide-react'
5252+// Automatically transformed to direct imports at build time
5353+```
5454+5555+Direct imports provide 15-70% faster dev boot, 28% faster builds, 40% faster cold starts, and significantly faster HMR.
5656+5757+Libraries commonly affected: `lucide-react`, `@mui/material`, `@mui/icons-material`, `@tabler/icons-react`, `react-icons`, `@headlessui/react`, `@radix-ui/react-*`, `lodash`, `ramda`, `date-fns`, `rxjs`, `react-use`.
5858+5959+Reference: [How we optimized package imports in Next.js](https://vercel.com/blog/how-we-optimized-package-imports-in-next-js)
···11+---
22+title: Early Length Check for Array Comparisons
33+impact: MEDIUM-HIGH
44+impactDescription: avoids expensive operations when lengths differ
55+tags: javascript, arrays, performance, optimization, comparison
66+---
77+88+## Early Length Check for Array Comparisons
99+1010+When comparing arrays with expensive operations (sorting, deep equality, serialization), check lengths first. If lengths differ, the arrays cannot be equal.
1111+1212+In real-world applications, this optimization is especially valuable when the comparison runs in hot paths (event handlers, render loops).
1313+1414+**Incorrect (always runs expensive comparison):**
1515+1616+```typescript
1717+function hasChanges(current: string[], original: string[]) {
1818+ // Always sorts and joins, even when lengths differ
1919+ return current.sort().join() !== original.sort().join()
2020+}
2121+```
2222+2323+Two O(n log n) sorts run even when `current.length` is 5 and `original.length` is 100. There is also overhead of joining the arrays and comparing the strings.
2424+2525+**Correct (O(1) length check first):**
2626+2727+```typescript
2828+function hasChanges(current: string[], original: string[]) {
2929+ // Early return if lengths differ
3030+ if (current.length !== original.length) {
3131+ return true
3232+ }
3333+ // Only sort when lengths match
3434+ const currentSorted = current.toSorted()
3535+ const originalSorted = original.toSorted()
3636+ for (let i = 0; i < currentSorted.length; i++) {
3737+ if (currentSorted[i] !== originalSorted[i]) {
3838+ return true
3939+ }
4040+ }
4141+ return false
4242+}
4343+```
4444+4545+This new approach is more efficient because:
4646+- It avoids the overhead of sorting and joining the arrays when lengths differ
4747+- It avoids consuming memory for the joined strings (especially important for large arrays)
4848+- It avoids mutating the original arrays
4949+- It returns early when a difference is found
···11+---
22+title: Use Loop for Min/Max Instead of Sort
33+impact: LOW
44+impactDescription: O(n) instead of O(n log n)
55+tags: javascript, arrays, performance, sorting, algorithms
66+---
77+88+## Use Loop for Min/Max Instead of Sort
99+1010+Finding the smallest or largest element only requires a single pass through the array. Sorting is wasteful and slower.
1111+1212+**Incorrect (O(n log n) - sort to find latest):**
1313+1414+```typescript
1515+interface Project {
1616+ id: string
1717+ name: string
1818+ updatedAt: number
1919+}
2020+2121+function getLatestProject(projects: Project[]) {
2222+ const sorted = [...projects].sort((a, b) => b.updatedAt - a.updatedAt)
2323+ return sorted[0]
2424+}
2525+```
2626+2727+Sorts the entire array just to find the maximum value.
2828+2929+**Incorrect (O(n log n) - sort for oldest and newest):**
3030+3131+```typescript
3232+function getOldestAndNewest(projects: Project[]) {
3333+ const sorted = [...projects].sort((a, b) => a.updatedAt - b.updatedAt)
3434+ return { oldest: sorted[0], newest: sorted[sorted.length - 1] }
3535+}
3636+```
3737+3838+Still sorts unnecessarily when only min/max are needed.
3939+4040+**Correct (O(n) - single loop):**
4141+4242+```typescript
4343+function getLatestProject(projects: Project[]) {
4444+ if (projects.length === 0) return null
4545+4646+ let latest = projects[0]
4747+4848+ for (let i = 1; i < projects.length; i++) {
4949+ if (projects[i].updatedAt > latest.updatedAt) {
5050+ latest = projects[i]
5151+ }
5252+ }
5353+5454+ return latest
5555+}
5656+5757+function getOldestAndNewest(projects: Project[]) {
5858+ if (projects.length === 0) return { oldest: null, newest: null }
5959+6060+ let oldest = projects[0]
6161+ let newest = projects[0]
6262+6363+ for (let i = 1; i < projects.length; i++) {
6464+ if (projects[i].updatedAt < oldest.updatedAt) oldest = projects[i]
6565+ if (projects[i].updatedAt > newest.updatedAt) newest = projects[i]
6666+ }
6767+6868+ return { oldest, newest }
6969+}
7070+```
7171+7272+Single pass through the array, no copying, no sorting.
7373+7474+**Alternative (Math.min/Math.max for small arrays):**
7575+7676+```typescript
7777+const numbers = [5, 2, 8, 1, 9]
7878+const min = Math.min(...numbers)
7979+const max = Math.max(...numbers)
8080+```
8181+8282+This works for small arrays, but can be slower or just throw an error for very large arrays due to spread operator limitations. Maximal array length is approximately 124000 in Chrome 143 and 638000 in Safari 18; exact numbers may vary - see [the fiddle](https://jsfiddle.net/qw1jabsx/4/). Use the loop approach for reliability.
···11+---
22+title: Use toSorted() Instead of sort() for Immutability
33+impact: MEDIUM-HIGH
44+impactDescription: prevents mutation bugs in React state
55+tags: javascript, arrays, immutability, react, state, mutation
66+---
77+88+## Use toSorted() Instead of sort() for Immutability
99+1010+`.sort()` mutates the array in place, which can cause bugs with React state and props. Use `.toSorted()` to create a new sorted array without mutation.
1111+1212+**Incorrect (mutates original array):**
1313+1414+```typescript
1515+function UserList({ users }: { users: User[] }) {
1616+ // Mutates the users prop array!
1717+ const sorted = useMemo(
1818+ () => users.sort((a, b) => a.name.localeCompare(b.name)),
1919+ [users]
2020+ )
2121+ return <div>{sorted.map(renderUser)}</div>
2222+}
2323+```
2424+2525+**Correct (creates new array):**
2626+2727+```typescript
2828+function UserList({ users }: { users: User[] }) {
2929+ // Creates new sorted array, original unchanged
3030+ const sorted = useMemo(
3131+ () => users.toSorted((a, b) => a.name.localeCompare(b.name)),
3232+ [users]
3333+ )
3434+ return <div>{sorted.map(renderUser)}</div>
3535+}
3636+```
3737+3838+**Why this matters in React:**
3939+4040+1. Props/state mutations break React's immutability model - React expects props and state to be treated as read-only
4141+2. Causes stale closure bugs - Mutating arrays inside closures (callbacks, effects) can lead to unexpected behavior
4242+4343+**Browser support (fallback for older browsers):**
4444+4545+`.toSorted()` is available in all modern browsers (Chrome 110+, Safari 16+, Firefox 115+, Node.js 20+). For older environments, use spread operator:
4646+4747+```typescript
4848+// Fallback for older browsers
4949+const sorted = [...items].sort((a, b) => a.value - b.value)
5050+```
5151+5252+**Other immutable array methods:**
5353+5454+- `.toSorted()` - immutable sort
5555+- `.toReversed()` - immutable reverse
5656+- `.toSpliced()` - immutable splice
5757+- `.with()` - immutable element replacement
···11+---
22+title: Suppress Expected Hydration Mismatches
33+impact: LOW-MEDIUM
44+impactDescription: avoids noisy hydration warnings for known differences
55+tags: rendering, hydration, ssr, nextjs
66+---
77+88+## Suppress Expected Hydration Mismatches
99+1010+In SSR frameworks (e.g., Next.js), some values are intentionally different on server vs client (random IDs, dates, locale/timezone formatting). For these *expected* mismatches, wrap the dynamic text in an element with `suppressHydrationWarning` to prevent noisy warnings. Do not use this to hide real bugs. Don’t overuse it.
1111+1212+**Incorrect (known mismatch warnings):**
1313+1414+```tsx
1515+function Timestamp() {
1616+ return <span>{new Date().toLocaleString()}</span>
1717+}
1818+```
1919+2020+**Correct (suppress expected mismatch only):**
2121+2222+```tsx
2323+function Timestamp() {
2424+ return (
2525+ <span suppressHydrationWarning>
2626+ {new Date().toLocaleString()}
2727+ </span>
2828+ )
2929+}
3030+```
···11+---
22+title: Calculate Derived State During Rendering
33+impact: MEDIUM
44+impactDescription: avoids redundant renders and state drift
55+tags: rerender, derived-state, useEffect, state
66+---
77+88+## Calculate Derived State During Rendering
99+1010+If a value can be computed from current props/state, do not store it in state or update it in an effect. Derive it during render to avoid extra renders and state drift. Do not set state in effects solely in response to prop changes; prefer derived values or keyed resets instead.
1111+1212+**Incorrect (redundant state and effect):**
1313+1414+```tsx
1515+function Form() {
1616+ const [firstName, setFirstName] = useState('First')
1717+ const [lastName, setLastName] = useState('Last')
1818+ const [fullName, setFullName] = useState('')
1919+2020+ useEffect(() => {
2121+ setFullName(firstName + ' ' + lastName)
2222+ }, [firstName, lastName])
2323+2424+ return <p>{fullName}</p>
2525+}
2626+```
2727+2828+**Correct (derive during render):**
2929+3030+```tsx
3131+function Form() {
3232+ const [firstName, setFirstName] = useState('First')
3333+ const [lastName, setLastName] = useState('Last')
3434+ const fullName = firstName + ' ' + lastName
3535+3636+ return <p>{fullName}</p>
3737+}
3838+```
3939+4040+References: [You Might Not Need an Effect](https://react.dev/learn/you-might-not-need-an-effect)
···11+---
22+title: Use Functional setState Updates
33+impact: MEDIUM
44+impactDescription: prevents stale closures and unnecessary callback recreations
55+tags: react, hooks, useState, useCallback, callbacks, closures
66+---
77+88+## Use Functional setState Updates
99+1010+When updating state based on the current state value, use the functional update form of setState instead of directly referencing the state variable. This prevents stale closures, eliminates unnecessary dependencies, and creates stable callback references.
1111+1212+**Incorrect (requires state as dependency):**
1313+1414+```tsx
1515+function TodoList() {
1616+ const [items, setItems] = useState(initialItems)
1717+1818+ // Callback must depend on items, recreated on every items change
1919+ const addItems = useCallback((newItems: Item[]) => {
2020+ setItems([...items, ...newItems])
2121+ }, [items]) // ❌ items dependency causes recreations
2222+2323+ // Risk of stale closure if dependency is forgotten
2424+ const removeItem = useCallback((id: string) => {
2525+ setItems(items.filter(item => item.id !== id))
2626+ }, []) // ❌ Missing items dependency - will use stale items!
2727+2828+ return <ItemsEditor items={items} onAdd={addItems} onRemove={removeItem} />
2929+}
3030+```
3131+3232+The first callback is recreated every time `items` changes, which can cause child components to re-render unnecessarily. The second callback has a stale closure bug—it will always reference the initial `items` value.
3333+3434+**Correct (stable callbacks, no stale closures):**
3535+3636+```tsx
3737+function TodoList() {
3838+ const [items, setItems] = useState(initialItems)
3939+4040+ // Stable callback, never recreated
4141+ const addItems = useCallback((newItems: Item[]) => {
4242+ setItems(curr => [...curr, ...newItems])
4343+ }, []) // ✅ No dependencies needed
4444+4545+ // Always uses latest state, no stale closure risk
4646+ const removeItem = useCallback((id: string) => {
4747+ setItems(curr => curr.filter(item => item.id !== id))
4848+ }, []) // ✅ Safe and stable
4949+5050+ return <ItemsEditor items={items} onAdd={addItems} onRemove={removeItem} />
5151+}
5252+```
5353+5454+**Benefits:**
5555+5656+1. **Stable callback references** - Callbacks don't need to be recreated when state changes
5757+2. **No stale closures** - Always operates on the latest state value
5858+3. **Fewer dependencies** - Simplifies dependency arrays and reduces memory leaks
5959+4. **Prevents bugs** - Eliminates the most common source of React closure bugs
6060+6161+**When to use functional updates:**
6262+6363+- Any setState that depends on the current state value
6464+- Inside useCallback/useMemo when state is needed
6565+- Event handlers that reference state
6666+- Async operations that update state
6767+6868+**When direct updates are fine:**
6969+7070+- Setting state to a static value: `setCount(0)`
7171+- Setting state from props/arguments only: `setName(newName)`
7272+- State doesn't depend on previous value
7373+7474+**Note:** If your project has [React Compiler](https://react.dev/learn/react-compiler) enabled, the compiler can automatically optimize some cases, but functional updates are still recommended for correctness and to prevent stale closure bugs.
···11+---
22+title: Use Lazy State Initialization
33+impact: MEDIUM
44+impactDescription: wasted computation on every render
55+tags: react, hooks, useState, performance, initialization
66+---
77+88+## Use Lazy State Initialization
99+1010+Pass a function to `useState` for expensive initial values. Without the function form, the initializer runs on every render even though the value is only used once.
1111+1212+**Incorrect (runs on every render):**
1313+1414+```tsx
1515+function FilteredList({ items }: { items: Item[] }) {
1616+ // buildSearchIndex() runs on EVERY render, even after initialization
1717+ const [searchIndex, setSearchIndex] = useState(buildSearchIndex(items))
1818+ const [query, setQuery] = useState('')
1919+2020+ // When query changes, buildSearchIndex runs again unnecessarily
2121+ return <SearchResults index={searchIndex} query={query} />
2222+}
2323+2424+function UserProfile() {
2525+ // JSON.parse runs on every render
2626+ const [settings, setSettings] = useState(
2727+ JSON.parse(localStorage.getItem('settings') || '{}')
2828+ )
2929+3030+ return <SettingsForm settings={settings} onChange={setSettings} />
3131+}
3232+```
3333+3434+**Correct (runs only once):**
3535+3636+```tsx
3737+function FilteredList({ items }: { items: Item[] }) {
3838+ // buildSearchIndex() runs ONLY on initial render
3939+ const [searchIndex, setSearchIndex] = useState(() => buildSearchIndex(items))
4040+ const [query, setQuery] = useState('')
4141+4242+ return <SearchResults index={searchIndex} query={query} />
4343+}
4444+4545+function UserProfile() {
4646+ // JSON.parse runs only on initial render
4747+ const [settings, setSettings] = useState(() => {
4848+ const stored = localStorage.getItem('settings')
4949+ return stored ? JSON.parse(stored) : {}
5050+ })
5151+5252+ return <SettingsForm settings={settings} onChange={setSettings} />
5353+}
5454+```
5555+5656+Use lazy initialization when computing initial values from localStorage/sessionStorage, building data structures (indexes, maps), reading from the DOM, or performing heavy transformations.
5757+5858+For simple primitives (`useState(0)`), direct references (`useState(props.value)`), or cheap literals (`useState({})`), the function form is unnecessary.
···11+---
22+33+title: Extract Default Non-primitive Parameter Value from Memoized Component to Constant
44+impact: MEDIUM
55+impactDescription: restores memoization by using a constant for default value
66+tags: rerender, memo, optimization
77+88+---
99+1010+## Extract Default Non-primitive Parameter Value from Memoized Component to Constant
1111+1212+When memoized component has a default value for some non-primitive optional parameter, such as an array, function, or object, calling the component without that parameter results in broken memoization. This is because new value instances are created on every rerender, and they do not pass strict equality comparison in `memo()`.
1313+1414+To address this issue, extract the default value into a constant.
1515+1616+**Incorrect (`onClick` has different values on every rerender):**
1717+1818+```tsx
1919+const UserAvatar = memo(function UserAvatar({ onClick = () => {} }: { onClick?: () => void }) {
2020+ // ...
2121+})
2222+2323+// Used without optional onClick
2424+<UserAvatar />
2525+```
2626+2727+**Correct (stable default value):**
2828+2929+```tsx
3030+const NOOP = () => {};
3131+3232+const UserAvatar = memo(function UserAvatar({ onClick = NOOP }: { onClick?: () => void }) {
3333+ // ...
3434+})
3535+3636+// Used without optional onClick
3737+<UserAvatar />
3838+```
···11+---
22+title: Put Interaction Logic in Event Handlers
33+impact: MEDIUM
44+impactDescription: avoids effect re-runs and duplicate side effects
55+tags: rerender, useEffect, events, side-effects, dependencies
66+---
77+88+## Put Interaction Logic in Event Handlers
99+1010+If a side effect is triggered by a specific user action (submit, click, drag), run it in that event handler. Do not model the action as state + effect; it makes effects re-run on unrelated changes and can duplicate the action.
1111+1212+**Incorrect (event modeled as state + effect):**
1313+1414+```tsx
1515+function Form() {
1616+ const [submitted, setSubmitted] = useState(false)
1717+ const theme = useContext(ThemeContext)
1818+1919+ useEffect(() => {
2020+ if (submitted) {
2121+ post('/api/register')
2222+ showToast('Registered', theme)
2323+ }
2424+ }, [submitted, theme])
2525+2626+ return <button onClick={() => setSubmitted(true)}>Submit</button>
2727+}
2828+```
2929+3030+**Correct (do it in the handler):**
3131+3232+```tsx
3333+function Form() {
3434+ const theme = useContext(ThemeContext)
3535+3636+ function handleSubmit() {
3737+ post('/api/register')
3838+ showToast('Registered', theme)
3939+ }
4040+4141+ return <button onClick={handleSubmit}>Submit</button>
4242+}
4343+```
4444+4545+Reference: [Should this code move to an event handler?](https://react.dev/learn/removing-effect-dependencies#should-this-code-move-to-an-event-handler)
···11+---
22+title: Do not wrap a simple expression with a primitive result type in useMemo
33+impact: LOW-MEDIUM
44+impactDescription: wasted computation on every render
55+tags: rerender, useMemo, optimization
66+---
77+88+## Do not wrap a simple expression with a primitive result type in useMemo
99+1010+When an expression is simple (few logical or arithmetical operators) and has a primitive result type (boolean, number, string), do not wrap it in `useMemo`.
1111+Calling `useMemo` and comparing hook dependencies may consume more resources than the expression itself.
1212+1313+**Incorrect:**
1414+1515+```tsx
1616+function Header({ user, notifications }: Props) {
1717+ const isLoading = useMemo(() => {
1818+ return user.isLoading || notifications.isLoading
1919+ }, [user.isLoading, notifications.isLoading])
2020+2121+ if (isLoading) return <Skeleton />
2222+ // return some markup
2323+}
2424+```
2525+2626+**Correct:**
2727+2828+```tsx
2929+function Header({ user, notifications }: Props) {
3030+ const isLoading = user.isLoading || notifications.isLoading
3131+3232+ if (isLoading) return <Skeleton />
3333+ // return some markup
3434+}
3535+```
···11+---
22+title: Cross-Request LRU Caching
33+impact: HIGH
44+impactDescription: caches across requests
55+tags: server, cache, lru, cross-request
66+---
77+88+## Cross-Request LRU Caching
99+1010+`React.cache()` only works within one request. For data shared across sequential requests (user clicks button A then button B), use an LRU cache.
1111+1212+**Implementation:**
1313+1414+```typescript
1515+import { LRUCache } from 'lru-cache'
1616+1717+const cache = new LRUCache<string, any>({
1818+ max: 1000,
1919+ ttl: 5 * 60 * 1000 // 5 minutes
2020+})
2121+2222+export async function getUser(id: string) {
2323+ const cached = cache.get(id)
2424+ if (cached) return cached
2525+2626+ const user = await db.user.findUnique({ where: { id } })
2727+ cache.set(id, user)
2828+ return user
2929+}
3030+3131+// Request 1: DB query, result cached
3232+// Request 2: cache hit, no DB query
3333+```
3434+3535+Use when sequential user actions hit multiple endpoints needing the same data within seconds.
3636+3737+**With Vercel's [Fluid Compute](https://vercel.com/docs/fluid-compute):** LRU caching is especially effective because multiple concurrent requests can share the same function instance and cache. This means the cache persists across requests without needing external storage like Redis.
3838+3939+**In traditional serverless:** Each invocation runs in isolation, so consider Redis for cross-process caching.
4040+4141+Reference: [https://github.com/isaacs/node-lru-cache](https://github.com/isaacs/node-lru-cache)
···11+---
22+title: Minimize Serialization at RSC Boundaries
33+impact: HIGH
44+impactDescription: reduces data transfer size
55+tags: server, rsc, serialization, props
66+---
77+88+## Minimize Serialization at RSC Boundaries
99+1010+The React Server/Client boundary serializes all object properties into strings and embeds them in the HTML response and subsequent RSC requests. This serialized data directly impacts page weight and load time, so **size matters a lot**. Only pass fields that the client actually uses.
1111+1212+**Incorrect (serializes all 50 fields):**
1313+1414+```tsx
1515+async function Page() {
1616+ const user = await fetchUser() // 50 fields
1717+ return <Profile user={user} />
1818+}
1919+2020+'use client'
2121+function Profile({ user }: { user: User }) {
2222+ return <div>{user.name}</div> // uses 1 field
2323+}
2424+```
2525+2626+**Correct (serializes only 1 field):**
2727+2828+```tsx
2929+async function Page() {
3030+ const user = await fetchUser()
3131+ return <Profile name={user.name} />
3232+}
3333+3434+'use client'
3535+function Profile({ name }: { name: string }) {
3636+ return <div>{name}</div>
3737+}
3838+```
+39
.agents/skills/web-design-guidelines/SKILL.md
···11+---
22+name: web-design-guidelines
33+description: Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
44+metadata:
55+ author: vercel
66+ version: "1.0.0"
77+ argument-hint: <file-or-pattern>
88+---
99+1010+# Web Interface Guidelines
1111+1212+Review files for compliance with Web Interface Guidelines.
1313+1414+## How It Works
1515+1616+1. Fetch the latest guidelines from the source URL below
1717+2. Read the specified files (or prompt user for files/pattern)
1818+3. Check against all rules in the fetched guidelines
1919+4. Output findings in the terse `file:line` format
2020+2121+## Guidelines Source
2222+2323+Fetch fresh guidelines before each review:
2424+2525+```
2626+https://raw.githubusercontent.com/vercel-labs/web-interface-guidelines/main/command.md
2727+```
2828+2929+Use WebFetch to retrieve the latest rules. The fetched content contains all the rules and output format instructions.
3030+3131+## Usage
3232+3333+When a user provides a file or pattern argument:
3434+1. Fetch guidelines from the source URL above
3535+2. Read the specified files
3636+3. Apply all rules from the fetched guidelines
3737+4. Output findings using the format specified in the guidelines
3838+3939+If no files specified, ask the user which files to review.