{"_id":"@bstockwelldev/prompt-rubric","name":"@bstockwelldev/prompt-rubric","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@bstockwelldev/prompt-rubric","version":"0.1.0","description":"Static prompt quality rubric (D1–D7), Zod schemas, inventory, heuristic scoring, and Markdown reports — no LLM calls","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","bin":{"prompt-rubric":"dist/cli/index.js"},"publishConfig":{"access":"public"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"build":"tsc","prepare":"tsc","typecheck":"tsc --noEmit","test":"vitest run","test:watch":"vitest","lint":"eslint src"},"repository":{"type":"git","url":"git+https://github.com/bstockwelldev/prompt-rubric.git"},"keywords":["prompt","rubric","llm","quality","evaluation","zod","ci"],"license":"MIT","dependencies":{"zod":"^3.25.76"},"devDependencies":{"@eslint/js":"^9.16.0","@types/node":"^20.17.10","eslint":"^9.16.0","typescript":"^5.7.2","typescript-eslint":"^8.18.0","vitest":"^2.1.8"},"engines":{"node":">=20.0.0"},"gitHead":"afb6db6884d0b897b72c742d2876bef796d54f75","_id":"@bstockwelldev/prompt-rubric@0.1.0","bugs":{"url":"https://github.com/bstockwelldev/prompt-rubric/issues"},"homepage":"https://github.com/bstockwelldev/prompt-rubric#readme","_nodeVersion":"20.18.0","_npmVersion":"11.11.1","dist":{"integrity":"sha512-sx4h4xswe6WaOLgFM04C2xZeKJgsMQfk83lQWrM+vkyovm+9trHUMYY10nzTVc0TAsnVIdBdSCwi7abkgYjJHw==","shasum":"5a5b8e4b286cf565d426b4c6ffc45ff47c3d6281","tarball":"https://registry.npmjs.org/@bstockwelldev/prompt-rubric/-/prompt-rubric-0.1.0.tgz","fileCount":80,"unpackedSize":171521,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDskgYqAPtcn0AcLXHf1SsH4Cv4KgySKzKCc5wv6IceMgIhAL3jktyNoWGVd1JEuD0dkH2n8gkQtcqhFEFoXqJYh7dv"}]},"_npmUser":{"name":"bgs1292","email":"bgs1292@gmail.com"},"directories":{},"maintainers":[{"name":"bgs1292","email":"bgs1292@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/prompt-rubric_0.1.0_1774012958597_0.365437113241011"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-20T13:22:38.433Z","0.1.0":"2026-03-20T13:22:38.736Z","modified":"2026-03-20T13:22:38.916Z"},"maintainers":[{"name":"bgs1292","email":"bgs1292@gmail.com"}],"description":"Static prompt quality rubric (D1–D7), Zod schemas, inventory, heuristic scoring, and Markdown reports — no LLM calls","homepage":"https://github.com/bstockwelldev/prompt-rubric#readme","keywords":["prompt","rubric","llm","quality","evaluation","zod","ci"],"repository":{"type":"git","url":"git+https://github.com/bstockwelldev/prompt-rubric.git"},"bugs":{"url":"https://github.com/bstockwelldev/prompt-rubric/issues"},"license":"MIT","readme":"# `@bstockwelldev/prompt-rubric`\r\n\r\nStatic **prompt artifact quality** model (**D1–D7**), **Zod** validation, **inventory** / path maps, **heuristic** score suggestions from review text, **Markdown** rendering, and **`check`** for CI — **no LLM calls** in core flows. An **optional** `judge` command calls an OpenAI-compatible HTTP API when you opt in (API key + explicit run).\r\n\r\n## Install\r\n\r\n```bash\r\npnpm add -D @bstockwelldev/prompt-rubric\r\n```\r\n\r\nRequires **Node.js ≥ 20**.\r\n\r\n## Dimensions (short)\r\n\r\n| ID | JSON key | Name |\r\n| -- | -------- | ---- |\r\n| D1 | `metadata` | Artifact identity |\r\n| D2 | `variables_trust` | Variables & trust |\r\n| D3 | `structure_delimiters` | Structure / delimiters |\r\n| D4 | `output_contract` | Output contract |\r\n| D5 | `consistency_grounding` | Consistency / grounding |\r\n| D6 | `fixtures_tests` | Fixtures / tests |\r\n| D7 | `safety_guardrails` | Safety / guardrails |\r\n\r\n**Scale:** `0` fail, `1` partial, `2` pass, `null` = n/a (omitted from mean).\r\n\r\n**Bands:** `poor` &lt; 1.0, `fair` ≥ 1.0 and &lt; 1.5, `good` ≥ 1.5.\r\n\r\nFull definitions: **[RUBRIC.md](./RUBRIC.md)** (canonical).\r\n\r\n## CLI\r\n\r\n```bash\r\npnpm exec prompt-rubric --help\r\npnpm exec prompt-rubric inventory --config ./prompt-rubric.config.mjs\r\npnpm exec prompt-rubric path-map --config ./prompt-rubric.config.mjs\r\npnpm exec prompt-rubric score-suggest --config ./prompt-rubric.config.mjs\r\npnpm exec prompt-rubric score-write --config ./prompt-rubric.config.mjs\r\npnpm exec prompt-rubric render-md --config ./prompt-rubric.config.mjs\r\npnpm exec prompt-rubric check --config ./prompt-rubric.config.mjs\r\npnpm exec prompt-rubric reviews-sync --config ./prompt-rubric.config.mjs\r\npnpm exec prompt-rubric reviews-sync --config ./prompt-rubric.config.mjs --merge-static\r\npnpm exec prompt-rubric llm-batch-pack --config ./prompt-rubric.config.mjs --output ./pack.md\r\npnpm exec prompt-rubric judge --config ./prompt-rubric.config.mjs --dry-run --limit 2\r\n```\r\n\r\n- **`reviews-sync`** — Aligns `llm-prompts-matrix-reviews.json` with current inventory: keeps existing `findings`/`recommendations`, adds stub rows for new prompts. `--merge-static` appends **synthetic static findings** (heuristic file scan; option **C**, not a full policy linter). `--dry-run` prints row count only.\r\n- **`llm-batch-pack`** — Emits one Markdown file for copy-paste into an external LLM (**option D**); no API keys. Merge model JSON back into reviews via PR.\r\n- **`judge`** — **Opt-in** rubric review via OpenAI-compatible `POST …/chat/completions` (`fetch` only; no SDK). Set **`OPENAI_API_KEY`** (or override env name via `judge.apiKeyEnv` in config). Env overrides: **`OPENAI_BASE_URL`**, **`PROMPT_RUBRIC_JUDGE_MODEL`**. Flags: **`--dry-run`** (no network), **`--limit N`**, **`--repo SLUG`**, **`--output FILE`** (JSON), **`--merge-reviews`** → merges model output into `findings` inside `<!-- llm-judge ISO -->` … `<!-- /llm-judge -->` (human text outside that block is preserved). Default rubric text: this package’s **RUBRIC.md** or `judge.rubricPath` relative to `cwd`. Costs tokens; output is **non-deterministic** — review in PR before trusting.\r\n\r\n### Config\r\n\r\nExport a default object (or async function) from `prompt-rubric.config.mjs`:\r\n\r\n```js\r\nimport path from \"node:path\";\r\nimport { fileURLToPath } from \"node:url\";\r\n\r\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\r\n\r\n/** @type {import('@bstockwelldev/prompt-rubric').PromptRubricUserConfig} */\r\nexport default {\r\n  cwd: __dirname,\r\n  preset: \"tabletop-like\",\r\n  secondaryRoots: {\r\n    boardGameSim: path.resolve(__dirname, \"..\", \"board-game-sim-ai\"),\r\n  },\r\n  paths: {\r\n    reviews: \"docs/llm-prompts-matrix-reviews.json\",\r\n    scores: \"docs/llm-prompts-quality-scores.json\",\r\n    scoresMarkdown: \"docs/llm-prompts-quality-scores.md\",\r\n  },\r\n  render: {\r\n    hubLinks: {\r\n      rubric: \"./prompt-quality-rubric.md\",\r\n      matrix: \"./llm-prompts-matrix.md\",\r\n      scoresJson: \"./llm-prompts-quality-scores.json\",\r\n      reviewsJson: \"./llm-prompts-matrix-reviews.json\",\r\n      promptManagement: \"./guides/prompt-management.md\",\r\n    },\r\n  },\r\n};\r\n```\r\n\r\nPresets:\r\n\r\n- **`tabletop-like`** — discovers `src/ai/prompts/*.prompt.ts`, `src/prompts/registry.json`, smart-import `promptConfig.ts` question steps.\r\n- **`board-game-sim-like`** — discovers `apps/web/features/board-game-sim/data/prompts/*.ts` exports.\r\n\r\nOverride repo slugs with `repoSlugs: { tabletop: 'tabletop-studio', boardGameSim: 'board-game-sim-ai' }`.\r\n\r\n## Programmatic API\r\n\r\n```ts\r\nimport {\r\n  qualityScoresDocumentSchema,\r\n  computeMeanAndBand,\r\n  DEFAULT_RUBRIC_VERSION,\r\n  DIMENSION_KEYS,\r\n} from \"@bstockwelldev/prompt-rubric\";\r\n```\r\n\r\n## Non-goals\r\n\r\n- No required OpenAI/Anthropic SDK; `judge` uses **`fetch`** only.\r\n- Heuristic `score-suggest` is **non-authoritative**; use `check` for schema + alignment.\r\n\r\n## License\r\n\r\nMIT — see [LICENSE](./LICENSE).\r\n","readmeFilename":"README.md","_rev":"1-4d4115a089f8e572864a5fea3da3c97a"}