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

agent-miniprogram

v0.1.0

Published

CLI tool for AI-driven WeChat miniprogram automation testing

Readme

Agent Miniprogram

A CLI tool for AI-driven WeChat miniprogram automation testing. Designed for use with AI agents like Claude Code.

Inspired by Agent Browser (ref system, token-efficient snapshots) and Agent Device (daemon architecture, SKILL.md, .amp recordings).

Install

npm install -g agent-miniprogram

Prerequisites

  1. WeChat Developer Tools installed
  2. In Developer Tools: Settings → Security → Enable CLI/HTTP calls
  3. Node.js 18+

Quick Start

# Start the daemon
agent-mp daemon

# Launch DevTools and connect
agent-mp launch /path/to/miniprogram

# Get snapshot (ref-annotated WXML tree)
agent-mp snapshot

# Tap an element by ref
agent-mp tap @e5

# Type into an input
agent-mp input @e3 "13800138000"

Snapshot Format

agent-mp snapshot outputs a compact, ref-annotated tree (~200-400 tokens):

Page: /pages/index/index

[view @e1]
  [image @e2] src="/img/logo.png"
  [text @e3] "欢迎登录"
[form @e4]
  [input @e5] placeholder="手机号" (bindinput=onPhoneInput)
  [input @e6] type="password" placeholder="密码" (bindinput=onPasswordInput)
  [button @e7] "登录" (bindtap=onLogin)
[navigator @e8] → /pages/register/index "注册账号"
  • @eN refs are assigned per snapshot call and persist in ~/.agent-miniprogram/refs.json
  • Only semantically meaningful nodes are shown (text, events, attributes)
  • Pure layout containers are folded

Commands

See skills/agent-miniprogram/SKILL.md for the full reference.

| Command | Description | |---------|-------------| | launch <path> | Launch DevTools and connect | | connect | Connect to running DevTools | | close | Close connection | | status | Show daemon status | | snapshot [--data] | WXML tree with refs | | screenshot | Take screenshot | | navigate <url> | Navigate to page | | back | Go back | | tap <ref> | Tap element | | input <ref> <text> | Type text | | scroll <ref> | Scroll element | | long-press <ref> | Long press | | swipe <ref> <dir> | Swipe gesture | | wait <ref\|ms> | Wait for element or time | | data [path] | Read page.data | | eval <code> | Run JS in AppService | | mock <api> <json> | Mock wx.* API | | diff snapshot | Diff vs last snapshot | | record start/stop | Record interactions | | replay <file.amp> | Replay recording |

Claude Code Integration

Copy or symlink skills/agent-miniprogram/SKILL.md to your Claude Code skills directory, or reference it in your project's CLAUDE.md.

Development

agent-mp <command>
    │
    ▼ HTTP POST /rpc (localhost:9430)
┌─────────────────────────┐
│   Daemon (Node.js)       │  ~/.agent-miniprogram/daemon.json
│   - session state        │  ~/.agent-miniprogram/refs.json
│   - ref registry         │
└─────────┬───────────────┘
          │ WebSocket
          ▼
  微信开发者工具 (miniprogram-automator)
          │
          ▼
    小程序(模拟器)
git clone https://github.com/michaelneale/agent-miniprogram
cd agent-miniprogram
npm install

# Start daemon (dev mode)
npm run daemon
# or
npx tsx src/daemon/server.ts

# Run tests
npm test

File Paths

  • ~/.agent-miniprogram/daemon.json — daemon runtime state
  • ~/.agent-miniprogram/refs.json — element ref registry
  • ~/.agent-miniprogram/last-snapshot.txt — last snapshot (for diff)
  • ~/.agent-miniprogram/screenshot.png — default screenshot path