SIB / example 03 Enterprise C# practices

C01Enterprise C# practices

Enforce the defaults. Explain the judgment calls.

This example creates a modest engineering baseline for ordinary C# business applications.

Build policy / architecture / coding / risk-based verification

The result deliberately separates machine-enforceable settings from human guidance. Compiler and analyzer defaults belong in Directory.Build.props and .editorconfig; architecture, failure semantics, testing depth, migration, and rollback still require documented engineering judgment and review.

C02Source-defined task

The fluent chain states the intended baseline in domain language. The builder records these dynamic calls as instructions for Codex; it does not implement a built-in method for each phrase.

Program.cs / excerpt
Builder.WithFile("AGENTS.md", options)
    .CreateOrReplaceEnterpriseCSharpAgentInstructions("AGENTS.md")
    .TargetSupportedDotNetWithNullableReferenceTypesAnalyzersWarningsAsErrorsAndDeterministicBuilds()
    .PreferTheSimplestArchitectureThatPreservesDomainBoundariesAndDependencyDirection()
    .RequireCancellationPropagationAsyncCorrectnessStructuredLoggingAndExplicitFailureSemantics()
    .RequireUnitIntegrationContractAndArchitectureTestsInProportionToRisk()
    .RequireSecurityPrivacyObservabilityBackwardCompatibilityMigrationAndRollbackReview()
    .ForbidInventedAbstractionsPrematureMicroservicesSwallowedExceptionsAndUnboundedRetries()
    .CreateOrReplaceEditorConfig(".editorconfig")
    .CreateOrReplaceSharedBuildPolicy("Directory.Build.props")
    .CreateOrReplaceArchitectureGuide("docs/engineering/architecture.md")
    .CreateOrReplaceCodingStandards("docs/engineering/coding-standards.md")
    .CreateOrReplaceQualityGates("docs/engineering/quality-gates.md")
    .CreateOrReplacePullRequestChecklist("docs/engineering/pull-request-checklist.md")
    .KeepRulesSpecificMechanicallyCheckableAndSuitableForARegularBusinessApplication()
    .DoNotCreateApplicationCodeOrModifyProgramProjectFilesOrBuilderSource();

Read the complete Program.cs for its research instructions, validation request, and execution options.

C03Run safely

Use the complete repository checkout because the project links ../../SuperIntelligenceBuilder.cs.

dry run
cd examples/enterprise-csharp
dotnet build
dotnet run

The default command is a dry run. See the shared example steps for preview and live-run prerequisites.

live execution
dotnet run -- --yes,please,proceed

A live run finds the checked-in AGENTS.md and asks for the exact reply yes, please proceed; no stops. Review every policy and configuration change before adopting it elsewhere. The complete state table and consent scope are under Execution and completion.

C04Inspect the outputs

Output What it governs
AGENTS.md Repository-wide instructions for agent-authored C# changes.
.editorconfig Editor formatting and analyzer severities that supporting tools can enforce.
Directory.Build.props Shared compiler, analyzer, nullable-reference, warning, and deterministic-build defaults.
architecture.md Dependency direction, module boundaries, and criteria for adding architectural complexity.
coding-standards.md Async, cancellation, failure, logging, data, and compatibility practices.
quality-gates.md Risk-based unit, integration, contract, architecture, security, and release verification.
pull-request-checklist.md A compact review prompt for change scope, evidence, operations, migration, and rollback.

C05Basis and evidence

The task grounds technical guidance in Microsoft’s C# coding conventions and architectural principles. GitHub’s dotnet-best-practices skill is named only as a research pointer, not as copied policy or a substitute for Microsoft’s technical documentation.

The generating run reported successful XML and EditorConfig parsing, local Markdown-link resolution, and internal-consistency checks. The example project also built with zero warnings and zero errors. Those checks establish syntax and local consistency; they do not prove that this baseline fits every organization or application. See the validation record for the exact evidence.