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

pict-section-prompteditor

v1.1.1

Published

Prompt crafting and management section for Pict: typed prompts with segments (context, request, success criteria), curated word list matrices with weights, a {~WordListEntry:Name~} template expression for weighted-random generation, batch generation with

Readme

pict-section-prompteditor

Read the Pict-Section-PromptEditor Documentation - interactive docs with the full API reference and a runnable example.

A prompt crafting and management section for the Pict ecosystem. Prompts are markdown organized by type into segments, word list matrices with weights drive a {~WordListEntry:Name~} template expression, and one crafted prompt generates endless concrete variants you can browse and download as a zip.

MIT License

Features

  • Typed prompts with markdown segments (Context / Request / Success Criteria and friends), plus fixed preamble segments for locked team standards
  • A per-prompt "segment headings in the output" toggle, saved with the prompt: on for structured documents (## Context above each block), off for bare bodies
  • Weighted word list matrices: [["Tyrannosaurus", 3], ["Diplodocus", 1]] draws 75/25, with live share percentages as you curate
  • The {~WordListEntry:Name~} template expression (short form {~WLE:~}), with an optional miss default: {~WLE:Name:fallback~}
  • Generation runs the real pict template engine, so every pict expression works inside a prompt
  • Inline preview with reroll, Formatted / Markdown toggle, and a copy button
  • Batch generation with provenance, browsed in file order, downloaded as a zip of <slug>-<sequence>.md files
  • Pluggable data backplane: in-memory by default, one PromptDataProvider class to back it with your API
  • Opaque Meta, Author stamping, stable keys, and mutation hooks: the seams a host platform layers ratings and collaboration onto
  • Resizable, collapsible list rail (a pict-section-modal panel) and a searchable insert control (pict-section-picker)
  • Rich segment editing via pict-section-markdowneditor in a modal when CodeMirror is available; plain textareas otherwise

Installation

npm install pict-section-prompteditor

Quick Start

const libPromptEditor = require('pict-section-prompteditor');

pict.addView('PromptEditor', Object.assign({}, libPromptEditor.default_configuration,
{
	DefaultDestinationAddress: '#My-Container',
	Title: 'Team Prompt Workshop',
	CurrentUser: { Key: 42, Name: 'Steven' }
}), libPromptEditor);

let tmpEditor = pict.views['PromptEditor'];
tmpEditor.render();

// Seed through the provider (in-memory by default), then reload the section.
tmpEditor._provider.createWordList(
	{ Name: 'Dinosaurs', Entries: [['Tyrannosaurus', 3], ['Diplodocus', 1]] })
	.then(() => tmpEditor.load());

The section renders three tabs: Prompts (the editor), Word Lists (the matrices), and Generated (the browseable output with a zip download). Write {~WordListEntry:Dinosaurs~} in any segment and each generation draws Tyrannosaurus 75% of the time.

To back it with your own API instead of memory, implement the twelve-method PromptDataProvider contract and pass it as DataProvider -- the in-memory provider is the reference implementation.

Documentation

Full documentation is available in the docs/ directory and hosted at fable-retold.github.io/pict-section-prompteditor:

Example Applications

| Example | Description | |---------|-------------| | Prompt Workshop | The full section in memory: seeded word lists and prompts, inline preview with reroll, batch generation, zip download |

Build it:

cd example_applications/prompt_workshop
npm install
npx quack build && npx quack copy
# serve dist/ and open index.html — or `npm run example` from the module root

API Overview

| Export | Description | |--------|-------------| | (default) / default_configuration | The section view class and its full default options | | PromptDataProvider | The data contract a host implements | | InMemoryPromptProvider | The default provider; deterministic via Now / KeyGenerator options | | DefaultPromptTypes / resolvePromptTypes / getPromptType | The built-in prompt types and their resolution helpers | | PromptCompiler | assembleSource, generate, wordListMap, slug, generatedFileName | | PromptZip | buildZip, downloadBlob | | PictTemplateWordListEntry / weightedPick | The template expression class and the weighted draw | | normalizeEntries | Word list entry normalization |

View instance methods hosts call: load(), refresh(), setReadOnly(bool), setDataProvider(provider) -- plus every UI action as a drivable method. See Developer Functions for snippets.

Testing

npm test

Fifty-seven mocha tests cover the provider contract, the weighted draw and expression, the compiler, zip round-trips, and the view (including focus-preserving edits and multi-instance isolation).

Related Packages

License

MIT

Contributing

Pull requests are welcome. For major changes, please open an issue first.