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

llm-docs-sync

v1.0.4

Published

Functional documentation sync for LLM context in SvelteKit projects

Downloads

194

Readme

llm-docs-sync

A functional, Effect-based documentation sync tool for maintaining up-to-date LLM context in your SvelteKit projects.

Features

  • 🚀 Functional & Type-Safe: Built with Effect library for robust error handling
  • 📦 Bun-First: Optimized for Bun runtime
  • 🔄 Auto-Sync: Keeps your LLM documentation context fresh
  • ⚙️ Configurable: Customize sources, output directory, and project rules
  • 🎯 SvelteKit Ready: Pre-configured for SvelteKit + Effect projects
  • 📝 Auto-Generated AGENTS.md: Creates comprehensive agent configuration files

Installation


bun add -d llm-docs-sync

Usage

CLI

Add to your package.json scripts:


{
  "scripts": {
    "sync-docs": "llm-docs-sync"
  }
}

Run:


bun run sync-docs

Programmatic API

import { syncDocs, type DocSource } from 'llm-docs-sync';
import { Effect } from 'effect';
import { DEFAULT_SOURCES, DEFAULT_PROJECT_RULES } from 'llm-docs-sync/defaults';

// Use defaults
Effect.runPromise(syncDocs());

// Custom configuration
Effect.runPromise(
  syncDocs({
    sources: [
      ...DEFAULT_SOURCES,
      { name: "Custom Lib", url: "https://example.com/llms.txt" }
    ],
    outputDir: "./docs/context",
    agentsFile: "AI_CONTEXT.md",
    projectRules: [
      "Use TypeScript strict mode",
      "Follow Effect best practices"
    ]
  })
);

Default Sources

  • Svelte 5: https://svelte.dev/docs/svelte/llms.txt
  • SvelteKit: https://svelte.dev/docs/kit/llms.txt
  • Effect: https://effect.website/llms-full.txt
  • Vite: https://vite.dev/llms.txt
  • Skeleton: https://www.skeleton.dev/llms-svelte.txt
  • Dexie: https://dexie.org/llms.txt

Default Project Rules

  1. Always use Bun for adding packages, running scripts, and testing.
  2. Svelte 5 Runes: Use $state, $derived, and $effect as defined in local Svelte context.
  3. Effect TS: Follow the patterns defined in the Effect full documentation file.

Configuration


type SyncConfig = {
  sources?: DocSource[];           // Documentation sources to sync (default: DEFAULT_SOURCES)
  outputDir?: string;              // Output directory (default: ./.opencode/context)
  agentsFile?: string;             // AGENTS.md file path (default: AGENTS.md)
  projectRules?: string[];         // Custom project rules (default: DEFAULT_PROJECT_RULES)
};

Example Workflow

  1. Install the package
  2. Add sync script to package.json
  3. Run before starting development or in CI/CD
  4. Your AGENTS.md and context files stay updated

{
  "scripts": {
    "predev": "bun run sync-docs",
    "dev": "vite dev"
  }
}

Generated AGENTS.md Format

The tool generates an AGENTS.md file with the following structure. If the file already exists, the new content is appended with a separator (\n\n---\n\n):

# OpenCode Agent Configuration
**Primary Runtime:** Bun (System-wide)
**Context Strategy:** Local Documentation First

## 📚 Local Documentation References
The following files contain the latest API specifications and standards.
Always consult these before attempting to write code for these libraries:

- **Svelte 5**: Refer to "./.opencode/context/svelte-5.md"
- **SvelteKit**: Refer to "./.opencode/context/sveltekit.md"
- **Effect**: Refer to "./.opencode/context/effect.md"
- **Vite**: Refer to "./.opencode/context/vite.md"
- **Skeleton**: Refer to "./.opencode/context/skeleton.md"
- **Dexie**: Refer to "./.opencode/context/dexie.md"

## 🛠 Project Rules
1. **Always use Bun** for adding packages, running scripts, and testing.
2. **Svelte 5 Runes:** Use `$state`, `$derived`, and `$effect` as defined in local Svelte context.
3. **Effect TS:** Follow the patterns defined in the Effect full documentation file.

API Reference

Functions

syncDocs(config?: Partial<SyncConfig>): Effect.Effect<void, never>

Main sync function that fetches documentation from all sources and generates AGENTS.md.

runCLI(): void

Runs the sync process from command line.

toFileName(name: string): string

Converts a source name to a filename (lowercase, spaces to hyphens).

createManifest(results: readonly SyncResult[]): readonly string[]

Creates manifest entries for successful sync results.

Types

DocSource


interface DocSource {
  readonly name: string;
  readonly url: string;
}

SyncResult


interface SyncResult {
  readonly name: string;
  readonly filePath: string;
  readonly status: "success" | "failed";
}

SyncConfig


interface SyncConfig {
  readonly sources: readonly DocSource[];
  readonly outputDir: string;
  readonly agentsFile?: string;
  readonly projectRules?: readonly string[];
}

Testing


bun test

Publishing

This package is published under:

License

MIT