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

@icoderyy/yy-prd-core

v0.1.8

Published

PRD Agent Runtime core SDK.

Readme

@icoderyy/yy-prd-core

PRD Agent Runtime core SDK. It turns rough PRD text into structured analysis, clarification questions, AI-development PRDs, validation reports, and Markdown artifacts for upper-layer apps.

Install

npm install @icoderyy/yy-prd-core

Minimal Usage

import { createAISDKProvider, createPRDCore } from '@icoderyy/yy-prd-core'

const prd = createPRDCore({
  provider: createAISDKProvider({ modelId: 'deepseek:deepseek-chat' }),
})
const session = await prd.createSession({
  source: {
    type: 'markdown',
    title: 'CRM 修改主账号功能优化',
    content: rawMarkdown,
  },
})

await prd.analyze(session.id)
await prd.generateClarificationQuestions(session.id)
const devPRD = await prd.generateDevPRD(session.id, { mode: 'auto' })
const report = await prd.validate(session.id)
const markdown = await prd.export(session.id)

Runtime Boundary

This package is only the core SDK. Web, CLI, server jobs, Feishu plugins, and IDE plugins should import this package instead of duplicating PRD prompts or workflow logic.

Provider use is optional. Without a provider, built-in deterministic PRD tools still run. With a provider, analysis, clarification question generation, and final PRD generation use LLM output validated by zod schemas, then fall back to deterministic tools if the provider fails.

Artifact Contract

Core methods return values that upper-layer apps can use directly, with an attached artifact on structured steps:

const analysis = await prd.analyze(session.id)
await appDb.saveArtifact(session.id, analysis.artifact)

const questions = await prd.generateClarificationQuestions(session.id)
await appDb.saveArtifact(session.id, questions.artifact)

const exportArtifact = await prd.exportArtifact(session.id)
await appDb.saveArtifact(session.id, exportArtifact)

The SDK keeps an in-memory runtime state only. Product persistence, users, projects, history, rollback, and database writes belong to the application layer.

Grill Runtime

Use runPrdAgentTurn() when the app wants a grill-me style loop. Core decides the next action; the app renders it and persists whatever it needs.

let turn = await prd.runPrdAgentTurn({
  source: {
    type: 'markdown',
    content: rawMarkdown,
  },
})

if (turn.nextAction.type === 'ask_user') {
  renderQuestion(turn.nextAction.question, turn.nextAction.recommendedAnswer)
}

turn = await prd.runPrdAgentTurn({
  sessionId: turn.session.id,
  answer: {
    questionId: turn.nextAction.type === 'ask_user' ? turn.nextAction.question.id : '',
    value: userAnswer,
  },
})

grill mode asks one unresolved P0/P1 implementation question at a time. auto skips grilling and generates with available context. strict only asks P0 blockers.

Core Layout

  • agent: PRD agent loop and workflow boundary.
  • providers: AI SDK model adapter and provider registry.
  • config: model aliases, provider env mapping, and default model resolution.
  • tools: deterministic PRD tools such as markdown parsing, missing-item detection, scoring, rendering, and validation.
  • skills: PRD workflow skills built on top of tools.
  • mcp: MCP server config types for upper-layer integrations.
  • plugins: extension boundary for extra tools, skills, providers, and MCP servers.
  • schemas: zod schemas for structured PRD runtime outputs.