ADR-0104: Engineering standards program¶
| Field | Value |
|---|---|
| Status | Accepted |
| Date | 2026-12-01 |
| Deciders | ConnectSoft Architecture Team (owner approval of 2026-12-01) |
| Supersedes | - |
Context¶
ConnectSoft engineering guidance is spread across four places that disagree with each other:
- ConnectSoft.Documentation has large pages, but several present outdated defaults (AutoMapper, MassTransit, Angular, .NET 8 and 9) and some contradict each other, for example on test naming and the coverage target.
- ConnectSoft.CompanyDocumentation holds the process standards (branching, workflow, testing, CI/CD, code ownership), which contradict the canonical pages.
- ConnectSoft.AI.AgentKit holds short standards for AI agents that are written by hand and drift from the documentation.
- Repository
AGENTS.mdfiles are copies of the BaseTemplate guide and have drifted from both the code and the documentation.
House rules that reviewers apply every day, and defect patterns learned from real incidents, exist in none of these places.
The build layer does not close the gap. The findings in the engineering standards findings register show that the shared .editorconfig is not parsed, several analyzers never load, and no pipeline fails on new warnings.
A code reviewer, human or AI, needs one set of rules that it can cite by ID.
Decision¶
1. One canonical source¶
- The engineering standards live in ConnectSoft.Documentation under
Docs/engineering-standards/. - The process standards move there from ConnectSoft.CompanyDocumentation. The original pages become short pointer pages.
- Every other copy is derived from the canonical pages and is never edited by hand. That covers the AgentKit standards, the review skills' checklists and the repository
AGENTS.mdblocks.
2. Rule IDs¶
- Every rule has a stable ID
CS-<AREA>-NNN, for exampleCS-LOG-003. Every defect pattern has an IDCS-DP-<AREA>-NNN. - The areas are:
| Area | Topic | Area | Topic |
|---|---|---|---|
PRC |
Development process | AUZ |
Authorization |
GIT |
Branching and commits | MSG |
Messaging |
REV |
Code review | ORL |
Orleans grains |
DOD |
Definition of Done | PER |
Persistence and migrations |
NAM |
Naming | API |
API contracts |
STY |
Code style and file layout | CFG |
Configuration and options |
XML |
XML documentation | UI |
Blazor UI |
ASY |
Async and concurrency | A11Y |
Accessibility, RTL, responsive layout |
ERR |
Error handling | TST |
Unit, integration and acceptance tests |
VAL |
Validation | E2E |
End-to-end tests |
MAP |
Object mapping | DEP |
Dependencies and licences |
SVC |
Domain service shape | TPL |
Templates and scaffolding |
LOG |
Logging | DOCS |
Documentation |
MET |
Metrics | SEC |
Security |
TIM |
Date and time | TRC |
Tracing |
- IDs are never renumbered or reused. A retired rule keeps its ID with
Status: retiredand a pointer to its replacement. - Each rule heading carries an explicit anchor equal to its lowercase ID, so links survive title changes.
3. Rule page template¶
A rule is written in this exact shape, so that a script can extract it:
### CS-LOG-003: Use source-generated logging in domain services { #cs-log-003 }
**Severity:** major · **Applies to:** service, library · **Enforced by:** manual (target: ENF-004) · **Status:** active
#### Why
#### Do
#### Don't
#### Example
#### How to check
- Severity uses the code review scale:
blocker,major,minor,nit. - Applies to lists repository families:
service,library,api-client,blazor,template,docs,pipelines. - Enforced by names the mechanism:
manual, an analyzer rule ID, a test or a pipeline gate. A rule that the build does not enforce names its findings-register row. - How to check is mandatory. A statement that cannot be checked is written as guidance text, not as a rule.
A defect pattern uses the same heading and metadata line, with the sections Symptom, Cause, Check, Test and Related rules.
4. Derived copies¶
ConnectSoft.AI.AgentKitgenerates its standards from the canonical pages with a script. Each generated line carries the rule ID, the severity and a link to the source anchor. The script has a-Checkmode that fails when the generated files differ from the source.- Review skills cite rule IDs instead of restating rules. The AgentKit verification fails when a skill cites an ID that does not exist.
- Repository
AGENTS.mdfiles contain a generated block between markers, chosen by repository family, plus a hand-written repository section outside the markers.
5. Register, do not enforce¶
- The standards program changes documentation, agent guidance and
AGENTS.mdfiles only. It does not change.editorconfigfiles, analyzer references, build properties or pipeline gates. - Enforcement defects are recorded in the findings register with target, actual state and evidence. A later enforcement phase picks them up after a separate decision.
- Turning on
--strictfor documentation builds is a documentation change, but it edits a shared pipeline step. It is approved separately and added as an opt-in parameter.
6. Content rules¶
- Standards are written in English.
- They contain no client names, client-specific identifiers, ticket numbers, dates of incidents or names of people. Examples use neutral domain types such as
OrderandCustomer. - Rules learned on a client project are generalized before they are added. Rules that only apply to one client stay in that client's repositories.
Alternatives considered¶
| Option | Outcome |
|---|---|
| Keep AgentKit as the source and publish it to the site | Rejected. Engineers read the site; the agent copy must follow the human standard, not lead it. |
| Maintain human and agent rule sets separately | Rejected. Two hand-maintained copies drift, which is the problem this record solves. |
| Fix the build layer in the same program | Deferred. The fixes change warnings and gates across about 250 repositories and need their own decision. The findings register keeps them visible. |
Copy .editorconfig and analyzer settings from BaseTemplate to every repository |
Deferred with the build layer. |
Consequences¶
- Reviewers and AI agents cite one ID for each finding, and a reader can follow the link to the reason and an example.
- Pages in
Docs/engineering-standards/follow a strict format, checked byscripts/connectsoft-docs.ps1. - Some rules will say
manualor name a findings-register row inEnforced byuntil the enforcement phase runs. The gap is visible rather than hidden. - CompanyDocumentation loses its engineering process pages and keeps pointers.
- AgentKit standards and repository
AGENTS.mdblocks can no longer be edited by hand.