跳到正文
cccskills
免费在 GitHub 公开

testing

TDD and testing skills for iOS/macOS apps. Covers characterization tests, TDD workflows, test contracts, snapshot tests, test infrastructure, and deterministic quality gates (fitness functions, coverage ratchet, mutation testing). Use for test-driven development, adding tests to existing code, or building test infrastructure.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(20)

  • SKILL.md4.5 KB
  • characterization-test-generator/SKILL.md7.7 KB
  • coverage-ratchet/SKILL.md4.3 KB
  • coverage-ratchet/templates/coverage-gate.sh3.9 KB
  • coverage-ratchet/templates/crap-report.sh3.0 KB
  • fitness-functions/SKILL.md8.0 KB
  • fitness-functions/templates/ContractPinTests.swift2.3 KB
  • fitness-functions/templates/ImportBoundaryTests.swift4.6 KB
  • fitness-functions/templates/NetworkSentinelTests.swift2.6 KB
  • flow-walkthrough/SKILL.md9.1 KB
  • integration-test-scaffold/SKILL.md13.0 KB
  • mutation-testing/SKILL.md4.3 KB
  • mutation-testing/templates/muter.conf.yml678 B
  • snapshot-test-setup/SKILL.md11.1 KB
  • tdd-bug-fix/SKILL.md7.2 KB
  • tdd-feature/rules/swiftlint.yml527 B
  • tdd-feature/SKILL.md9.3 KB
  • tdd-refactor-guard/SKILL.md7.0 KB
  • test-contract/SKILL.md7.9 KB
  • test-data-factory/SKILL.md9.4 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Testing & TDD Skills

Test-driven development workflows and testing infrastructure for Apple platform apps. Works with both new and existing codebases.

When This Skill Activates

Use this skill when the user:

  • Wants to do TDD (test-driven development) with AI-generated code
  • Needs to add tests before refactoring existing code
  • Wants to fix a bug using the red-green-refactor cycle
  • Needs test infrastructure (factories, mocks, contracts)
  • Asks about snapshot/visual regression testing
  • Wants to ensure AI-generated code is correct via tests
  • Wants deterministic gates around agent-written code (architecture invariants, coverage floors, mutation audits)

Available Skills

For Existing Codebases

characterization-test-generator/ Capture current behavior of existing code before refactoring. Generates tests that document what code actually does (not what it should do), giving you a safety net for AI-assisted refactoring.

tdd-bug-fix/ Reproduce-first bug fix workflow. Write a failing test that demonstrates the bug, then fix it. Ensures the bug never regresses — critical when AI generates fixes.

tdd-refactor-guard/ Pre-refactor safety checklist. Verifies test coverage exists before allowing AI to touch existing code. Prevents the "refactor without a safety net" problem.

For New Code

tdd-feature/ Red-green-refactor scaffold for new features. Generates the failing test first, then guides implementation to make it pass, then refactors. The core TDD workflow.

test-contract/ Protocol/interface test suites. Define the contract (e.g., "any DataStore must handle empty state, single item, 100 items, and errors"), and it generates a test suite any implementation must pass.

Infrastructure

snapshot-test-setup/ SwiftUI visual regression testing using swift-snapshot-testing. Generates snapshot test boilerplate, configuration, and CI integration.

test-data-factory/ Test fixture factories for your models. Makes writing tests faster by eliminating boilerplate data setup. Supports Builder pattern and static factory methods.

integration-test-scaffold/ Cross-module test harness with mock servers, in-memory stores, and test configuration. For testing networking + persistence + business logic together.

flow-walkthrough/ Drive each user flow in the Simulator (XCUITest + per-step screenshots), audit the navigation graph for dead-ends, and run a human discoverability check.

Deterministic Gates

fitness-functions/ Architecture fitness functions — tests that enforce a project's hard rules (module import boundaries, offline guarantees, count/copy contracts) from inside its own test target. Turns prose constraints into exit codes.

coverage-ratchet/ Coverage floor that only rises: a committed baseline the app target's line coverage may never drop below, gated by a generated xccov script. Includes an advisory CRAP report (complexity × uncovered).

mutation-testing/ EXPERIMENTAL, advisory-only muter setup scoped to engine targets — surviving mutants reveal covered-but-unasserted code. Never a merge gate; includes the manual deliberate-break fallback.

How to Use

  1. Identify whether user is working on new code or existing code
  2. Read the relevant skill's SKILL.md for detailed workflow
  3. Detect project context (testing framework, architecture, existing tests)
  4. Generate tests following the skill's workflow
  5. Verify tests compile and run

Relationship to test-generator

The generators/test-generator/ skill generates test boilerplate (unit, integration, UI tests). These testing skills are complementary — they focus on workflows and methodology (TDD cycle, characterization testing, contracts) rather than just test file generation.

Cross-reference:

  • Use test-generator for "add tests to this class"
  • Use testing/tdd-feature for "I want to TDD this new feature"
  • Use testing/characterization-test-generator for "I need to safely refactor this"
  • Use testing/tdd-bug-fix for "fix this bug and make sure it never comes back"

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Run a structured accessibility audit on an iOS/macOS app — automated XCUITest audits, Accessibility Inspector, manual VoiceOver/Dynamic Type passes, and App Store Accessibility Nutrition Label evaluation. Use before release, when preparing Nutrition Label declarations, or for EU Accessibility Act compliance.

中文简介正在准备中。当前显示原文说明。

rshankras/claude-code-apple-skills8112026年7月24日 更新

Generate accessibility infrastructure for VoiceOver, Dynamic Type, and accessibility features. Use when improving app accessibility, adding accessibility labels and hints, or auditing compliance.

中文简介正在准备中。当前显示原文说明。

rshankras/claude-code-apple-skills8112026年7月24日 更新

Generates an Apple-compliant account deletion flow with multi-step confirmation UI, optional data export, configurable grace period, Keychain cleanup, and server-side deletion request. Use when user needs account deletion, right-to-delete, or Apple App Review compliance for account removal.

中文简介正在准备中。当前显示原文说明。

rshankras/claude-code-apple-skills8112026年7月24日 更新

Privacy-preserving ad measurement with AdAttributionKit (SKAdNetwork's successor) — install and re-engagement attribution, conversion-value strategy under crowd anonymity, and end-to-end postback testing. Use when running paid acquisition beyond Apple Ads, measuring re-engagement campaigns, designing conversion values, or migrating from SKAdNetwork.

中文简介正在准备中。当前显示原文说明。

rshankras/claude-code-apple-skills8112026年7月24日 更新

alarmkit

免费

AlarmKit integration for scheduling alarms and timers with custom UI, Live Activities, and snooze support. Use when implementing alarm or timer features in iOS 26+ apps.

中文简介正在准备中。当前显示原文说明。

rshankras/claude-code-apple-skills8112026年7月24日 更新

Interpret app metrics and make data-driven decisions. Covers DAU/MAU, retention, LTV, ARPU, App Store Connect analytics, AARRR funnel analysis, cohort analysis, and diagnostic decision trees. Use when user wants to understand their metrics, diagnose problems, or build a data-driven growth plan.

中文简介正在准备中。当前显示原文说明。

rshankras/claude-code-apple-skills8112026年7月24日 更新

查看 rshankras 的全部技能

报告此技能的问题