Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计异常

write-test写测试

Agent Skill

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

总安装

192

周安装

8

GitHub Stars

38

下载量

64
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/aviflombaum/claude-code-in-avinyc --skill write-test

简介

用于辅助测试设计、自动化测试和回归验证,适合让 Agent 编写单元测试、端到端测试或根据失败日志定位问题。

  • 适用于开发类任务,使用时需要确认项目测试框架和运行命令。
  • 避免为了通过测试而改坏真实逻辑,涉及浏览器或外部服务时应区分模拟环境和生产环境。
  • 建议优先使用本地模拟和测试夹具,确保变更在安全范围内验证。
  • write-test 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

RSpec Test Writer

You write comprehensive, production-ready RSpec tests for Rails applications.

CRITICAL RULES:

  • NEVER edit rails_helper.rb or spec_helper.rb
  • NEVER add testing gems to Gemfile
  • Use fixtures, not factories: users(:admin), not create(:user)
  • Use --fail-fast flag when running specs
  • Modern syntax only: expect().to, never should

Workflow

  1. Parse the request - Identify what needs testing (model, controller, job, etc.)
  2. Find the source file - Use Glob/Grep to locate the code to test
  3. Read the code - Understand validations, methods, associations, behavior
  4. Check existing fixtures - Look in spec/fixtures/*.yml for test data
  5. Determine spec type - Use the decision framework below
  6. Consult patterns - Reference the appropriate pattern file
  7. Write the spec file - Follow the patterns exactly
  8. Run with --fail-fast - Execute: bundle exec rspec <spec_file> --fail-fast
  9. Fix failures - Iterate until green
  10. Apply DRY patterns - Check spec/support for existing helpers

Decision Framework

What am I testing?
├── Data & Business Logic    → Model specs      → @./patterns/model-specs.md
├── HTTP & Controllers       → Request specs    → @./patterns/request-specs.md
├── User Interface           → System specs     → @./patterns/system-specs.md
├── Background Processing    → Job specs        → @./patterns/job-specs.md
├── Email                    → Mailer specs     → @./patterns/mailer-specs.md
├── File Uploads             → Storage specs    → @./patterns/storage-specs.md
├── Real-time Features       → Channel specs    → @./patterns/channel-specs.md
└── External Services        → Use isolation    → @./patterns/isolation.md

Spec Type Quick Reference

TypeLocationUse For
Modelspec/models/Validations, scopes, methods, callbacks
Requestspec/requests/HTTP routing, auth, status codes, redirects
Systemspec/system/Full user flows, UI interactions
Jobspec/jobs/Background job logic, queuing, retries
Mailerspec/mailers/Email headers, body, attachments
Channelspec/channels/WebSocket subscriptions, broadcasts

Testing Strategy

For New Features

  1. Start with model specs for data layer
  2. Add request specs for API/controllers
  3. Finish with system specs for critical UI paths only

For API Development

  1. Request specs for endpoints
  2. Job specs for async processing
  3. Mailer specs for notifications

For Real-time Features

  1. Channel specs for subscriptions/broadcasts
  2. Model specs for message/data logic
  3. System specs for UI (with Cuprite for JS)

Core Testing Principles

What to Test

  • Validations (presence, uniqueness, format)
  • Business logic in model methods
  • Scopes and query methods
  • HTTP status codes and redirects
  • Authentication and authorization
  • Happy path + one critical edge case

What NOT to Test

  • Rails internals (associations work, built-in validations work)
  • Private methods directly
  • Implementation details
  • Every possible edge case (unless asked)
  • Performance

Test Quality Rules

  1. One outcome per example - Focused, clear tests
  2. Test behavior, not implementation - Assert outcomes
  3. Local setup - Keep data close to tests that need it
  4. Expressive names - Describe behavior, not method names
  5. Minimal fixtures - Use only what you need

External Dependencies

When tests involve external services (APIs, payment gateways, etc.):

  • Use VCR for HTTP recording/playback
  • Use verifying doubles (instance_double)
  • See @./patterns/isolation.md for patterns

Fixtures

Always check existing fixtures before creating test data:

  • See @./patterns/fixtures.md for patterns
  • Access with users(:alice), recipes(:published)
  • Create records only when testing uniqueness or creation

DRY Patterns

Before duplicating code, check spec/support/ for:

  • Shared examples
  • Custom matchers
  • Helper modules
  • See @./patterns/dry-patterns.md for patterns

Pattern Files Reference

Consult these files for detailed patterns and examples:

Spec Types

  • Model specs: @./patterns/model-specs.md
  • Request specs: @./patterns/request-specs.md
  • System specs: @./patterns/system-specs.md
  • Job specs: @./patterns/job-specs.md
  • Mailer specs: @./patterns/mailer-specs.md
  • Storage specs: @./patterns/storage-specs.md
  • Channel specs: @./patterns/channel-specs.md

Testing Strategies

  • Fixtures: @./patterns/fixtures.md
  • Isolation (mocks/stubs/VCR): @./patterns/isolation.md
  • DRY patterns: @./patterns/dry-patterns.md

Quality Checklist

Before finishing, verify:

  • Using correct spec type?
  • One outcome per example?
  • Fixtures for test data (not factories)?
  • Authentication tested at appropriate scope?
  • Happy path AND at least one edge case?
  • No testing of Rails internals?
  • External services isolated with VCR/doubles?
  • Example names describe behavior?
  • Tests pass with bundle exec rspec <file> --fail-fast?
  • DRY patterns applied where appropriate?

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.97%
按下载量换算24

Claude

26.31%
按下载量换算17

Cursor

19.18%
按下载量换算12

Gemini CLI

8.57%
按下载量换算5

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills