This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is the LionFire.Core monorepo - a collection of mini-frameworks and toolkits for .NET 9.0+ development. The project follows a layered architecture philosophy from minimal base utilities to opinionated frameworks.
Note: This is part of a larger development environment at /mnt/c/src/core on a Windows WSL2 setup.
This codebase is on a Windows filesystem mounted in WSL2. Always use dotnet-win instead of dotnet for all .NET operations:
dotnet-win build
dotnet-win restore
dotnet-win test
dotnet-win runUse git_win for git operations that require authentication (e.g., git_win push).
The repository is organized into multiple solutions:
- Core.sln - Primary solution for core libraries
- All.sln - Comprehensive solution including all projects
- Execution.sln - Execution-related projects
- Machine.sln - Machine-specific projects
src/- All source code organized by componenttest/- Test projectsdocs/- Architecture documentation (especially VOS system indocs/data/)attic/- Deprecated/archived codebuild/- Build scripts and tools
This repository uses Central Package Management (CPM):
- Package versions are centrally defined in
Directory.Packages.props - Individual
.csprojfiles reference packages without version numbers - To update a package version, edit
Directory.Packages.propsonly
- Uses
Directory.Build.propsfor common MSBuild settings - Current version:
7.0.0-alpha - Uses latest C# language version
- Generates reference assemblies
- Portable PDB symbols with embedded sources
- File-scoped namespaces enabled (
.editorconfig)
# Restore packages
dotnet-win restore
# Build the main solution
dotnet-win build Core.sln
# Build specific project
dotnet-win build src/LionFire.Base/LionFire.Base.csproj
# Run tests
dotnet-win test test/LionFire.Core.Tests/LionFire.Core.Tests.csproj
# Build in Release mode (auto-generates NuGet packages)
dotnet-win build Core.sln -c ReleaseLionFire.Base - BCL augmentation with no external dependencies
- Collections, DateTime utilities, reflection helpers
- Extension methods for common patterns
- Located in:
src/LionFire.Base/
LionFire.Flex - Strongly-typed dynamic object pattern
- Adds
FlexDataproperty for runtime type extension - Depends only on Base
LionFire.Structures - Data structures and collection types
- Depends on Base and Flex
Hosting (src/LionFire.Hosting*/)
- Extensions to Microsoft.Extensions.Hosting
- Wraps IHostBuilder and HostApplicationBuilder
- Multiple sub-projects for different hosting scenarios
Serialization (src/LionFire.Serialization*/)
- Open-ended serialization framework
- Multiple serializer implementations (JSON.NET, etc.)
Referencing (src/LionFire.Referencing*/)
- URL/URI handling and custom schema support
- Foundation for the Handle and Persistence layers
Handles (src/LionFire.Data.Async*/)
- Object handles with reference (URL) support
- Can load/save/observe data through references
Persistence (src/LionFire.Persistence/)
- Open-ended persistence framework
- Supports multiple storage backends
Virtual Object System (VOS) (src/LionFire.Vos*/)
- Mount filesystems, databases, zip files into a virtual filesystem
- Overlay multiple mounts for advanced scenarios
- Hierarchical dependency injection via virtual directories
- Critical: Extensively documented in
docs/data/directory
Assets/Ided (src/LionFire.Assets*/)
- Simplified entity referencing via primary keys
- Simpler alternative to full VOS for database-like access patterns
Instantiating (src/LionFire.*.Instantiating/)
- Template-based object instantiation with parameters
LionFire.Core.Extras - General-purpose framework utilities
- Less commonly used features
- May depend on multiple toolkit abstractions
LionFire.AspNetCore.Framework - Opinionated ASP.NET Core setup
- Best-practice ASP.NET Core application structure
LionFire.Vos.VosApp - VOS application framework
- Default capabilities for VOS-based apps (configuration, etc.)
LionFire.Framework - Complete integrated framework
- Brings all toolkits together
- Goal:
new HostApplicationBuilder().LionFire()for full-featured apps
The codebase is actively being updated for nullable reference types:
- Recent effort reduced warnings from 40 to 23 (see
nullability-status.md) - When adding nullability annotations, document complex cases in
nullability-review.md - Simple cases (field initialization, obvious null checks) can be fixed directly
Test projects follow the naming pattern: LionFire.<Component>.Tests
- Located in
test/directory - Use xUnit or MSTest frameworks
# Run all tests
dotnet-win test
# Run specific test project
dotnet-win test test/LionFire.Core.Tests/LionFire.Core.Tests.csproj
# Run tests with detailed output
dotnet-win test --logger "console;verbosity=detailed"When adding new projects:
- Place in appropriate
src/subdirectory - Do NOT specify package versions in
.csproj(use CPM) - Follow naming convention:
LionFire.<Component>[.<SubComponent>] - Ensure
Directory.Build.propssettings are inherited - Add to appropriate solution file(s)
To add a package to a project:
<!-- In .csproj - NO version attribute -->
<ItemGroup>
<PackageReference Include="PackageName" />
</ItemGroup>To define or update package version:
<!-- In Directory.Packages.props at repo root -->
<PackageVersion Include="PackageName" Version="x.y.z" />The most complex and powerful toolkit. Essential reading for VOS work:
- Start with:
docs/data/README.md - Architecture:
docs/data/vos-architecture.md - Core concepts:
docs/data/vos-core-concepts.md - Examples:
docs/data/vos-examples.md
Key VOS concepts:
- Vobs: Virtual objects (nodes in the virtual tree)
- References: Paths to locate objects
- Mounts: Connect data sources to the virtual tree
- Handles: Read/write access to data
- Overlays: Multiple mounts at the same path for layered data
A cross-cutting pattern used throughout the codebase:
- Objects can present multiple type interfaces dynamically
- Enables flexible composition and adaptation patterns
- See
src/LionFire.Core.Extras/MultiTyping/for implementation
The codebase heavily uses Microsoft.Extensions.DependencyInjection:
- Most components are registered via extension methods on
IServiceCollection - Hosting extensions follow pattern:
AddLionFire<Component>() - Service locator pattern available but dependency injection preferred
The repository contains ~100+ projects organized by functionality. Major areas:
- Applications:
LionFire.Applications*- Application framework - AspNetCore:
LionFire.AspNetCore*- Web framework extensions - Assets:
LionFire.Assets*- Entity/asset management - Auth:
LionFire.Auth*- Authentication integrations - Avalon:
LionFire.Avalon*- WPF/Avalon UI components - Blazor:
LionFire.Blazor*- Blazor component libraries - Data:
LionFire.Data*- Data access patterns - Execution:
LionFire.Execution*- Execution engines and state machines - Hosting:
LionFire.Hosting*- Application hosting - Persistence:
LionFire.Persistence*- Storage backends - Serialization:
LionFire.Serialization*- Serialization providers - Vos:
LionFire.Vos*- Virtual Object System
Per README.md:
Layered Approach:
- Base layer: Minimal dependencies, BCL augmentation
- Toolkits: Unopinionated, a la carte, may depend on each other
- Framework: Opinionated integration of toolkits
Design Goals:
- Decoupled but sharing common interfaces
- Raise the lowest common denominator above BCL
- Enable patterns like multi-typing across components
- Most toolkits are exploratory; some will be promoted to first-class libraries
The codebase makes heavy use of extension methods for discoverability:
- Collection extensions in
LionFire.Base/Collections/ - Type extensions in
LionFire.Base/Types/ - String extensions in
LionFire.Base/Text/
Configuration follows ASP.NET Core options pattern:
- Options classes typically suffixed with
Options - Configured via
IServiceCollection.Configure<TOptions>() - Validated at startup when possible
- Async methods suffixed with
Async IAsyncDisposablepreferred for async cleanup- Extensive use of
ValueTask<T>for performance
- Target: .NET 9.0.107 SDK (see
global.json) - Roll forward: Latest minor version allowed
- Language: Latest C# version
- Platform: Primarily tested on Windows/WSL2
For detailed architectural documentation, especially on the VOS system, see:
docs/data/- VOS documentation and examplesdocs/architecture/- Architectural analysis and recommendations- Source code comments - Most complex areas are well-documented inline
Per README.md:
"This is only really intended to be usable to me, but feel free to mine the codebase for interesting parts"
The project is under active development with ongoing efforts around:
- Nullable reference type annotations (see
nullability-status.md) - Framework consolidation
- Documentation improvements