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

@stone087641/tdd-spec

v0.2.0

Published

AI-driven Test-Driven Development framework

Readme

TDD-Spec

AI 驱动的测试驱动开发框架

概述

TDD-Spec 是一个结构化的测试技能框架,通过四阶段流程帮助 AI Agent 系统化地完成从分析到执行到评估的测试全流程。

设计哲学

  1. 测试左移:在需求阶段就开始思考测试
  2. 上下文连续:每个阶段产物自动流入下一阶段
  3. 分层验证:单元 → 接口 → 集成 → E2E 逐层递进
  4. 智能推荐:AI 分析代码变更自动推荐测试点
  5. 闭环反馈:测试结果驱动回归和质量度量
  6. 迭代友好:测试设计可反复精炼,而非一次性产出

快速开始

安装

npm install -g @tdd-spec/cli

初始化

cd your-project
tdd init

工作流程

Init (一次性)     Step A         Step B         Step C
架构分析    →   范围分析    →   测试设计    →   执行评估
                  (可重复)        (可迭代)        (可迭代)

命令

初始化

tdd init                    # 初始化 TDD-Spec
tdd init --force            # 强制重新初始化

Step A: 范围分析

tdd scope                   # 分析需求或变更
tdd scope --story STORY-123 # 指定 Story ID
tdd scope --diff diff.txt   # 分析代码变更

Step B: 测试设计

tdd design                  # 设计测试用例
tdd design --refine         # 基于上次结果迭代

Step C: 执行评估

tdd run                     # 执行测试并评估
tdd run --level unit        # 只执行单元测试
tdd run --case TC-0101      # 只执行指定用例

迭代闭环

tdd iterate                 # B ⇄ C 迭代直到质量门通过
tdd iterate --max-iterations 10  # 最大迭代次数

目录结构

.tdd-spec/
├── config.yaml              # 项目配置
├── context/                 # 长期上下文
│   └── arch.md              # 架构上下文
├── analysis/                # 分析产物
│   └── scope-{ts}.md        # 范围分析
├── design/                  # 测试设计
│   └── cases.md             # 测试用例
└── execution/               # 执行产物
    └── report.md            # 执行报告

测试设计维度

| 功能类型 | 自动应用的测试维度 | |---------|-----------------| | CRUD | 正向 + 参数校验 + 权限 + 数据一致性 | | 状态机 | 状态迁移 + 非法流转 + 并发竞态 + 超时处理 | | 外部集成 | 正常响应 + 超时 + 错误码 + 幂等 + 重试 | | 查询 | 正常查询 + 空结果 + 分页边界 + 排序 + 权限 | | 计算 | 正确性 + 精度边界 + 溢出 + 精度丢失 | | 文件处理 | 格式校验 + 大小限制 + 类型校验 + 并发写入 |

Agent Skills

TDD-Spec 提供以下 Agent Skills:

  • tdd-init - 项目初始化和架构分析
  • tdd-scope - 需求和变更分析 (Step A)
  • tdd-design - 测试设计 (Step B)
  • tdd-run - 执行和评估 (Step C)
  • tdd-iterate - 迭代闭环 (B ⇄ C)

开发

# 安装依赖
pnpm install

# 构建
pnpm run build

# 测试
pnpm test

# 开发模式
pnpm run dev

许可证

MIT