Skip to content
CAI
Software that uses CAICheck a score

pdevito3/craftsman

37.4

Weak · 7 November 2026

17.2k

lines of production code

C#

primary language

7

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Craftsman is a .NET CLI scaffolding tool that generates full-stack application structures from YAML or JSON templates. It produces backend components including ASP.NET Core Web APIs with CQRS, Entity Framework Core configurations, and role-based authentication via Keycloak, alongside Next.js frontend applications with React Query integration. The system also provisions infrastructure code for Docker, RabbitMQ messaging, and Pulumi-based deployments, while automatically generating comprehensive unit and integration test suites for the created code.

How it got here

2020 — CLI modernization and scaffolding expansion

10 changes.

The Craftsman CLI underwent a significant architectural overhaul, migrating to .NET 8 and adopting dependency injection, MediatR, and Spectre.Console for improved structure and user experience. This period focused on expanding the scaffolding engine with new builders for configuration, value objects, and database mappings, while generating immutable DTOs and enhancing error handling with specific exception types.

2021 — Scaffolding modernization and test coverage

9 changes.

The project upgraded its scaffolding infrastructure to target .NET 8 and modernized the test suite by introducing xUnit, NSubstitute, and comprehensive functional and integration test generators. It also enhanced code generation capabilities to support direct DbContext usage, HeimGuard permissions, API versioning, and robust input validation for message bus components.

2022–2023 — comprehensive scaffolding engine expansion

15 changes.

The project significantly expanded its code generation capabilities by introducing a robust domain model and service infrastructure for the Craftsman tool. This period focused on scaffolding full-stack applications, adding support for .NET backend services with Docker and infrastructure integration, as well as Next.js frontend features with TypeScript and React Query. The work also included generating comprehensive integration tests and Pulumi-based authentication infrastructure to streamline the creation of secure, production-ready projects.

Features

Added .editorconfig and test project scaffolding

The repository now includes a comprehensive .editorconfig file that enforces .NET coding conventions, including C\# formatting rules, naming styles, and using directive placement, ensuring consistent code style across the project. Additionally, a new Craftsman.Tests project has been added to the solution, providing a dedicated location for unit and integration tests.

(repo-wide) · high confidence

Added Next.js domain scaffolding builders for TypeScript types and validation

The scaffolding engine now generates specific TypeScript files for Next.js SPA features, including entity index re-exports, API type definitions (Read, Creation, Update DTOs), and Yup-based validation schemas. This allows the tool to produce complete domain-layer TypeScript code for entities, handling property mapping and nullable types automatically.

Craftsman/Builders/NextJs/Domain · high confidence

Added scaffolding for Next.js Domain API layer

The code generator now produces the API client layer for Next.js applications. New builders generate React Query hooks (useAdd, useGet, useGetList, useUpdate, useDelete) and API key definitions for each entity, handling HTTP requests via Axios and managing cache invalidation.

Craftsman/Builders/NextJs/Domain/Api · high confidence

New Next.js scaffolding for entity forms and list tables

The code generator now produces dedicated Next.js feature files for entities, including a form component with validation and autosave, and a paginated list table with permission-based delete and edit actions. These builders generate the React components and TypeScript interfaces required for CRUD operations within the Next.js SPA structure.

Craftsman/Builders/NextJs/Domain/Features · high confidence

New domain enums for scaffolding configuration

The Craftsman domain now includes a comprehensive set of enums in the \Craftsman.Domain.Enums\ namespace to drive code generation. These include \FeatureType\ (defining operations like GetRecord, AddRecord, Job, and GetAll), \EntityModel\ (distinguishing Creation and Update models), \ExampleType\ (configuring scaffolding complexity such as WithAuth or WithBus), and \ValueObjectEnum\ (identifying value objects like Email, Percent, and MonetaryAmount). Additionally, \TypescriptPropertyType\ and \ValueObjectPropertyType\ provide detailed logic for generating TypeScript types, form controls, and validation schemas, while \NextJsDomainCategory\ and \ExchangeTypeEnum\ support frontend and messaging infrastructure configuration.

Craftsman/Domain/Enums · high confidence

New domain model for project scaffolding templates

The scaffolding engine now uses a comprehensive set of domain classes in the Craftsman/Domain layer to represent the structure of generated projects. This includes templates for API configurations (ApiTemplate, AddEntityTemplate), database contexts (DbContextConfig, DbProvider), and entity definitions (Entity, EntityProperty). It introduces typed support for database relationships (DbRelationship) including one-to-many, many-to-one, and one-to-one, as well as configuration for authentication (AuthServerTemplate, AuthSettings), message brokers (Bus, Consumer, Producer), and Docker environments (DockerConfig). This change establishes the data structures required to drive the code generation process.

Craftsman/Domain · high confidence

New scaffolding builders for configuration, value objects, and database mappings

The Craftsman scaffolding engine now includes a suite of new builders that generate foundational project artifacts. AppSettingsBuilder and AppSettingsDevelopmentBuilder create structured JSON configuration files for production and development environments, including connection strings, authentication, and RabbitMQ settings. CommonValueObjectBuilder scaffolds reusable domain value objects such as Address, PostalCode, Percent, and MonetaryAmount. CoreExceptionsBuilder generates a standard set of domain exceptions (NotFound, Validation, Forbidden, NoRolesAssigned). DatabaseEntityConfigBuilder and its associated modifiers scaffold Entity Framework Core configuration files, automatically handling relationship markers, string array types for Postgres, and value object conversions. Additionally, ConsumerRegistrationBuilder generates MassTransit consumer registration code for RabbitMQ exchanges, and CurrentUserServiceBuilder provides a service to extract user claims from HTTP contexts or Hangfire job contexts.

Craftsman/Builders · high confidence

New scaffolding service infrastructure and path helpers

The Craftsman tooling introduces a new \ApiScaffoldingService\ and \EntityScaffoldingService\ to orchestrate the generation of API projects, including database contexts, entity models, DTOs, controllers, and test suites. This is supported by new \ClassPath\ and \ClassPathHelper\ utilities that standardize file and namespace generation across solution directories, alongside a \ScaffoldingDirectoryStore\ for managing project paths. Additional services include \DbMigrator\ for running EF Core migrations, \GitService\ for initializing repositories, and \VersionChecker\ for validating tool updates.

Craftsman/Services · high confidence

Next.js scaffolding now supports custom navigation icons and permission types

The Next.js code generator has been enhanced to allow greater customization of the generated application structure. Users can now specify custom icons for navigation items, which are automatically imported from @tabler/icons and inserted into the side navigation component. Additionally, the generator can now inject specific permission types into the application's permission configuration file, ensuring that generated routes and features are correctly associated with the required access controls.

Craftsman/Builders/NextJs · high confidence

Scaffolded API controllers now include API versioning, permissions, and role management endpoints

The endpoint scaffolding in Craftsman has been updated to generate ASP.NET Core controllers that include built-in API versioning (via Asp.Versioning) and dedicated controllers for managing permissions and roles. Specifically, the scaffolding now produces a PermissionsController that exposes endpoints to list all available permissions and the current user's assigned permissions, and a RolesController that lists available roles. Additionally, the standard entity controllers now support custom user endpoints for adding and removing roles, and the scaffolding logic has been refactored to use primary constructors and MediatR handlers for cleaner code generation.

Craftsman/Builders/Endpoints · high confidence

Scaffolded API versioning, CORS, MassTransit, OpenTelemetry, and service configuration builders

The scaffolding tool now generates dedicated extension builders for core infrastructure services. It creates an API versioning extension that configures URL-segment versioning with Swagger support, a CORS extension that allows all origins in development/testing environments, a MassTransit extension for RabbitMQ integration, and an OpenTelemetry extension that configures Jaeger tracing and metrics. Additionally, it provides a service configuration builder that wires up MediatR, FluentValidation, health checks, and optionally integrates the Hellang ProblemDetails middleware for error handling.

Craftsman/Builders/ExtensionBuilders · high confidence

Scaffolded Dockerfile and Compose builders for BFF and Web API projects

The scaffolding engine now generates Docker artifacts for BFF and Web API projects. BFF Dockerfiles are generated using .NET 6 SDK/runtime images with optional Node.js 16 installation, while Web API Dockerfiles use .NET 8 SDK/runtime images. Additionally, the system creates a \.dockerignore\ file and manages \docker-compose.yaml\ updates to include services for RabbitMQ (with configurable ports) and Jaeger (with randomized free ports for its various endpoints).

Craftsman/Builders/Docker · high confidence

Scaffolding for Pulumi-based Keycloak authentication server

The AuthServer builder now generates a complete Pulumi infrastructure project to provision a Keycloak realm. This includes a Pulumi program (RealmBuild.cs) that creates the realm, configures client scopes, and provisions seed users (Bob and Alice). It also generates helper classes: a ClientFactory for creating Code Flow and Client Credentials clients, extension methods to manage default scopes and audience mappers, a ScopeFactory for defining scopes, and UserExtensions for assigning roles. Additionally, Pulumi configuration files (Pulumi.yaml and Pulumi.dev.yaml) are scaffolded to manage the Keycloak connection details.

Craftsman/Builders/AuthServer · high confidence

Scaffolding for role-based permissions and user policy handling

The scaffolding tool now generates a Permissions class containing constants for role management actions (adding/removing roles, getting roles/permissions) and a UserPolicyHandler that enforces these permissions. The handler checks for a SuperAdmin role to grant full access, otherwise queries the database for the user's specific permissions based on their assigned roles, and automatically seeds a root super-admin user if none exist.

Craftsman/Builders/Auth · high confidence

Behavioural changes

CLI application restructured with dependency injection and enhanced command scaffolding

The Craftsman CLI has been rewritten to use Microsoft.Extensions.DependencyInjection for dependency injection, replacing the previous global singleton approach. This change introduces a new \TypeRegistrar\ to bridge Spectre.Console.Cli with the DI container and adds an \OperatingSystemInterceptor\ to ensure consistent emoji rendering on Windows. Users benefit from a more robust command structure that now explicitly supports scaffolding entities, bounded contexts, features, message buses, auth servers, and consumers via YAML/JSON templates, along with a new \add next entity\ command for NextJS projects. The application also integrates MediatR for command handling and includes a version checker that runs after execution.

Craftsman · high confidence

CLI scaffolding commands refactored to use MediatR pipeline and Spectre.Console

The command handlers in Craftsman/Commands have been rewritten to use the MediatR pipeline for delegating scaffolding logic to dedicated builder commands, replacing the previous direct implementation approach. This change also migrates the CLI interface to Spectre.Console, introducing interactive prompts for commands like AddFeature and RegisterProducer, and adds new commands such as AddAuthServer, AddBus, and RegisterProducer to support scaffolding authentication servers, message bus infrastructure, and producer registrations.

Craftsman/Commands · high confidence

DTOs generated as immutable records with log masking and pagination support

The scaffolding tool now generates Data Transfer Objects (DTOs) as C\# records instead of mutable classes, improving immutability and value-based equality. Read parameters now inherit from a new BasePaginationParameters class (with a max page size of 500) and support nullable filters and sort orders. Additionally, properties marked for log masking are automatically annotated with \[LogMasked\] in the generated code to prevent sensitive data leakage in logs.

Craftsman/Builders/Dtos · high confidence

Generate C\# 9+ sealed record entity models with log masking support

The scaffolding tool now generates entity models as C\# sealed records instead of traditional classes, providing immutable data structures for the application domain. This change introduces support for string array properties, which are initialized to empty arrays by default, and adds the ability to mask sensitive properties in logs using the \[LogMasked\] attribute when the corresponding entity property is configured for log masking. The builder creates separate model files for creation and update scenarios, ensuring that only primitive types, string arrays, and value objects are included as properties while excluding those with database relationships or non-manipulable flags.

Craftsman/Builders/EntityModels · high confidence

Input validation for producer, consumer, and message definitions

The Craftsman tool now enforces required fields when generating or modifying message bus components. New validators ensure that Producer, Consumer, and Message definitions include non-empty values for their respective names, exchange names, queue names, and endpoint registration method names, providing clear error messages to guide users in correctly configuring MassTransit bindings.

Craftsman/Validators · high confidence

Introduces Spectre.Console-based CLI output and sponsorship request

The Craftsman CLI now uses the Spectre.Console library for all console interactions, replacing previous output methods. This change introduces a new \ConsoleWriter\ component that formats informational, error, warning, and help messages with specific colors and styles. Additionally, the tool now prompts users for support after use, offering a choice to open a GitHub sponsorship page (https://github.com/sponsors/pdevito3) rather than a star request, with platform-specific handling for Windows, Linux, and macOS.

Craftsman/Helpers · high confidence

Introduction of specific exception types for validation and configuration errors

The Craftsman tool now includes a dedicated set of exception classes in the \Craftsman.Exceptions\ namespace to provide clearer error reporting. These new types, such as \DataValidationErrorException\, \DirectoryAlreadyExistsException\, \EntityNotFoundException\, and \InvalidDbProviderException\, replace generic error handling with specific, typed exceptions that implement the \ICraftsmanException\ interface. This change improves the user experience by delivering precise, context-aware error messages for issues like invalid file types, unrecognized database providers, or missing solution files.

Craftsman/Exceptions · high confidence

Next.js scaffolding now generates permission-controlled entity pages

The Next.js code generator now produces index, new, and edit pages for entities that enforce role-based access control. These generated pages import the \useHasPermission\ hook and conditionally render the entity forms or tables only when the user holds the required \AddRecord\, \GetList\, or \UpdateRecord\ permissions; otherwise, a \Forbidden\ component is displayed. The scaffolding also includes proper \\<Head\>\ tags for page titles and integrates with the existing \PrivateLayout\, \SearchInput\, and \PaginatedTableProvider\ components.

Craftsman/Builders/NextJs/Domain/Pages · high confidence

Scaffolding for CRUD features now uses DbContext directly with HeimGuard permissions

The feature builders in Craftsman/Builders/Features have been rewritten to generate CQRS commands and queries that interact with the DbContext directly instead of using repository abstractions. All generated handlers now accept the DbContext as a constructor parameter and use AsNoTracking for read operations. Additionally, protected features now include HeimGuard permission checks (MustHavePermission) injected via IHeimGuardClient, and the scaffolding supports new feature types including batch add (CommandAddListBuilder), user role management (CommandAddUserRoleBuilder/CommandRemoveUserRoleBuilder), and background jobs (JobFeatureBuilder).

Craftsman/Builders/Features · high confidence

Scaffolding updates to .NET 8 and modernized test infrastructure

The project scaffolding templates in the Craftsman builders have been upgraded to target .NET 8.0 for the Web API, Functional Tests, Integration Tests, Shared Tests, and Unit Tests projects. The test project builders now utilize xUnit, NSubstitute, and AutoBogusLifesupport, replacing previous testing frameworks. Additionally, the BFF project builder now scaffolds a .NET 6.0 project with Duende BFF and Yarp, while the Auth Server builder generates a .NET 8.0 project with Pulumi.Keycloak.

Craftsman/Builders/Projects · high confidence

Test coverage

Added functional test infrastructure for health checks and foreign key relationships; Added integration test builders for role permissions; Added integration test scaffolding for user role assignment; Added test fakes and builders for entity scaffolding; Added tests for solution file detection and message deserialization; Generated integration tests for User CRUD operations; Integration test scaffolding for CRUD and list operations; Scaffolding for functional and integration test infrastructure; Scaffolding for generated unit tests.

Dependencies

Upgrade to .NET 8 and add test project

The Craftsman tool has been upgraded from .NET Core 3.1 to .NET 8, bringing it in line with the latest runtime and library support. A new test project (Craftsman.Tests) has been added, utilizing xUnit, FluentAssertions, and Microsoft.NET.Test.Sdk. The main project now includes several new dependencies such as Ardalis.SmartEnum, FluentValidation, Humanizer.Core, LibGit2Sharp, MediatR, MinVer, Spectre.Console, and System.IO.Abstractions, enhancing its capabilities for scaffolding and CLI interaction.

(dependencies) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 37 → 37 (+0.1)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 43 → 43 (-0.1)
  • Architecture 78 → 74 (-4.5)
  • Maturity 60 → 64 (+3.7)
  • Readiness 47 → 50 (+2.6)
  • Security 23 → 23 (-0.6)
  • Performance 60 → 60 (+0.0)

Resolved (3)

  • Coverage not measured — no coverage collector is wired up
  • Split Craftsman
  • XML-doc coverage: Craftsman (Craftsman/Craftsman.csproj)

New (2)

  • Projects may be oversized for their cohesion (Craftsman/Craftsman.csproj)
  • doc comments repeat the names (Craftsman/Domain/DbContextConfig.cs)

Architecture

  • Unchanged — 2 containers · 0 contexts · 0 edges

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

pdevito3/craftsman was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 7 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 018b2218483da1ff2347d917da6e5da0c24a8a96 — the exact code this score is about.
  • Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.3+preprod-45ab2cab63de.