Claude Next.js Skills is a proof of concept automation bundle designed to improve pass rates on Next.js evaluations. It benefits developers and operations teams by automating tasks to enhance performance on Next.js evals. The skills connect to the Next.js evaluation framework, helping to streamline the development and testing process.
git clone https://github.com/wsimmonds/claude-nextjs-skills.gitClaude Next.js Skills is a proof-of-concept automation bundle designed to improve Claude model performance on Vercel's Next.js evaluation framework. The skill set increases baseline pass rates from 32% to 78% for Claude Haiku and 76% for Claude Sonnet, covering 50 Next.js evaluation tasks including app router migrations, server components, client components, route handlers, and AI SDK integrations. It automates common Next.js patterns and best practices, helping developers and operations teams streamline the development and testing process while achieving higher success rates on standardized evaluations. The skills are tested and benchmarked against specific Next.js evaluation criteria published on nextjs.org/evals.
1. **Set Up the Environment:** - Install the claude-nextjs-skills bundle via npm: `npm install -g claude-nextjs-skills`. - Ensure your Next.js project is in a Git repository to track changes. - *Tip:* Run `claude-nextjs-skills --init` to generate a configuration file with default rules. 2. **Run the Evaluation:** - Execute the full scan: `claude-nextjs-skills scan --project ./acme-ecommerce`. - For targeted checks (e.g., only images), use: `claude-nextjs-skills check --category images`. - *Tip:* Use `--verbose` to log detailed timings and dependency graphs. 3. **Review the Report:** - Open the generated `nextjs-eval-report.md` in your project root. - Prioritize tasks based on the `Impact Score` and `Effort` columns. - *Tip:* Focus on high-impact, low-effort fixes first (e.g., dependency cleanup). 4. **Implement Fixes:** - Follow the provided code snippets and update your project files. - Use `claude-nextjs-skills verify --file ./pages/products/[id].js` to validate changes. - *Tip:* Test fixes locally with `next build && next start` before committing. 5. **Monitor Performance:** - Deploy changes to staging and run `claude-nextjs-skills audit --url https://staging.acme.com`. - Compare Core Web Vitals before/after using Google Search Console. - *Tip:* Set up automated GitHub Actions to run scans on every PR merge.
Improving Next.js evaluation pass rates for Claude-powered development tools
Automating Next.js migration tasks from Pages Router to App Router
Handling server components, client components, and server actions
Integrating AI SDK functionality into Next.js applications
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/wsimmonds/claude-nextjs-skillsCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Use the claude-nextjs-skills automation bundle to evaluate and improve the performance of [NEXTJS_PROJECT_NAME] in Next.js evaluations. Run the following checks: [1] Analyze the project's static generation and server-side rendering configurations for potential bottlenecks. [2] Identify unused dependencies or scripts that could slow down build times. [3] Suggest optimizations for image loading and API route performance. [4] Generate a prioritized list of changes with estimated impact on evaluation scores. Provide code snippets for critical fixes and a step-by-step implementation guide.
### Next.js Evaluation Optimization Report for **Acme Corp E-Commerce Platform**
**Project Overview:**
Acme Corp’s Next.js e-commerce platform (v13.4.12) is currently scoring **78/100** on Next.js evaluations, with critical failures in static generation (SSG) and image optimization. The team identified a 3.2s build time increase after the last deployment, correlating with a 15% drop in Lighthouse performance scores.
**Key Findings:**
1. **Static Generation Bottlenecks:**
- The `/products/[id]` page uses `getStaticProps` but fetches 1,247 unused product variants during build, adding 800ms to generation time. The `revalidate` setting is set to 3600s (1 hour) for a catalog that updates hourly, causing stale data risks.
- **Fix:** Implement incremental static regeneration (ISR) with `revalidate: 300` (5 minutes) and add a `stale-while-revalidate` header for dynamic content.
```javascript
export async function getStaticProps({ params }) {
const product = await fetchProduct(params.id);
return {
props: { product },
revalidate: 300, // Update every 5 minutes
};
}
```
2. **Unused Dependencies:**
- `sharp` (v0.32.1) is installed but only used for 3% of images. The rest rely on `next/image`’s default loader, adding unnecessary build complexity.
- **Fix:** Remove `sharp` and configure `next.config.js` to use the default loader:
```javascript
module.exports = {
images: {
loader: 'default',
disableStaticImages: true,
},
};
```
3. **Image Optimization:**
- Product images are served at 2x resolution (e.g., 1920x1080) but displayed at 480x270, wasting 4.2MB per image. The `next/image` component lacks `priority` or `sizes` attributes.
- **Fix:** Update the component to:
```jsx
<Image
src={product.image}
alt={product.name}
width={480}
height={270}
priority={true}
sizes="(max-width: 768px) 100vw, 50vw"
quality={85}
/>
```
4. **API Route Performance:**
- The `/api/products` endpoint queries a MongoDB collection with no indexing, returning 5,000 documents per request. Average response time: 1.8s.
- **Fix:** Add a compound index for `category` and `price` and paginate results:
```javascript
// api/products/route.js
export async function GET(request) {
const { searchParams } = new URL(request.url);
const category = searchParams.get('category');
const page = parseInt(searchParams.get('page')) || 1;
const limit = 50;
const products = await Product.find({ category })
.sort({ price: 1 })
.skip((page - 1) * limit)
.limit(limit);
return NextResponse.json(products);
}
```
**Prioritized Action Plan:**
| Task | Impact Score | Effort (Hours) | Estimated Score Improvement | Deadline |
|-------------------------------|--------------|----------------|-----------------------------|-----------|
| Fix SSG revalidation | 9/10 | 2 | +12 points | 2023-11-15|
| Remove unused dependencies | 7/10 | 1 | +5 points | 2023-11-10|
| Optimize images | 8/10 | 3 | +15 points | 2023-11-20|
| Index API routes | 8/10 | 4 | +10 points | 2023-11-25|
**Expected Outcome:**
After implementing these changes, the project’s Next.js evaluation score is projected to reach **95/100**, with Lighthouse performance scores improving from **62 to 91**. The team should see a 40% reduction in build times and a 25% faster time-to-interactive for end users.
**Next Steps:**
1. Commit the changes to a new branch (`feature/nextjs-optimizations`).
2. Run `next build && next start` to verify the fixes locally.
3. Deploy to staging and monitor Core Web Vitals in Google Search Console.
4. Merge to production after QA approval.AI assistant built for thoughtful, nuanced conversation
Get more done every day with Microsoft Teams – powered by AI
Automate security compliance and monitor real-time security posture seamlessly.
Automate your spreadsheet tasks with AI power
Agentic AI Workflow platform
Connected workspace for docs, wikis, and projects
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan