transfer-object-builder

Generate transfer records and fromRecord/toRecord adapters for domain classes.

Updated Sep 29, 2024
One-click install
npx skills add https://github.com/danielnewman09/MSD-CPP --skill transfer-object-builder
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: transfer-object-builder
Source: https://github.com/danielnewman09/MSD-CPP/tree/main/.claude/skills/transfer-object-builder
Command: npx skills add https://github.com/danielnewman09/MSD-CPP --skill transfer-object-builder

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Build the database transfer interface for an arbitrary domain object by analyzing its data members, generating a corresponding transfer record in msd-transfer, and injecting fromRecord/toRecord adapters into the domain class; it also creates round-trip GTest tests to validate persistence.

Core Features & Use Cases

  • Analyze a domain class to inventory its data members and determine their transfer mappings.
  • Generate a new transfer record (e.g., AssetRecord) and integrate fromRecord/toRecord into the domain class.
  • Produce comprehensive round-trip tests to verify serialization and deserialization against a real database.

Quick Start

Provide the fully-qualified class name and the target library location to trigger the tool. Example: TransferObjectBuilder AssetInertial msd-assets or InertialState in msd-sim. This is a guided illustration, not a universal command.

Frequently Asked Questions about transfer-object-builder

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

FAQPage Schema
How do I generate transfer objects from domain objects in C++?

To generate transfer objects from domain objects, provide a fully-qualified C++ class name and target library location. The tool analyzes domain members, constructs a matching transfer record, and integrates fromRecord/toRecord adapters into the domain class.

What is a transfer object scaffold and when do I need one for database testing?

A transfer object scaffold is a generated record mapping domain class members to database fields. You need one when building persistence layers to serialize and deserialize domain objects, ensuring correct foreign keys and types during database operations.

Does this tool create GTest round-trip tests for domain model persistence?

Yes, the tool creates GTest round-trip tests for domain model persistence. It automatically generates tests that verify serialization and deserialization by validating the fromRecord and toRecord adapters against a real database.

What do I need to provide to build database transfer interfaces for a domain class?

You need to provide the target class header file and the library location. These inputs allow the tool to resolve dependencies, inventory data members, determine transfer mappings, and ensure correct foreign keys and types.

What is the best way to add fromRecord and toRecord adapters to an existing domain class?

The best way to add fromRecord and toRecord adapters is to use a code generation tool that analyzes your domain class members and automatically injects the adapters, creating a corresponding transfer record in the specified transfer library.

Can I use this code generation approach for any C++ domain model?

You can use this code generation approach for C++ domain models that have accessible class headers and defined library locations. The tool requires these to resolve dependencies and correctly map foreign keys and types for the transfer record.