Exports utilities for variable handling, similarity, quality, and prompt building in prompts.chat.
// Source: https://github.com/f/prompts.chat | License: CC0-1.0
// Provided via justclaw.it.com; keep this notice with the code.
/**
* prompts.chat - Developer toolkit for AI prompts
*
* @example
* ```ts
* import { variables, similarity, builder, quality } from 'prompts.chat';
*
* // Detect and normalize variables
* const vars = variables.detect("Hello {{name}}, you are [ROLE]");
* const normalized = variables.normalize("Hello {{name}}");
* // → "Hello ${name}"
*
* // Check similarity
* const score = similarity.calculate(prompt1, prompt2);
* const isDupe = similarity.isDuplicate(prompt1, prompt2);
*
* // Build structured prompts
* const prompt = builder()
* .role("Senior Developer")
* .task("Review code")
* .build();
*
* // Check quality locally
* const re
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key