Token导航 LogoToken导航

Agent Skill · 研究检索

fake-driven-testing(假驱动测试)

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

fake-driven-testing 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为执行命令;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 37,366。

总安装 1,747周安装 70GitHub Stars 81下载 566核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:fake-driven-testing(假驱动测试)
来源仓库:https://github.com/dagster-io/erk
仓库路径:skills/fake-driven-testing
安装命令:
npx skills add https://github.com/dagster-io/erk --skill fake-driven-testing
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/dagster-io/erk --skill fake-driven-testing

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

对于快速任务:从quick-reference.md开始 为了理解:从testing-strategy.md开始 或网关架构.md 有关分步指导:使用workflows.md 有关实现细节:使用patterns.md 对于错误处理设计:检查non-ideal-states.md 将模拟转换为假货:检查mock-to-fake-conversion.md 验证:检查 anti-patterns.md 对于 Python 细节:检查 python-specific.md 每周安装量 70 存储库 达格斯特-io/erk GitHub 之星 81 第一次看到 2026 年 1 月 20 日 安全审计 Gen Agent Trust Hub 通行证 套接字通行证 斯尼克通行证

来源仓库内路径:skills/fake-driven-testing

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/dagster-io/erk --skill fake-driven-testing;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要执行命令,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

fake-driven-testing 怎么安装?

在终端执行 npx skills add https://github.com/dagster-io/erk --skill fake-driven-testing。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

fake-driven-testing 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

fake-driven-testing 需要什么权限?

权限级别是执行命令。安装流程涉及命令执行,可能通过 npx skills add https://github.com/dagster-io/erk --skill fake-driven-testing 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

fake-driven-testing 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

fake-driven-testing 用的人多吗?

公开数据是累计安装 1,747 次,近一周安装 70 次,下载 566 次,GitHub 81 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

fake-driven-testing 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要执行命令,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
fake-driven-testing

假驱动测试 · 本页

1,74781执行命令未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Fake-Driven Testing Architecture for Python

Use this skill when: Writing tests, fixing bugs, adding features, or modifying gateway layers in Python projects.

No prerequisites. This skill is self-contained. It focuses on testing architecture, not language-specific style.

Overview

This skill provides a defense-in-depth testing strategy with five layers for Python applications:

┌─────────────────────────────────────────────────┐
│  Layer 5 "smoke": Business Logic Integration Tests (5%)  │  ← Smoke tests over real system
├─────────────────────────────────────────────────┤
│  Layer 4 "logic": Business Logic Tests (70%)             │  ← Tests over fakes (MOST TESTS)
├─────────────────────────────────────────────────┤
│  Layer 3 "pure": Pure Unit Tests (10%)                   │  ← Zero dependencies, isolated testing
├─────────────────────────────────────────────────┤
│  Layer 2 "real-sanity": Integration Sanity Tests (10%)   │  ← Fast validation with mocking
├─────────────────────────────────────────────────┤
│  Layer 1 "fake-check": Fake Infrastructure Tests (5%)    │  ← Verify test doubles work
└─────────────────────────────────────────────────┘

Philosophy: Test business logic extensively over fast in-memory fakes. Use real implementations sparingly for integration validation.

Terminology note: The "gateway layer" (also called adapters/providers) refers to thin wrappers around heavyweight external APIs (databases, filesystems, HTTP APIs, message queues, etc.). The pattern matters more than the name.

Quick Decision: What Should I Read?

Adding a feature or fixing a bug? → Read quick-reference.md first, then workflows.md#adding-a-new-feature

Need to understand where to put a test? → Read testing-strategy.md

Working with Python-specific patterns? → Read python-specific.md

Adding/changing a gateway interface? → Read gateway-architecture.md, then workflows.md#adding-a-gateway-method

Wondering where the DI boundary is? → Read gateway-architecture.md#the-di-boundary-only-fake-gateways — only gateways get fakes

Need to understand non-ideal states vs exceptions? → Read non-ideal-states.md

Found tests using unittest.mock that should use fakes? → Read mock-to-fake-conversion.md

Need to implement a specific pattern (CliRunner, builders, etc.)? → Read patterns.md

Want to extend the gateway system (e.g., dry-run preview)? → Read advanced-extensions.md

Not sure if I'm doing it right? → Read anti-patterns.md

Just need a quick lookup? → Read quick-reference.md

When to Read Each Reference Document

📖 gateway-architecture.md

Read when:

  • Adding or changing gateway/ABC interfaces
  • Understanding the ABC/Real/Fake pattern
  • Need examples of gateway implementations
  • Want to understand what gateways are (and why they're thin)
  • Creating a backend (higher-level abstraction that composes gateways)

Contents:

  • What are gateway classes? (naming: gateways/adapters/providers)
  • The three core implementations (ABC, Real, Fake)
  • Code examples for each
  • When to add/change gateway methods
  • Design principles (keep gateways thin)
  • Common gateway types (Database, API, FileSystem, MessageQueue)
  • The DI boundary — only gateways get fakes

📖 non-ideal-states.md

Read when:

  • Designing return types for gateway operations that can fail
  • Deciding between exceptions and discriminated unions
  • Implementing error injection in fakes
  • Understanding error boundaries (where try/except belongs)

Contents:

  • Non-ideal states vs exceptions (the core distinction)
  • Decision framework for choosing between them
  • How this shapes gateway signatures and fake design
  • Error boundaries (try/except only in Real implementations)
  • Three test categories per discriminated union operation
  • The tracking-on-error decision
  • isinstance() for type narrowing (never truthiness)

📖 mock-to-fake-conversion.md

Read when:

  • Tests use unittest.mock.patch or @patch decorators
  • An agent wrote tests with mocks instead of gateway fakes
  • Converting existing mock-based tests to the gateway pattern

Contents:

  • Step-by-step conversion workflow (audit, find/create gateway, inject, rewrite)
  • "subprocess.run is never the right gateway boundary"
  • Monkeypatch decision tree (when it's still OK)
  • Common pitfalls (wrong abstraction level, subprocess-level gateways)

📖 testing-strategy.md

Read when:

  • Deciding where to put a test
  • Understanding the five testing layers
  • Need test distribution guidance (5/70/10/10/5 rule)
  • Want to know which layer tests what

Contents:

  • Layer 1 "fake-check": Unit tests of fakes (verify test infrastructure)
  • Layer 2 "real-sanity": Integration sanity tests with mocking (quick validation)
  • Layer 3 "pure": Pure unit tests (zero dependencies, isolated testing)
  • Layer 4 "logic": Business logic over fakes (majority of tests)
  • Layer 5 "smoke": Business logic integration tests (smoke tests over real systems)
  • Decision tree: where should my test go?
  • Test distribution examples

📖 python-specific.md

Read when:

  • Working with pytest fixtures
  • Need Python mocking patterns
  • Testing Flask/FastAPI/Django applications
  • Understanding Python testing tools
  • Need Python-specific commands

Contents:

  • pytest fixtures and parametrization
  • Mocking with unittest.mock and pytest-mock
  • Testing web frameworks (Flask, FastAPI, Django)
  • Python testing commands
  • Type hints in tests
  • Python packaging for test utilities

📖 workflows.md

Read when:

  • Adding a new feature (step-by-step)
  • Fixing a bug (step-by-step)
  • Adding a gateway method (complete checklist)
  • Changing an interface (what to update)
  • Managing dry-run features

Contents:

  • Adding a new feature (TDD workflow)
  • Fixing a bug (reproduce → fix → regression test)
  • Adding a gateway method (8-step checklist with examples)
  • Changing an interface (update all layers)
  • Managing dry-run features (wrapping pattern)
  • Testing with builder patterns

📖 patterns.md

Read when:

  • Implementing constructor injection for fakes
  • Adding mutation tracking to fakes
  • Using CliRunner for CLI tests
  • Building complex test scenarios with builders
  • Testing dry-run behavior
  • Need code examples of specific patterns

Contents:

  • Constructor injection (how and why)
  • Mutation tracking properties (read-only access)
  • Using CliRunner (not subprocess)
  • Builder patterns for complex scenarios
  • Simulated environment pattern
  • Error injection pattern
  • Dry-run testing pattern

📖 anti-patterns.md

Read when:

  • Unsure if your approach is correct
  • Want to avoid common mistakes
  • Reviewing code for bad patterns
  • Debugging why tests are slow/brittle

Contents:

  • ❌ Testing speculative features
  • ❌ Hardcoded paths in tests (catastrophic)
  • ❌ Not updating all layers
  • ❌ Using subprocess in unit tests
  • ❌ Complex logic in gateway classes
  • ❌ Fakes with I/O operations
  • ❌ Testing implementation details
  • ❌ Incomplete test coverage for gateways

📖 quick-reference.md

Read when:

  • Quick lookup for file locations
  • Finding example tests to reference
  • Looking up common fixtures
  • Need command reference
  • Want test distribution guidelines

Contents:

  • Decision tree (where to add test)
  • File location map (source + tests)
  • Common fixtures (tmp_path, CliRunner, etc.)
  • Common test patterns (code snippets)
  • Example tests to reference
  • Useful commands (pytest, ty, etc.)
  • Quick checklist for adding gateway methods

Quick Navigation by Task

I'm adding a new feature

  1. Quick start: quick-reference.md → Decision tree
  2. Step-by-step: workflows.md#adding-a-new-feature
  3. Patterns: patterns.md (CliRunner, builders)
  4. Avoid: anti-patterns.md (speculative tests, hardcoded paths)

I'm fixing a bug

  1. Step-by-step: workflows.md#fixing-a-bug
  2. Patterns: patterns.md#constructor-injection-for-fakes
  3. Examples: quick-reference.md#example-tests-to-reference

I'm adding/changing a gateway method

  1. Understanding: gateway-architecture.md
  2. Step-by-step: workflows.md#adding-a-gateway-method
  3. Checklist: quick-reference.md#quick-checklist-adding-a-new-gateway-method
  4. Avoid: anti-patterns.md#not-updating-all-layers

I don't know where my test should go

  1. Decision tree: quick-reference.md#decision-tree
  2. Detailed guide: testing-strategy.md
  3. Examples: quick-reference.md#example-tests-to-reference

I need to implement a pattern

  1. All patterns: patterns.md
  2. Examples: quick-reference.md#common-test-patterns

I think I'm doing something wrong

  1. Anti-patterns: anti-patterns.md
  2. Correct approach: workflows.md

Visual Layer Guide

┌──────────────────────────────────────────────────────────────┐
│ Layer 5 "smoke": Business Logic Integration Tests (5%)       │
│ ┌──────────────────────────────────────────────────────────┐ │
│ │ Real database, filesystem, APIs, actual subprocess        │ │
│ │ Purpose: Smoke tests, catch integration issues           │ │
│ │ When: Sparingly, for critical workflows                  │ │
│ │ Speed: Seconds per test                                   │ │
│ │ Location: tests/e2e/ or tests/integration/               │ │
│ └──────────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────┐
│ Layer 4 "logic": Business Logic Tests (70%) ← MOST TESTS    │
│ ┌──────────────────────────────────────────────────────────┐ │
│ │ FakeDatabase, FakeApiClient, FakeFileSystem              │ │
│ │ Purpose: Test features and business logic extensively    │ │
│ │ When: For EVERY feature and bug fix                      │ │
│ │ Speed: Milliseconds per test                              │ │
│ │ Location: tests/unit/, tests/services/, tests/commands/  │ │
│ └──────────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────┐
│ Layer 3 "pure": Pure Unit Tests (10%)                        │
│ ┌──────────────────────────────────────────────────────────┐ │
│ │ Zero dependencies, no fakes, no mocks                    │ │
│ │ Purpose: Test isolated utilities and helpers             │ │
│ │ When: For pure functions, data structures, parsers       │ │
│ │ Speed: Milliseconds per test                              │ │
│ │ Location: tests/unit/                                     │ │
│ └──────────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────┐
│ Layer 2 "real-sanity": Integration Sanity Tests (10%)        │
│ ┌──────────────────────────────────────────────────────────┐ │
│ │ RealDatabase with mocked connections                     │ │
│ │ Purpose: Quick validation, catch syntax errors           │ │
│ │ When: When adding/changing real implementation           │ │
│ │ Speed: Fast (mocked)                                      │ │
│ │ Location: tests/integration/test_real_*.py               │ │
│ └──────────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────┐
│ Layer 1 "fake-check": Fake Infrastructure Tests (5%)         │
│ ┌──────────────────────────────────────────────────────────┐ │
│ │ Test FakeDatabase itself                                 │ │
│ │ Purpose: Verify test infrastructure is reliable          │ │
│ │ When: When adding/changing fake implementation           │ │
│ │ Speed: Milliseconds per test                              │ │
│ │ Location: tests/unit/fakes/test_fake_*.py               │ │
│ └──────────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────┘

Key Principles

  1. Thin gateway layer: Wrap external state, push complexity to business logic
  2. Fast tests over fakes: 70% of tests should use in-memory fakes
  3. Defense in depth: Fakes → sanity tests → pure unit → business logic → integration
  4. Test what you're building: No speculative tests, only active work
  5. Update all layers: When changing interfaces, update ABC/Real/Fake
  6. The DI boundary: Only gateways get fakes; everything above them is tested with real logic and fake gateways

Layer Selection Guide

Distinguishing Layer 3 "pure" from Layer 4 "logic":

  • Layer 3 "pure" (Pure Unit Tests): ZERO dependencies - no fakes, no mocks, no external state

- Testing string utilities: sanitize_branch_name("feat/FOO") → "feat-foo" - Testing parsers: parse_git_status("## main") → {"branch": "main"} - Testing data structures: LinkedList.append() without any external dependencies

  • Layer 4 "logic" (Business Logic Tests): Uses fakes for external dependencies

- Testing commands: create_worktree(fake_git, name="feature") - Testing workflows: submit_pr(fake_gh, fake_git,...) - Testing business logic that coordinates multiple integrations

**If your test imports a Fake*, it belongs in Layer 4 "logic", not Layer 3 "pure".**

Default Testing Strategy

When in doubt:

  • Write test over fakes (Layer 4 "logic") for business logic
  • Write pure unit test (Layer 3 "pure") for utilities/helpers with no dependencies
  • Use pytest with fixtures
  • Use tmp_path fixture (not hardcoded paths)
  • Follow examples in quick-reference.md

Summary

For quick tasks: Start with quick-reference.md

For understanding: Start with testing-strategy.md or gateway-architecture.md

For step-by-step guidance: Use workflows.md

For implementation details: Use patterns.md

For error handling design: Check non-ideal-states.md

For converting mocks to fakes: Check mock-to-fake-conversion.md

For validation: Check anti-patterns.md

For Python specifics: Check python-specific.md

平台分布

Codex

34.76%
按下载量换算197

Claude

33.76%
按下载量换算191

Cursor

18.83%
按下载量换算107

Gemini CLI

10.39%
按下载量换算59

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/dagster-io/erk --skill fake-driven-testing 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills