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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@gace/vaac

v0.1.0

Published

Vibe as a Code - AI-powered code generation at build time

Readme

VAAC - Vibe as a Code

Keep AI-generated code separate from human code.

Versioned. Reviewable. Reproducible.


The Problem

AI-generated code is everywhere, but it's a mess:

  • ChatGPT snippets copy-pasted inline
  • Copilot suggestions scattered across files
  • No way to track what's AI vs human
  • Impossible to audit or review

VAAC fixes this. All AI-generated code lives in one place: the .ai/ directory.


How It Works

your-project/
├── src/
│   └── utils.ts           ← You write the prompt here
└── .ai/
    └── slugify-01.ts      ← AI generates code here

1. Annotate your function:

import { Ai } from '@gace/vaac';

@Ai({
  id: 'slugify-01',
  prompt: 'Convert text to URL-friendly slug. Lowercase, replace spaces with dashes, remove special characters.'
})
export function slugify(text: string): string {}

2. Run your build:

npm run build

3. VAAC generates .ai/slugify-01.ts:

export function slugify(text: string): string {
  return text
    .toLowerCase()
    .trim()
    .replace(/[^\w\s-]/g, '')
    .replace(/\s+/g, '-');
}

4. At build time, your function body is replaced with the generated code.

Your source stays clean. AI code stays separate.


Installation

npm install @gace/vaac

Add to your vite.config.ts:

import { defineConfig } from 'vite';
import { vaac } from '@gace/vaac/vite';
import 'dotenv/config';

export default defineConfig({
  plugins: [
    vaac({
      model: 'openai/gpt-4-turbo',
      verbose: true,        // Optional: enable debug logging
      // apiKey: '...',     // Optional: auto-detects from env vars
    }),
  ],
});

Create a .env file with your API key:

# OpenRouter (recommended - access to multiple models)
OPENROUTER_API_KEY=sk-or-...

# Or use OpenAI directly
# OPENAI_API_KEY=sk-...

Philosophy

As AI-generated code becomes ubiquitous, mixing it with human-written code creates chaos - hard to track, hard to audit, hard to manage.

VAAC isolates AI code. Every generated function lives in .ai/, committed to Git, reviewed like any other code. Your human code stays clean.


Key Features

| Feature | Description | |---------|-------------| | Separation | AI code in .ai/, human code everywhere else | | Versioned | Generated files are committed to Git | | Reproducible | Same commit = same build output | | CI-safe | Build fails if .ai/ files are missing - no surprise AI calls | | Zero runtime | Generated code is compiled in, no runtime dependency | | Editable | Don't like the AI output? Edit .ai/ files directly |


Developer Flow

| Action | How | |--------|-----| | Generate code | Run npm run build - missing .ai/ files are created | | Review AI code | Open .ai/[id].ts - it's just TypeScript | | Edit AI code | Modify .ai/[id].ts directly - your changes persist | | Regenerate | Delete .ai/[id].ts and rebuild | | Commit | Add both source and .ai/ files to Git |


Configuration

vaac({
  // AI model (default: gpt-4-turbo)
  model: 'openai/gpt-4-turbo',
  
  // Output directory (default: .ai)
  outputDir: '.ai',
  
  // Enable debug logging (default: false)
  verbose: true,
  
  // API key - auto-detects from env vars
  // Priority: OPENROUTER_API_KEY > OPENAI_API_KEY
  // Or pass explicitly:
  // apiKey: process.env.OPENROUTER_API_KEY,
  
  // CI mode: error if files missing instead of generating
  ciMode: process.env.CI === 'true',
})

License

MIT


Built with the belief that AI and human code shouldn't mix.