@oddessentials/repo-standards 1.0.1

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Repo Standards
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,202 @@
1
+ [![npm version](https://img.shields.io/npm/v/@oddessentials/repo-standards.svg)](https://www.npmjs.com/package/@oddessentials/repo-standards)
2
+ [![CI](https://github.com/oddessentials/repo-standards/actions/workflows/ci.yml/badge.svg)](https://github.com/oddessentials/repo-standards/actions/workflows/ci.yml)
3
+ [![license](https://img.shields.io/npm/l/@oddessentials/repo-standards.svg)](LICENSE)
4
+
5
+ # 🐝 Repository Standards & CI Checklist
6
+
7
+ **@oddessentials/repo-standards**
8
+
9
+ This package defines a **single, authoritative JSON specification** for repository quality standards across multiple stacks (TypeScript/JS, C#/.NET, Python), plus deterministic tooling to generate **stack- and CI-specific views**.
10
+
11
+ It is designed to be:
12
+
13
+ - **Machine-readable** (for autonomous agents and CI systems)
14
+ - **Human-navigable** (for onboarding and audits)
15
+ - **Migration-friendly** (soft-fail legacy, hard-fail new violations)
16
+
17
+ > Think of this as a _policy catalog_, not an enforcement engine.
18
+
19
+ ---
20
+
21
+ ## What’s Included
22
+
23
+ - **Master spec (source of truth)**
24
+ `config/standards.json`
25
+
26
+ - **Generated stack views (artifacts)**
27
+ `config/standards.<stack>[.<ciSystem>].json`
28
+
29
+ - **Generator scripts**
30
+ Deterministically derive filtered views from the master spec.
31
+
32
+ ---
33
+
34
+ ## Meta Rules (Global Policy)
35
+
36
+ The master spec includes a `meta` block that defines system-wide expectations:
37
+
38
+ ### Coverage
39
+
40
+ - `defaultCoverageThreshold = 0.8`
41
+ - Target ~80% coverage on **new or changed code**
42
+ - Prefer diff-based coverage where supported
43
+
44
+ ### Soft-Fail on Legacy
45
+
46
+ - `qualityGatePolicy.preferSoftFailOnLegacy = true`
47
+ - New checks should:
48
+ - Warn on **existing** violations
49
+ - Fail CI only for **new violations** introduced by the change
50
+
51
+ ### Complexity
52
+
53
+ - `complexityChecks.enabledByDefault = true`
54
+ - Complexity rules start as **warnings**
55
+ - Intended to tighten gradually as codebases mature
56
+
57
+ ### Migration Guide
58
+
59
+ `meta.migrationGuide` defines a stepwise adoption path:
60
+
61
+ 1. Local safety nets (formatting, linting, pre-commit)
62
+ 2. Mirror in CI with soft-fail legacy
63
+ 3. Add type safety, coverage, dependency security
64
+ 4. Add docs, governance, integration/perf/accessibility
65
+ _(plus ML-specific practices for Python data teams)_
66
+
67
+ ---
68
+
69
+ ## Structure of `config/standards.json`
70
+
71
+ - `version` — schema version
72
+ - `meta` — global rules and migration policy
73
+ - `ciSystems` — supported CI platforms
74
+ _(currently `github-actions`, `azure-devops`)_
75
+ - `stacks` — supported stacks:
76
+ - `typescript-js`
77
+ - `csharp-dotnet`
78
+ - `python`
79
+
80
+ - `checklist`
81
+ - `core` — must-have requirements
82
+ - `recommended` — high-value additions
83
+ - `optionalEnhancements` — advanced / nice-to-have
84
+
85
+ Each checklist item includes:
86
+
87
+ - `id`, `label`, `description`
88
+ - `appliesTo.stacks`, `appliesTo.ciSystems`
89
+ - `ciHints` — suggested pipeline stages
90
+ - `stackHints[stack]`
91
+ - example tools
92
+ - example config files
93
+ - notes and trade-offs (including ML variants for Python)
94
+
95
+ ---
96
+
97
+ ## Generating Stack-Specific JSON
98
+
99
+ The generator reads the master spec and produces filtered, deterministic outputs.
100
+
101
+ ### Commands
102
+
103
+ ```bash
104
+ # TypeScript / JavaScript
105
+ npm run generate:ci -- typescript-js
106
+
107
+ # Python
108
+ npm run generate:ci -- python
109
+
110
+ # C# / .NET
111
+ npm run generate:ci -- csharp-dotnet
112
+
113
+ # Python + Azure DevOps
114
+ npm run generate:ci -- python azure-devops
115
+
116
+ # TypeScript + GitHub Actions
117
+ npm run generate:ci -- typescript-js github-actions
118
+ ```
119
+
120
+ ### Outputs
121
+
122
+ All CI systems:
123
+
124
+ ```text
125
+ config/standards.typescript-js.json
126
+ config/standards.csharp-dotnet.json
127
+ config/standards.python.json
128
+ ```
129
+
130
+ Filtered by CI system (example):
131
+
132
+ ```text
133
+ config/standards.python.azure-devops.json
134
+ config/standards.typescript-js.github-actions.json
135
+ ```
136
+
137
+ > These generated files are **artifacts**.
138
+ > Do not edit them manually — always modify `config/standards.json`.
139
+
140
+ ---
141
+
142
+ ## Consuming This Package (npm)
143
+
144
+ Install:
145
+
146
+ ```bash
147
+ npm install @oddessentials/repo-standards
148
+ ```
149
+
150
+ Typical usage:
151
+
152
+ - Load the **master spec** for tooling or audits
153
+ - Load a **stack-specific view** as:
154
+ - a CI contract
155
+ - an onboarding checklist
156
+ - input to autonomous agents (e.g. Odd Hive Mind)
157
+
158
+ This package is intentionally **read-only** and **side-effect free**.
159
+
160
+ ---
161
+
162
+ ## How to Apply to a Repository
163
+
164
+ 1. Identify the stack (`typescript-js`, `csharp-dotnet`, `python`)
165
+ 2. Generate the filtered checklist
166
+ 3. Use it as:
167
+ - a baseline for CI
168
+ - a migration checklist for legacy repos
169
+ - a governance artifact for reviews
170
+
171
+ For existing repositories, follow `meta.migrationGuide` to adopt standards incrementally without breaking teams.
172
+
173
+ ---
174
+
175
+ ## Instruction Generation
176
+
177
+ Human-readable “agent instructions” can also be generated:
178
+
179
+ ```bash
180
+ # Default (TypeScript + GitHub Actions)
181
+ npm run generate:instructions
182
+
183
+ # Python
184
+ npm run generate:instructions -- standards.python.json
185
+
186
+ # C# / .NET + Azure DevOps
187
+ npm run generate:instructions -- standards.csharp-dotnet.azure-devops.json
188
+ ```
189
+
190
+ ---
191
+
192
+ ## Philosophy
193
+
194
+ 🐝 **Small rules. Shared language. Predictable outcomes.**
195
+
196
+ This repo deliberately separates:
197
+
198
+ - **Policy definition** (what good looks like)
199
+ - **Enforcement** (handled elsewhere)
200
+ - **Execution** (CI, agents, humans)
201
+
202
+ That separation is what makes it composable, automatable, and safe.