create-contextkit 0.3.2 → 0.3.4

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) 2026 Eric Kittelson
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,41 @@
1
+ # create-contextkit
2
+
3
+ Project scaffolder for [ContextKit](https://github.com/erickittelson/ContextKit) — AI-ready metadata governance over OSI.
4
+
5
+ ## Usage
6
+
7
+ ```bash
8
+ # Create a new ContextKit project
9
+ npx create-contextkit my-project
10
+ cd my-project
11
+
12
+ # Start working
13
+ context lint
14
+ context tier
15
+ context build
16
+ ```
17
+
18
+ ## What it creates
19
+
20
+ ```
21
+ my-project/
22
+ ├── context/
23
+ │ ├── models/ # OSI semantic models
24
+ │ ├── governance/ # Ownership, trust, security, semantic roles
25
+ │ ├── rules/ # Golden queries, business rules, guardrails
26
+ │ ├── lineage/ # Upstream/downstream lineage
27
+ │ ├── glossary/ # Business term definitions
28
+ │ └── owners/ # Team ownership records
29
+ ├── contextkit.config.yaml
30
+ └── package.json
31
+ ```
32
+
33
+ Includes example files to get started. Run `context setup` after scaffolding to connect a database and auto-generate metadata.
34
+
35
+ ## Part of ContextKit
36
+
37
+ See the [ContextKit repository](https://github.com/erickittelson/ContextKit) for full documentation.
38
+
39
+ ## License
40
+
41
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-contextkit",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "Scaffold a new ContextKit project",
5
5
  "license": "MIT",
6
6
  "author": "Eric Kittelson",
@@ -10,17 +10,27 @@
10
10
  "url": "https://github.com/erickittelson/ContextKit.git",
11
11
  "directory": "create-contextkit"
12
12
  },
13
- "keywords": ["contextkit", "scaffolder", "create", "init"],
13
+ "keywords": [
14
+ "contextkit",
15
+ "scaffolder",
16
+ "create",
17
+ "init"
18
+ ],
14
19
  "type": "module",
15
- "bin": { "create-contextkit": "./dist/index.js" },
16
- "files": ["dist", "templates"],
17
- "scripts": {
18
- "build": "tsup",
19
- "clean": "rm -rf dist"
20
+ "bin": {
21
+ "create-contextkit": "./dist/index.js"
20
22
  },
23
+ "files": [
24
+ "dist",
25
+ "templates"
26
+ ],
21
27
  "devDependencies": {
22
28
  "@types/node": "^25.3.3",
23
29
  "tsup": "^8.4.0",
24
30
  "typescript": "^5.7.0"
31
+ },
32
+ "scripts": {
33
+ "build": "tsup",
34
+ "clean": "rm -rf dist"
25
35
  }
26
- }
36
+ }
@@ -122,7 +122,93 @@ When you discover data quality issues (null values, broken joins, missing data),
122
122
 
123
123
  **Bronze (7):** descriptions, owner, security, grain, table_type
124
124
  **Silver (+6):** trust, 2+ tags, glossary linked, lineage, refresh, 2+ sample_values
125
- **Gold (+21):** semantic_role on ALL fields, metric aggregation/additive, 1+ guardrail, 3+ golden queries, 1+ business rule, 1+ hierarchy, 1+ default_filter, trust=endorsed, contactable owner, 1+ relationship, description >=50 chars, ai_context (no TODO), 1+ business_context, version, field descriptions not lazy, glossary definitions substantive, lineage references real sources, grain statements specific, ai_context filled in
125
+ **Gold (+24):** semantic_role on ALL fields, metric aggregation/additive, 1+ guardrail, 3+ golden queries, 1+ business rule, 1+ hierarchy, 1+ default_filter, trust=endorsed, contactable owner, 1+ relationship, description >=50 chars, ai_context (no TODO), 1+ business_context, version, field descriptions not lazy, glossary definitions substantive, lineage references real sources, grain statements specific, ai_context filled in, 3+ relationships (models with 3+ datasets), 1+ computed metric, 3+ glossary terms (models with 5+ datasets)
126
+
127
+ ## How to Reach Gold: Curation Recipes
128
+
129
+ ### Metrics (gold/metrics-defined)
130
+
131
+ Inspect computed views in the database. Any calculated column is a candidate metric.
132
+
133
+ ```sql
134
+ -- Find computed columns in views
135
+ SELECT column_name, data_type
136
+ FROM information_schema.columns
137
+ WHERE table_name LIKE 'vw_%' AND data_type IN ('DOUBLE', 'FLOAT', 'INTEGER', 'BIGINT', 'DECIMAL');
138
+ ```
139
+
140
+ For each computed column (e.g., `opportunity_score`, `shops_per_10k`, `demand_signal_pct`):
141
+ 1. Query it to understand what it measures
142
+ 2. Add it to the model's `metrics[]` array in the OSI YAML
143
+ 3. Include the SQL expression, aggregation type (SUM/AVG), and a human description
144
+ 4. Mark whether it's additive (can be summed across dimensions)
145
+
146
+ Example:
147
+ ```yaml
148
+ metrics:
149
+ - name: opportunity_score
150
+ expression:
151
+ dialects:
152
+ - dialect: DuckDB
153
+ expression: "(population/10000)*2 + (income/50000)*2 + (10-shops_per_10k)*3 + transit*1.5 + demand*0.5"
154
+ description: Composite score ranking census tracts for coffee shop viability
155
+ aggregation: AVG
156
+ additive: false
157
+ ```
158
+
159
+ ### Glossary Terms (gold/glossary-coverage)
160
+
161
+ For each key business concept your model measures, create a glossary term file.
162
+
163
+ Think about the terms a new analyst would need defined:
164
+ - What is "supply saturation"? (> 5.0 shops per 10k people)
165
+ - What is a "demand signal"? (review mentioning wait/line/crowded/busy)
166
+ - What is "opportunity score"? (composite ranking formula)
167
+
168
+ For each term, create `context/glossary/<term-name>.term.yaml`:
169
+ ```yaml
170
+ term: supply-saturation
171
+ definition: >
172
+ A measure of coffee shop density per census tract. Calculated as
173
+ shops per 10,000 residents. Tracts with > 5.0 are considered saturated.
174
+ owner: analytics-team
175
+ tags: [coffee-analytics]
176
+ ```
177
+
178
+ Models with 5+ datasets need at least 3 glossary terms linked by shared tags or owner.
179
+
180
+ ### Relationships (gold/relationships-coverage)
181
+
182
+ For each join in the SQL views, define a relationship in the OSI model.
183
+
184
+ ```sql
185
+ -- Find joins by examining view definitions
186
+ -- Look for patterns: ON table_a.col = table_b.col
187
+ -- Or spatial joins: ABS(a.lat - b.lat) < threshold
188
+ ```
189
+
190
+ For each join:
191
+ ```yaml
192
+ relationships:
193
+ - name: business-to-tract
194
+ left_dataset: yelp_business
195
+ right_dataset: census_tract
196
+ join_type: spatial
197
+ cardinality: many-to-one
198
+ description: Businesses assigned to nearest census tract within 0.02 degrees (~1 mile)
199
+ ```
200
+
201
+ Models with 3+ datasets need at least 3 relationships.
202
+
203
+ ### Golden Queries
204
+
205
+ Write 3-5 SQL queries answering common business questions. **Test each query first!**
206
+
207
+ ```sql
208
+ -- Run the query, verify it returns sensible results, then document:
209
+ SELECT geoid, tract_name, opportunity_score
210
+ FROM vw_candidate_zones ORDER BY opportunity_score DESC LIMIT 10;
211
+ ```
126
212
 
127
213
  ## YAML Formats
128
214