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

@useavalon/agent-optimization

v0.2.0

Published

AI agent optimization plugin for Avalon — llms.txt, markdown negotiation, sitemaps, WebPage JSON-LD

Readme

@useavalon/agent-optimization

AI agent optimization plugin for Avalon — serves llms.txt, markdown content negotiation, and sitemaps to make your site consumable by AI agents and LLMs.

Install

bun add @useavalon/agent-optimization

Usage

Add the plugin to your vite.config.ts:

import { agentOptimization } from '@useavalon/agent-optimization';
import { avalon } from '@useavalon/avalon';
import { defineConfig } from 'vite';

export default defineConfig(async () => {
  const avalonPlugins = await avalon({ /* ... */ });

  return {
    plugins: [
      agentOptimization({
        sitemap: {
          siteUrl: 'https://mysite.com',
          changefreq: 'weekly',
          exclude: ['/admin/**'],
        },
        markdown: true,
        llms: {
          siteUrl: 'https://mysite.com',
          siteName: 'My Site',
          siteDescription: 'A site built with Avalon',
          sections: {
            Pages: ['/'],
            Docs: ['/docs'],
            Blog: ['/blog'],
          },
          full: true,
        },
      }),
      ...avalonPlugins,
    ],
  };
});

Features

Sitemap (/sitemap.xml)

Auto-discovers routes from your Avalon pages directory and generates a Sitemap Protocol 0.9 compliant XML file. Excludes dynamic routes, private routes (_-prefixed), and paths matching your exclude patterns.

Markdown Content Negotiation

When a request includes Accept: text/markdown, the plugin intercepts the HTML response and converts it to clean markdown with YAML front matter. This lets AI agents fetch your pages as structured text instead of parsing HTML.

curl -H "Accept: text/markdown" https://mysite.com/docs/intro

Returns:

---
title: "Introduction"
description: "Get started with Avalon"
---

# Introduction

Get started with Avalon...

llms.txt (/llms.txt and /llms-full.txt)

Implements the llms.txt standard — a markdown file at the site root that gives LLMs a structured overview of your content.

  • /llms.txt — Concise index with site name, description, and categorized links
  • /llms-full.txt — Full markdown content of all pages concatenated (when full: true)

Config Reference

| Option | Type | Default | Description | |--------|------|---------|-------------| | sitemap | boolean \| SitemapConfig | — | Enable sitemap generation | | sitemap.siteUrl | string | required | Base URL for sitemap entries | | sitemap.changefreq | string? | 'weekly' | Default change frequency | | sitemap.priority | number? | 0.5 | Default priority (0–1) | | sitemap.dynamicPaths | Record<string, string[]>? | — | Expand dynamic route params | | sitemap.exclude | string[]? | — | Glob patterns to exclude | | markdown | boolean? | — | Enable markdown content negotiation | | llms | boolean \| LlmsConfig | — | Enable llms.txt generation | | llms.siteUrl | string | required | Base URL for llms.txt links | | llms.siteName | string | required | H1 heading in llms.txt | | llms.siteDescription | string? | — | Blockquote description | | llms.sections | Record<string, string[]>? | — | Group routes into named sections | | llms.exclude | string[]? | — | Patterns to exclude | | llms.full | boolean? | false | Generate llms-full.txt with full content |

Relationship to @useavalon/seo

This plugin handles AI/agent-facing concerns. For search-engine-facing SEO (Open Graph, Twitter cards, canonical URLs, JSON-LD structured data), use @useavalon/seo.

The two plugins complement each other and can be used together:

plugins: [
  seo({ siteUrl: '...', siteName: '...' }),
  agentOptimization({ sitemap: { siteUrl: '...' }, markdown: true, llms: { ... } }),
  ...avalonPlugins,
]

License

MIT