morphir-architect
БесплатноБез исполняемых скриптовНе проверенDesigns AST node structures, implements IR-to-code transformations, applies functional programming patterns, and architects code generation backends for…
Об этом скилле
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
- Language Design Guidance - AST/CST patterns, visitor implementations, type system design
- Functional Programming Expertise - Monads, functors, lenses, railway-oriented programming
- IR Modeling & Transformation - Morphir IR design, validation, optimization pipelines
- Code Generation Architecture - Template design, backend implementations, multi-target generation
- F#/C# Interop Strategy - Bridging patterns, dual IR design, conversion strategies
- Pattern Recognition & Application - Identify applicable patterns, recommend implementations
Core Competencies
Language Design Patterns
When asked about AST/CST design, type systems, or tree structures:
- Reference Language Design Patterns KB
- 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
- Provide F# and C# implementations as appropriate
- Show morphir-dotnet usage examples from actual codebase
- 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:
- Reference Visitor Pattern Implementations KB
- 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)
- Provide selection criteria based on use case
- 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:
- Reference Functional Programming Patterns KB
- 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
- Choose F# or C# implementation based on context
- 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:
- Reference Computation Expressions for AST KB
- Understand builder pattern (Yield, Bind, For, Combine, CustomOperation)
- Study real-world examples:
- Fabulous.AST: 93% boilerplate reduction for F# code generation
- Fun.Blazor: Used in Morphir.Live for component trees
- Design computation expression builders for Morphir IR construction
- Balance readability vs complexity
Example (Proposed Morphir Type Builder):
type TypeBuilder() =
member _.Yield(()) = Type.Unit(())
[<CustomO
Установить morphir-architect в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
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), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic