npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@forgedock/fd-fastest-ai-recommendations

v1.0.2

Published

AI-powered performance recommendations for FD-Fastest

Readme

@fd-fastest/ai-recommendations

AI-powered performance recommendations for FD-Fastest using Vercel AI SDK.

Features

  • 🤖 AI-powered analysis using OpenAI or Anthropic models
  • 📊 Structured recommendations with severity levels and impact estimates
  • 🎯 Detailed fixing prompts for AI code generation tools
  • 💾 In-memory caching to reduce API costs
  • 🔒 Type-safe with Zod schema validation
  • 📦 ESM module with full TypeScript support

Installation

pnpm add @fd-fastest/ai-recommendations

Usage

Basic Example

import { AIRecommender } from '@fd-fastest/ai-recommendations';
import type { Report } from '@fd-fastest/reporter-json';

// Initialize with OpenAI
const recommender = new AIRecommender({
  provider: 'openai',
  apiKey: process.env.OPENAI_API_KEY!,
  model: 'gpt-4o-mini', // optional
  temperature: 0.3, // optional
  maxRecommendations: 10, // optional
  enableCaching: true, // optional
});

// Generate recommendations
const result = await recommender.generateRecommendations(report);

console.log(`Generated ${result.recommendations.length} recommendations`);
console.log(`Model: ${result.model}`);
console.log(`Tokens used: ${result.tokensUsed}`);

result.recommendations.forEach((rec) => {
  console.log(`[${rec.severity}] ${rec.category}: ${rec.issue}`);
  console.log(`Recommendation: ${rec.recommendation}`);
  console.log(`Impact: ${rec.impact}`);
});

Using Anthropic

const recommender = new AIRecommender({
  provider: 'anthropic',
  apiKey: process.env.ANTHROPIC_API_KEY!,
  model: 'claude-3-5-sonnet-20241022',
});

Generating Fixing Prompts

import { FixingPromptGenerator } from '@fd-fastest/ai-recommendations';

const generator = new FixingPromptGenerator();

// Single prompt
const prompt = generator.generate({
  recommendation: result.recommendations[0],
  projectContext: 'Next.js 14 App Router project',
});

console.log(prompt);

// Batch prompts
const prompts = generator.generateBatch(
  result.recommendations,
  'Next.js 14 App Router project'
);

prompts.forEach((prompt, key) => {
  console.log(`\n=== ${key} ===`);
  console.log(prompt);
});

API

AIRecommender

Constructor Options

interface AIRecommenderConfig {
  provider: 'openai' | 'anthropic';
  apiKey: string;
  model?: string;
  temperature?: number; // 0.0-1.0
  maxRecommendations?: number;
  enableCaching?: boolean;
}

Methods

  • generateRecommendations(report: Report): Promise<AIRecommendationResult>
  • static clearCache(): void

FixingPromptGenerator

Methods

  • generate(options: FixingPromptOptions): string
  • generateBatch(recommendations: AIRecommendation[], projectContext?: string): Map<string, string>

Types

AIRecommendation

interface AIRecommendation {
  severity: 'critical' | 'warning' | 'info';
  category: string;
  issue: string;
  recommendation: string;
  fixingPrompt: string;
  impact: 'high' | 'medium' | 'low';
  estimatedImprovement?: string;
  affectedRoutes?: string[];
}

AIRecommendationResult

interface AIRecommendationResult {
  recommendations: AIRecommendation[];
  generatedAt: string;
  model: string;
  tokensUsed?: number;
}

Environment Variables

# For OpenAI
OPENAI_API_KEY=your_key_here

# For Anthropic
ANTHROPIC_API_KEY=your_key_here

Development

# Install dependencies
pnpm install

# Build
pnpm build

# Test
pnpm test

# Type check
pnpm type-check

License

MIT