This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Artex is a single lightweight ASP.NET Core service hosting NuGet V3 and Maven repositories
# Restore, build, test
dotnet restore Artex.sln
dotnet build Artex.sln
dotnet test Artex.sln --no-restore --no-build --verbosity normal
# Run a single test project
dotnet test Artex.Tests/Artex.Tests.csproj --no-restore --no-build --verbosity normal
# Run a single test by name
dotnet test Artex.sln --no-restore --no-build --filter "FullyQualifiedName~TestClassName.TestMethodName"
# Build with CI flag (used in GitHub Actions)
dotnet build --no-restore /p:ContinuousIntegrationBuild=true
# Test with coverage
dotnet test Artex.sln --no-restore --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutput="../CoverageResults/" /p:MergeWith="../CoverageResults/coverage.json" /p:CoverletOutputFormat=\"opencover,json\"Test framework: NUnit 4.x. Both Artex and Artex.Tests target .NET 10.0 (net10.0).
| Project | Purpose |
|---|---|
| Artex | Carter-based REST endpoints providing minimal lightweight NuGet V3 and Maven repositories |
| Artex.Tests | NUnit test fixtures for the Artex service |
Root namespace is PackageRegistry (set in .csproj). Sub-namespaces follow a layer convention:
| Namespace | Contents |
|---|---|
PackageRegistry.Models |
MavenArtifact, NuGetPackage, PackageSearchResult |
PackageRegistry.Storage |
IPackageStorage, FileSystemPackageStorage |
PackageRegistry.Services |
IMavenService, MavenService, INuGetService, NuGetService |
PackageRegistry.Modules |
ApiModule, MavenModule, NuGetModule |
Artex.Tests |
Test fixtures |
| Package | Version | Used in |
|---|---|---|
Carter |
10.0.0 | Artex (module routing) |
System.IO.Compression |
4.3.0 | Artex (package handling) |
NUnit |
4.5.0 | Artex.Tests |
coverlet |
8.0.0 | Artex.Tests (coverage) |
Settings live in appsettings.json:
| Key | Default | Purpose |
|---|---|---|
Storage:Path |
./packages |
Root directory for stored packages |
Auth:NuGetApiKey |
— | API key for NuGet push authentication |
Auth:MavenToken |
— | Bearer token for Maven push authentication |
All three services (FileSystemPackageStorage, MavenService, NuGetService) are registered as singletons in Program.cs. The storage abstraction (IPackageStorage) can be swapped for S3/Blob implementations without changing service code.
| Module | Base path | Purpose |
|---|---|---|
NuGetModule |
/v3/ |
NuGet V3 protocol endpoints |
MavenModule |
/maven/ |
Maven repository endpoints |
ApiModule |
/api/ |
General API endpoints |
Non-API routes fall back to a SPA frontend served via app.UseStaticFiles() and app.MapFallbackToFile("index.html").
- 4 spaces indentation, no tabs
- No
_prefix on member names; usethis.for instance members - Use
varunless the type is ambiguous - Use C# type aliases (
int,string, notInt32,String) - Always wrap blocks in curly braces, even single-line
usingstatements go inside the namespaceSystem.*namespaces go first, then other namespaces shall be sorted alphabeticaly- No
#regiondirectives - All public members require XML documentation (
///)
- We use SonarQube with a quality gate that expects at least 80% code coverage on new code.
- When writing new code, always add or update unit tests to meet this coverage threshold.
- Run coverage locally with the
dotnet testcoverage command in Build & Test Commands above.
Every .cs file must have the Apache 2.0 copyright header:
// -------------------------------------------------------------------------------------------------
// <copyright file="FileName.cs" company="Starion Group S.A.">
//
// Copyright (C) 2026 Starion Group S.A.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
// ------------------------------------------------------------------------------------------------- Default branch:
development(never work directly on main) - Create feature branches from
development - Rebase before submitting PRs
- This is a C# codebase, refrain from using Python to verify the correctness of the implementation.