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

@promptg/spec

v1.0.1

Published

PromptG open specification + JSON Schemas for prompts, templates, and prompt packs (the companion standard to the @promptg/cli ecosystem).

Readme

PromptG Specification

An open standard JSON format for prompts, templates, and prompt packs

License Spec Version

Overview

PromptG defines a standardized JSON format for storing, versioning, and sharing prompts, templates, and prompt packs. This specification enables tool-agnostic prompt management with support for variables, metadata, and extensibility.

Includes JSON Schemas, conformance tests, and a standardized .promptg/ on-disk layout.

Design principles:

  • Simple: Core format is minimal and portable
  • Extensible: x-* fields allow tool-specific metadata
  • Interoperable: Works with any JSON Schema validator
  • Local-first: No cloud dependencies required

Quick Links

Ecosystem

  • You are in promptg/spec: the canonical PromptG standard (spec text, schemas, conformance tests).
  • Reference implementation: https://github.com/promptg/cli (CLI + UI).
  • Starter packs: https://github.com/promptg/starter-packs
  • Website: https://promptg.io (landing page, hosted schemas, pack mirror).

Routing:

  • Spec/schema issues: https://github.com/promptg/spec/issues
  • CLI bugs/features: https://github.com/promptg/cli/issues

PromptG documents use schemaVersion: "1".

Document Types

Prompt (kind: "prompt")

A ready-to-use prompt instance.

{
  "kind": "prompt",
  "schemaVersion": "1",
  "name": "code-review",
  "content": "Review this {{language}} code for {{focus}}"
}

Template (kind: "template")

A reusable blueprint for creating prompts.

{
  "kind": "template",
  "schemaVersion": "1",
  "name": "pr-review",
  "displayName": "PR Review",
  "description": "Review a pull request diff",
  "prompt": {
    "kind": "prompt",
    "schemaVersion": "1",
    "name": "pr-review",
    "content": "Review this PR: {{diff}}"
  }
}

Pack (kind: "pack")

A versioned bundle of prompts and templates.

{
  "kind": "pack",
  "schemaVersion": "1",
  "name": "dev-essentials",
  "version": "1.0.0",
  "templates": [...]
}

JSON Schemas

All formats have JSON schemas for validation:

Schema URLs:

  • https://promptg.io/schemas/v1/prompt.schema.json
  • https://promptg.io/schemas/v1/template.schema.json
  • https://promptg.io/schemas/v1/pack.schema.json

Implementations

Reference Implementation

Features

Variable Interpolation

{
  "content": "Review {{language}} code for {{focus}}",
  "defaults": {
    "language": "TypeScript",
    "focus": "security"
  }
}

Variables use {{variableName}} syntax. Missing variables are left unchanged.

To emit a literal placeholder, use {{!name}} which renders as literal {{name}} (and is ignored as a variable occurrence during rendering).

Extensibility

{
  "kind": "prompt",
  "x-my-tool-metadata": { "customField": "value" },
  "x-promptg-interactive": {
    "language": {
      "question": "What programming language?",
      "required": true
    }
  }
}

Use x-* fields for tool-specific extensions. The x-promptg-* namespace is reserved.

Standard Extensions (Stable in v1.0)

  • x-promptg-interactive - Interactive prompting metadata
  • x-promptg-time - Timestamp metadata

Validation

Node.js: CI runs on Node 20; Node 20+ is recommended for running this repo's validation and test scripts.

Node.js (ajv)

npm install ajv ajv-formats
import Ajv from 'ajv';
import addFormats from 'ajv-formats';

const ajv = new Ajv();
addFormats(ajv);

const schema = await fetch('https://promptg.io/schemas/v1/prompt.schema.json').then((r) =>
  r.json()
);

const validate = ajv.compile(schema);
const valid = validate(promptData);

if (!valid) console.error(validate.errors);

Python (jsonschema)

pip install jsonschema requests
import json
import requests
from jsonschema import validate

schema = requests.get('https://promptg.io/schemas/v1/prompt.schema.json').json()
validate(instance=prompt_data, schema=schema)

Repository Structure

.
|---- spec/                    # Normative specification
|   `---- promptg-spec.md
|---- schemas/v1/              # JSON Schemas
|   |---- prompt.schema.json
|   |---- template.schema.json
|   `---- pack.schema.json
|---- examples/                # Human-friendly examples
|   |---- prompts/
|   |---- templates/
|   `---- packs/
|---- conformance/             # Conformance test suite
|   |---- valid/               # Valid test cases
|   |---- invalid/             # Invalid test cases (should fail)
|   `---- semantics/           # Semantic test vectors (render/extract/instantiate)
|---- docs/                    # Supporting documentation
|   `---- guide.md
`---- .github/workflows/       # CI validation

Contributing

We welcome contributions! See CONTRIBUTING.md for:

  • How to propose schema changes
  • RFC process for major changes
  • Code of conduct

Governance

See GOVERNANCE.md for:

  • Maintainer structure
  • Decision-making process
  • Versioning policy

License

Apache License 2.0 - See LICENSE for details.


PromptG: Prompts as code. Versioned, shareable, standard.