Skip to content

Latest commit

 

History

History
85 lines (61 loc) · 3.6 KB

File metadata and controls

85 lines (61 loc) · 3.6 KB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Build and Development Commands

Building the Project

dotnet build -c Release

Packaging as NuGet Tool

dotnet pack

The NuGet packages are output to ./nupkg/ directory.

Installing/Updating the Tool Locally

# Install globally
dotnet tool install --global HC.Dev

# Update to latest
dotnet tool update --global HC.Dev

Architecture Overview

This is a .NET 8.0 command-line tool (dev) that simplifies common development tasks for .NET projects. The tool is distributed as a NuGet package (HC.Dev).

Core Components

  • Program.cs: Main entry point that handles command routing and execution. Uses Spectre.Console for terminal UI.
  • SemVer.cs: Semantic versioning implementation for version bumping operations.
  • Dev.csproj: Project configuration with NuGet package metadata and tool configuration.

Key Features Implementation

  1. Command System: The tool supports both built-in commands and custom commands via commands.json configuration files.

  2. Solution/Project Detection: Automatically detects .sln, .slnx, or .csproj files in the current directory to determine context.

  3. Version Management: Uses regex pattern <Version>(?<version>.*)</Version> to find and update versions in project files.

  4. Cross-Platform Support: Uses RuntimeInformation.IsOSPlatform() to handle platform-specific behaviors (Windows vs Linux/macOS).

Command Aliases

  • bbuild
  • cclean
  • h or ?help
  • ffrontend
  • vbump
  • vcbump-commit

Command Combinations

Commands can be combined using the + operator to execute them sequentially (e.g., dev b+f to build then run frontend). Execution stops if any command fails.

External Dependencies

  • Microsoft.VisualStudio.SolutionPersistence: For parsing solution files
  • Spectre.Console: For rich terminal UI
  • ThisAssembly.AssemblyInfo/Git: For build-time assembly information

Security & STRIDE Threat Model

This project maintains a STRIDE threat model in STRIDE.md. When making changes, always review whether STRIDE.md needs updating. This applies to:

  • New features that introduce trust boundaries, external process execution, file I/O, or user input handling
  • Security-related changes such as trust mechanisms, authentication, input validation, or sandboxing
  • Changes to existing threats — if a mitigation is implemented, update the affected threat's severity and mitigation column
  • New configuration surfaces — any new config files, environment variables, or CLI flags that could be abused
  • Dependency changes — new external processes, Docker images, NuGet packages, or network calls

When updating STRIDE.md:

  1. Update the version and date at the top
  2. Add/modify threat entries in the appropriate STRIDE category
  3. Update the Risk Summary table
  4. Update the Recommended Mitigations section (strike through completed items)

Important Implementation Notes

  • When bumping versions, the tool preserves the original version structure (major.minor.build.fix-suffix+buildvars).
  • The frontend command uses Docker image ghcr.io/stevehansen/vidyano-frontend-builder:latest.
  • Build files (build.cmd on Windows, build.sh on Linux/macOS) take precedence over dotnet build if they exist.
  • The clean command removes bin, obj, tmp-build, and platform-specific build directories, excluding node_modules.
  • Custom commands in commands.json support placeholders: {sln}, {project}, {dir}.