Write Unit Tests

🏢Official
by tldraw · vlatest · Repository

Automatically generate basic unit tests for your tldraw diagrams' logic and functionality.

Install on your platform

We auto-selected Claude Code based on this skill’s supported platforms.

1

Run in terminal (recommended)

terminal
claude mcp add write-unit-tests npx -- -y @trustedskills/write-unit-tests
2

Or manually add to ~/.claude/settings.json

~/.claude/settings.json
{
  "mcpServers": {
    "write-unit-tests": {
      "command": "npx",
      "args": [
        "-y",
        "@trustedskills/write-unit-tests"
      ]
    }
  }
}

Requires Claude Code (claude CLI). Run claude --version to verify your install.

About This Skill

What it does

This skill enables AI agents to generate unit tests specifically tailored for the tldraw application. It automates the creation of test cases that verify core drawing and editing functionalities within the tldraw codebase, ensuring reliability during development cycles.

When to use it

  • You need to validate new features added to the tldraw editor without manually writing test files.
  • You want to maintain a comprehensive test suite for the tldraw repository as you refactor existing drawing logic.
  • You are setting up a CI/CD pipeline to automatically check for regressions in tldraw's core rendering engine.

Key capabilities

  • Generates unit tests specifically for the tldraw project structure.
  • Covers drawing operations, state management, and UI interactions within the tldraw app.
  • Produces code compatible with the existing testing framework used by the tldraw team.

Example prompts

  • "Generate a unit test suite for the new shape resizing feature in tldraw."
  • "Write tests to verify that the tldraw editor correctly handles undo and redo operations."
  • "Create unit tests for the tldraw selection logic to ensure multi-select works as expected."

Tips & gotchas

Ensure your AI agent has access to the latest tldraw source code or a local clone of the repository, as generated tests rely on specific internal APIs and component structures. Always review generated tests against the actual tldraw behavior, as AI may hallucinate method names if the underlying codebase has recently changed.

Tags

🛡️

TrustedSkills Verification

Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.

Security Audits

Gen Agent Trust HubPass
SocketPass
SnykPass

Details

Version
vlatest
License
Author
tldraw
Installs
134

🏢 Official

Published by the company or team that built the technology.