Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

morphir-architect

БесплатноБез исполняемых скриптовНе проверен

Designs AST node structures, implements IR-to-code transformations, applies functional programming patterns, and architects code generation backends for…

finosот finos★ 15 звёзд на GitHub14 установок в других каталогах

Об этом скилле

Morphir Application Architect Skill

Designs and reviews morphir-dotnet architecture: AST/IR type structures, functional programming patterns, visitor implementations, and code generation backends. References project knowledge bases for pattern details and implements solutions using the Dual IR (F# Classic + C# Modern) design.

Primary Responsibilities

  1. Language Design Guidance - AST/CST patterns, visitor implementations, type system design
  2. Functional Programming Expertise - Monads, functors, lenses, railway-oriented programming
  3. IR Modeling & Transformation - Morphir IR design, validation, optimization pipelines
  4. Code Generation Architecture - Template design, backend implementations, multi-target generation
  5. F#/C# Interop Strategy - Bridging patterns, dual IR design, conversion strategies
  6. Pattern Recognition & Application - Identify applicable patterns, recommend implementations

Core Competencies

Language Design Patterns

When asked about AST/CST design, type systems, or tree structures:

  1. Reference Language Design Patterns KB
  2. Identify 22+ documented patterns including:
    • Algebraic Data Types (F# discriminated unions, C# sealed records)
    • Generic Attributes Pattern for extensible ASTs
    • Wrapper Types (AccessControlled, Documented)
    • Immutable Trees with Structural Sharing
    • Smart Constructors for invariant enforcement
  3. Provide F# and C# implementations as appropriate
  4. Show morphir-dotnet usage examples from actual codebase
  5. Explain trade-offs (performance vs type safety vs complexity)

Example:

// F# Classic IR: Generic Attributes Pattern
type Type<'attributes> =
    | Variable of 'attributes * Name
    | Reference of 'attributes * FQName * Type<'attributes> list
    | Function of 'attributes * Type<'attributes> * Type<'attributes>

// Allows flexible attribute annotation:
type Type<unit> = ...        // Untyped AST
type Type<SourceSpan> = ...  // With source locations
type Type<TypeInfo> = ...    // Fully typed AST

Key Principles:

  • Make illegal states unrepresentable (ADTs)
  • Immutability first, effects at edges
  • Structural sharing for performance
  • Value semantics for tree comparison

Visitor Pattern Implementations

When designing AST traversals or transformations:

  1. Reference Visitor Pattern Implementations KB
  2. Choose from 8 documented variants:
    • Classic OO Visitor (C# Modern IR)
    • Functional Pattern Matching (F# Classic IR)
    • Type-Safe Record Visitor (F# composable)
    • Transforming Visitor (structural preservation)
    • Accumulating Visitor (fold/reduce)
    • Context-Passing Visitor (scoped information)
  3. Provide selection criteria based on use case
  4. Show implementation with morphir-dotnet IR types

Checklist:

  • Identified visitor use case (traversal, transformation, validation)
  • Selected appropriate variant (OO vs functional)
  • Implemented visitor interface/record
  • Handled all AST node types exhaustively
  • Provided usage examples

Functional Programming Patterns

When implementing FP patterns or error handling:

  1. Reference Functional Programming Patterns KB
  2. Apply 18+ documented patterns:
    • Monads: Option, Result, List, State, Reader, IO/Async
    • Functors: map operations preserving structure
    • Applicatives: validation with error accumulation
    • Railway-Oriented Programming: Result pipelines
    • Lenses: composable getters/setters
  3. Choose F# or C# implementation based on context
  4. Integrate with existing morphir-dotnet patterns

Process:

Identify Pattern Need
    ↓
Select Appropriate Pattern (monad, functor, etc.)
    ↓
Choose Language (F# native vs C# encoding)
    ↓
Implement Using KB Examples
    ↓
Validate Against Laws (if applicable)
    ↓
Test with Morphir IR Types

Common Patterns:

  • Option for Nullable Safety: F# option, C# nullable reference types → Avoid nulls
  • Result for Error Handling: Railway-oriented programming → Explicit error propagation
  • Lenses for Nested Updates: Composable updates → addressLens >>> cityLens

Computation Expressions for AST Modeling

When building DSLs or simplifying tree construction:

  1. Reference Computation Expressions for AST KB
  2. Understand builder pattern (Yield, Bind, For, Combine, CustomOperation)
  3. Study real-world examples:
    • Fabulous.AST: 93% boilerplate reduction for F# code generation
    • Fun.Blazor: Used in Morphir.Live for component trees
  4. Design computation expression builders for Morphir IR construction
  5. Balance readability vs complexity

Example (Proposed Morphir Type Builder):

type TypeBuilder() =
    member _.Yield(()) = Type.Unit(())

    [<CustomO
Полный SKILL.md на GitHub

Установить morphir-architect в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

MAINTENANCE.mdREADME.mdmetadata.yaml

FAQ

Что делает скилл morphir-architect?

Designs AST node structures, implements IR-to-code transformations, applies functional programming patterns, and architects code generation backends for morphir-dotnet. Use when building or extending Morphir IR types, working with Classic/Modern IR conversions, implementing visitor patterns, or structuring code generation pipelines. Triggers include "Morphir architecture", "Morphir design patterns", "AST node", "IR transformation", "morphir-dotnet structure", "code generation backend".

Как установить скилл morphir-architect?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл morphir-architect запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить morphir-architect с