|
| 1 | +# AI Instructions for SpdxModel |
| 2 | + |
| 3 | +This file provides specific context and instructions for AI coding agents to |
| 4 | +interact effectively with this C# project. |
| 5 | + |
| 6 | + |
| 7 | +## Project Overview |
| 8 | + |
| 9 | +SpdxModel is a C# library for serializing and deserializing SPDX SBOMs into an |
| 10 | +in-memory representation suitable for manipulation and analysis. |
| 11 | + |
| 12 | + |
| 13 | +## Technologies and Dependencies |
| 14 | + |
| 15 | +* **Language**: C# 12 |
| 16 | +* **.NET Frameworks**: .NET 8, 9, and 10 |
| 17 | +* **Primary Dependencies**: [System.Text.Json] |
| 18 | + |
| 19 | + |
| 20 | +## Project Structure |
| 21 | + |
| 22 | +The repository is organized as follows: |
| 23 | + |
| 24 | +* `/.config/`: Contains the .NET Tool configuration. |
| 25 | +* `/.github/workflows/`: Contains the CI/CD pipeline configurations. |
| 26 | +* `/src/DemaConsulting.SpdxModel/`: Contains the library source code. |
| 27 | +* `/test/DemaConsulting.SpdxModel.Tests/`: Contains the library unit tests. |
| 28 | +* `/DemaConsulting.SpdxModel.sln`: The main Visual Studio solution file. |
| 29 | + |
| 30 | + |
| 31 | +## Development Commands |
| 32 | + |
| 33 | +Use these commands to perform common development tasks: |
| 34 | + |
| 35 | +* **Restore DotNet Tools**: |
| 36 | + ```bash |
| 37 | + dotnet tool restore |
| 38 | + ``` |
| 39 | + |
| 40 | +* **Build the Project**: |
| 41 | + ```bash |
| 42 | + dotnet build |
| 43 | + ``` |
| 44 | + |
| 45 | +* **Run All Tests**: |
| 46 | + ```bash |
| 47 | + dotnet test |
| 48 | + ``` |
| 49 | + |
| 50 | + |
| 51 | +## Testing Guidelines |
| 52 | + |
| 53 | +* Tests are located under the `/test/DemaConsulting.SpdxModel.Tests/` folder and use the MSTest framework. |
| 54 | +* Test files should end with `.cs` and adhere to the naming convention `[Component]Tests.cs`. |
| 55 | +* All new features should be tested with comprehensive unit tests. |
| 56 | +* The build must pass all tests and static analysis warnings before merging. |
| 57 | +* Tests should be written using the AAA (Arrange, Act, Assert) pattern. |
| 58 | + |
| 59 | + |
| 60 | +## Code Style and Conventions |
| 61 | + |
| 62 | +* Follow standard C# naming conventions (PascalCase for classes/methods/properties, camelCase for local variables). |
| 63 | +* Use nullable reference types (`#nullable enable`). |
| 64 | +* Warnings are treated as errors (`<WarningsAsErrors>true</WarningsAsErrors>`). |
| 65 | +* Avoid public fields; prefer properties. |
| 66 | + |
| 67 | + |
| 68 | +## Boundaries and Guardrails |
| 69 | + |
| 70 | +* **NEVER** modify files within the `/obj/` or `/bin/` directories. |
| 71 | +* **NEVER** commit secrets, API keys, or sensitive configuration data. |
| 72 | +* **ASK FIRST** before making significant architectural changes to the core library logic. |
0 commit comments