write-unit-tests

Generate minimal testthat 3e unit tests for R package code.

47|4|Updated Sep 9, 2025
One-click install
npx skills add https://github.com/simonpcouch/side --skill write-unit-tests-simonpcouch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write-unit-tests
Source: https://github.com/simonpcouch/side/tree/main/inst/skills/write-unit-tests
Command: npx skills add https://github.com/simonpcouch/side --skill write-unit-tests-simonpcouch

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing tests for R packages can be repetitive and error-prone; this Skill helps generate minimal, tidy testthat 3e unit tests from a given code selection.

Core Features & Use Cases

  • Generate concise testthat tests from a code selection, aligned with tidy style guidelines.
  • Produce runnable test blocks suitable for R packages, with focus on core functionality and edge cases.
  • Integrate with common testing workflows and CI pipelines to validate package behavior.

Quick Start

Provide a minimal testthat 3e unit test for the given R code selection.

Frequently Asked Questions about write-unit-tests

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate testthat unit tests for an R package function?

Generate testthat unit tests by providing a selection of R package code to produce minimal, tidy testthat 3e test blocks that validate functions, edge cases, and expected behavior. The output is pure test code without comments.

What is testthat 3e and how does it structure R unit tests?

testthat 3e is the third edition of the R testing framework, using minimal and tidy test conventions. This Skill produces runnable test blocks following testthat 3e conventions and tidy style guidelines for R package development.

Can I use this to write tests for existing R package code?

Yes, you can write tests for existing R package code by selecting the specific functions you want to validate. The Skill generates concise, runnable testthat blocks suitable for common R package testing workflows and CI pipelines.

Does the generated test code include comments and documentation?

No, the generated test code is pure and does not include comments. It focuses on producing minimal, tidy testthat 3e test blocks that align with tidy style guidelines for validating core functionality and edge cases.

What's the best way to automate testthat tests for R package edge cases?

Automate testthat tests for edge cases by supplying the target R code selection to the Skill. It generates concise testthat 3e unit tests focused on validating expected behavior and edge cases for typical package development tasks.

Are there limitations to the testthat tests generated for R packages?

The generated testthat tests are minimal and target typical package development tasks like validating functions and edge cases. They follow tidy style and testthat 3e conventions but may require manual review for complex domain-specific logic or custom dependencies.