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

@af-mobile/prompt

v2.0.3

Published

af-mobile UI System Prompt builder — modular (role + whitelist + component API + few-shot + model)

Readme

@af-mobile/prompt

af-mobile UI 的 Prompt 即 API 薄入口。将 af-mobile UI 分层设计体系(角色 / 白名单 / 组件 API / few-shot / 模型)编译成一份可用的 System Prompt。

安装

npm i @af-mobile/prompt

用法

import { buildPrompt } from '@af-mobile/prompt';

// 按需求裁剪 few-shot;返回完整的 System Prompt 字符串(含白名单 + 组件 API + 精选 few-shot)
const system = buildPrompt({ userPrompt: '商品列表页带图,支持搜索' });

CLI(MCP 不可达时的降级入口)

npx @af-mobile/prompt "商品列表页带图"        # 按需求裁剪,输出到 stdout
npx @af-mobile/prompt "需求" --full           # 全量 prompt
npx @af-mobile/prompt "需求" -o prompt.md     # 写入文件

与 MCP get_prompt 工具同构,适合未接入 MCP 的 Agent / 脚本环境。

API

| 导出 | 说明 | |---|---| | buildPrompt({ userPrompt, components, categories, projectRecipes, model, theme }?) | 主入口;按 userPrompt(或显式 categories)裁剪 few-shot,返回 System Prompt 字符串 | | pickCategories | 按需求关键词分派到相关 few-shot 类别 | | filterFewshots | 裁剪最相关的 few-shot 样本 | | buildWhitelistSection | 生成白名单约束段落 | | buildComponentTableSection | 生成组件 API 段落 | | buildProjectExtensionSection | 生成项目扩展段落 | | extractGroupsFromCss | 从 CSS 提取 token 分组 | | extractProjectExtensions | 提取项目扩展能力 |

该包是纯函数 + 资产快照,无外部运行时依赖,Tree Shaking 友好(ESM)。 若与 MCP 一起使用,推荐直接用 @af-mobile/mcpget_prompt 工具,无需手动拼装。

资产

内部 assets(whitelist / CSS / template / models)在发布时快照进 assets/,读包内副本,不依赖编译时生成。