edit-library-transformers

Automate creation and updating of Library-Implemented Miroir Transformers with an 8-step TDD workflow.

2|1|Updated Mar 24, 2024
One-click install
npx skills add https://github.com/miroir-framework/miroir --skill edit-library-transformers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: edit-library-transformers
Source: https://github.com/miroir-framework/miroir/tree/main/.github/skills/edit-library-transformers
Command: npx skills add https://github.com/miroir-framework/miroir --skill edit-library-transformers

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps engineers create and update Library-Implemented Miroir Transformers by providing a structured, repeatable workflow that ties together TypeScript handler code, transformer registrations, and build-time/type-generation steps. It reduces manual wiring and ensures consistency across in-memory and database-backed execution paths.

Core Features & Use Cases

  • Guided TDD workflow for library-based transformers, including pre-flight tests, test-first development, and verification.
  • End-to-end integration covering runtime and build-time registrations, schema updates, and type generation to keep transformers in sync.
  • Targeted for transformers with transformerImplementationType: "libraryImplementation" and for editing handler code in TransformerrsForRuntime.ts.
  • Real-world use cases include creating new transformers (e.g., formatDate) or updating existing TypeScript handlers and their registrations.

Quick Start

  • Run the pre-flight unit and integration tests to establish baseline.
  • Create a new TransformerDefinition JSON using the provided template and set transformerImplementationType to "libraryImplementation".
  • Implement the TypeScript handler in TransformersForRuntime.ts and register it in the appropriate runtime and build-time collections.
  • Export and register the transformer in Transformers.ts and ensure schema/type generation entries are updated.
  • Execute devBuild and the full test suite to validate end-to-end functionality.

Frequently Asked Questions about edit-library-transformers

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

FAQPage Schema
How do I build library-implemented transformers using TDD in TypeScript?

To build library-implemented transformers using TDD in TypeScript, follow an 8-step workflow: run pre-flight tests, define the transformer with transformerImplementationType set to libraryImplementation, implement the handler, and verify with devBuild and full test suites.

What is the workflow for wiring a Miroir transformer definition into runtime and build-time registrations?

The workflow for wiring a Miroir transformer definition involves creating a TransformerDefinition JSON, implementing the TypeScript handler in TransformersForRuntime.ts, and registering it across runtime and build-time collections to ensure schema registration and type generation stay in sync.

How do I update an existing TypeScript transformer handler and keep its schema and types in sync?

To update an existing TypeScript transformer handler and keep schema and types in sync, edit the handler code in TransformersForRuntime.ts, update its runtime and build-time registrations, and execute devBuild to validate type generation and end-to-end functionality.

Does the Miroir transformer TDD workflow support both in-memory and SQL-backed execution paths?

Yes, the Miroir transformer TDD workflow explicitly supports both in-memory and SQL-backed execution paths, ensuring consistent transformer registrations and TypeScript handler behavior across different runtime environments.

Can I use this workflow to create a new transformer like formatDate from scratch?

Yes, you can use this workflow to create a new transformer like formatDate by generating a new TransformerDefinition JSON, setting transformerImplementationType to libraryImplementation, and implementing the TypeScript handler before running the full test suite.

What are the limitations when editing TransformersForRuntime.ts for library-based transformers?

When editing TransformersForRuntime.ts for library-based transformers, limitations include the strict requirement to manually wire transformer registrations across runtime and build-time collections and the necessity of executing devBuild to ensure proper schema and type generation.