@oddessentials/repo-standards 4.4.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,72 @@
1
1
  {
2
2
  "checklist": {
3
3
  "core": [
4
+ {
5
+ "ciHints": {
6
+ "azure-devops": {
7
+ "notes": "Run CRLF detection early in pipeline before other checks.",
8
+ "stage": "quality"
9
+ },
10
+ "github-actions": {
11
+ "job": "ci",
12
+ "notes": "Add .gitattributes check as first step in CI job."
13
+ }
14
+ },
15
+ "description": "Enforce line endings at the Git layer using .gitattributes. Mark text files with appropriate EOL handling (eol=lf for shell scripts, eol=auto for most files) and binary files as binary to prevent corruption. This prevents 'works locally, fails in CI' issues caused by CRLF/LF mismatches.",
16
+ "id": "gitattributes-eol",
17
+ "label": "Git Attributes (Line Endings)",
18
+ "stack": {
19
+ "exampleConfigFiles": [
20
+ ".gitattributes",
21
+ ".editorconfig"
22
+ ],
23
+ "exampleTools": [
24
+ "git"
25
+ ],
26
+ "machineCheck": {
27
+ "command": "git ls-files --eol | grep -E 'w/crlf.*\\.sh$' && exit 1 || exit 0",
28
+ "description": "Verify no CRLF in shell scripts",
29
+ "expectExitCode": 0
30
+ },
31
+ "notes": "Use .gitattributes for EOL authority. Mark *.sh, *.ps1 scripts appropriately. .editorconfig drives editor behavior but .gitattributes is the source of truth for Git operations.",
32
+ "optionalFiles": [
33
+ ".editorconfig"
34
+ ],
35
+ "requiredFiles": [
36
+ ".gitattributes"
37
+ ],
38
+ "verification": "Run 'git ls-files --eol' to check EOL consistency."
39
+ }
40
+ },
41
+ {
42
+ "ciHints": {
43
+ "azure-devops": {
44
+ "notes": "Run CRLF detection as the first quality check before linting or testing.",
45
+ "stage": "quality"
46
+ },
47
+ "github-actions": {
48
+ "job": "ci",
49
+ "notes": "Add CRLF detection step before main CI steps."
50
+ }
51
+ },
52
+ "description": "Fail CI early for Linux-executed files containing CRLF line endings. Shell scripts, Python files, and other interpreted files fail silently or with cryptic errors when they contain \\r characters. Detect this before running deeper CI steps.",
53
+ "id": "crlf-detection",
54
+ "label": "CRLF Detection in CI",
55
+ "stack": {
56
+ "exampleConfigFiles": [],
57
+ "exampleTools": [
58
+ "file",
59
+ "grep"
60
+ ],
61
+ "machineCheck": {
62
+ "command": "git ls-files --eol | grep -E 'w/crlf.*\\.sh$' && exit 1 || exit 0",
63
+ "description": "Detect CRLF in shell scripts",
64
+ "expectExitCode": 0
65
+ },
66
+ "notes": "Detect CRLF in shell scripts and CI configuration files. C# source files can tolerate CRLF but shell scripts cannot.",
67
+ "verification": "Run CRLF detection on .sh files in CI."
68
+ }
69
+ },
4
70
  {
5
71
  "ciHints": {
6
72
  "azure-devops": {
@@ -196,6 +262,32 @@
196
262
  "verification": "Trigger the release pipeline and confirm all artifacts share the same version number and tag."
197
263
  }
198
264
  },
265
+ {
266
+ "ciHints": {
267
+ "azure-devops": {
268
+ "notes": "Set HUSKY=0 or equivalent in release pipeline to disable hooks.",
269
+ "stage": "release"
270
+ },
271
+ "github-actions": {
272
+ "job": "release",
273
+ "notes": "Set HUSKY=0 or equivalent in release job to disable hooks."
274
+ }
275
+ },
276
+ "description": "Release automation must bypass local developer hooks (HUSKY=0, --no-verify) and rely solely on CI gates for validation. This ensures idempotent, reproducible releases that don't fail due to hook environment differences.",
277
+ "id": "release-hook-bypass",
278
+ "label": "Release Hook Bypass",
279
+ "stack": {
280
+ "exampleConfigFiles": [
281
+ "azure-pipelines.yml",
282
+ ".github/workflows/release.yml"
283
+ ],
284
+ "exampleTools": [
285
+ "GitVersion"
286
+ ],
287
+ "notes": "Release pipelines should skip local hooks. If using Lefthook, set LEFTHOOK=0. Rely on CI gates for all validation.",
288
+ "verification": "Check release pipeline for hook bypass configuration."
289
+ }
290
+ },
199
291
  {
200
292
  "ciHints": {
201
293
  "azure-devops": {
@@ -322,24 +414,81 @@
322
414
  {
323
415
  "ciHints": {
324
416
  "azure-devops": {
417
+ "notes": "Hooks and CI must invoke identical verification commands. Use npm run verify or equivalent.",
325
418
  "stage": "quality"
326
419
  },
327
420
  "github-actions": {
328
- "job": "ci"
421
+ "job": "ci",
422
+ "notes": "Hooks and CI must invoke identical verification commands. Use npm run verify or equivalent."
329
423
  }
330
424
  },
331
- "description": "Use git hooks to run linting, formatting, tests, and commit linting before changes are committed.",
425
+ "description": "Use git hooks to run linting, formatting, and commit linting before changes are committed. Hooks should CHECK by default (not auto-fix), be fast, and scope to changed files only. Use a single entry hook mechanism (e.g., Husky as entry point calling pre-commit or lint-staged).",
332
426
  "id": "pre-commit-hooks",
333
427
  "label": "Pre-Commit Hooks",
334
428
  "stack": {
335
429
  "exampleConfigFiles": [
336
- "lefthook.yml"
430
+ "lefthook.yml",
431
+ ".husky/"
337
432
  ],
338
433
  "exampleTools": [
339
- "Lefthook"
434
+ "Lefthook",
435
+ "husky.net"
340
436
  ],
341
- "notes": "Configure Lefthook or similar to run formatting and basic checks on staged files before commits.",
342
- "verification": "Inspect the hook configuration (for example, Lefthook or similar) and confirm it runs at least formatting and basic checks on staged changes before commits or pushes."
437
+ "notes": "Configure Lefthook or husky.net to run formatting checks (not auto-fix) on staged files. Hooks should be deterministic and environment-pinned via global.json SDK version.",
438
+ "verification": "Inspect hook configuration and confirm checks run in verify mode, not auto-fix mode."
439
+ }
440
+ },
441
+ {
442
+ "ciHints": {
443
+ "azure-devops": {
444
+ "notes": "CI should call the same verify script that hooks use locally.",
445
+ "stage": "quality"
446
+ },
447
+ "github-actions": {
448
+ "job": "ci",
449
+ "notes": "CI should call the same verify script that hooks use locally."
450
+ }
451
+ },
452
+ "description": "Local hooks and CI must invoke identical verification commands to prevent 'works locally, fails in CI' issues. Use a single canonical verify entrypoint (e.g., npm run verify) that both hooks and CI call.",
453
+ "id": "hook-ci-parity",
454
+ "label": "Hook/CI Parity",
455
+ "stack": {
456
+ "exampleConfigFiles": [
457
+ "Makefile",
458
+ "Directory.Build.props"
459
+ ],
460
+ "exampleTools": [
461
+ "dotnet CLI",
462
+ "make"
463
+ ],
464
+ "notes": "Define a verify target (make verify or dotnet cake verify) that both hooks and CI invoke. Keep verification logic in one place.",
465
+ "verification": "Compare hook commands with CI commands and confirm they invoke the same targets."
466
+ }
467
+ },
468
+ {
469
+ "ciHints": {
470
+ "azure-devops": {
471
+ "notes": "Also run secret scanning in CI as a safety net for commits that bypassed hooks.",
472
+ "stage": "quality"
473
+ },
474
+ "github-actions": {
475
+ "job": "ci",
476
+ "notes": "Enable GitHub secret scanning and also run gitleaks in CI."
477
+ }
478
+ },
479
+ "description": "Scan staged diffs for credentials, API keys, and secrets before they reach the remote repository. Catch secrets at commit time rather than after they're pushed.",
480
+ "id": "secret-scanning-precommit",
481
+ "label": "Pre-commit Secret Scanning",
482
+ "stack": {
483
+ "exampleConfigFiles": [
484
+ ".gitleaks.toml"
485
+ ],
486
+ "exampleTools": [
487
+ "gitleaks",
488
+ "detect-secrets"
489
+ ],
490
+ "notes": "Add gitleaks to pre-commit hooks via Lefthook. Scan staged changes before commits.",
491
+ "verification": "Run 'gitleaks protect --staged' and verify it catches test secrets."
343
492
  }
344
493
  },
345
494
  {
@@ -582,6 +731,85 @@
582
731
  ],
583
732
  "verification": "LICENSE file is present in the repository root; CODE_OF_CONDUCT.md and CONTRIBUTING.md are present for contribution guidance."
584
733
  }
734
+ },
735
+ {
736
+ "ciHints": {
737
+ "azure-devops": {
738
+ "notes": "CI should call the canonical verify command, not duplicate check logic.",
739
+ "stage": "quality"
740
+ },
741
+ "github-actions": {
742
+ "job": "ci",
743
+ "notes": "CI should call the canonical verify command, not duplicate check logic."
744
+ }
745
+ },
746
+ "description": "Provide one canonical 'verify' command per repository/stack that all stages call with appropriate flags. This prevents duplication, drift, and ensures consistency between local development and CI.",
747
+ "id": "canonical-verify",
748
+ "label": "Canonical Verify Entrypoint",
749
+ "stack": {
750
+ "exampleConfigFiles": [
751
+ "Makefile",
752
+ "build.cake"
753
+ ],
754
+ "exampleTools": [
755
+ "dotnet CLI",
756
+ "make",
757
+ "cake"
758
+ ],
759
+ "notes": "Define 'make verify' or 'dotnet cake verify' that runs all checks. Both hooks and CI use this single entrypoint with stage-appropriate flags.",
760
+ "verification": "Makefile or build script contains a 'verify' target."
761
+ }
762
+ },
763
+ {
764
+ "ciHints": {
765
+ "azure-devops": {
766
+ "notes": "Ensure CI reads from authoritative configs, not duplicated settings.",
767
+ "stage": "quality"
768
+ },
769
+ "github-actions": {
770
+ "job": "ci",
771
+ "notes": "Ensure CI reads from authoritative configs, not duplicated settings."
772
+ }
773
+ },
774
+ "description": "Each configuration rule must live in exactly one authoritative config file. Avoid duplication across .editorconfig, linter configs, and CI definitions. Document which file is authoritative for each concern.",
775
+ "id": "config-authority",
776
+ "label": "Config File Authority Rules",
777
+ "stack": {
778
+ "exampleConfigFiles": [
779
+ ".gitattributes",
780
+ ".editorconfig",
781
+ "Directory.Build.props"
782
+ ],
783
+ "exampleTools": [],
784
+ "notes": "Authority mapping: .gitattributes for EOL, .editorconfig for formatting rules, Directory.Build.props for shared build settings. Roslyn analyzers read from .editorconfig.",
785
+ "verification": "Review configs and confirm no rule is duplicated across files."
786
+ }
787
+ },
788
+ {
789
+ "ciHints": {
790
+ "azure-devops": {
791
+ "notes": "CI should read skip paths from config files, not hardcode them in pipeline.",
792
+ "stage": "quality"
793
+ },
794
+ "github-actions": {
795
+ "job": "ci",
796
+ "notes": "CI should read skip paths from config files, not hardcode them in pipeline."
797
+ }
798
+ },
799
+ "description": "Encode path exclusions and skip rules deterministically in config files, not through ad-hoc human judgment. Make it clear which paths are excluded from checks and why.",
800
+ "id": "explicit-skip-paths",
801
+ "label": "Explicit Skip Paths",
802
+ "stack": {
803
+ "exampleConfigFiles": [
804
+ ".editorconfig"
805
+ ],
806
+ "exampleTools": [
807
+ "dotnet format",
808
+ "Roslyn"
809
+ ],
810
+ "notes": "Use .editorconfig file globs to exclude generated code from analysis. Document exclusions with comments.",
811
+ "verification": "Review .editorconfig and confirm exclusions are explicit and documented."
812
+ }
585
813
  }
586
814
  ],
587
815
  "optionalEnhancements": [
@@ -816,6 +1044,140 @@
816
1044
  "verification": "For web-facing apps, run the configured accessibility checks or tools against your main UI endpoints and confirm that blocking accessibility issues are addressed."
817
1045
  }
818
1046
  },
1047
+ {
1048
+ "ciHints": {
1049
+ "azure-devops": {
1050
+ "notes": "Run AI drift detection in a scheduled nightly pipeline separate from main CI.",
1051
+ "stage": "nightly"
1052
+ },
1053
+ "github-actions": {
1054
+ "job": "nightly",
1055
+ "notes": "Use scheduled workflow (cron) to run AI drift detection nightly."
1056
+ }
1057
+ },
1058
+ "description": "Run nightly or scheduled checks comparing AI-generated outputs against pinned baselines to detect model drift, prompt drift, or code changes affecting AI behavior. Attribute regressions to code changes vs model updates vs prompt changes.",
1059
+ "id": "ai-drift-detection",
1060
+ "label": "AI Drift Detection",
1061
+ "stack": {
1062
+ "exampleConfigFiles": [
1063
+ "*.verified.txt",
1064
+ "ai-baselines/"
1065
+ ],
1066
+ "exampleTools": [
1067
+ "Verify",
1068
+ "custom baseline tests"
1069
+ ],
1070
+ "notes": "Use Verify library or custom comparison tests to detect AI output drift. Run nightly to catch model-side changes that don't show up in code diffs.",
1071
+ "verification": "Run AI baseline tests and confirm outputs match pinned baselines."
1072
+ }
1073
+ },
1074
+ {
1075
+ "ciHints": {
1076
+ "azure-devops": {
1077
+ "notes": "Run schema validation tests as part of quality gates.",
1078
+ "stage": "quality"
1079
+ },
1080
+ "github-actions": {
1081
+ "job": "ci",
1082
+ "notes": "Include AI output schema validation in CI test suite."
1083
+ }
1084
+ },
1085
+ "description": "Validate all AI-generated outputs against strict JSON schemas or type definitions at system boundaries. Reject invalid outputs early rather than letting malformed data propagate through the system.",
1086
+ "id": "ai-schema-enforcement",
1087
+ "label": "AI Output Schema Enforcement",
1088
+ "stack": {
1089
+ "exampleConfigFiles": [
1090
+ "*.schema.json",
1091
+ "Schemas/"
1092
+ ],
1093
+ "exampleTools": [
1094
+ "System.Text.Json",
1095
+ "FluentValidation",
1096
+ "JsonSchema.Net"
1097
+ ],
1098
+ "notes": "Use strongly-typed DTOs with validation attributes or FluentValidation for AI outputs. Deserialize with strict settings that reject unknown properties.",
1099
+ "verification": "Review AI integration code and confirm outputs are validated against schemas."
1100
+ }
1101
+ },
1102
+ {
1103
+ "ciHints": {
1104
+ "azure-devops": {
1105
+ "notes": "Run AI golden tests as part of the test stage.",
1106
+ "stage": "test"
1107
+ },
1108
+ "github-actions": {
1109
+ "job": "ci",
1110
+ "notes": "Include AI golden contract tests in CI test suite."
1111
+ }
1112
+ },
1113
+ "description": "Validate AI tool-generated patches, configs, and code against exact expected formats. Test that AI outputs respect forbidden paths, file patterns, and format constraints through golden contract tests.",
1114
+ "id": "ai-golden-tests",
1115
+ "label": "AI Golden Contract Tests",
1116
+ "stack": {
1117
+ "exampleConfigFiles": [
1118
+ "TestData/",
1119
+ "*.verified.json"
1120
+ ],
1121
+ "exampleTools": [
1122
+ "xUnit",
1123
+ "Verify"
1124
+ ],
1125
+ "notes": "Use Verify for golden file testing of AI outputs. Ensure AI-generated code respects namespace conventions and doesn't modify protected files.",
1126
+ "verification": "Run golden tests and confirm AI outputs match verified snapshots."
1127
+ }
1128
+ },
1129
+ {
1130
+ "ciHints": {
1131
+ "azure-devops": {
1132
+ "notes": "Run AI safety tests as part of security stage on main branch.",
1133
+ "stage": "security"
1134
+ },
1135
+ "github-actions": {
1136
+ "job": "security",
1137
+ "notes": "Run AI safety checks on main branch merges."
1138
+ }
1139
+ },
1140
+ "description": "Test AI integrations for prompt injection resistance, input sanitization, output filtering, and data exfiltration prevention. Include adversarial test cases that attempt to manipulate AI behavior.",
1141
+ "id": "ai-safety-checks",
1142
+ "label": "AI Adversarial & Safety Testing",
1143
+ "stack": {
1144
+ "exampleConfigFiles": [
1145
+ "Tests/AiSafety/"
1146
+ ],
1147
+ "exampleTools": [
1148
+ "xUnit",
1149
+ "custom security tests"
1150
+ ],
1151
+ "notes": "Test prompt injection resistance and output sanitization. Ensure AI outputs are escaped/validated before use in SQL queries, command execution, or HTML rendering.",
1152
+ "verification": "Run AI safety tests and confirm adversarial inputs are handled safely."
1153
+ }
1154
+ },
1155
+ {
1156
+ "ciHints": {
1157
+ "azure-devops": {
1158
+ "notes": "Verify AI provenance logging is implemented in quality checks.",
1159
+ "stage": "quality"
1160
+ },
1161
+ "github-actions": {
1162
+ "job": "ci",
1163
+ "notes": "Check AI provenance logging implementation in CI."
1164
+ }
1165
+ },
1166
+ "description": "Log AI provider, model version, prompt template version, parameters, and tool versions for all AI operations. Enable attribution of outputs to specific model+prompt combinations for debugging and compliance.",
1167
+ "id": "ai-provenance-tracking",
1168
+ "label": "AI Provenance & Audit Logging",
1169
+ "stack": {
1170
+ "exampleConfigFiles": [
1171
+ "AiProvenance.cs"
1172
+ ],
1173
+ "exampleTools": [
1174
+ "OpenTelemetry",
1175
+ "Serilog"
1176
+ ],
1177
+ "notes": "Use structured logging to capture AI call provenance. Include model version, prompt hash, and parameters in log context.",
1178
+ "verification": "Review AI integration and confirm provenance logging is implemented."
1179
+ }
1180
+ },
819
1181
  {
820
1182
  "ciHints": {
821
1183
  "azure-devops": {
@@ -897,27 +1259,41 @@
897
1259
  },
898
1260
  "migrationGuide": [
899
1261
  {
900
- "description": "Start by adding pre-commit hooks and core formatting/linting so developers get fast feedback without touching CI.",
1262
+ "description": "Configure .gitattributes for cross-platform line ending correctness and establish the canonical verify entrypoint before adding any checks. This prevents 'works locally, fails in CI' issues from day one.",
1263
+ "focusIds": [
1264
+ "gitattributes-eol",
1265
+ "canonical-verify",
1266
+ "hook-ci-parity",
1267
+ "config-authority"
1268
+ ],
1269
+ "notes": "Start here to avoid debugging cryptic CRLF failures later. Use .gitattributes as the authority for EOL (not .editorconfig). Run 'git add --renormalize .' after adding .gitattributes to fix existing files.",
1270
+ "step": 0,
1271
+ "title": "Foundation: Line Endings and Hook Entry Point"
1272
+ },
1273
+ {
1274
+ "description": "Add pre-commit hooks with secret scanning, formatting, and linting. Hooks should CHECK (not auto-fix) and scope to changed files only for speed.",
901
1275
  "focusIds": [
902
1276
  "pre-commit-hooks",
1277
+ "secret-scanning-precommit",
903
1278
  "linting",
904
1279
  "code-formatter"
905
1280
  ],
906
- "notes": "Keep hooks fast and focused on changed files to avoid slowing down day-to-day work.",
1281
+ "notes": "Keep hooks fast by scoping to staged files. Use Husky as entry point calling lint-staged or pre-commit. Hooks should check, not fix, to keep developers aware of issues.",
907
1282
  "step": 1,
908
1283
  "title": "Establish Local Safety Nets First"
909
1284
  },
910
1285
  {
911
- "description": "Introduce CI quality gates that mirror local checks, but treat existing violations as warnings wherever possible.",
1286
+ "description": "Introduce CI quality gates that mirror local hooks exactly. Add CRLF detection early in pipeline. Treat existing violations as warnings where possible.",
912
1287
  "focusIds": [
1288
+ "crlf-detection",
913
1289
  "ci-quality-gates",
914
1290
  "linting",
915
1291
  "code-formatter",
916
1292
  "commit-linting"
917
1293
  ],
918
- "notes": "Use diff-based tools or baselines so only new violations break builds; legacy issues remain visible but non-blocking.",
1294
+ "notes": "CI must call the same verify scripts that hooks use. Add CRLF detection before other checks to fail fast on line ending issues. Use diff-based tools so only new violations break builds.",
919
1295
  "step": 2,
920
- "title": "Mirror Local Checks in CI (Soft-Fail on Legacy)"
1296
+ "title": "Mirror Local Checks in CI with CRLF Detection"
921
1297
  },
922
1298
  {
923
1299
  "description": "Enable type-checking, coverage thresholds, and dependency/vulnerability scanning with gradual enforcement.",
@@ -942,9 +1318,22 @@
942
1318
  "complexity-analysis",
943
1319
  "accessibility-auditing"
944
1320
  ],
945
- "notes": "Tackle recommended items in order of business value; backend-only repos can skip web-focused checks like accessibility. For AI/ML-heavy Python teams, consider extending containerization with data versioning (DVC) and unit tests with data quality checks (e.g., Great Expectations) as part of this step.",
1321
+ "notes": "Tackle recommended items in order of business value; backend-only repos can skip web-focused checks like accessibility.",
946
1322
  "step": 4,
947
1323
  "title": "Layer in Docs, Governance, and Recommended Checks"
1324
+ },
1325
+ {
1326
+ "description": "For repos using or building with generative AI, add drift detection, schema enforcement, golden contract tests, safety testing, and provenance tracking.",
1327
+ "focusIds": [
1328
+ "ai-drift-detection",
1329
+ "ai-schema-enforcement",
1330
+ "ai-golden-tests",
1331
+ "ai-safety-checks",
1332
+ "ai-provenance-tracking"
1333
+ ],
1334
+ "notes": "Skip this step if your repo has no AI/ML components. For AI-heavy repos: add nightly drift detection to catch model changes, enforce strict schemas at AI output boundaries, and log provenance for debugging 'why did AI do X?'",
1335
+ "step": 5,
1336
+ "title": "AI/ML Governance (If Applicable)"
948
1337
  }
949
1338
  ],
950
1339
  "qualityGatePolicy": {