Haya.Core
0.0.6-beta1
dotnet add package Haya.Core --version 0.0.6-beta1
NuGet\Install-Package Haya.Core -Version 0.0.6-beta1
<PackageReference Include="Haya.Core" Version="0.0.6-beta1" />
<PackageVersion Include="Haya.Core" Version="0.0.6-beta1" />
<PackageReference Include="Haya.Core" />
paket add Haya.Core --version 0.0.6-beta1
#r "nuget: Haya.Core, 0.0.6-beta1"
#:package Haya.Core@0.0.6-beta1
#addin nuget:?package=Haya.Core&version=0.0.6-beta1&prerelease
#tool nuget:?package=Haya.Core&version=0.0.6-beta1&prerelease
<p align="center"> <img src="docs/images/haya-logo.svg" alt="haya" width="280"> </p>
<h3 align="center">Living architecture docs, generated from your code.</h3>
<p align="center"> Haya reads small annotations you put next to your code (<code>Responsibility</code>, <code>Collaborator</code>, <code>Meta</code>) and generates CRC documents, C4 diagrams and a Backstage catalog, for <b>C#</b> and <b>TypeScript</b> codebases. </p>
<p align="center"> <a href="https://github.com/dburriss/haya-net/actions/workflows/build.yml"><img src="https://github.com/dburriss/haya-net/actions/workflows/build.yml/badge.svg" alt="Build and test"></a> <a href="https://www.nuget.org/packages/Haya.Tool"><img src="https://img.shields.io/nuget/v/Haya.Tool?logo=nuget&label=Haya.Tool" alt="NuGet Haya.Tool"></a> <a href="https://www.nuget.org/packages/Haya"><img src="https://img.shields.io/nuget/v/Haya?logo=nuget&label=Haya" alt="NuGet Haya"></a> <a href="https://github.com/dburriss/haya-net/blob/main/LICENSE"><img src="https://img.shields.io/github/license/dburriss/haya-net" alt="License"></a> </p>
Get started
Install the tool and the attributes package (alpha, hence --prerelease; .NET 10 SDK required):
dotnet tool install --global Haya.Tool --prerelease
dotnet add package Haya --prerelease
For TypeScript, see the TypeScript tutorial.
Then annotate your code and run one command:
[assembly: Meta(AppName = "CheckoutApi", System = "HayaEcomm", Description = "Handles payment for a cart")]
[Responsibility(Description = "Handles order processing")]
public class CreditCardPaymentUsecase { }
haya crc -cc ./Example.sln
Start with the tutorial for your stack:
- Getting started with C#
- Getting started with TypeScript
- Custom C# attributes
- Custom TypeScript annotations
See the annotated C# example and its generated CRC.
What it does
- CRC documents. Components, Responsibilities and Collaborators as Markdown, optionally with embedded diagrams. See the CLI reference.
- C4 diagrams. Level 1 (system context) and level 2 (containers) as Mermaid. See Generate C4 diagrams.
- Backstage catalog. One component per application with dependencies. See Publish to Backstage.
- Describe files. A JSON/YAML description of an application that every other command accepts as input. See the describe format.
- Many systems at once. Merge several codebases, C# and TypeScript mixed, into one picture. See Document several systems together.
- Same output on both stacks. The C# tool (
Haya.Tool) and the TypeScript tool (Haya.Bun) share one rendering core. See Architecture.
Haya is not a replacement for good documentation practices. It keeps a minimum level of documentation next to the code, so it stays current and a new joiner has somewhere to start exploring.
Documentation
Organised by Diataxis, starting at the docs index:
| I want to... | Go to |
|---|---|
| Learn Haya by doing | Tutorials |
| Get a specific job done | How-to guides |
| Look up a flag or attribute | CLI, Attributes |
| Understand why it works this way | Concepts, ADRs |
More: examples · changelog · contributing
License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Flexi.Json (>= 0.1.0)
- Flexi.Yaml (>= 0.1.0)
- FSharp.Core (>= 10.1.403)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Haya.Core:
| Package | Downloads |
|---|---|
|
Haya.Roslyn
Roslyn based analysis of C# solutions for Haya. Finds the Haya attributes and produces Haya.Core descriptors. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 0.0.6-beta1 | 99 | 11/9/2026 | |
| 0.0.2 | 354 | 9/20/2024 | |
| 0.0.1 | 295 | 9/16/2024 |
Releases are tag-driven: pushing a `v*` tag publishes `Haya`, `Haya.Core`, `Haya.Roslyn` and `Haya.Tool` to NuGet with
`--include-references` and `--include-assembly <glob>` (with `--verbose`) read Haya attributes from public types in
Custom TypeScript annotations with defaults: `defineResponsibility`, `defineCollaborator` and `defineMeta` in
Custom C# attributes with defaults: derive from `ResponsibilityAttribute`, `CollaboratorAttribute` or `MetaAttribute` and
Documentation reorganised by Diataxis under `docs/` (tutorials, how-to guides, reference, explanation), a new README
C4 Level 2 (container) diagram: `crc -cc` adds it after the level 1 diagram and `diagram -t c4container` writes only
`Technology` and `Kind` on `Meta` (`meta({ technology, kind })` in TypeScript). `Kind` is an `AppKind`
Every command accepts several inputs (solutions, tsconfig projects and/or describe files, mixed) and builds one
`crc`, `describe`, `diagram` and `backstage` accept a `haya describe` file (`.json`, `.yaml`, `.yml`) as input
`Haya.Bun` is a working CLI: `crc`, `describe`, `diagram` and `backstage` for TypeScript projects, with a static analyser
`src/Haya.TypeScript` (`@haya/annotations`): `@Responsibility`, `@Collaborator` and `meta()` for TypeScript, replacing
`examples/typescript/example`: TypeScript equivalent of the C# example; its `CRC.md` is now generated by the CLI.
`src/Haya.Bun`: experimental Fable → TypeScript build of the CLI running on Bun (command skeleton).
`AGENTS.md` (with `CLAUDE.md` symlink), `global.json`, `nuget.config`, local Fable tool manifest.
The `describe` document is now version `0.2`: an app's `meta` may have `tech` and `kind` (left out when unset).
The `describe` document moved to version `0.1` before `0.2`: `{ "apps": [ { meta, responsibilities, collaborators } ], "version": "0.1" }`
Library API: `Describe`, `Crc`, `Diagram` and `Backstage` take an `App list` instead of a `Descriptor list`;
`Haya.Bun` references `Haya.Core` as a whole and compiles all of it with Fable (previously three linked files).
`crc` markdown is rendered by an internal builder instead of FuncyDown (output unchanged, always LF line endings).
JSON/YAML output is written with Flexi.Json and Flexi.Yaml via explicit encoders (ADR004), replacing
Roslyn analysis moved out of `Haya.Core` into the new `Haya.Roslyn` project (ADR003). `Haya.Core` no longer
Target .NET 10 (`Haya` attributes stay on netstandard2.0).
Upgraded dependencies: Roslyn 5.9, YamlDotNet 18.1, FuncyDown 1.4.2, Argu 6.2.5.
Tests migrated to xunit.v3 on Microsoft.Testing.Platform.
CI uses the SDK from `global.json` and builds the Bun project.
Markdown table cells escape `|` and newlines.
`diagram` (and the `crc` C4 diagram) apply the same default system for a collaborator without a `System` as
`backstage`: an app now lists, in `dependsOn`, the apps in the catalog that declare it as an upstream collaborator.
`backstage`: a collaborator without a `System` now takes its owning app's system (or `External` when its
`backstage`: `dependsOn` and `dependencyOf` now follow the collaborator `Direction`: downstream collaborators go in
`backstage` no longer fails for an app without `meta()`; it catalogues the collaborators only (regression test added).
`backstage -f json` now writes JSON (an array of Component entities) instead of YAML, on both stacks.
`Haya.Bun` now finds annotations in workspace packages imported by name (symlinked into `node_modules`) and in
`Haya.Tool` no longer emits a responsibility twice and drops the collaborator for a C# class that has both
Solutions containing F# projects no longer crash analysis; only C# projects are analysed.
FSharpPlus dependency.
Direct `Microsoft.Build` package references (Roslyn's MSBuild build host handles project loading).