build-functors

Generate functors mapping domain types to API, persistence, and event schemas.

37|5|Updated Nov 18, 2025
One-click install
npx skills add https://github.com/BellaBe/lean-os --skill build-functors
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: build-functors
Source: https://github.com/BellaBe/lean-os/tree/main/.claude/skills/engineering-build-functors
Command: npx skills add https://github.com/BellaBe/lean-os --skill build-functors

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill defines structure-preserving maps (functors) from a Domain to target categories, enabling automated translation of domain concepts to API, persistence, and event representations.

Core Features & Use Cases

  • Read targets.yaml and artifacts to generate functors
  • Define object and morphism mappings for each enabled target
  • Preserve identity and composition laws

Quick Start

Run the build-functors process to create F_api, F_persist, and F_events for the enabled targets based on artifacts and targets.yaml.

Frequently Asked Questions about build-functors

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

FAQPage Schema
How do I map domain models to API endpoints and database schemas?

Structure-preserving maps (functors) translate domain concepts to target representations. build-functors reads your domain category and targets.yaml to automatically generate functor definitions that map domain types and operations to API endpoints, persistence models, and event schemas while preserving identity and composition laws.

What does it mean to preserve identity and composition in domain mapping?

Identity preservation ensures domain objects map to corresponding target objects without loss; composition preservation ensures domain relationships maintain their structure in the target. build-functors enforces both laws so your API, persistence, and event representations stay functionally equivalent to your domain model.

How do I generate functors for API, persistence, and events targets?

Define enabled targets in targets.yaml, structure your domain in category.yaml, then run build-functors. It reads both files and generates functors.yaml per target, with object and morphism mappings that translate domain types to API endpoints, storage models, and event schemas automatically.

Can I use functors to handle multiple target formats simultaneously?

Yes. build-functors supports multiple enabled targets—API, persistence, and events—in a single process. Each target gets its own functor definition with tailored object and morphism mappings, so one domain model drives consistent representations across all formats.

What input files does build-functors require?

build-functors requires category.yaml (your domain structure) and targets.yaml (target definitions). It reads these from artifacts/v{N}/build/ and generates functors.yaml in the same location, mapping domain concepts to each enabled target representation.