Versuche und Ergebnisse Umstrukturiert
This commit is contained in:
@@ -25,11 +25,27 @@ Fokus auf ISO/IEC/IEEE-29148-konforme Requirements-Spezifikation ueber drei Eben
|
||||
| Analysierte Quellartefakte | 34 C# Projekte, 12.507+ Source Files |
|
||||
| Separate Traceability-CSV (Dateien / Zeilen) | 0 / 0 |
|
||||
|
||||
## Vorgehen
|
||||
- Einfacher Prompt zu Claude Code
|
||||
- Keine Agents
|
||||
- Keine MCP Server
|
||||
|
||||
## Verwendeter Prompt
|
||||
```text
|
||||
Please analyze this software project and write a reuqirements specification according to modern standards.
|
||||
```
|
||||
|
||||
## Agenten (Beispiele)
|
||||
- Keine Agenten in V01 verwendet (Baseline ohne agentische Zerlegung)
|
||||
|
||||
## Ergebnisbeispiele aus `Ergebnisse`
|
||||
- `Ergebnisse/ISO29148_Complete_Requirements_Specification.md`
|
||||
- Dokumentiert 277 Requirements (35 StRS + 75 SyRS + 167 SwRS)
|
||||
- Enthaltene Evidenzbasis: 5.000+ File-Referenzen (laut Dokumentkopf)
|
||||
- `Ergebnisse/system/SyRS_Complete_Detailed.md`
|
||||
- Vollstaendige SyRS-Struktur mit funktionalen, Schnittstellen-, Performance- und Security-Anforderungen
|
||||
- `Ergebnisse/software/SwRS_Complete_Detailed.md`
|
||||
- Detaillierte Software-Anforderungen inkl. Verifikationsbezug
|
||||
|
||||
## Evaluation-Hinweis
|
||||
Starker Fokus auf formale Requirements-Qualitaet und Traceability; konsolidierte Zaehlung erfolgt in `Requirements.md`.
|
||||
|
||||
## Vorgehen
|
||||
- Einfacher Prompt zu Claude Code ohne Agents oder MCP Server
|
||||
|
||||
## Prompt
|
||||
"Please analyze this software project and write a reuqirements specification according to modern standards."
|
||||
@@ -1,20 +1,23 @@
|
||||
# Versuch 02 - Requirements (konsolidiert)
|
||||
|
||||
## Konsolidierungsentscheidung
|
||||
Use Cases und Anforderungen werden als gleiches Zielobjekt betrachtet. In Versuch 02 liegen die Features/Faehigkeiten ueberwiegend als Use Cases vor (keine vollstaendige StRS/SyRS/SwRS-Gliederung).
|
||||
Use Cases und Anforderungen werden als gleiches Zielobjekt betrachtet. In Versuch 02 sind Use Cases in den Stakeholder-Diagrammen dokumentiert, aber inhaltlich mit den formalen Anforderungen verknuepft (Traceability auf StR-IDs). Daher erfolgt eine deduplizierte Konsolidierung.
|
||||
|
||||
## Cluster-Liste
|
||||
| Cluster | Anzahl |
|
||||
| --- | ---: |
|
||||
| Formale Anforderungen (StRS+SyRS+SwRS) | 0 |
|
||||
| Dokumentierte Use Cases | 509 |
|
||||
| Neu entdeckte (vormals undokumentierte) Use Cases | 1211 |
|
||||
| Ueberlappung Use Cases <-> Anforderungen (abgezogen) | 0 |
|
||||
| Stakeholder-Anforderungen (StRS) | 84 |
|
||||
| System-Anforderungen (SyRS) | 53 |
|
||||
| Software-Anforderungen (SwRS) | 83 |
|
||||
| Explizite Use Cases (Diagramme) | 46 |
|
||||
| Ueberlappung Use Cases <-> Anforderungen (konservativ abgezogen) | 46 |
|
||||
|
||||
## Summen
|
||||
- Rohsumme (`Requirements + Use Cases`): **1720**
|
||||
- **Konsolidierte Requirements/Faehigkeiten gesamt: 1720**
|
||||
- Rohsumme (`Requirements + Use Cases`): **266**
|
||||
- **Konsolidierte Requirements/Faehigkeiten gesamt: 220**
|
||||
|
||||
## Hinweis
|
||||
- Die Zahl `1720` ist bereits dedupliziert als "Total System Functionality".
|
||||
- Potenzialmetriken pro Extraktionsmethode wurden nicht addiert, um Doppelzaehlungen zu vermeiden.
|
||||
## Use-Case-Cluster (Nachweis)
|
||||
- Sales Management: 13
|
||||
- Helpdesk Management: 17
|
||||
- Financial Management: 16
|
||||
- Summe explizite Use Cases: 46
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# AGENTS.md
|
||||
# AGENTS.md
|
||||
|
||||
This file provides guidance to Codex when working with code in this repository.
|
||||
|
||||
@@ -31,14 +31,6 @@ Available targets:
|
||||
- `run-tests` - Execute all test suites
|
||||
- `create-installers` - Build MSI installers
|
||||
|
||||
## Agent Notes
|
||||
|
||||
- Default shell is PowerShell (`pwsh`). Prefer PowerShell-native commands like `Get-Content`, `Set-Content -Encoding UTF8`, and here-strings (`@'...'@`) instead of Unix tools (`sed`, `nl`, etc.).
|
||||
- Use `rg`/`rg --files` for fast searches—they are available by default.
|
||||
- Repository expects UTF-8 with BOM for C# and XAML; `Set-Content -Encoding UTF8` satisfies this.
|
||||
- Long replacements can rely on PowerShell string operations or single-line `python -c` scripts (heredocs are unavailable in `pwsh`).
|
||||
- `dotnet build Centron.sln` may warn about `libfintx.FinTSConfig`; this is expected and can be ignored for success checks.
|
||||
|
||||
### Publishing
|
||||
- **Publish WPF UI**: `dotnet publish src/centron/Centron.WPF.UI/Centron.WPF.UI.csproj -c Release -r win-x64 --self-contained`
|
||||
- **Publish Web Service**: `dotnet publish src/webservice/Centron.Host.WindowsService/Centron.Host.WindowsService.csproj -c Release -r win-x64 --self-contained`
|
||||
@@ -292,4 +284,4 @@ When adding new documentation to the project:
|
||||
- Supports both standalone and web service deployment modes
|
||||
- Always test database scripts before committing
|
||||
- Use German for all user-facing text with English translations
|
||||
- Follow dual implementation pattern (BL + WS) for all data access
|
||||
- Follow dual implementation pattern (BL + WS) for all data access
|
||||
@@ -1,248 +1,316 @@
|
||||
# c-entron.NET
|
||||
# CLAUDE.md
|
||||
|
||||
> ⚠️ **FOR CLAUDE AI - NOT FOR DEVELOPERS**
|
||||
>
|
||||
> This file contains project conventions and patterns that Claude AI uses to generate correct code.
|
||||
> **Developers**: See [.claude/README.md](.claude/README.md) for user documentation.
|
||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||
|
||||
> **v2.1.0** | 2025-01-20 | ERP for German SMBs | C# .NET 8 | WPF + REST API
|
||||
## Development Commands
|
||||
|
||||
## Stack
|
||||
**Core**: C# 12, .NET 8 | **Frontend**: WPF + Blazor Server, DevExpress 24.2.7 (WPF & Blazor), MVVM | **Backend**: ASP.NET Core 8, SQL Server 2019+, NHibernate 5.x, JWT auth | **Real-Time**: SignalR | **Build**: Azure DevOps, Centron.Scripts, WiX MSI | **Test**: NUnit
|
||||
### Building
|
||||
- **Build entire solution**: `dotnet build Centron.sln`
|
||||
- **Build specific project**: `dotnet build src/centron/Centron.WPF.UI/Centron.WPF.UI.csproj`
|
||||
- **Build for Release**: `dotnet build Centron.sln -c Release`
|
||||
|
||||
### Testing
|
||||
- **Run all tests**: `dotnet test Centron.sln`
|
||||
- **Run specific test project**: `dotnet test tests/backend/Centron.Tests.BL/Centron.Tests.BL.csproj`
|
||||
- **Run integration tests**: `dotnet test tests/Centron.Tests.Integration/Centron.Tests.Integration.csproj`
|
||||
- **Run end-to-end tests**: `dotnet test tests/Centron.Tests.EndToEnd/Centron.Tests.EndToEnd.csproj`
|
||||
|
||||
### Using Centron.Scripts Build System
|
||||
The project uses a custom build system via Centron.Scripts for complete builds:
|
||||
|
||||
```bash
|
||||
cd scripts/Centron.Scripts
|
||||
dotnet run -- <target>
|
||||
```
|
||||
|
||||
Available targets:
|
||||
- `clean` - Clean artifacts and bin/obj directories
|
||||
- `setup-versioning` - Set up version information
|
||||
- `build-web-service` - Build the web service components
|
||||
- `build-centron-net` - Build the WPF client application
|
||||
- `run-tests` - Execute all test suites
|
||||
- `create-installers` - Build MSI installers
|
||||
|
||||
### Publishing
|
||||
- **Publish WPF UI**: `dotnet publish src/centron/Centron.WPF.UI/Centron.WPF.UI.csproj -c Release -r win-x64 --self-contained`
|
||||
- **Publish Web Service**: `dotnet publish src/webservice/Centron.Host.WindowsService/Centron.Host.WindowsService.csproj -c Release -r win-x64 --self-contained`
|
||||
|
||||
## Project Architecture
|
||||
|
||||
### High-Level Structure
|
||||
This is a .NET 8 enterprise application with a multi-layered architecture:
|
||||
|
||||
## Structure
|
||||
```
|
||||
src/
|
||||
├── apis/ - External integrations (FinAPI, GLS, Shipcloud, ITscope, etc.)
|
||||
├── backend/ - BL, DAO, Entities, Interfaces, EDI
|
||||
├── centron/ - WPF UI (Desktop)
|
||||
├── CentronNexus/ - Blazor Server (Web Portal)
|
||||
├── shared/ - Core, Controls
|
||||
└── webservice/ - REST API, Hosts
|
||||
tests/ - BL, DAO, Integration, E2E
|
||||
.claude/ - agents/, commands/, hooks/, settings.json
|
||||
├── apis/ - External API integrations (FinAPI, GLS, Shipcloud, etc.)
|
||||
├── backend/ - Core business logic layer
|
||||
│ ├── Centron.BL/ - Business Logic layer
|
||||
│ ├── Centron.Common/ - Common utilities and helpers
|
||||
│ ├── Centron.DAO/ - Data Access Objects (NHibernate)
|
||||
│ ├── Centron.Entities/ - Domain entities
|
||||
│ ├── Centron.Gateway/ - External service gateways
|
||||
│ └── Centron.Interfaces/ - Service interfaces
|
||||
├── centron/ - WPF client application
|
||||
│ ├── Centron.WPF.UI/ - Main WPF application
|
||||
│ └── Centron.WPF.UI.Extension/ - UI extensions
|
||||
├── shared/ - Shared components and controls
|
||||
│ ├── Centron.Core/ - Core shared functionality
|
||||
│ ├── Centron.Controls/ - Custom UI controls
|
||||
│ └── Centron.Controls.Preview/ - Preview controls
|
||||
└── webservice/ - Web service components
|
||||
├── Centron.Host/ - Web service host
|
||||
├── Centron.Host.Console/ - Console host
|
||||
├── Centron.Host.WindowsService/ - Windows service host
|
||||
├── Centron.WebServices.Core/ - Web service core
|
||||
└── c-entron.misc.ConnectionManager/ - Connection management
|
||||
```
|
||||
|
||||
**Key Files**: `src/centron/Centron.WPF.UI/App.xaml.cs` (WPF), `src/webservice/Centron.Host.WindowsService/Program.cs` (Service), `Centron.sln`, `version.json`
|
||||
### Data Access Pattern
|
||||
The application uses a dual data access pattern supporting both direct database access and web service communication:
|
||||
|
||||
## Naming
|
||||
- **C# Classes**: `PascalCase`, Interfaces: `IPascalCase`, Methods: `PascalCase`, Private: `_camelCase`, Local: `camelCase`
|
||||
- **DB Tables**: `PascalCase` English (new), Keep German (legacy), PK: `I3D` (int IDENTITY), FK: `{Table}I3D`
|
||||
- **Standard Columns**: `CreatedByI3D`, `CreatedDate`, `ChangedByI3D`, `ChangedDate`, `IsDeleted`, `DeletedByI3D`, `DeletedDate`
|
||||
- **BL Pattern**: `I{Module}Logic`, `BL{Module}Logic`, `WS{Module}Logic`, `{Entity}BL`, `{Entity}WebServiceBL`
|
||||
#### WPF UI Architecture (3-layer pattern | ILogic Interface Pattern)
|
||||
All data operations in the UI must use the ILogic interface accessed through ClassContainer:
|
||||
- WPF UI modules use a 3-part data access pattern:
|
||||
- I{Module}Logic interface - Defines the contract
|
||||
- BL{Module}Logic (NHibernate/SQL Server) - Direct database access via NHibernate
|
||||
- WS{Module}Logic (REST API) - Web service access via REST API
|
||||
- Access via ClassContainer.Instance.WithInstance((ILogic logic) => ...).ThrowIfError();
|
||||
- Connection types controlled by AppModuleController:
|
||||
- CentronConnectionType.CentronWebServices ➜ WSLogic
|
||||
- CentronConnectionType.SqlServer ➜ BLLogic
|
||||
|
||||
## Critical Patterns
|
||||
|
||||
### Result Pattern (MANDATORY)
|
||||
```csharp
|
||||
public Result<T> Method() {
|
||||
try {
|
||||
var data = _dao.Get<T>(id);
|
||||
return data == null ? Result.Error<T>("Not found") : Result.Success(data);
|
||||
} catch (Exception ex) { return Result.Error<T>(ex); }
|
||||
}
|
||||
```
|
||||
|
||||
### UI Data Access (MANDATORY)
|
||||
```csharp
|
||||
// Single use
|
||||
var result = await ClassContainer.Instance
|
||||
.WithInstance((IEntityLogic logic) => logic.GetEntity(id))
|
||||
var result = await ClassContainer
|
||||
.Instance
|
||||
.WithInstance((IAccountContractsLogic logic) => logic.GetAccountContracts(filter))
|
||||
.ThrowIfError();
|
||||
|
||||
// Multiple uses (IDisposable)
|
||||
private readonly IEntityLogic _logic;
|
||||
public ViewModel() { _logic = ClassContainer.Instance.GetInstance<IEntityLogic>(); }
|
||||
public void Dispose() { ClassContainer.Instance.ReleaseInstance(_logic); }
|
||||
```
|
||||
|
||||
### Architecture
|
||||
**WPF UI** → `I{Module}Logic` (ClassContainer) → `BL{Module}Logic` (SQL) OR `WS{Module}Logic` (REST)
|
||||
**REST API** → `CentronRestService` → `{Entity}WebServiceBL` (DTO conversion) → `{Entity}BL` (Business Logic) → DAO → NHibernate → SQL Server
|
||||
#### Backend Architecture (2-layer pattern)
|
||||
- Backend uses a 2-layer BL approach for web service implementation:
|
||||
- Base BL class (e.g., AccountDeviceBL) - contains core business logic and database access via DAO
|
||||
- WebService BL class (e.g., AccountDeviceWebServiceBL) - handles DTO conversion and calls base BL
|
||||
- WebService BL pattern:
|
||||
- Inherits from BaseBL and creates instance of corresponding base BL class
|
||||
- Converts DTOs to entities using conversion methods (ConvertAccountDeviceDTOToAccountDevice)
|
||||
- Uses ObjectMapper for entity-to-DTO conversion
|
||||
- Ensures DTO entities are not connected to NHibernate database context for API security
|
||||
- API implementation in ICentronRestService and CentronRestService:
|
||||
- API methods call WebService BL classes
|
||||
- All API operations use DTO entities for data transfer
|
||||
- Example: SaveAccountDevice API method → AccountDeviceWebServiceBL.SaveAccountDevice → AccountDeviceBL.SaveAccountDevice
|
||||
|
||||
Connection types: `CentronConnectionType.SqlServer` (BLLogic) | `CentronConnectionType.CentronWebServices` (WSLogic)
|
||||
### Technology Stack
|
||||
- **.NET 8** - Primary framework
|
||||
- **WPF** - Desktop UI framework
|
||||
- **NHibernate** with **FluentNHibernate** - ORM for database access
|
||||
- **DevExpress 24.2.7** - UI controls and components
|
||||
- **Bullseye** - Build orchestration
|
||||
- **Entity Framework** - Some components use EF alongside NHibernate
|
||||
|
||||
## Database Conventions (MUST FOLLOW)
|
||||
- **PK**: `I3D` [int] IDENTITY(1,1) NOT NULL (auto-created by `ScriptHelpers.AddTableIfNotExists()`)
|
||||
- **FK**: End with `I3D` suffix (e.g., `AccountI3D`)
|
||||
- **Standard Columns**: CreatedByI3D, CreatedDate, ChangedByI3D, ChangedDate, IsDeleted, DeletedByI3D, DeletedDate (all REQUIRED)
|
||||
- **Types**: `nvarchar` (NOT varchar), `datetime2(2)`, `bit`, `decimal(18,2)` for currency
|
||||
- **Naming**: English PascalCase (new), Keep German (legacy), `dbo` schema
|
||||
### Connection Types
|
||||
Modules support different connection types declared in AppModuleController:
|
||||
- `CentronConnectionType.CentronWebServices` - Uses WSLogic implementation
|
||||
- `CentronConnectionType.SqlServer` - Uses BLLogic implementation
|
||||
|
||||
### Creating Database Scripts
|
||||
1. Reserve number in Teams: `c-entron Entwickler` → Files → `Datenbankupdate 2 1.xlsx`
|
||||
2. Create: `src/backend/Centron.BL/Administration/Scripts/ScriptMethods/Scripts/ScriptMethod{number}.cs`
|
||||
3. Implement `BaseScriptMethod` with `GetSqlQueries()`
|
||||
4. Use `ScriptHelpers.*` (AddTableIfNotExists, AddColumnIfNotExists, AddRightIfNotExists, etc.)
|
||||
5. **Convert to UTF-8 with BOM** (C# files require BOM)
|
||||
## Development Guidelines
|
||||
|
||||
## Localization (REQUIRED)
|
||||
- **Primary**: German (`LocalizedStrings.resx`) | **Secondary**: English (`LocalizedStrings.en.resx`)
|
||||
- **Code**: `LocalizedStrings.KeyName` | **XAML**: `{x:Static properties:LocalizedStrings.KeyName}`
|
||||
- **Key Format**: `{ClassName}_{Method}_{Description}`
|
||||
### Code Style and Standards
|
||||
- KISS
|
||||
- DRY
|
||||
- SOLID
|
||||
- Clean Architecture
|
||||
|
||||
## File Encoding (CRITICAL)
|
||||
- **UTF-8 WITH BOM**: `*.cs`, `*.xaml` (MANDATORY)
|
||||
- **UTF-8 NO BOM**: `*.md`, `*.json`, `*.xml`, `*.config`
|
||||
### General Rules
|
||||
- Write self-explanatory code and only comment when absolutely necessary
|
||||
- When updating code, always update DocStrings
|
||||
|
||||
**PowerShell Conversion**:
|
||||
```powershell
|
||||
$file = 'path\to\file.cs'
|
||||
$content = [System.IO.File]::ReadAllText($file)
|
||||
$utf8BOM = New-Object System.Text.UTF8Encoding($true)
|
||||
[System.IO.File]::WriteAllText($file, $content, $utf8BOM)
|
||||
```
|
||||
### Language Requirements
|
||||
- All user-facing content must be in German (primary market)
|
||||
- Support for English through localization files
|
||||
- Use German resource files (LocalizedStrings.resx) and English (LocalizedStrings.en.resx)
|
||||
|
||||
## NHibernate Performance
|
||||
- Use `.Fetch()` for eager loading (prevent N+1)
|
||||
- Always filter: `.Where(x => !x.IsDeleted)`
|
||||
- Use `Future()` for multiple collections
|
||||
- Avoid lazy loading in loops
|
||||
### File Encoding
|
||||
- All C# source files (*.cs) must use UTF-8 with BOM
|
||||
- All XAML files (*.xaml) must use UTF-8 with BOM
|
||||
|
||||
```csharp
|
||||
// Good
|
||||
var accounts = session.Query<Account>()
|
||||
.Where(x => !x.IsDeleted)
|
||||
.Fetch(x => x.AccountType)
|
||||
.Fetch(x => x.PriceList)
|
||||
.ToList();
|
||||
```
|
||||
### Naming Conventions
|
||||
- ILogic interfaces: `I{Module}Logic`
|
||||
- BL implementations: `BL{Module}Logic`
|
||||
- WS implementations: `WS{Module}Logic`
|
||||
- All methods return `Result<T>` or `Task<Result<T>>`
|
||||
|
||||
### Code Signing (Optional)
|
||||
Set environment variables for code signing:
|
||||
- `CENTRON_BUILD_CODE_SIGNING_CERTIFICATE` - Path to certificate
|
||||
- `CENTRON_BUILD_CODE_SIGNING_CERTIFICATE_PASSWORD` - Certificate password
|
||||
|
||||
## Database
|
||||
- Uses NHibernate ORM with SQL Server
|
||||
- Configuration files generated during build process
|
||||
- Test databases required for end-to-end testing
|
||||
|
||||
## Development Processes
|
||||
|
||||
### Database Schema Changes
|
||||
|
||||
#### Creating Database Scripts
|
||||
1. **Reserve script number** in Teams `c-entron Entwickler` group → Files → `Datenbankupdate 2 1.xlsx`
|
||||
2. **Create script class** at `src/backend/Centron.BL/Administration/Scripts/ScriptMethods/Scripts/ScriptMethod{number}.cs`
|
||||
3. **Implement BaseScriptMethod** with `ApplicationVersion` and `GetSqlQueries()` method
|
||||
4. **Use ScriptHelpers** when possible (preferred over raw SQL):
|
||||
- `ScriptHelpers.AddColumnIfNotExists()`
|
||||
- `ScriptHelpers.AddTableIfNotExists()`
|
||||
- `ScriptHelpers.AddRightIfNotExists()`
|
||||
- `ScriptHelpers.AddIndexIfNotExists()`
|
||||
- `ScriptHelpers.AddForeignKeyIfNotExists()`
|
||||
|
||||
#### Database Conventions
|
||||
- **Primary Key**: Every table must have `I3D` [int] IDENTITY(1,1) NOT NULL
|
||||
- **Foreign Keys**: Must end with `I3D` suffix (e.g., `AccountI3D`)
|
||||
- **Standard Columns**: Include `CreatedByI3D`, `CreatedDate`, `ChangedByI3D`, `ChangedDate`, `IsDeleted`, `DeletedByI3D`, `DeletedDate`
|
||||
- **Data Types**: Use `nvarchar` over `varchar`, `datetime2(2)` for timestamps, `bit` for booleans
|
||||
- **Naming**: New tables/columns use English names (historical German names remain unchanged)
|
||||
|
||||
### Settings Management
|
||||
- **Legacy**: `Stammdat` table (read-only)
|
||||
- **New**: `ApplicationSettings` table ONLY
|
||||
- Get next ID from `src/backend/Centron.Interfaces/Administration/Settings/ApplicationSettingID.cs`
|
||||
- Add description to `ApplicationSettingDefinitions.cs`
|
||||
|
||||
### User Rights
|
||||
1. Get next I3D from `UserRightsConst.cs`
|
||||
2. Create script: `ScriptHelpers.AddRightIfNotExists(id, parentId, "German name", "German desc")`
|
||||
3. Add constant to `UserRightsConst.cs`
|
||||
#### Application Settings
|
||||
- **Legacy settings**: Stored in `Stammdat` table (read-only, no new additions)
|
||||
- **New settings**: Use `ApplicationSettings` table exclusively
|
||||
- **Setting IDs**: Get next available ID from comment in `src/backend/Centron.Interfaces/Administration/Settings/ApplicationSettingID.cs`
|
||||
- **Descriptions**: Add to `ApplicationSettingDefinitions.cs`
|
||||
|
||||
### Web Service (Full Stack)
|
||||
1. **BL**: `{Entity}BL.cs` returning `Result<T>`
|
||||
2. **WebServiceBL**: `{Entity}WebServiceBL.cs` with DTO↔Entity conversion
|
||||
3. **RestService**: Add to `CentronRestService.cs` (`Request<T>` → `Response<T>`)
|
||||
4. **Interface**: `ICentronRestService.cs` with `[OperationContract]`, `[WebInvoke(Method="POST", UriTemplate="...")]`, `[Authenticate]`
|
||||
5. **Logic**: `I{Entity}Logic`, `BL{Entity}Logic`, `WS{Entity}Logic`
|
||||
#### Adding New Settings
|
||||
1. Check next available ID in `ApplicationSettingID.cs`
|
||||
2. Add enum value with new ID
|
||||
3. Update "Next Centron Settings ID" comment
|
||||
4. Add description in `ApplicationSettingDefinitions.cs`
|
||||
5. Create group setting classes for accessing settings
|
||||
6. Use `AppSettingsBL.GetSettings()` and `GetSettingsForUpdate()`
|
||||
|
||||
### WPF Module
|
||||
1. **Controller**: Implement `ICentronAppModuleController`
|
||||
2. **View**: `UserControl` inheriting `BaseModule`
|
||||
3. **ViewModel**: Inherit `BindableBase`
|
||||
4. **Ribbon**: Implement `IRibbonControlModule` variations
|
||||
5. **Registration**: Add to `ModuleRegistration.cs` with rights checks
|
||||
6. **Theme**: Prefer DevExpress controls over WPF standard
|
||||
### User Rights Management
|
||||
|
||||
## Agent Usage (MANDATORY)
|
||||
#### Adding New Rights
|
||||
1. **Open** `UserRightsConst.cs` to get next I3D
|
||||
2. **Create script** using `ScriptHelpers.AddRightIfNotExists()`:
|
||||
```csharp
|
||||
yield return ScriptHelpers.AddRightIfNotExists(
|
||||
UserRightsConst.Sales.Customer.Helpdesk.SHOW_HOURLYSURCHARGERATES,
|
||||
UserRightsConst.Sales.Customer.Helpdesk.ID,
|
||||
"German display name",
|
||||
"German description");
|
||||
```
|
||||
3. **Add constant** to `UserRightsConst.cs`
|
||||
|
||||
### Project Agents (.claude/agents/)
|
||||
- **primary-development**: ALL development tasks (orchestrator)
|
||||
- **database-script-creator**: Database schema changes → generates ScriptMethod*.cs
|
||||
- **webservice-developer**: Full-stack web service implementation
|
||||
- **ui-module-creator**: WPF modules with MVVM + DevExpress
|
||||
- **centron-nexus-developer**: Blazor Server, Razor components, SignalR, DevExpress Blazor
|
||||
- **external-api-integrator**: Third-party API integrations (FinAPI, GLS, Shipcloud, etc.)
|
||||
- **edi-specialist**: EDI processing (OpenTrans, EDIFACT, supplier integrations)
|
||||
- **nhibernate-query-reviewer**: Query optimization, N+1 detection
|
||||
- **localization-checker**: German/English verification
|
||||
- **bookkeeping-export-expert**: DATEV, Abacus, SAP exports
|
||||
- **test-engineer**: Test generation
|
||||
- **code-reviewer**: Code quality/security
|
||||
- **refactoring-specialist**: Code cleanup
|
||||
- **debugger**: Bug diagnosis
|
||||
- **architect**: System design
|
||||
- **documentation-writer**: Docs
|
||||
- **security-analyst**: Security reviews
|
||||
### Web Service Development
|
||||
|
||||
### MANDATORY Agent Usage
|
||||
- New features → **primary-development**
|
||||
- DB schema → **database-script-creator**
|
||||
- Web service → **webservice-developer**
|
||||
- WPF module → **ui-module-creator**
|
||||
- CentronNexus/Blazor → **centron-nexus-developer**
|
||||
- External API → **external-api-integrator**
|
||||
- EDI integration → **edi-specialist**
|
||||
- Complex queries → **nhibernate-query-reviewer**
|
||||
- UI text → **localization-checker**
|
||||
#### Creating Web Service Methods (Full Stack)
|
||||
1. **BL Layer**: Create method in `{Entity}BL.cs` returning `Result<T>`
|
||||
2. **WebServiceBL**: Create `{Entity}WebServiceBL.cs` with DTO↔Entity conversion
|
||||
3. **RestService**: Add method to `CentronRestService.cs` accepting `Request<T>` and returning `Response<T>`
|
||||
4. **Interface**: Add method signature to `ICentronRestService.cs` with attributes:
|
||||
```csharp
|
||||
[OperationContract]
|
||||
[WebInvoke(Method = "POST", UriTemplate = "MethodName")]
|
||||
[Authenticate]
|
||||
```
|
||||
5. **Logic Interfaces**: Create `I{Entity}Logic`, `BL{Entity}Logic`, `WS{Entity}Logic`
|
||||
|
||||
## Commands
|
||||
```bash
|
||||
dotnet build Centron.sln # Build
|
||||
dotnet test Centron.sln # Test all
|
||||
cd scripts/Centron.Scripts && dotnet run # Build orchestration
|
||||
#### Request Classes
|
||||
- Place in `Centron.WebServices.Core/RestRequests/`
|
||||
- Decorate with `[DataContract]` and `[DataMember]` attributes
|
||||
- Use for complex parameters instead of multiple individual parameters
|
||||
|
||||
### UI Development
|
||||
|
||||
#### Creating WPF Modules
|
||||
1. **AppModuleController**: Implement `ICentronAppModuleController`
|
||||
2. **View**: Create `UserControl` inheriting from `BaseModule`
|
||||
3. **ViewModel**: Inherit from `BindableBase`
|
||||
4. **Ribbon**: Implement `IRibbonControlModule` interface variations
|
||||
5. **Registration**: Add to `ModuleRegistration.cs` with rights and feature checks
|
||||
|
||||
#### Localization Requirements
|
||||
- **Resource Files**:
|
||||
- German (default): `LocalizedStrings.resx`
|
||||
- English: `LocalizedStrings.en.resx`
|
||||
- **XAML Usage**: `{x:Static properties:LocalizedStrings.KeyName}`
|
||||
- **Code Usage**: Direct access via `LocalizedStrings.KeyName`
|
||||
- **Key Format**: `{ClassName}_{MethodName}_{Description}`
|
||||
- **Tool**: Use ResXManager Visual Studio extension
|
||||
|
||||
### Accessing Data in Client Code
|
||||
|
||||
#### Single Use
|
||||
```csharp
|
||||
var result = await ClassContainer.Instance
|
||||
.WithInstance((IEntityLogic logic) => logic.GetEntity(id))
|
||||
.ThrowIfError();
|
||||
```
|
||||
|
||||
**Targets**: clean, setup-versioning, build-web-service, build-centron-net, run-tests, create-installers
|
||||
#### Multiple Uses (with proper disposal)
|
||||
```csharp
|
||||
public class ViewModel : IDisposable
|
||||
{
|
||||
private readonly IEntityLogic _logic;
|
||||
|
||||
## Slash Commands
|
||||
`/test`, `/review`, `/optimize`, `/implement`, `/explain`, `/analyze`, `/adr`, `/scaffold`
|
||||
public ViewModel()
|
||||
{
|
||||
_logic = ClassContainer.Instance.GetInstance<IEntityLogic>();
|
||||
}
|
||||
|
||||
## MCP Servers
|
||||
**serena**: Semantic search, symbol manipulation | **context7**: Library docs | **fetch**: Web content | **sequential-thinking**: Problem decomposition | **memory**: Knowledge graph | **playwright**: Browser automation | **windows-mcp**: Windows interaction
|
||||
|
||||
## Claude Instructions
|
||||
|
||||
### Tooling Decision (REQUIRED at task start)
|
||||
```
|
||||
🎯 Tooling Strategy Decision
|
||||
|
||||
Task Analysis: [Brief description]
|
||||
|
||||
Tooling Decisions:
|
||||
- Agents: [name] / Not using - Reason: [justification]
|
||||
- Slash Commands: [/command] / Not using - Reason: [justification]
|
||||
- MCP Servers: [server:tool] / Not using - Reason: [justification]
|
||||
- Approach: [strategy]
|
||||
public void Dispose()
|
||||
{
|
||||
ClassContainer.Instance.ReleaseInstance(_logic);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**When NOT to use agents**: Single file read, simple edit, 1-2 tool calls
|
||||
## Documentation
|
||||
|
||||
### Task Summary (REQUIRED at end)
|
||||
```
|
||||
📊 Task Completion Summary
|
||||
### Creating Documentation
|
||||
When adding new documentation to the project:
|
||||
|
||||
What Was Done: [description]
|
||||
1. **Choose the right location** within the existing `docs/` structure:
|
||||
- `docs/getting-started/` - Beginner guides and introductory material
|
||||
- `docs/guides/development/` - Development task guides
|
||||
- `docs/guides/database/` - Database-related guides
|
||||
- `docs/guides/ui/` - UI development guides
|
||||
- `docs/guides/services/` - Web services guides
|
||||
- `docs/reference/architecture/` - Architecture specifications
|
||||
- `docs/reference/database/` - Database reference documentation
|
||||
- `docs/reference/receipts/` - Receipts system documentation
|
||||
- `docs/reference/security/` - Security documentation
|
||||
- `docs/operations/` - Operational procedures
|
||||
|
||||
Features Involved:
|
||||
- Agents: [list or None - justification]
|
||||
- Slash Commands: [list or None - justification]
|
||||
- MCP Servers: [list or None - justification]
|
||||
- Core Tools: [Read, Write, Edit, Glob, Grep, Bash, etc.]
|
||||
- Files Modified: [list or None]
|
||||
- Performance: [Parallel ops, extended thinking, or N/A]
|
||||
2. **Name the file appropriately** using kebab-case (e.g., `actionprice-system.md`)
|
||||
|
||||
Efficiency Notes: [observations]
|
||||
```
|
||||
3. **Create the file** with UTF-8 with BOM encoding, using proper Markdown format
|
||||
|
||||
### Checklist
|
||||
✅ Provide tooling decisions at task start
|
||||
✅ Use `Result<T>` pattern
|
||||
✅ Follow ILogic interface pattern
|
||||
✅ German localization for UI text
|
||||
✅ UTF-8 with BOM for C#/XAML
|
||||
✅ DB conventions (I3D, FK, tracking columns)
|
||||
✅ Run tests before commits
|
||||
✅ Reference ticket numbers
|
||||
✅ Use parallel tool calls
|
||||
✅ Leverage agents/slash commands/MCP servers
|
||||
4. **Update navigation** in `docs/README.md`:
|
||||
- Add a new entry with a link to your documentation file
|
||||
- Follow the existing pattern and place in appropriate section
|
||||
|
||||
## Common Tasks
|
||||
1. **DB Table**: database-script-creator → ScriptMethod*.cs with conventions
|
||||
2. **Web Service**: webservice-developer → BL → WebServiceBL → REST → Logic
|
||||
3. **WPF Module**: ui-module-creator → View, ViewModel, Controller, Ribbon, Localization
|
||||
4. **Query Optimization**: nhibernate-query-reviewer → N+1, indexes, soft delete
|
||||
5. **Update the Solution File** (`Centron.sln`):
|
||||
- Find the appropriate solution folder for your documentation directory
|
||||
- Add your file to the `ProjectSection(SolutionItems)` section
|
||||
- Use the pattern: `docs\path\to\your-file.md = docs\path\to\your-file.md`
|
||||
|
||||
## Critical Files
|
||||
- `src/centron/Centron.WPF.UI/App.xaml.cs` - WPF entry
|
||||
- `src/backend/Centron.BL/` - Business logic
|
||||
- `src/backend/Centron.DAO/` - Data access
|
||||
- `src/webservice/Centron.WebServices.Core/RestService/CentronRestService.cs` - REST API
|
||||
- `src/backend/Centron.Interfaces/` - Service interfaces
|
||||
|
||||
## Git
|
||||
**Branch**: `master` (main) | **Types**: `feature/*`, `bugfix/*`, `hotfix/*`
|
||||
**Commits**: `feat(module):`, `fix(module):`, `refactor(module):`, `docs:` + optional `(Ticket #12345)`
|
||||
### Documentation Standards
|
||||
- Use UTF-8 with BOM encoding for all documentation files
|
||||
- Start with a `#` heading that clearly describes the content
|
||||
- Use proper Markdown formatting for headings, lists, code blocks, etc.
|
||||
- Include links to related documentation when appropriate
|
||||
- For internal links, use relative paths to other documentation files
|
||||
|
||||
## Important Notes
|
||||
- Project uses custom versioning via Nerdbank.GitVersioning
|
||||
- Build artifacts placed in `/artifacts` directory
|
||||
- Integration with Azure DevOps for CI/CD
|
||||
- Automatic ticket integration with c-entron ticket system
|
||||
- Supports both standalone and web service deployment modes
|
||||
- Always test database scripts before committing
|
||||
- Use German for all user-facing text with English translations
|
||||
- Follow dual implementation pattern (BL + WS) for all data access
|
||||
- When creating a script, do not override ApplicationVersion, MethodKind, or ScriptCollection. These are legacy properties.
|
||||
- When creating a linq query for database access, beware of the limitations and capabilities of NHibernate (it is our OR-Mapper).
|
||||
@@ -1,45 +1,60 @@
|
||||
# Versuch 02 - Kurzuebersicht
|
||||
|
||||
## Inhalt
|
||||
Fokus auf Use-Case- und Modulanalyse (ERP-Dokumentation), inkl. Gap-Analyse zwischen dokumentierter und tatsaechlich entdeckter Funktionalitaet. Der Versuch liefert vor allem Umfangs-, Coverage- und Discovery-Kennzahlen statt klassischer StRS/SyRS/SwRS-Requirements.
|
||||
Fokus auf konsolidierte End-to-End-Requirements-Spezifikation (StRS, SyRS, SwRS) mit hoher ISO-29148-Reife, Qualitaetsmetriken und separaten Traceability-Artefakten (CSV). Gegenueber Versuch 01 ist die Struktur noch staerker in Teilartefakte fuer Stakeholder/System/Software zerlegt.
|
||||
|
||||
## Kennzahlen (einheitliches Vergleichsformat)
|
||||
| Kennzahl | Wert |
|
||||
| --- | --- |
|
||||
| Ergebnisdateien gesamt | 30 |
|
||||
| Ergebnisdateitypen (MD/PDF/CSV/SQL/YAML/JSON/TXT) | 24 / 4 / 0 / 2 / 0 / 0 / 0 |
|
||||
| Markdown-Zeilen gesamt | 21.882 |
|
||||
| Anforderungen/Features gesamt (konsolidiert) | 1.720 (siehe `Requirements.md`) |
|
||||
| Formale Anforderungen gesamt (StRS+SyRS+SwRS) | 0 |
|
||||
| Stakeholder-Anforderungen (StRS) | 0 |
|
||||
| System-Anforderungen (SyRS) | 0 |
|
||||
| Software-Anforderungen (SwRS) | 0 |
|
||||
| Use Cases gesamt (explizit) | 1.720 |
|
||||
| Dokumentierte Use Cases | 509 |
|
||||
| Undokumentierte Use Cases | 1.211 (71% Gap) |
|
||||
| Ueberlappung Use Cases <-> Anforderungen (abgezogen) | 0 (bereits dedupliziert) |
|
||||
| ISO-29148-Compliance | n.v. |
|
||||
| Traceability-Abdeckung | n.v. (kein StRS->SyRS->SwRS-Nachweis) |
|
||||
| Code Coverage | n.v. |
|
||||
| Test Coverage | n.v. |
|
||||
| Analysierte Quellartefakte | 150.000+ LoC analysiert; 3.412 potenzielle Use Cases |
|
||||
| Separate Traceability-CSV (Dateien / Zeilen) | 0 / 0 |
|
||||
|
||||
## Evaluation-Hinweis
|
||||
Sehr stark fuer Funktions-/Use-Case-Discovery und Doku-Gap-Analyse; konsolidierte Zaehlung erfolgt in `Requirements.md`.
|
||||
| Ergebnisdateien gesamt | 37 |
|
||||
| Ergebnisdateitypen (MD/PDF/CSV/SQL/YAML/JSON/TXT) | 26 / 1 / 5 / 0 / 1 / 3 / 1 |
|
||||
| Markdown-Zeilen gesamt | 15.625 |
|
||||
| Anforderungen/Features gesamt (konsolidiert) | 220 (siehe `Requirements.md`) |
|
||||
| Formale Anforderungen gesamt (StRS+SyRS+SwRS) | 220 |
|
||||
| Stakeholder-Anforderungen (StRS) | 84 |
|
||||
| System-Anforderungen (SyRS) | 53 |
|
||||
| Software-Anforderungen (SwRS) | 83 |
|
||||
| Use Cases gesamt (explizit) | 46 |
|
||||
| Dokumentierte Use Cases | 46 |
|
||||
| Undokumentierte Use Cases | n.v. |
|
||||
| Ueberlappung Use Cases <-> Anforderungen (abgezogen) | 46 (konservativ) |
|
||||
| ISO-29148-Compliance | 96,1% (100% mandatory) |
|
||||
| Traceability-Abdeckung | 100% bidirektional |
|
||||
| Code Coverage | 87,3% (laut Doku) |
|
||||
| Test Coverage | 87,3% (laut Doku) |
|
||||
| Analysierte Quellartefakte | 14.940 Dateien (13.717 C#, 1.189 XAML, 34 Projekte) |
|
||||
| Separate Traceability-CSV (Dateien / Zeilen) | 4 / 327 |
|
||||
|
||||
## Vorgehen
|
||||
- Erweiterter Prompt zu Claude Code
|
||||
- Verwendung spezialisierter generischer Agenten für Claude Code.
|
||||
- Verwendung von MCP Servern zur Verbesserung der LLM Performance
|
||||
- Serena MCP zum Speichern von Memories
|
||||
- Windows-MCP (Basierend auf AutoiT) um Auch das laufende Frontend mit in die Analyse Einzubeziehen
|
||||
- MSSQL MCP mit Anbindung an die Datenbank um auch das DB Schema mit in die Analyse einzubinden
|
||||
|
||||
- Erweiterter Prompt zu Claude Code
|
||||
- Verwendung spezialisierter ISO-29148-Agents
|
||||
- Kein MCP-Fokus (ISO-Konsolidierung vor Discovery-Erweiterung)
|
||||
|
||||
## Prompt
|
||||
"Please analyze this software project and write a reuqirements specification according to modern standards.
|
||||
Use Agents and MCP servers wherever possible.
|
||||
Keep superflous texts to a minimum and concentrate on actual requirements.
|
||||
"
|
||||
## Verwendeter Prompt
|
||||
```text
|
||||
Please analyze this software project and write a ISO 29148 compliant reuqirements specification.
|
||||
Use Agents wherever possible.
|
||||
```
|
||||
|
||||
## Agenten (Beispiele)
|
||||
- `Tools/agents/iso29148-master-orchestrator-agent.md`
|
||||
- Orchestrierung der Meilensteine und Integration der Teilartefakte
|
||||
- `Tools/agents/iso29148-system-requirements-agent.md`
|
||||
- Systemanforderungen (SyRS), Architektur- und Schnittstellenfokus
|
||||
- `Tools/agents/iso29148-stakeholder-agent.md`
|
||||
- Stakeholder-Anforderungen (StRS) und fachliche Perspektive
|
||||
- `Tools/agents/iso29148-software-requirements-agent`
|
||||
- Softwareanforderungen (SwRS) und Umsetzungsbezug
|
||||
|
||||
## Ergebnisbeispiele aus `Ergenisse`
|
||||
- `Ergenisse/master/ISO29148_Executive_Summary.md`
|
||||
- 14.940 analysierte Dateien und 220+ Requirements (Executive-Ebene)
|
||||
- `Ergenisse/master/ISO29148_Quality_Report.md`
|
||||
- Gesamtscore 92,4%, Traceability 100%, ISO-29148 konforme Qualitaetsbewertung
|
||||
- `Ergenisse/master/ISO29148_Traceability_Master.csv`
|
||||
- Konsolidierte Nachverfolgbarkeit zwischen Requirement-Ebenen
|
||||
- `Ergenisse/stakeholder/StRS_Complete.md`, `Ergenisse/system/SyRS_Complete.md`, `Ergenisse/software/SwRS_Complete.md`
|
||||
- Vollstaendige Dreiebenen-Spezifikation
|
||||
|
||||
## Evaluation-Hinweis
|
||||
Sehr gut geeignet fuer vergleichende ISO-29148-Evaluation mit quantifizierter Qualitaets- und Traceability-Sicht; konsolidierte Zaehlung erfolgt in `Requirements.md`.
|
||||
|
||||
@@ -1,23 +1,20 @@
|
||||
# Versuch 03 - Requirements (konsolidiert)
|
||||
|
||||
## Konsolidierungsentscheidung
|
||||
Use Cases und Anforderungen werden als gleiches Zielobjekt betrachtet. In Versuch 03 sind Use Cases in den Stakeholder-Diagrammen dokumentiert, aber inhaltlich mit den formalen Anforderungen verknuepft (Traceability auf StR-IDs). Daher erfolgt eine deduplizierte Konsolidierung.
|
||||
Use Cases und Anforderungen werden als gleiches Zielobjekt betrachtet. In Versuch 03 liegen die Features/Faehigkeiten ueberwiegend als Use Cases vor (keine vollstaendige StRS/SyRS/SwRS-Gliederung).
|
||||
|
||||
## Cluster-Liste
|
||||
| Cluster | Anzahl |
|
||||
| --- | ---: |
|
||||
| Stakeholder-Anforderungen (StRS) | 84 |
|
||||
| System-Anforderungen (SyRS) | 53 |
|
||||
| Software-Anforderungen (SwRS) | 83 |
|
||||
| Explizite Use Cases (Diagramme) | 46 |
|
||||
| Ueberlappung Use Cases <-> Anforderungen (konservativ abgezogen) | 46 |
|
||||
| Formale Anforderungen (StRS+SyRS+SwRS) | 0 |
|
||||
| Dokumentierte Use Cases | 509 |
|
||||
| Neu entdeckte (vormals undokumentierte) Use Cases | 1211 |
|
||||
| Ueberlappung Use Cases <-> Anforderungen (abgezogen) | 0 |
|
||||
|
||||
## Summen
|
||||
- Rohsumme (`Requirements + Use Cases`): **266**
|
||||
- **Konsolidierte Requirements/Faehigkeiten gesamt: 220**
|
||||
- Rohsumme (`Requirements + Use Cases`): **1720**
|
||||
- **Konsolidierte Requirements/Faehigkeiten gesamt: 1720**
|
||||
|
||||
## Use-Case-Cluster (Nachweis)
|
||||
- Sales Management: 13
|
||||
- Helpdesk Management: 17
|
||||
- Financial Management: 16
|
||||
- Summe explizite Use Cases: 46
|
||||
## Hinweis
|
||||
- Die Zahl `1720` ist bereits dedupliziert als "Total System Functionality".
|
||||
- Potenzialmetriken pro Extraktionsmethode wurden nicht addiert, um Doppelzaehlungen zu vermeiden.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# AGENTS.md
|
||||
# AGENTS.md
|
||||
|
||||
This file provides guidance to Codex when working with code in this repository.
|
||||
|
||||
@@ -31,6 +31,14 @@ Available targets:
|
||||
- `run-tests` - Execute all test suites
|
||||
- `create-installers` - Build MSI installers
|
||||
|
||||
## Agent Notes
|
||||
|
||||
- Default shell is PowerShell (`pwsh`). Prefer PowerShell-native commands like `Get-Content`, `Set-Content -Encoding UTF8`, and here-strings (`@'...'@`) instead of Unix tools (`sed`, `nl`, etc.).
|
||||
- Use `rg`/`rg --files` for fast searches—they are available by default.
|
||||
- Repository expects UTF-8 with BOM for C# and XAML; `Set-Content -Encoding UTF8` satisfies this.
|
||||
- Long replacements can rely on PowerShell string operations or single-line `python -c` scripts (heredocs are unavailable in `pwsh`).
|
||||
- `dotnet build Centron.sln` may warn about `libfintx.FinTSConfig`; this is expected and can be ignored for success checks.
|
||||
|
||||
### Publishing
|
||||
- **Publish WPF UI**: `dotnet publish src/centron/Centron.WPF.UI/Centron.WPF.UI.csproj -c Release -r win-x64 --self-contained`
|
||||
- **Publish Web Service**: `dotnet publish src/webservice/Centron.Host.WindowsService/Centron.Host.WindowsService.csproj -c Release -r win-x64 --self-contained`
|
||||
@@ -284,4 +292,4 @@ When adding new documentation to the project:
|
||||
- Supports both standalone and web service deployment modes
|
||||
- Always test database scripts before committing
|
||||
- Use German for all user-facing text with English translations
|
||||
- Follow dual implementation pattern (BL + WS) for all data access
|
||||
- Follow dual implementation pattern (BL + WS) for all data access
|
||||
|
||||
@@ -1,316 +1,248 @@
|
||||
# CLAUDE.md
|
||||
# c-entron.NET
|
||||
|
||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||
> ⚠️ **FOR CLAUDE AI - NOT FOR DEVELOPERS**
|
||||
>
|
||||
> This file contains project conventions and patterns that Claude AI uses to generate correct code.
|
||||
> **Developers**: See [.claude/README.md](.claude/README.md) for user documentation.
|
||||
|
||||
## Development Commands
|
||||
> **v2.1.0** | 2025-01-20 | ERP for German SMBs | C# .NET 8 | WPF + REST API
|
||||
|
||||
### Building
|
||||
- **Build entire solution**: `dotnet build Centron.sln`
|
||||
- **Build specific project**: `dotnet build src/centron/Centron.WPF.UI/Centron.WPF.UI.csproj`
|
||||
- **Build for Release**: `dotnet build Centron.sln -c Release`
|
||||
|
||||
### Testing
|
||||
- **Run all tests**: `dotnet test Centron.sln`
|
||||
- **Run specific test project**: `dotnet test tests/backend/Centron.Tests.BL/Centron.Tests.BL.csproj`
|
||||
- **Run integration tests**: `dotnet test tests/Centron.Tests.Integration/Centron.Tests.Integration.csproj`
|
||||
- **Run end-to-end tests**: `dotnet test tests/Centron.Tests.EndToEnd/Centron.Tests.EndToEnd.csproj`
|
||||
|
||||
### Using Centron.Scripts Build System
|
||||
The project uses a custom build system via Centron.Scripts for complete builds:
|
||||
|
||||
```bash
|
||||
cd scripts/Centron.Scripts
|
||||
dotnet run -- <target>
|
||||
```
|
||||
|
||||
Available targets:
|
||||
- `clean` - Clean artifacts and bin/obj directories
|
||||
- `setup-versioning` - Set up version information
|
||||
- `build-web-service` - Build the web service components
|
||||
- `build-centron-net` - Build the WPF client application
|
||||
- `run-tests` - Execute all test suites
|
||||
- `create-installers` - Build MSI installers
|
||||
|
||||
### Publishing
|
||||
- **Publish WPF UI**: `dotnet publish src/centron/Centron.WPF.UI/Centron.WPF.UI.csproj -c Release -r win-x64 --self-contained`
|
||||
- **Publish Web Service**: `dotnet publish src/webservice/Centron.Host.WindowsService/Centron.Host.WindowsService.csproj -c Release -r win-x64 --self-contained`
|
||||
|
||||
## Project Architecture
|
||||
|
||||
### High-Level Structure
|
||||
This is a .NET 8 enterprise application with a multi-layered architecture:
|
||||
## Stack
|
||||
**Core**: C# 12, .NET 8 | **Frontend**: WPF + Blazor Server, DevExpress 24.2.7 (WPF & Blazor), MVVM | **Backend**: ASP.NET Core 8, SQL Server 2019+, NHibernate 5.x, JWT auth | **Real-Time**: SignalR | **Build**: Azure DevOps, Centron.Scripts, WiX MSI | **Test**: NUnit
|
||||
|
||||
## Structure
|
||||
```
|
||||
src/
|
||||
├── apis/ - External API integrations (FinAPI, GLS, Shipcloud, etc.)
|
||||
├── backend/ - Core business logic layer
|
||||
│ ├── Centron.BL/ - Business Logic layer
|
||||
│ ├── Centron.Common/ - Common utilities and helpers
|
||||
│ ├── Centron.DAO/ - Data Access Objects (NHibernate)
|
||||
│ ├── Centron.Entities/ - Domain entities
|
||||
│ ├── Centron.Gateway/ - External service gateways
|
||||
│ └── Centron.Interfaces/ - Service interfaces
|
||||
├── centron/ - WPF client application
|
||||
│ ├── Centron.WPF.UI/ - Main WPF application
|
||||
│ └── Centron.WPF.UI.Extension/ - UI extensions
|
||||
├── shared/ - Shared components and controls
|
||||
│ ├── Centron.Core/ - Core shared functionality
|
||||
│ ├── Centron.Controls/ - Custom UI controls
|
||||
│ └── Centron.Controls.Preview/ - Preview controls
|
||||
└── webservice/ - Web service components
|
||||
├── Centron.Host/ - Web service host
|
||||
├── Centron.Host.Console/ - Console host
|
||||
├── Centron.Host.WindowsService/ - Windows service host
|
||||
├── Centron.WebServices.Core/ - Web service core
|
||||
└── c-entron.misc.ConnectionManager/ - Connection management
|
||||
├── apis/ - External integrations (FinAPI, GLS, Shipcloud, ITscope, etc.)
|
||||
├── backend/ - BL, DAO, Entities, Interfaces, EDI
|
||||
├── centron/ - WPF UI (Desktop)
|
||||
├── CentronNexus/ - Blazor Server (Web Portal)
|
||||
├── shared/ - Core, Controls
|
||||
└── webservice/ - REST API, Hosts
|
||||
tests/ - BL, DAO, Integration, E2E
|
||||
.claude/ - agents/, commands/, hooks/, settings.json
|
||||
```
|
||||
|
||||
### Data Access Pattern
|
||||
The application uses a dual data access pattern supporting both direct database access and web service communication:
|
||||
**Key Files**: `src/centron/Centron.WPF.UI/App.xaml.cs` (WPF), `src/webservice/Centron.Host.WindowsService/Program.cs` (Service), `Centron.sln`, `version.json`
|
||||
|
||||
#### WPF UI Architecture (3-layer pattern | ILogic Interface Pattern)
|
||||
All data operations in the UI must use the ILogic interface accessed through ClassContainer:
|
||||
- WPF UI modules use a 3-part data access pattern:
|
||||
- I{Module}Logic interface - Defines the contract
|
||||
- BL{Module}Logic (NHibernate/SQL Server) - Direct database access via NHibernate
|
||||
- WS{Module}Logic (REST API) - Web service access via REST API
|
||||
- Access via ClassContainer.Instance.WithInstance((ILogic logic) => ...).ThrowIfError();
|
||||
- Connection types controlled by AppModuleController:
|
||||
- CentronConnectionType.CentronWebServices ➜ WSLogic
|
||||
- CentronConnectionType.SqlServer ➜ BLLogic
|
||||
## Naming
|
||||
- **C# Classes**: `PascalCase`, Interfaces: `IPascalCase`, Methods: `PascalCase`, Private: `_camelCase`, Local: `camelCase`
|
||||
- **DB Tables**: `PascalCase` English (new), Keep German (legacy), PK: `I3D` (int IDENTITY), FK: `{Table}I3D`
|
||||
- **Standard Columns**: `CreatedByI3D`, `CreatedDate`, `ChangedByI3D`, `ChangedDate`, `IsDeleted`, `DeletedByI3D`, `DeletedDate`
|
||||
- **BL Pattern**: `I{Module}Logic`, `BL{Module}Logic`, `WS{Module}Logic`, `{Entity}BL`, `{Entity}WebServiceBL`
|
||||
|
||||
## Critical Patterns
|
||||
|
||||
### Result Pattern (MANDATORY)
|
||||
```csharp
|
||||
var result = await ClassContainer
|
||||
.Instance
|
||||
.WithInstance((IAccountContractsLogic logic) => logic.GetAccountContracts(filter))
|
||||
.ThrowIfError();
|
||||
```
|
||||
|
||||
#### Backend Architecture (2-layer pattern)
|
||||
- Backend uses a 2-layer BL approach for web service implementation:
|
||||
- Base BL class (e.g., AccountDeviceBL) - contains core business logic and database access via DAO
|
||||
- WebService BL class (e.g., AccountDeviceWebServiceBL) - handles DTO conversion and calls base BL
|
||||
- WebService BL pattern:
|
||||
- Inherits from BaseBL and creates instance of corresponding base BL class
|
||||
- Converts DTOs to entities using conversion methods (ConvertAccountDeviceDTOToAccountDevice)
|
||||
- Uses ObjectMapper for entity-to-DTO conversion
|
||||
- Ensures DTO entities are not connected to NHibernate database context for API security
|
||||
- API implementation in ICentronRestService and CentronRestService:
|
||||
- API methods call WebService BL classes
|
||||
- All API operations use DTO entities for data transfer
|
||||
- Example: SaveAccountDevice API method → AccountDeviceWebServiceBL.SaveAccountDevice → AccountDeviceBL.SaveAccountDevice
|
||||
|
||||
### Technology Stack
|
||||
- **.NET 8** - Primary framework
|
||||
- **WPF** - Desktop UI framework
|
||||
- **NHibernate** with **FluentNHibernate** - ORM for database access
|
||||
- **DevExpress 24.2.7** - UI controls and components
|
||||
- **Bullseye** - Build orchestration
|
||||
- **Entity Framework** - Some components use EF alongside NHibernate
|
||||
|
||||
### Connection Types
|
||||
Modules support different connection types declared in AppModuleController:
|
||||
- `CentronConnectionType.CentronWebServices` - Uses WSLogic implementation
|
||||
- `CentronConnectionType.SqlServer` - Uses BLLogic implementation
|
||||
|
||||
## Development Guidelines
|
||||
|
||||
### Code Style and Standards
|
||||
- KISS
|
||||
- DRY
|
||||
- SOLID
|
||||
- Clean Architecture
|
||||
|
||||
### General Rules
|
||||
- Write self-explanatory code and only comment when absolutely necessary
|
||||
- When updating code, always update DocStrings
|
||||
|
||||
### Language Requirements
|
||||
- All user-facing content must be in German (primary market)
|
||||
- Support for English through localization files
|
||||
- Use German resource files (LocalizedStrings.resx) and English (LocalizedStrings.en.resx)
|
||||
|
||||
### File Encoding
|
||||
- All C# source files (*.cs) must use UTF-8 with BOM
|
||||
- All XAML files (*.xaml) must use UTF-8 with BOM
|
||||
|
||||
### Naming Conventions
|
||||
- ILogic interfaces: `I{Module}Logic`
|
||||
- BL implementations: `BL{Module}Logic`
|
||||
- WS implementations: `WS{Module}Logic`
|
||||
- All methods return `Result<T>` or `Task<Result<T>>`
|
||||
|
||||
### Code Signing (Optional)
|
||||
Set environment variables for code signing:
|
||||
- `CENTRON_BUILD_CODE_SIGNING_CERTIFICATE` - Path to certificate
|
||||
- `CENTRON_BUILD_CODE_SIGNING_CERTIFICATE_PASSWORD` - Certificate password
|
||||
|
||||
## Database
|
||||
- Uses NHibernate ORM with SQL Server
|
||||
- Configuration files generated during build process
|
||||
- Test databases required for end-to-end testing
|
||||
|
||||
## Development Processes
|
||||
|
||||
### Database Schema Changes
|
||||
|
||||
#### Creating Database Scripts
|
||||
1. **Reserve script number** in Teams `c-entron Entwickler` group → Files → `Datenbankupdate 2 1.xlsx`
|
||||
2. **Create script class** at `src/backend/Centron.BL/Administration/Scripts/ScriptMethods/Scripts/ScriptMethod{number}.cs`
|
||||
3. **Implement BaseScriptMethod** with `ApplicationVersion` and `GetSqlQueries()` method
|
||||
4. **Use ScriptHelpers** when possible (preferred over raw SQL):
|
||||
- `ScriptHelpers.AddColumnIfNotExists()`
|
||||
- `ScriptHelpers.AddTableIfNotExists()`
|
||||
- `ScriptHelpers.AddRightIfNotExists()`
|
||||
- `ScriptHelpers.AddIndexIfNotExists()`
|
||||
- `ScriptHelpers.AddForeignKeyIfNotExists()`
|
||||
|
||||
#### Database Conventions
|
||||
- **Primary Key**: Every table must have `I3D` [int] IDENTITY(1,1) NOT NULL
|
||||
- **Foreign Keys**: Must end with `I3D` suffix (e.g., `AccountI3D`)
|
||||
- **Standard Columns**: Include `CreatedByI3D`, `CreatedDate`, `ChangedByI3D`, `ChangedDate`, `IsDeleted`, `DeletedByI3D`, `DeletedDate`
|
||||
- **Data Types**: Use `nvarchar` over `varchar`, `datetime2(2)` for timestamps, `bit` for booleans
|
||||
- **Naming**: New tables/columns use English names (historical German names remain unchanged)
|
||||
|
||||
### Settings Management
|
||||
|
||||
#### Application Settings
|
||||
- **Legacy settings**: Stored in `Stammdat` table (read-only, no new additions)
|
||||
- **New settings**: Use `ApplicationSettings` table exclusively
|
||||
- **Setting IDs**: Get next available ID from comment in `src/backend/Centron.Interfaces/Administration/Settings/ApplicationSettingID.cs`
|
||||
- **Descriptions**: Add to `ApplicationSettingDefinitions.cs`
|
||||
|
||||
#### Adding New Settings
|
||||
1. Check next available ID in `ApplicationSettingID.cs`
|
||||
2. Add enum value with new ID
|
||||
3. Update "Next Centron Settings ID" comment
|
||||
4. Add description in `ApplicationSettingDefinitions.cs`
|
||||
5. Create group setting classes for accessing settings
|
||||
6. Use `AppSettingsBL.GetSettings()` and `GetSettingsForUpdate()`
|
||||
|
||||
### User Rights Management
|
||||
|
||||
#### Adding New Rights
|
||||
1. **Open** `UserRightsConst.cs` to get next I3D
|
||||
2. **Create script** using `ScriptHelpers.AddRightIfNotExists()`:
|
||||
```csharp
|
||||
yield return ScriptHelpers.AddRightIfNotExists(
|
||||
UserRightsConst.Sales.Customer.Helpdesk.SHOW_HOURLYSURCHARGERATES,
|
||||
UserRightsConst.Sales.Customer.Helpdesk.ID,
|
||||
"German display name",
|
||||
"German description");
|
||||
```
|
||||
3. **Add constant** to `UserRightsConst.cs`
|
||||
|
||||
### Web Service Development
|
||||
|
||||
#### Creating Web Service Methods (Full Stack)
|
||||
1. **BL Layer**: Create method in `{Entity}BL.cs` returning `Result<T>`
|
||||
2. **WebServiceBL**: Create `{Entity}WebServiceBL.cs` with DTO↔Entity conversion
|
||||
3. **RestService**: Add method to `CentronRestService.cs` accepting `Request<T>` and returning `Response<T>`
|
||||
4. **Interface**: Add method signature to `ICentronRestService.cs` with attributes:
|
||||
```csharp
|
||||
[OperationContract]
|
||||
[WebInvoke(Method = "POST", UriTemplate = "MethodName")]
|
||||
[Authenticate]
|
||||
```
|
||||
5. **Logic Interfaces**: Create `I{Entity}Logic`, `BL{Entity}Logic`, `WS{Entity}Logic`
|
||||
|
||||
#### Request Classes
|
||||
- Place in `Centron.WebServices.Core/RestRequests/`
|
||||
- Decorate with `[DataContract]` and `[DataMember]` attributes
|
||||
- Use for complex parameters instead of multiple individual parameters
|
||||
|
||||
### UI Development
|
||||
|
||||
#### Creating WPF Modules
|
||||
1. **AppModuleController**: Implement `ICentronAppModuleController`
|
||||
2. **View**: Create `UserControl` inheriting from `BaseModule`
|
||||
3. **ViewModel**: Inherit from `BindableBase`
|
||||
4. **Ribbon**: Implement `IRibbonControlModule` interface variations
|
||||
5. **Registration**: Add to `ModuleRegistration.cs` with rights and feature checks
|
||||
|
||||
#### Localization Requirements
|
||||
- **Resource Files**:
|
||||
- German (default): `LocalizedStrings.resx`
|
||||
- English: `LocalizedStrings.en.resx`
|
||||
- **XAML Usage**: `{x:Static properties:LocalizedStrings.KeyName}`
|
||||
- **Code Usage**: Direct access via `LocalizedStrings.KeyName`
|
||||
- **Key Format**: `{ClassName}_{MethodName}_{Description}`
|
||||
- **Tool**: Use ResXManager Visual Studio extension
|
||||
|
||||
### Accessing Data in Client Code
|
||||
|
||||
#### Single Use
|
||||
```csharp
|
||||
var result = await ClassContainer.Instance
|
||||
.WithInstance((IEntityLogic logic) => logic.GetEntity(id))
|
||||
.ThrowIfError();
|
||||
```
|
||||
|
||||
#### Multiple Uses (with proper disposal)
|
||||
```csharp
|
||||
public class ViewModel : IDisposable
|
||||
{
|
||||
private readonly IEntityLogic _logic;
|
||||
|
||||
public ViewModel()
|
||||
{
|
||||
_logic = ClassContainer.Instance.GetInstance<IEntityLogic>();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
ClassContainer.Instance.ReleaseInstance(_logic);
|
||||
}
|
||||
public Result<T> Method() {
|
||||
try {
|
||||
var data = _dao.Get<T>(id);
|
||||
return data == null ? Result.Error<T>("Not found") : Result.Success(data);
|
||||
} catch (Exception ex) { return Result.Error<T>(ex); }
|
||||
}
|
||||
```
|
||||
|
||||
## Documentation
|
||||
### UI Data Access (MANDATORY)
|
||||
```csharp
|
||||
// Single use
|
||||
var result = await ClassContainer.Instance
|
||||
.WithInstance((IEntityLogic logic) => logic.GetEntity(id))
|
||||
.ThrowIfError();
|
||||
|
||||
### Creating Documentation
|
||||
When adding new documentation to the project:
|
||||
// Multiple uses (IDisposable)
|
||||
private readonly IEntityLogic _logic;
|
||||
public ViewModel() { _logic = ClassContainer.Instance.GetInstance<IEntityLogic>(); }
|
||||
public void Dispose() { ClassContainer.Instance.ReleaseInstance(_logic); }
|
||||
```
|
||||
|
||||
1. **Choose the right location** within the existing `docs/` structure:
|
||||
- `docs/getting-started/` - Beginner guides and introductory material
|
||||
- `docs/guides/development/` - Development task guides
|
||||
- `docs/guides/database/` - Database-related guides
|
||||
- `docs/guides/ui/` - UI development guides
|
||||
- `docs/guides/services/` - Web services guides
|
||||
- `docs/reference/architecture/` - Architecture specifications
|
||||
- `docs/reference/database/` - Database reference documentation
|
||||
- `docs/reference/receipts/` - Receipts system documentation
|
||||
- `docs/reference/security/` - Security documentation
|
||||
- `docs/operations/` - Operational procedures
|
||||
### Architecture
|
||||
**WPF UI** → `I{Module}Logic` (ClassContainer) → `BL{Module}Logic` (SQL) OR `WS{Module}Logic` (REST)
|
||||
**REST API** → `CentronRestService` → `{Entity}WebServiceBL` (DTO conversion) → `{Entity}BL` (Business Logic) → DAO → NHibernate → SQL Server
|
||||
|
||||
2. **Name the file appropriately** using kebab-case (e.g., `actionprice-system.md`)
|
||||
Connection types: `CentronConnectionType.SqlServer` (BLLogic) | `CentronConnectionType.CentronWebServices` (WSLogic)
|
||||
|
||||
3. **Create the file** with UTF-8 with BOM encoding, using proper Markdown format
|
||||
## Database Conventions (MUST FOLLOW)
|
||||
- **PK**: `I3D` [int] IDENTITY(1,1) NOT NULL (auto-created by `ScriptHelpers.AddTableIfNotExists()`)
|
||||
- **FK**: End with `I3D` suffix (e.g., `AccountI3D`)
|
||||
- **Standard Columns**: CreatedByI3D, CreatedDate, ChangedByI3D, ChangedDate, IsDeleted, DeletedByI3D, DeletedDate (all REQUIRED)
|
||||
- **Types**: `nvarchar` (NOT varchar), `datetime2(2)`, `bit`, `decimal(18,2)` for currency
|
||||
- **Naming**: English PascalCase (new), Keep German (legacy), `dbo` schema
|
||||
|
||||
4. **Update navigation** in `docs/README.md`:
|
||||
- Add a new entry with a link to your documentation file
|
||||
- Follow the existing pattern and place in appropriate section
|
||||
### Creating Database Scripts
|
||||
1. Reserve number in Teams: `c-entron Entwickler` → Files → `Datenbankupdate 2 1.xlsx`
|
||||
2. Create: `src/backend/Centron.BL/Administration/Scripts/ScriptMethods/Scripts/ScriptMethod{number}.cs`
|
||||
3. Implement `BaseScriptMethod` with `GetSqlQueries()`
|
||||
4. Use `ScriptHelpers.*` (AddTableIfNotExists, AddColumnIfNotExists, AddRightIfNotExists, etc.)
|
||||
5. **Convert to UTF-8 with BOM** (C# files require BOM)
|
||||
|
||||
5. **Update the Solution File** (`Centron.sln`):
|
||||
- Find the appropriate solution folder for your documentation directory
|
||||
- Add your file to the `ProjectSection(SolutionItems)` section
|
||||
- Use the pattern: `docs\path\to\your-file.md = docs\path\to\your-file.md`
|
||||
## Localization (REQUIRED)
|
||||
- **Primary**: German (`LocalizedStrings.resx`) | **Secondary**: English (`LocalizedStrings.en.resx`)
|
||||
- **Code**: `LocalizedStrings.KeyName` | **XAML**: `{x:Static properties:LocalizedStrings.KeyName}`
|
||||
- **Key Format**: `{ClassName}_{Method}_{Description}`
|
||||
|
||||
### Documentation Standards
|
||||
- Use UTF-8 with BOM encoding for all documentation files
|
||||
- Start with a `#` heading that clearly describes the content
|
||||
- Use proper Markdown formatting for headings, lists, code blocks, etc.
|
||||
- Include links to related documentation when appropriate
|
||||
- For internal links, use relative paths to other documentation files
|
||||
## File Encoding (CRITICAL)
|
||||
- **UTF-8 WITH BOM**: `*.cs`, `*.xaml` (MANDATORY)
|
||||
- **UTF-8 NO BOM**: `*.md`, `*.json`, `*.xml`, `*.config`
|
||||
|
||||
**PowerShell Conversion**:
|
||||
```powershell
|
||||
$file = 'path\to\file.cs'
|
||||
$content = [System.IO.File]::ReadAllText($file)
|
||||
$utf8BOM = New-Object System.Text.UTF8Encoding($true)
|
||||
[System.IO.File]::WriteAllText($file, $content, $utf8BOM)
|
||||
```
|
||||
|
||||
## NHibernate Performance
|
||||
- Use `.Fetch()` for eager loading (prevent N+1)
|
||||
- Always filter: `.Where(x => !x.IsDeleted)`
|
||||
- Use `Future()` for multiple collections
|
||||
- Avoid lazy loading in loops
|
||||
|
||||
```csharp
|
||||
// Good
|
||||
var accounts = session.Query<Account>()
|
||||
.Where(x => !x.IsDeleted)
|
||||
.Fetch(x => x.AccountType)
|
||||
.Fetch(x => x.PriceList)
|
||||
.ToList();
|
||||
```
|
||||
|
||||
## Development Processes
|
||||
|
||||
### Settings Management
|
||||
- **Legacy**: `Stammdat` table (read-only)
|
||||
- **New**: `ApplicationSettings` table ONLY
|
||||
- Get next ID from `src/backend/Centron.Interfaces/Administration/Settings/ApplicationSettingID.cs`
|
||||
- Add description to `ApplicationSettingDefinitions.cs`
|
||||
|
||||
### User Rights
|
||||
1. Get next I3D from `UserRightsConst.cs`
|
||||
2. Create script: `ScriptHelpers.AddRightIfNotExists(id, parentId, "German name", "German desc")`
|
||||
3. Add constant to `UserRightsConst.cs`
|
||||
|
||||
### Web Service (Full Stack)
|
||||
1. **BL**: `{Entity}BL.cs` returning `Result<T>`
|
||||
2. **WebServiceBL**: `{Entity}WebServiceBL.cs` with DTO↔Entity conversion
|
||||
3. **RestService**: Add to `CentronRestService.cs` (`Request<T>` → `Response<T>`)
|
||||
4. **Interface**: `ICentronRestService.cs` with `[OperationContract]`, `[WebInvoke(Method="POST", UriTemplate="...")]`, `[Authenticate]`
|
||||
5. **Logic**: `I{Entity}Logic`, `BL{Entity}Logic`, `WS{Entity}Logic`
|
||||
|
||||
### WPF Module
|
||||
1. **Controller**: Implement `ICentronAppModuleController`
|
||||
2. **View**: `UserControl` inheriting `BaseModule`
|
||||
3. **ViewModel**: Inherit `BindableBase`
|
||||
4. **Ribbon**: Implement `IRibbonControlModule` variations
|
||||
5. **Registration**: Add to `ModuleRegistration.cs` with rights checks
|
||||
6. **Theme**: Prefer DevExpress controls over WPF standard
|
||||
|
||||
## Agent Usage (MANDATORY)
|
||||
|
||||
### Project Agents (.claude/agents/)
|
||||
- **primary-development**: ALL development tasks (orchestrator)
|
||||
- **database-script-creator**: Database schema changes → generates ScriptMethod*.cs
|
||||
- **webservice-developer**: Full-stack web service implementation
|
||||
- **ui-module-creator**: WPF modules with MVVM + DevExpress
|
||||
- **centron-nexus-developer**: Blazor Server, Razor components, SignalR, DevExpress Blazor
|
||||
- **external-api-integrator**: Third-party API integrations (FinAPI, GLS, Shipcloud, etc.)
|
||||
- **edi-specialist**: EDI processing (OpenTrans, EDIFACT, supplier integrations)
|
||||
- **nhibernate-query-reviewer**: Query optimization, N+1 detection
|
||||
- **localization-checker**: German/English verification
|
||||
- **bookkeeping-export-expert**: DATEV, Abacus, SAP exports
|
||||
- **test-engineer**: Test generation
|
||||
- **code-reviewer**: Code quality/security
|
||||
- **refactoring-specialist**: Code cleanup
|
||||
- **debugger**: Bug diagnosis
|
||||
- **architect**: System design
|
||||
- **documentation-writer**: Docs
|
||||
- **security-analyst**: Security reviews
|
||||
|
||||
### MANDATORY Agent Usage
|
||||
- New features → **primary-development**
|
||||
- DB schema → **database-script-creator**
|
||||
- Web service → **webservice-developer**
|
||||
- WPF module → **ui-module-creator**
|
||||
- CentronNexus/Blazor → **centron-nexus-developer**
|
||||
- External API → **external-api-integrator**
|
||||
- EDI integration → **edi-specialist**
|
||||
- Complex queries → **nhibernate-query-reviewer**
|
||||
- UI text → **localization-checker**
|
||||
|
||||
## Commands
|
||||
```bash
|
||||
dotnet build Centron.sln # Build
|
||||
dotnet test Centron.sln # Test all
|
||||
cd scripts/Centron.Scripts && dotnet run # Build orchestration
|
||||
```
|
||||
|
||||
**Targets**: clean, setup-versioning, build-web-service, build-centron-net, run-tests, create-installers
|
||||
|
||||
## Slash Commands
|
||||
`/test`, `/review`, `/optimize`, `/implement`, `/explain`, `/analyze`, `/adr`, `/scaffold`
|
||||
|
||||
## MCP Servers
|
||||
**serena**: Semantic search, symbol manipulation | **context7**: Library docs | **fetch**: Web content | **sequential-thinking**: Problem decomposition | **memory**: Knowledge graph | **playwright**: Browser automation | **windows-mcp**: Windows interaction
|
||||
|
||||
## Claude Instructions
|
||||
|
||||
### Tooling Decision (REQUIRED at task start)
|
||||
```
|
||||
🎯 Tooling Strategy Decision
|
||||
|
||||
Task Analysis: [Brief description]
|
||||
|
||||
Tooling Decisions:
|
||||
- Agents: [name] / Not using - Reason: [justification]
|
||||
- Slash Commands: [/command] / Not using - Reason: [justification]
|
||||
- MCP Servers: [server:tool] / Not using - Reason: [justification]
|
||||
- Approach: [strategy]
|
||||
```
|
||||
|
||||
**When NOT to use agents**: Single file read, simple edit, 1-2 tool calls
|
||||
|
||||
### Task Summary (REQUIRED at end)
|
||||
```
|
||||
📊 Task Completion Summary
|
||||
|
||||
What Was Done: [description]
|
||||
|
||||
Features Involved:
|
||||
- Agents: [list or None - justification]
|
||||
- Slash Commands: [list or None - justification]
|
||||
- MCP Servers: [list or None - justification]
|
||||
- Core Tools: [Read, Write, Edit, Glob, Grep, Bash, etc.]
|
||||
- Files Modified: [list or None]
|
||||
- Performance: [Parallel ops, extended thinking, or N/A]
|
||||
|
||||
Efficiency Notes: [observations]
|
||||
```
|
||||
|
||||
### Checklist
|
||||
✅ Provide tooling decisions at task start
|
||||
✅ Use `Result<T>` pattern
|
||||
✅ Follow ILogic interface pattern
|
||||
✅ German localization for UI text
|
||||
✅ UTF-8 with BOM for C#/XAML
|
||||
✅ DB conventions (I3D, FK, tracking columns)
|
||||
✅ Run tests before commits
|
||||
✅ Reference ticket numbers
|
||||
✅ Use parallel tool calls
|
||||
✅ Leverage agents/slash commands/MCP servers
|
||||
|
||||
## Common Tasks
|
||||
1. **DB Table**: database-script-creator → ScriptMethod*.cs with conventions
|
||||
2. **Web Service**: webservice-developer → BL → WebServiceBL → REST → Logic
|
||||
3. **WPF Module**: ui-module-creator → View, ViewModel, Controller, Ribbon, Localization
|
||||
4. **Query Optimization**: nhibernate-query-reviewer → N+1, indexes, soft delete
|
||||
|
||||
## Critical Files
|
||||
- `src/centron/Centron.WPF.UI/App.xaml.cs` - WPF entry
|
||||
- `src/backend/Centron.BL/` - Business logic
|
||||
- `src/backend/Centron.DAO/` - Data access
|
||||
- `src/webservice/Centron.WebServices.Core/RestService/CentronRestService.cs` - REST API
|
||||
- `src/backend/Centron.Interfaces/` - Service interfaces
|
||||
|
||||
## Git
|
||||
**Branch**: `master` (main) | **Types**: `feature/*`, `bugfix/*`, `hotfix/*`
|
||||
**Commits**: `feat(module):`, `fix(module):`, `refactor(module):`, `docs:` + optional `(Ticket #12345)`
|
||||
|
||||
## Important Notes
|
||||
- Project uses custom versioning via Nerdbank.GitVersioning
|
||||
- Build artifacts placed in `/artifacts` directory
|
||||
- Integration with Azure DevOps for CI/CD
|
||||
- Automatic ticket integration with c-entron ticket system
|
||||
- Supports both standalone and web service deployment modes
|
||||
- Always test database scripts before committing
|
||||
- Use German for all user-facing text with English translations
|
||||
- Follow dual implementation pattern (BL + WS) for all data access
|
||||
- When creating a script, do not override ApplicationVersion, MethodKind, or ScriptCollection. These are legacy properties.
|
||||
- When creating a linq query for database access, beware of the limitations and capabilities of NHibernate (it is our OR-Mapper).
|
||||
@@ -1,38 +1,64 @@
|
||||
# Versuch 03 - Kurzuebersicht
|
||||
|
||||
## Inhalt
|
||||
Fokus auf konsolidierte End-to-End-Requirements-Spezifikation (StRS, SyRS, SwRS) mit hoher ISO-29148-Reife, Qualitaetsmetriken und separaten Traceability-Artefakten (CSV). Gegenueber Versuch 01 ist die Struktur noch staerker in Teilartefakte fuer Stakeholder/System/Software zerlegt.
|
||||
Fokus auf Use-Case- und Modulanalyse (ERP-Dokumentation), inkl. Gap-Analyse zwischen dokumentierter und tatsaechlich entdeckter Funktionalitaet. Der Versuch liefert vor allem Umfangs-, Coverage- und Discovery-Kennzahlen statt klassischer StRS/SyRS/SwRS-Requirements.
|
||||
|
||||
## Kennzahlen (einheitliches Vergleichsformat)
|
||||
| Kennzahl | Wert |
|
||||
| --- | --- |
|
||||
| Ergebnisdateien gesamt | 37 |
|
||||
| Ergebnisdateitypen (MD/PDF/CSV/SQL/YAML/JSON/TXT) | 26 / 1 / 5 / 0 / 1 / 3 / 1 |
|
||||
| Markdown-Zeilen gesamt | 15.625 |
|
||||
| Anforderungen/Features gesamt (konsolidiert) | 220 (siehe `Requirements.md`) |
|
||||
| Formale Anforderungen gesamt (StRS+SyRS+SwRS) | 220 |
|
||||
| Stakeholder-Anforderungen (StRS) | 84 |
|
||||
| System-Anforderungen (SyRS) | 53 |
|
||||
| Software-Anforderungen (SwRS) | 83 |
|
||||
| Use Cases gesamt (explizit) | 46 |
|
||||
| Dokumentierte Use Cases | 46 |
|
||||
| Undokumentierte Use Cases | n.v. |
|
||||
| Ueberlappung Use Cases <-> Anforderungen (abgezogen) | 46 (konservativ) |
|
||||
| ISO-29148-Compliance | 96,1% (100% mandatory) |
|
||||
| Traceability-Abdeckung | 100% bidirektional |
|
||||
| Code Coverage | 87,3% (laut Doku) |
|
||||
| Test Coverage | 87,3% (laut Doku) |
|
||||
| Analysierte Quellartefakte | 14.940 Dateien (13.717 C#, 1.189 XAML, 34 Projekte) |
|
||||
| Separate Traceability-CSV (Dateien / Zeilen) | 4 / 327 |
|
||||
|
||||
## Evaluation-Hinweis
|
||||
Sehr gut geeignet fuer vergleichende ISO-29148-Evaluation mit quantifizierter Qualitaets- und Traceability-Sicht; konsolidierte Zaehlung erfolgt in `Requirements.md`.
|
||||
| Ergebnisdateien gesamt | 30 |
|
||||
| Ergebnisdateitypen (MD/PDF/CSV/SQL/YAML/JSON/TXT) | 24 / 4 / 0 / 2 / 0 / 0 / 0 |
|
||||
| Markdown-Zeilen gesamt | 21.882 |
|
||||
| Anforderungen/Features gesamt (konsolidiert) | 1.720 (siehe `Requirements.md`) |
|
||||
| Formale Anforderungen gesamt (StRS+SyRS+SwRS) | 0 |
|
||||
| Stakeholder-Anforderungen (StRS) | 0 |
|
||||
| System-Anforderungen (SyRS) | 0 |
|
||||
| Software-Anforderungen (SwRS) | 0 |
|
||||
| Use Cases gesamt (explizit) | 1.720 |
|
||||
| Dokumentierte Use Cases | 509 |
|
||||
| Undokumentierte Use Cases | 1.211 (71% Gap) |
|
||||
| Ueberlappung Use Cases <-> Anforderungen (abgezogen) | 0 (bereits dedupliziert) |
|
||||
| ISO-29148-Compliance | n.v. |
|
||||
| Traceability-Abdeckung | n.v. (kein StRS->SyRS->SwRS-Nachweis) |
|
||||
| Code Coverage | n.v. |
|
||||
| Test Coverage | n.v. |
|
||||
| Analysierte Quellartefakte | 150.000+ LoC analysiert; 3.412 potenzielle Use Cases |
|
||||
| Separate Traceability-CSV (Dateien / Zeilen) | 0 / 0 |
|
||||
|
||||
## Vorgehen
|
||||
- Erweiterter Prompt zu Claude Code
|
||||
- Verwendung spezialisierter Agenten für Claude Code.
|
||||
- Erweiterter Prompt zu Claude Code
|
||||
- Verwendung spezialisierter generischer Agenten
|
||||
- Verwendung von MCP-Servern zur Erweiterung der Discovery-Breite
|
||||
- Serena MCP (Memory/Knowledge)
|
||||
- Windows-MCP (UI-Interaktion)
|
||||
- MSSQL MCP (DB-Schema-Analyse)
|
||||
|
||||
## Prompt
|
||||
"Please analyze this software project and write a ISO 29148 compliant reuqirements specification.
|
||||
Use Agents wherever possible.
|
||||
"
|
||||
## Verwendeter Prompt
|
||||
```text
|
||||
Please analyze this software project and write a reuqirements specification according to modern standards.
|
||||
Use Agents and MCP servers wherever possible.
|
||||
Keep superflous texts to a minimum and concentrate on actual requirements.
|
||||
```
|
||||
|
||||
## Agenten (Beispiele)
|
||||
- `Tools/Agents/centron-documentation-writer.md`
|
||||
- Dokumentiert Module, Architektur und Muster
|
||||
- `Tools/Agents/nhibernate-query-reviewer.md`
|
||||
- Query-/Persistenzanalyse fuer datengetriebene Use Cases
|
||||
- `Tools/Agents/centron-code-reviewer.md`
|
||||
- Review und Ableitung technischer Funktionalitaet
|
||||
- `Tools/Agents/webservice-developer.md`
|
||||
- API- und Integrationssicht in der Discovery
|
||||
|
||||
## Ergebnisbeispiele aus `ERP_DOCUMENTATION`
|
||||
- `ERP_DOCUMENTATION/ANALYSIS_SUMMARY.md`
|
||||
- 34 identifizierte Module, davon 11 neu entdeckt
|
||||
- `ERP_DOCUMENTATION/UNDOCUMENTED_USE_CASES_SUMMARY.md`
|
||||
- 1.720+ extrahierte Use Cases, ca. 71% Dokumentations-Gap
|
||||
- `ERP_DOCUMENTATION/USE_CASES.md` und `ERP_DOCUMENTATION/USE_CASE_MAPPING.md`
|
||||
- Konsolidierte Use-Case-Sichten und Zuordnungen
|
||||
- `ERP_DOCUMENTATION/SCREENSHOT_MAPPING_COMPLETE.md`
|
||||
- UI-/Screenshot-Mapping zur funktionalen Validierung
|
||||
|
||||
## Evaluation-Hinweis
|
||||
Sehr stark fuer Funktions-/Use-Case-Discovery und Doku-Gap-Analyse; konsolidierte Zaehlung erfolgt in `Requirements.md`.
|
||||
|
||||
Reference in New Issue
Block a user