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

@kidkender/archmind-prompt-builder

v0.2.0

Published

Serializes ArchMind execution graphs into LLM-ready prompts.

Readme

@archmind/prompt-builder

Compiles execution graphs and findings into structured LLM prompts — with mode-aware reasoning and conversation history support.


Why a dedicated prompt builder?

A prompt is not just a string. For ArchMind to get consistent, structured responses from an LLM, the prompt needs to:

  • Present the execution graph in a format the LLM can reason about
  • Include findings with enough context to explain but not overwhelm
  • Enforce a specific output schema via instructions
  • Adapt the reasoning style to what the user is trying to do
  • Carry forward relevant context from prior conversation turns
  • Flag when new context contradicts what was said before

Doing this ad-hoc in the orchestrator would be fragile and untestable. @archmind/prompt-builder makes it a first-class, independently testable stage in the pipeline.


Key features

Mode-aware prompts The same graph and findings can be presented to the LLM in three different ways depending on what you're trying to accomplish:

| Mode | Behavior | Best for | |---|---|---| | review | Concise security reviewer — findings-focused, terse | PR review, security audit | | teach | Patient senior engineer — step-by-step, uses analogies | Onboarding, explaining unfamiliar code | | debug | Terse incident responder — root cause only, minimal fix | Production incidents, debugging |

The system prompt, framing, and output instructions all change with the mode. The underlying graph and findings stay the same.

Structured output enforcement Each mode includes specific output_instructions that tell the LLM exactly what JSON schema to return. This is what allows @archmind/llm-client to validate the response reliably.

Conversation continuity Pass previous ConversationTurn[] and the prompt builder weaves them into the context. The LLM can reference what was said before and build on prior reasoning.

Contradiction detection detectContradictions() compares the current graph against prior conversation turns. If a new graph context contradicts a claim made earlier, the discrepancy is injected into the prompt so the LLM can acknowledge and correct it — not silently repeat a stale answer.


Usage

import { buildPrompt } from "@archmind/prompt-builder"

const prompt = buildPrompt({
  query:    "does this endpoint validate the request body?",
  graph:    graph,
  findings: findings,
  mode:     "teach",         // optional, defaults to "review"
  history:  priorTurns,      // optional, for multi-turn sessions
})

// Pass to any LLMClient:
const result = await llmClient.call(prompt)

Running tests

cd packages/prompt-builder
node --experimental-vm-modules ../../node_modules/jest/bin/jest.js