CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

testing-core-processors

This guide explains how to test error processors with `MockLanguageModelV2`, including simulating API errors, verifying retry behavior, and constructing complete stream events. It outlines happy-path, control, and selectivity tests, shows how to seed tool-call messages, and provides commands for running focused or broader test suites.

Quality

88%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Passed

No findings from the security scan

The canonical home for this skill is testing-core-processors in mastra-ai/mastra

SKILL.md
Quality
Evals
Security

Quality

Scored by GLM 5.3

Content

82%Weight 40%Scale 1-5

Reviews the quality of instructions and guidance provided to agents. Good implementation is clear, handles edge cases, and produces reliable results.

A highly actionable, well-structured body: complete executable code, exact commands, and a checklist-driven test structure with per-test assertions. The gaps are modest — a couple of trimmable lines, no general failure-recovery loop, and a mock code block long enough that part of it could be externalized.

Suggestions

Remove the opening line that restates the description ("How to write integration tests for error processors in packages/core/src/processors/.") and let the Prerequisites section lead.

Add a brief troubleshooting step after the run commands (e.g., what to check first when a processor test fails) to complete the feedback loop, extending the existing stream-mock gotcha pattern.

Consider moving the doStream mock variant into a reference file (or a short pointer to prefill-error-recovery.test.ts) and keeping only the event-sequence requirement inline, to slim the SKILL.md body.

DimensionReasoningScore

Conciseness

Efficient and free of concept explanations Claude already knows — it goes straight to the mock pattern, commands, and message formats. Minor trimmable content (the opening line restates the description verbatim, and the combined doGenerate/doStream block is long, though justified as the reference pattern), placing it at anchor 4 rather than 5's "every token earns its place".

4 / 5

Actionability

Fully executable, copy-paste-ready guidance: a complete MockLanguageModelV2 setup with real APICallError fields, exact AI SDK message-format objects for tool-call seeding, and exact commands ("npx vitest run packages/core/src/processors/my-processor.test.ts", "pnpm test:core"). The examples cover the common cases, matching anchor 5.

5 / 5

Workflow Clarity

Clear sequence (mock pattern → required test structure → run commands) with a numbered checklist and explicit "Assert:" checkpoints per test type, plus one genuine error-recovery note (the stream mock gotcha explaining empty output from the minimal event format). It falls short of anchor 5 because there is no general test-failure feedback loop beyond that single gotcha and no expected-output guidance for the run commands; not a destructive/batch skill, so no cap applies.

4 / 5

Progressive Disclosure

No bundle files exist, so this is scored on the single-file structure: well-organized headed sections with content appropriately placed inline, and a useful one-level pointer to a repo file ("See prefill-error-recovery.test.ts for the reference pattern"). At ~110 lines it exceeds the under-50-line simple-skill exception, and the ~40-line doStream half of the mock block could live in a reference file — anchor 4's "minor organization gaps".

4 / 5

Total

17

/

20

Passed

Description

87%Weight 40%Scale 1-5

Based on the skill's description, can an agent find and select it at the right time? Clear, specific descriptions lead to better discovery.

A strong description: it states both what the skill covers and when to use it with concrete, niche-specific triggers (exact path, named mock class, vitest). Its only weaknesses are minor — a couple of missing natural-term variants and unmentioned capabilities from the body.

DimensionReasoningScore

Specificity

Lists several concrete actions — "simulating API errors", "verifying retry behavior", "run focused vitest runs" — anchored by a named pattern ("MockLanguageModelV2 pattern") and an exact directory path. Minor gaps: the test-structure requirements and tool-call message seeding covered in the body go unmentioned, so it fits anchor 4 rather than 5's comprehensive coverage.

4 / 5

Completeness

Explicitly answers "when" with concrete triggers ("Use when writing or debugging integration tests for error processors in packages/core/src/processors/") and "what" ("Covers the MockLanguageModelV2 pattern... simulating API errors and verifying retry behavior, plus how to run focused vitest runs"). Both are explicit and concrete, matching the anchor-5 example; the "Use when..." clause is present, so the completeness cap does not apply.

5 / 5

Trigger Term Quality

Includes natural terms users would say — "integration tests", "debugging", "error processors", "retry behavior", "vitest" — with good coverage overall. A few natural variants are missing (e.g., "unit tests", "test failures", ".test.ts", "mock model"), keeping it just below anchor 5's synonym/extension coverage.

4 / 5

Distinctiveness Conflict Risk

The exact monorepo path ("packages/core/src/processors/"), the specific mock class ("MockLanguageModelV2"), and "vitest" define a clear niche with distinct triggers and minimal conflict risk with other skills. Voice is third person ("Covers..."), so no penalty applies.

5 / 5

Total

18

/

20

Passed

Validation

100%

Checks the skill against the spec for correct structure and formatting. All validation checks must pass before discovery and implementation can be scored.

Validation — 16 / 16 Passed

Validation for skill structure

No warnings or errors.

Repository

mastra-ai/mastra

Path

.agents/skills/testing-core-processors/SKILL.md

Reviewed

Table of Contents

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.