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

mm_work

v1.0.3

Published

工作模块,描述工作规范与工作流配置,基于 mm_mod 生命周期,无全局对象与原型扩展依赖

Readme

mm_work 工作模块

就是给 AI 的提示:工作时该做什么,不该做什么,该怎么做。同时负责读取 work.json(工作流 JSON)并解析其中的文件引用。

rule 规范

规范提示词(AI的行为约束),就是告诉AI该做什么,不该做什么。

method 方法

方法提示词(AI的行为方式),就是告诉AI该怎么做。

trick 技巧

技巧提示词(AI的技巧方式),告诉AI如何能更高效地解决问题。

安装与引用

npm install mm_work
const { Work, WorkManager, workAdmin } = require('mm_work');

快速使用

const { Manager } = require('mm_work');

const manager = new Manager({ dir: './ai/work' });

// 目录加载:每个子目录一个 work.json
await manager.load('./ai/work');

const work = manager.getMod('develop');
work.setPrompt('# 开发规范\n- 先读代码再改代码');
console.log(work.getPrompt());
console.log(work.getWorkflow());
// 手动登记
const work = await manager.create({ name: 'develop', title: '开发工作' });

工作结构

work-name/
├── work.json    # 工作配置(含 steps 工作流定义)
└── work.md      # 工作规范提示词(可缺失,缺失时读取为空串)

主要接口

| 接口 | 说明 | | --- | --- | | manager.add(config) | 登记工作,不初始化 | | manager.create(config) | 登记并初始化工作 | | manager.load(dir) | 扫描目录加载全部工作 | | manager.del(name) | 释放并注销工作 | | manager.reload(name) | 重新读取配置文件 | | manager.runAll('init', eventer, logger) | 批量初始化并注入事件与日志 | | work.getPromptFile() | 获取 work.md 绝对路径 | | work.getPrompt() | 读取工作内容 | | work.setPrompt(prompt) | 写入工作内容 | | work.getSystemPrompt() | 获取工作流运行时注入的系统提示词 | | work.getWorkflow() | 读取并解析工作流 JSON | | work.run(input, meta) | 交由父级服务的 runWork 执行工作流 | | work.getDetail() | 获取工作详情 |

工作流文件引用

steps[].params.system_prompt 支持 @file:xxx.md 形式,读取时会转换为文件内容,并对 {{ }} 做转义,避免被工作流引擎当作模板渲染。

依赖

  • mm_mod:生命周期基类与管理器
  • mm_corejs:Admin 工厂
  • 原生 fs / path:替代 .fullname()/.addDir()/.saveText()/.loadText() 等原型扩展

测试

npm test