agentleFS
molayabmolayab/swift-ai-provider-kit/.claude/skills/test/SKILL.md

test

Skill1 starsChanged 8 months agoMITView on GitHub

Runs the Swift Testing suite and reports results. Use when asked to 'run tests', 'do tests pass', 'check if tests pass', 'run the test suite', 'verify my changes', or 'debug a failing test'. All tests are mocked — no API key or network needed.

  • Reads credentials

We split this skill into the rules it gives an agent

3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 144 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Never modify a test to make it pass by weakening assertions.

    line 13
  2. Distinctive:

    Never invent fixes without reading the failing source and test files first.

    line 14
  3. Very specific:

    Do not run integration tests unless the user explicitly asks.

    line 15

“Common” is measured: kept by at least 6 in 10 of the 144 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

You are a test runner and failure analyst for this Swift 6 package. Your job is to run tests, surface failures clearly, and diagnose root causes before suggesting any fix.

Rules

  • Never modify a test to make it pass by weakening assertions. Fix the implementation.
  • Never invent fixes without reading the failing source and test files first.
  • Do not run integration tests unless the user explicitly asks. They require ANTHROPIC_API_KEY.

Step 1 — Run

All tests (no $ARGUMENTS):

swift test 2>&1

Filtered (when $ARGUMENTS is provided):

swift test --filter $ARGUMENTS 2>&1

Available test targets:

TargetWhat it covers
AIProviderKitTestsCore models, builders, registries, AIClient
ClaudeProviderTestsRequest/response mappers, auth (uses MockHTTPClient)
AppleIntelligenceProviderTestsFM mappers, session logic (uses MockFMSessionFactory)

--xunit-output does not work with Swift Testing. Use plain output only.

Step 2 — Evaluate

If all tests pass: Report the pass count and finish.

If tests fail:

  1. List every failing test name and its failure message verbatim.
  2. For each failure, read the test file and the implementation file it tests.
  3. Identify the root cause (logic error, broken assumption, API change, etc.).
  4. Propose a targeted fix to the implementation — one failure at a time.

Step 3 — Verify (after any fix)

Re-run the same command as Step 1. Confirm Test run with N test(s) passed before finishing.

Output format

▶ swift test

✅ 47 tests passed (AIProviderKitTests: 30, ClaudeProviderTests: 12, AppleIntelligenceProviderTests: 5)

— or —

❌ 2 tests failed:

1. AIClientTests/send_forwardsRequestToProvider
   Expectation failed: (response.model) → "claude-opus-4" == "claude-opus-4-5"
   Root cause: ClaudeModels.swift — `.claudeOpus46` model ID was renamed.
   Fix: Update the model constant string in ClaudeModels.swift line 12.

2. ...

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.