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

@wasmagent/agent-prompts

v1.0.3

Published

Reusable system prompt templates for wasmagent — code/tool/framework prompts with D2 + Markdown card conventions

Readme

/agent-prompts

Reusable system prompt fragments + composePrompt() for wasmagent — code/tool/sandbox/output-contract conventions exported as named string constants you compose into your own system prompt.

Part of wasmagent — a TypeScript + WASM agent runtime.

Install

npm install /agent-prompts

Usage

composePrompt() joins fragments with double newlines and trims trailing whitespace — no template engine, no runtime. The fragments are typed const strings, so your IDE auto-completes them and a typo fails the build.

import {
  composePrompt,
  REASONING_FIRST,
  CODE_QUALITY_TYPESCRIPT,
  SANDBOX_QUICKJS,
  OUTPUT_CONTRACT_FINAL_ANSWER,
} from "/agent-prompts";

const system = composePrompt([
  REASONING_FIRST,             // "## Approach (Reasoning-First)" block
  CODE_QUALITY_TYPESCRIPT,     // type-safety, no `any`, exhaustive checks
  SANDBOX_QUICKJS,             // QuickJS-specific: no node:, no native, …
  OUTPUT_CONTRACT_FINAL_ANSWER,// "Return your final answer as …"
]);

// Pass `system` to any wasmagent Agent / Vercel AI SDK / Claude SDK / etc.

Where it's used in this repo

  • bscode worker (apps/worker/src/agents/prompts.ts) — composes 13 fragments (CODE_QUALITY_TYPESCRIPT, SANDBOX_QUICKJS, DIAGRAMS_CODE_JS, FILE_OPS_ATOMIC, …) into the production system prompt for bscode's CodeAgent. Each fragment is a generic wasmagent building block; product-specific instructions (persona, <boltThinking> tag, WebContainers conventions) sit alongside.
  • tests/integration/cross-package.test.ts — pins the contract that fragments compose without conflict and that composePrompt() is byte-stable across re-orderings.

Fragment catalogue

| Category | Fragments | |---|---| | Approach | REASONING_FIRST, STRUCTURED_PLAN | | Output | OUTPUT_CONTRACT_FINAL_ANSWER, OUTPUT_CONTRACT_STDOUT | | Code | CODE_QUALITY_GENERIC, CODE_QUALITY_TYPESCRIPT, ERROR_RECOVERY, FILE_OPS_ATOMIC | | Sandbox | SANDBOX_QUICKJS, SANDBOX_PYODIDE, SANDBOX_NODE | | Diagrams | re-exported from ./diagrams (DIAGRAMS_CODE_JS, DIAGRAMS_CODE_PY, …) |

The full surface lives in src/fragments.ts and src/diagrams.ts.

Why these particular fragments

The fragments were extracted from production system prompts that survived contact with real users (bscode in production since 2026-04, wasmagent's own examples in CI). Each one solves a recurring failure mode — e.g. CODE_QUALITY_TYPESCRIPT exists because models default to writing untyped JS; SANDBOX_QUICKJS exists because models attempt require('fs') on a kernel that has no fs.

License

Apache-2.0 — © wasmagent contributors