Effect-TS Architecture

Standardize and validate 7-layer Effect-TS architecture across Holochain apps.

14|5|Updated Dec 19, 2023
One-click install
npx skills add https://github.com/happenings-community/requests-and-offers --skill effect-ts-architecture
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Effect-TS Architecture
Source: https://github.com/happenings-community/requests-and-offers/tree/main/.claude/skills/effect-ts-7layer-architecture
Command: npx skills add https://github.com/happenings-community/requests-and-offers --skill effect-ts-architecture

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires effect-ts, svelte, typescript, @holochain/client, @holochain/tryorama.

What problem does it solve?

Building large-scale Holochain hApps with consistent, maintainable architecture can be challenging. This skill provides a battle-tested 7-layer Effect-TS architecture pattern, ensuring type safety, standardized services, and reactive state management across all domains. It reduces architectural drift and accelerates development.

Core Features & Use Cases

  • 7-Layer Architecture: Standardized patterns for Service, Store, Schema, Error Handling, Composables, Components, and Testing.
  • Effect-Native Services: Uses Context.Tag for dependency injection and composable error handling.
  • Reactive Stores: Integrates Svelte 5 Runes with 9 helper functions for comprehensive state management.
  • Use Case: A development team needs to implement a new domain within an existing Holochain hApp, ensuring it adheres to strict architectural guidelines and maintains high code quality and consistency. This skill provides the templates and validation tools to achieve this.

Quick Start

// Service Layer (Layer 1) export const MyDomainService = Context.GenericTag<MyDomainService>("MyDomainService");

// Store Layer (Layer 2) with 9 helper functions export const createMyDomainStore = Effect.gen(function* () { // Implements: createUIEntity, mapRecordsToUIEntities, createCacheSyncHelper, // createStatusAwareEventEmitters, createEntitiesFetcher, withLoadingState, // createRecordCreationHelper, createStatusTransitionHelper, processMultipleRecordCollections });

// Schema Layer (Layer 3) export const CreateMyDomainSchema = Schema.Struct({ name: Schema.String, // ... other fields });

Frequently Asked Questions about Effect-TS Architecture

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

FAQPage Schema
How do I standardize architecture across a Holochain hApp with TypeScript?

Standardize architecture by implementing the 7-layer Effect-TS pattern: Service, Store, Schema, Error Handling, Composables, Components, and Testing layers. This ensures type safety, consistent dependency injection via Context.Tag, and reactive state management across all domains and zomes, reducing architectural drift.

Can I use Effect-TS with Svelte for state management in Holochain applications?

Yes. Effect-TS integrates with Svelte 5 Runes through 9 store helper functions—createUIEntity, mapRecordsToUIEntities, createCacheSyncHelper, createStatusAwareEventEmitters, createEntitiesFetcher, withLoadingState, createRecordCreationHelper, createStatusTransitionHelper, and processMultipleRecordCollections—providing comprehensive reactive state management for Holochain hApps.

What's the best way to enforce consistent architecture across multiple domains in Holochain?

Use automated architecture scoring and validation tooling to enforce the 7-layer Effect-TS pattern across domains and zomes. This approach validates Context.Tag-based dependency injection, Effect Schema constraints, and store helper compliance, ensuring consistency and preventing architectural drift in large-scale hApps.

Do I need to validate Effect Schema in Holochain domain implementations?

Yes. Effect Schema validation is part of the 7-layer architecture pattern, ensuring type safety and contract enforcement across Service, Store, and Component layers. This requirement is built into template generation and consistency enforcement tooling for new domain implementations.

How do I implement dependency injection in Effect-TS services for Holochain?

Use Context.Tag for composable, type-safe dependency injection in the Service layer. Context.Tag enables declarative service declarations and Effect-native composable error handling, making dependencies explicit and testable across Holochain domain implementations.