test-spec

test-spec is a skill for Claude Code from rshankras/claude-code-apple-skills. It costs 40 tokens per session (11,767 once invoked), scanned B, original, MIT.

A test specification and quality-assurance plan for iOS and macOS apps, based on product and implementation requirements.

In plain words
What is it for?
Use it to plan unit tests, UI tests, accessibility checks, manual testing, and beta testing.
Why use it?
It turns requirements into clear test cases and helps uncover edge cases before users do.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool; positional $N argument.

Part of the apple-skills plugin — 147 skills shipped together , and of apple-skills

Good fit Use it to plan unit tests, UI tests, accessibility checks, manual testing, and beta testing.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rshankras/claude-code-apple-skills/test-spec
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add rshankras/claude-code-apple-skills --skill test-spec
Clone the repo
git clone --depth 1 https://github.com/rshankras/claude-code-apple-skills

Made for: Claude Code.

Or install apple-skills, the plugin that ships this one along with the rest of its 147 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for test-spec

README.md
[![agentmods](https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/test-spec.svg)](https://agentmods.dev/skills/rshankras/claude-code-apple-skills/test-spec)
Your own site
<a href="https://agentmods.dev/skills/rshankras/claude-code-apple-skills/test-spec"><img src="https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/test-spec.svg" alt="Measured on agentmods" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 11,767 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Output Handling · line 737
    Output size or generation rate is not bounded. Unbounded output enables denial-of-service through resource exhaustion, log flooding, or context-window stuffing.
    Fix: Set explicit limits on output length, generation count, and rate. Use max_tokens and truncation to prevent unbounded output.
  • medium Privilege Escalation · line 1004
    Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
    Fix: Avoid sudo/root unless strictly required. Prefer least-privilege patterns. If elevation is needed, document the justification and scope.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00040 $0.11767
Opus 5 $0.00020 $0.05883
Sonnet 5 $0.00008 $0.02353
Haiku 4.5 $0.00004 $0.01177

Measured 4d ago against content hash a55c05c78b05, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade B, and why

test-spec scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

run: sudo xcode-select -s /Applications/Xcode_15.0.app
skills/product/test-spec/SKILL.md · 1,514 lines

How it starts

The opening of the file, as written. The whole thing — 1,514 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Test Specification Skill

Generate comprehensive test specification and QA plan for iOS/macOS app testing.

Metadata

  • Name: test-spec
  • Version: 1.0.0
  • Role: QA Engineer
  • Author: ProductAgent Team

When This Skill Activates

This skill activates when the user says:

  • "generate test spec"
  • "create QA plan"
  • "write testing guide"
  • "generate test cases"
  • "create test specification"

Description

You are a QA Engineer AI agent specializing in iOS/macOS app testing. Your job is to transform product requirements and implementation details into a comprehensive test specification that ensures quality, identifies edge cases, and provides clear test cases for both automated and manual testing.

Prerequisites

Before activating this skill, ensure:

  1. PRD exists (from prd-generator skill) with features and acceptance criteria
  2. IMPLEMENTATION_GUIDE exists (from implementation-guide skill) with code structure
  3. UX_SPEC exists (from ux-spec skill) for UI testing scenarios

Input Sources

Read and extract information from:

  1. docs/PRD.md

    • All features with acceptance criteria
    • User stories (Given/When/Then format)
    • Success criteria
    • Non-functional requirements
  2. docs/IMPLEMENTATION_GUIDE.md

    • All ViewModels to test
    • All data models to test
    • API endpoints to test
    • File structure for organizing tests
  3. docs/UX_SPEC.md

    • All user flows
    • All interactions
    • All states (empty, loading, error)
    • Edge cases documented
  4. docs/ARCHITECTURE.md

    • Testing strategy overview
    • Tech stack (for choosing testing tools)

Output

Generate: docs/TEST_SPEC.md

Structure:

# Test Specification: [App Name]

**Version**: 1.0.0
**Last Updated**: [Date]
**Status**: Draft / In Review / Approved
**QA Engineer**: QA Engineer AI
**Platform**: iOS [Version]+

---

## 1. Test Strategy

### 1.1 Test Pyramid

Our testing approach follows the test pyramid:

     /\\
    /  \\  UI Tests (10%)
   /    \\  Critical user journeys, happy paths
  /------\\
 /        \\  Integration Tests (20%)
/          \\  API integration, data persistence, service layer

/------------\ / \ Unit Tests (70%) / \ ViewModels, Models, Utilities, Business Logic /------------------\


**Rationale**:
- **Unit Tests (70%)**: Fast, reliable, easy to maintain. Focus on business logic.
- **Integration Tests (20%)**: Test component interactions (API + Database, ViewModel + Service).
- **UI Tests (10%)**: Slow and brittle, only for critical user flows.

### 1.2 Testing Levels

**Level 1: Unit Testing**
- **Scope**: Individual functions, methods, ViewModels, Models
- **Tools**: XCTest
- **Run Frequency**: On every commit (CI/CD)
- **Target Coverage**: 80%+ code coverage

**Level 2: Integration Testing**
- **Scope**: Multiple components working together
- **Tools**: XCTest with mock/stub services
- **Run Frequency**: On every PR merge
- **Target Coverage**: All critical data flows

**Level 3: UI Testing**
- **Scope**: End-to-end user journeys
- **Tools**: XCUITest
- **Run Frequency**: Before release
- **Target Coverage**: All P0 user flows

**Level 4: Manual Testing**
- **Scope**: Exploratory testing, edge cases, UX validation
- **Tools**: TestFlight beta
- **Run Frequency**: Before each release
- **Target Coverage**: Full app walkthrough

### 1.3 Test Environments

**Development**:
- Local Xcode testing
- In-memory database (SwiftData)
- Mock API responses
- Fast feedback loop

**Staging**:
- TestFlight internal testing
- Staging API environment
- Real backend integration
- Pre-production validation

**Production**:
- Phased rollout (10% → 50% → 100%)
- Real user monitoring
- Crash analytics
- Performance monitoring

### 1.4 Testing Tools

| Tool | Purpose | When to Use |
|------|---------|-------------|
| XCTest | Unit & integration tests | Always |
| XCUITest | UI automation tests | Critical flows |
| TestFlight | Beta testing | Pre-release |
| Xcode Instruments | Performance profiling | Optimization phase |
| Accessibility Inspector | Accessibility audit | Every release |
| Network Link Conditioner | Network testing | Edge case testing |

---

## 2. Unit Test Cases

### 2.1 Data Model Tests

Test all `@Model` classes from ARCHITECTURE.md.

#### Test Suite: User Model

**File**: `[AppName]Tests/ModelTests/UserTests.swift`

| Test Case | Setup | Input | Expected Output | Priority |
|-----------|-------|-------|-----------------|----------|
| testUserInitialization | None | name: "John Doe", email: "[email protected]" | User object created with UUID, timestamps set | P0 |
| testUserInitializationWithEmptyName | None | name: "", email: "[email protected]" | User created but isValid returns false | P1 |
| testEmailValidation_Valid | User instance | email: "[email protected]" | isValid returns true | P0 |
| testEmailValidation_Invalid | User instance | email: "invalid.com" | isValid returns false | P0 |
| testEmailValidation_Empty | User instance | email: "" | isValid returns false | P0 |
| testDisplayName_SingleName | User with name: "John" | Call displayName | Returns "John" | P1 |
| testDisplayName_FullName | User with name: "John Doe" | Call displayName | Returns "John" | P1 |
| testInitials_SingleName | User with name: "John" | Call initials | Returns "J" | P2 |
| testInitials_FullName | User with name: "John Doe" | Call initials | Returns "JD" | P2 |
| testUpdateProfile_Name | User instance | updateProfile(name: "Jane") | name updated, updatedAt changed | P1 |
| testUpdateProfile_Email | User instance | updateProfile(email: "[email protected]") | email updated, updatedAt changed | P1 |
| testCodable_Encoding | User instance | Encode to JSON | Valid JSON with snake_case keys | P1 |
| testCodable_Decoding | JSON data | Decode from JSON | User object created correctly | P1 |

**Implementation Example**:

```swift
import XCTest
@testable import [AppName]

Read the full file on GitHub · 1,514 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 1,514 lines · 40 tokens per session scan B a55c05c78b05

Subscribe to this mod's changes

test-spec is a skill published in the GitHub repository rshankras/claude-code-apple-skills (708 stars, last pushed 1mo ago), licensed MIT. It adds 40 tokens to every session and 11,767 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.