sharpino architecture

    0

    Architectural patterns and F# code skeletons for Sharpino event-sourced aggregates in BlazorBookLibrary.

    $3

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    sharpino architecture

    Example session with this skill installed

    Create a new Member aggregate for the library with a TenantId, Name, and Email, including a command to update the email.

    • Read your context and instructions
    • Compiled the sharpino architecture

    I have generated the Sharpino aggregate, command, and event structures for the Member slice.

    Member Domain Slice

    namespace BookLibrary.Domain
    
    open System
    open System.Text.Json
    open FsToolkit.ErrorHandling
    open Sharpino
    open BookLibrary.Shared.Commons
    
    type MemberId = | MemberId of Guid with
        static member New() = MemberId(Guid.NewGuid())
        member this.Value = match this with MemberId v -> v
    
    type Member = 
        {
            TenantId: TenantId
            MemberId: MemberId
            Name: string
            Email: string
        }
        with
            static member New (tenantId: TenantId) name email =
                { TenantId = tenantId; MemberId = MemberId.New(); Name = name; Email = email }
    
            member this.UpdateEmail (newEmail: string) (dt: DateTime) : Result<Member, string> =
                if not (newEmail.Contains("@")) then Error "Invalid email format"
                else Ok { this with Email = newEmail }
    
            // Sharpino Contract
            member this.Id = this.MemberId.Value
            static member Version = "_01"
            static member StorageName = "_member"
            static member SnapshotsInterval = 100
            member this.Serialize = JsonSerializer.Serialize(this, jsonOptions)
            static member Deserialize (data: string) : Result<Member, string> =
                try JsonSerializer.Deserialize<Member>(data, jsonOptions) |> Ok
                with ex -> Error ex.Message
    
    type MemberCommand =
    
        | UpdateEmail of string * DateTime
    
        interface AggregateCommand<Member, MemberEvent> with
            member this.Execute (m: Member) =
                match this with
    
                | UpdateEmail (email, dt) ->
    
                    m.UpdateEmail email dt |> Result.map (fun updated -> updated, [EmailUpdated (email, dt)])
            member this.Undoer = None
    
    and MemberEvent =
    
        | EmailUpdated of string * DateTime
    
        interface Event<Member> with
            member this.Process (m: Member) =
                match this with | EmailUpdated (email, dt) -> m.UpdateEmail email dt
    

    Next steps

    1. Add MemberId to Shared/Slices/Common/Commons.fs.
    2. Generate the PostgreSQL migration using ./generateAggregateByTemplate.sh "_01" "_member" "text".
    3. Implement IMemberService in the Server project to handle the UpdateEmail command.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Building event-sourced systems in F# often leads to boilerplate sprawl and inconsistent tenant isolation. This skill provides the exact architectural invariants and code skeletons required to implement Sharpino-based aggregates and services within the blazorBookLibrary stack.

    What it does

    • Enforces Domain Purity: Generates immutable F# records for aggregates and entities, ensuring zero I/O or side effects in business logic.
    • Automates Sharpino Skeletons: Provides boilerplate for AggregateCommand, Event, and AggregateViewerAsync2 implementations.
    • Secures Multi-Tenancy: Embeds TenantId and UserContext validation directly into the service layer to prevent cross-tenant data leaks.
    • Handles CQRS Read Models: Scaffolds RefreshableAsync models and cache invalidation logic for complex UI views.
    • Generates Database Migrations: Provides the mandatory PL/pgSQL functions and table schemas required for Sharpino event store optimistic locking.

    How it works

    1. Define the Value Objects: Use the provided DU templates in Commons.fs to wrap primitive types like Guid or string.
    2. Implement the Aggregate: Create the core record in the domain layer following the Sharpino contract for serialization and versioning.
    3. Map Commands and Events: Define the DU transitions that evolve the aggregate state and emit event streams.
    4. Wire the Service: Implement the service interface using runAggregateCommandMdAsync for write operations and AggregateViewerAsync2 for reads.

    Frameworks & tools

    F#, .NET, Blazor, PostgreSQL, Sharpino, FsToolkit.ErrorHandling, and SQL.

    Why this beats prompting it yourself

    Generic AI prompts often miss the strict "No I/O in domain" rule or fail to include the specific PL/pgSQL stored procedures Sharpino requires for its runtime. This skill ensures every generated line respects the blazorBookLibrary tenant isolation patterns and deterministic event-processing requirements.

    Use cases

    • Adding a new feature slice with full event-sourcing and audit history.
    • Refactoring a legacy service to use immutable records and result-driven control flow.
    • Generating PostgreSQL migration scripts for new aggregate roots.
    • Implementing a multi-aggregate transaction using Sharpino command runners.

    Known limitations

    Does not support direct SQL updates on aggregate tables. Requires FsToolkit.ErrorHandling for result monads. migrations must follow the exact naming convention for Sharpino to detect streams.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Prompt & Skill Engineering.

    Requires FsToolkit.ErrorHandling. Supports only Sharpino-style event sourcing. No support for mutable domain states. Migration naming is strict.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 12 days ago

    Permissions

    Terminal / Shell
    Listed12 days ago
    Updated10 days ago

    What's inside

    Frequently Asked Questions

    This skill provides specialized architectural patterns and F# code skeletons for implementing Sharpino event-sourcing. It specifically eliminates boilerplate sprawl while enforcing domain purity and secure multi-tenancy within the blazorBookLibrary stack.

    It is optimized for any AI agent or LLM capable of generating .NET/F# code. It works best when provided with your specific domain context, which it then processes through the lens of Sharpino's strict architectural invariants.

    The purchase includes the core architectural templates for aggregates, command/event mapping, service layer wiring, and the specific PL/pgSQL migration scripts required for the event store. You also get the patterns for CQRS read models and cache invalidation.

    Yes, the skill is designed to handle multi-tenant environments by embedding TenantId and UserContext validation directly into the generated service layer. This ensures that event streams remain isolated and prevents accidental cross-tenant data access.

    While it scaffolds the necessary PL/pgSQL functions and event store schemas, it does not support direct SQL updates to aggregate tables. Additionally, you must use the FsToolkit.ErrorHandling library for the result monads that drive the control flow.

    New in Prompt & Skill Engineering