forgecraft-mcp 1.2.0 → 1.3.2

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.
Files changed (136) hide show
  1. package/README.md +525 -525
  2. package/dist/cli/help.js +44 -44
  3. package/dist/registry/renderer-skeletons.js +92 -92
  4. package/dist/shared/gs-score-logger.js +6 -6
  5. package/dist/tools/add-module.js +123 -123
  6. package/dist/tools/advice-registry.js +18 -18
  7. package/dist/tools/check-cascade-report.js +64 -64
  8. package/dist/tools/configure-mcp.d.ts +3 -0
  9. package/dist/tools/configure-mcp.d.ts.map +1 -1
  10. package/dist/tools/configure-mcp.js +10 -0
  11. package/dist/tools/configure-mcp.js.map +1 -1
  12. package/dist/tools/forgecraft-dispatch.d.ts.map +1 -1
  13. package/dist/tools/forgecraft-dispatch.js +3 -0
  14. package/dist/tools/forgecraft-dispatch.js.map +1 -1
  15. package/dist/tools/forgecraft-schema-params.d.ts +9 -0
  16. package/dist/tools/forgecraft-schema-params.d.ts.map +1 -1
  17. package/dist/tools/forgecraft-schema-params.js +21 -0
  18. package/dist/tools/forgecraft-schema-params.js.map +1 -1
  19. package/dist/tools/forgecraft-schema.d.ts +9 -0
  20. package/dist/tools/forgecraft-schema.d.ts.map +1 -1
  21. package/dist/tools/refresh-output.js +14 -14
  22. package/dist/tools/scaffold-spec-stubs.js +115 -115
  23. package/dist/tools/scaffold-templates.js +62 -62
  24. package/dist/tools/setup-artifact-writers.d.ts +30 -0
  25. package/dist/tools/setup-artifact-writers.d.ts.map +1 -1
  26. package/dist/tools/setup-artifact-writers.js +120 -8
  27. package/dist/tools/setup-artifact-writers.js.map +1 -1
  28. package/dist/tools/setup-phase1.d.ts +3 -0
  29. package/dist/tools/setup-phase1.d.ts.map +1 -1
  30. package/dist/tools/setup-phase1.js +79 -35
  31. package/dist/tools/setup-phase1.js.map +1 -1
  32. package/dist/tools/setup-phase2.d.ts +2 -0
  33. package/dist/tools/setup-phase2.d.ts.map +1 -1
  34. package/dist/tools/setup-phase2.js +10 -1
  35. package/dist/tools/setup-phase2.js.map +1 -1
  36. package/dist/tools/setup-project.d.ts +18 -0
  37. package/dist/tools/setup-project.d.ts.map +1 -1
  38. package/dist/tools/setup-project.js +77 -1
  39. package/dist/tools/setup-project.js.map +1 -1
  40. package/dist/tools/spec-parser-tags.d.ts +9 -0
  41. package/dist/tools/spec-parser-tags.d.ts.map +1 -1
  42. package/dist/tools/spec-parser-tags.js +92 -0
  43. package/dist/tools/spec-parser-tags.js.map +1 -1
  44. package/package.json +89 -86
  45. package/templates/analytics/instructions.yaml +37 -37
  46. package/templates/analytics/mcp-servers.yaml +11 -11
  47. package/templates/analytics/structure.yaml +25 -25
  48. package/templates/api/instructions.yaml +231 -231
  49. package/templates/api/mcp-servers.yaml +22 -13
  50. package/templates/api/nfr.yaml +23 -23
  51. package/templates/api/review.yaml +103 -103
  52. package/templates/api/structure.yaml +34 -34
  53. package/templates/api/verification.yaml +132 -132
  54. package/templates/cli/instructions.yaml +31 -31
  55. package/templates/cli/mcp-servers.yaml +11 -11
  56. package/templates/cli/review.yaml +53 -53
  57. package/templates/cli/structure.yaml +16 -16
  58. package/templates/data-lineage/instructions.yaml +28 -28
  59. package/templates/data-lineage/mcp-servers.yaml +22 -22
  60. package/templates/data-pipeline/instructions.yaml +84 -84
  61. package/templates/data-pipeline/mcp-servers.yaml +13 -13
  62. package/templates/data-pipeline/nfr.yaml +39 -39
  63. package/templates/data-pipeline/structure.yaml +23 -23
  64. package/templates/fintech/hooks.yaml +55 -55
  65. package/templates/fintech/instructions.yaml +112 -112
  66. package/templates/fintech/mcp-servers.yaml +13 -13
  67. package/templates/fintech/nfr.yaml +46 -46
  68. package/templates/fintech/playbook.yaml +210 -210
  69. package/templates/fintech/verification.yaml +239 -239
  70. package/templates/game/instructions.yaml +289 -289
  71. package/templates/game/mcp-servers.yaml +38 -38
  72. package/templates/game/nfr.yaml +64 -64
  73. package/templates/game/playbook.yaml +214 -214
  74. package/templates/game/review.yaml +97 -97
  75. package/templates/game/structure.yaml +67 -67
  76. package/templates/game/verification.yaml +174 -174
  77. package/templates/healthcare/instructions.yaml +42 -42
  78. package/templates/healthcare/mcp-servers.yaml +13 -13
  79. package/templates/healthcare/nfr.yaml +47 -47
  80. package/templates/hipaa/instructions.yaml +41 -41
  81. package/templates/hipaa/mcp-servers.yaml +13 -13
  82. package/templates/infra/instructions.yaml +104 -104
  83. package/templates/infra/mcp-servers.yaml +20 -20
  84. package/templates/infra/nfr.yaml +46 -46
  85. package/templates/infra/review.yaml +65 -65
  86. package/templates/infra/structure.yaml +25 -25
  87. package/templates/library/instructions.yaml +36 -36
  88. package/templates/library/mcp-servers.yaml +20 -20
  89. package/templates/library/review.yaml +56 -56
  90. package/templates/library/structure.yaml +19 -19
  91. package/templates/medallion-architecture/instructions.yaml +41 -41
  92. package/templates/medallion-architecture/mcp-servers.yaml +22 -22
  93. package/templates/ml/instructions.yaml +85 -85
  94. package/templates/ml/mcp-servers.yaml +11 -11
  95. package/templates/ml/nfr.yaml +39 -39
  96. package/templates/ml/structure.yaml +25 -25
  97. package/templates/ml/verification.yaml +156 -156
  98. package/templates/mobile/instructions.yaml +44 -44
  99. package/templates/mobile/mcp-servers.yaml +11 -11
  100. package/templates/mobile/nfr.yaml +49 -49
  101. package/templates/mobile/structure.yaml +27 -27
  102. package/templates/mobile/verification.yaml +121 -121
  103. package/templates/observability-xray/instructions.yaml +40 -40
  104. package/templates/observability-xray/mcp-servers.yaml +15 -15
  105. package/templates/realtime/instructions.yaml +42 -42
  106. package/templates/realtime/mcp-servers.yaml +13 -13
  107. package/templates/soc2/instructions.yaml +41 -41
  108. package/templates/soc2/mcp-servers.yaml +24 -24
  109. package/templates/social/instructions.yaml +43 -43
  110. package/templates/social/mcp-servers.yaml +24 -24
  111. package/templates/state-machine/instructions.yaml +42 -42
  112. package/templates/state-machine/mcp-servers.yaml +11 -11
  113. package/templates/tools-registry.yaml +164 -164
  114. package/templates/universal/hooks.yaml +531 -531
  115. package/templates/universal/instructions.yaml +1692 -1692
  116. package/templates/universal/mcp-servers.yaml +50 -50
  117. package/templates/universal/nfr.yaml +197 -197
  118. package/templates/universal/reference.yaml +326 -326
  119. package/templates/universal/review.yaml +204 -204
  120. package/templates/universal/skills.yaml +262 -262
  121. package/templates/universal/structure.yaml +67 -67
  122. package/templates/universal/verification.yaml +416 -416
  123. package/templates/web-react/hooks.yaml +44 -44
  124. package/templates/web-react/instructions.yaml +207 -207
  125. package/templates/web-react/mcp-servers.yaml +20 -20
  126. package/templates/web-react/nfr.yaml +27 -27
  127. package/templates/web-react/review.yaml +94 -94
  128. package/templates/web-react/structure.yaml +46 -46
  129. package/templates/web-react/verification.yaml +126 -126
  130. package/templates/web-static/instructions.yaml +115 -115
  131. package/templates/web-static/mcp-servers.yaml +20 -20
  132. package/templates/web3/instructions.yaml +44 -44
  133. package/templates/web3/mcp-servers.yaml +11 -11
  134. package/templates/web3/verification.yaml +159 -159
  135. package/templates/zero-trust/instructions.yaml +41 -41
  136. package/templates/zero-trust/mcp-servers.yaml +15 -15
@@ -1,25 +1,25 @@
1
- tag: INFRA
2
- section: structure
3
- entries:
4
- - path: terraform/
5
- description: "Terraform root — one directory per stack/environment"
6
- - path: terraform/modules/
7
- description: "Reusable Terraform modules (VPC, ECS, RDS, etc.)"
8
- - path: terraform/environments/
9
- description: "Per-environment tfvars: dev.tfvars, staging.tfvars, prod.tfvars"
10
- - path: cdk/
11
- description: "CDK app (if using CDK instead of Terraform)"
12
- - path: cdk/lib/
13
- description: "CDK stack definitions — one file per stack"
14
- - path: cdk/bin/
15
- description: "CDK app entry point"
16
- - path: docker/
17
- description: "Dockerfiles and docker-compose for local development"
18
- - path: docker/docker-compose.yml
19
- description: "Local development stack: app + backing services"
20
- - path: scripts/
21
- description: "Operational scripts: deploy, migrate, seed, rotate-secrets"
22
- - path: .github/workflows/
23
- description: "CI/CD pipeline definitions (GitHub Actions)"
24
- - path: docs/runbooks/
25
- description: "Operational runbooks: incident response, failover, scaling"
1
+ tag: INFRA
2
+ section: structure
3
+ entries:
4
+ - path: terraform/
5
+ description: "Terraform root — one directory per stack/environment"
6
+ - path: terraform/modules/
7
+ description: "Reusable Terraform modules (VPC, ECS, RDS, etc.)"
8
+ - path: terraform/environments/
9
+ description: "Per-environment tfvars: dev.tfvars, staging.tfvars, prod.tfvars"
10
+ - path: cdk/
11
+ description: "CDK app (if using CDK instead of Terraform)"
12
+ - path: cdk/lib/
13
+ description: "CDK stack definitions — one file per stack"
14
+ - path: cdk/bin/
15
+ description: "CDK app entry point"
16
+ - path: docker/
17
+ description: "Dockerfiles and docker-compose for local development"
18
+ - path: docker/docker-compose.yml
19
+ description: "Local development stack: app + backing services"
20
+ - path: scripts/
21
+ description: "Operational scripts: deploy, migrate, seed, rotate-secrets"
22
+ - path: .github/workflows/
23
+ description: "CI/CD pipeline definitions (GitHub Actions)"
24
+ - path: docs/runbooks/
25
+ description: "Operational runbooks: incident response, failover, scaling"
@@ -1,36 +1,36 @@
1
- tag: LIBRARY
2
- section: instructions
3
- blocks:
4
- - id: library-standards
5
- tier: recommended
6
- title: "Library Standards"
7
- content: |
8
- ## Library / Package Standards
9
-
10
- ### Public API
11
- - Clear, minimal public API surface. Export only what consumers need.
12
- - Barrel file (index.ts / __init__.py) defines the public API explicitly.
13
- - Internal modules prefixed with underscore or in internal/ directory.
14
- - Every public API has JSDoc/docstring with examples.
15
-
16
- ### Versioning & Compatibility
17
- - Semantic versioning: MAJOR.MINOR.PATCH.
18
- - MAJOR: breaking API changes. MINOR: new features, backward compatible. PATCH: bug fixes.
19
- - CHANGELOG.md maintained with every release.
20
- - Deprecation warnings before removal (minimum 1 minor version).
21
-
22
- ### Distribution
23
- - Package includes only dist/ and necessary runtime files.
24
- - Types included (declaration files for TypeScript).
25
- - Peer dependencies used for framework integrations.
26
- - Minimize runtime dependencies — every dep is a risk.
27
-
28
- ### Testing
29
- - Test against the public API, not internals.
30
- - Test with multiple versions of peer dependencies.
31
- - Integration tests simulate real consumer usage patterns.
32
-
33
- ### Documentation
34
- - README with: install, quick start, API reference, examples.
35
- - Usage examples for every major feature.
36
- - Migration guide for every major version bump.
1
+ tag: LIBRARY
2
+ section: instructions
3
+ blocks:
4
+ - id: library-standards
5
+ tier: recommended
6
+ title: "Library Standards"
7
+ content: |
8
+ ## Library / Package Standards
9
+
10
+ ### Public API
11
+ - Clear, minimal public API surface. Export only what consumers need.
12
+ - Barrel file (index.ts / __init__.py) defines the public API explicitly.
13
+ - Internal modules prefixed with underscore or in internal/ directory.
14
+ - Every public API has JSDoc/docstring with examples.
15
+
16
+ ### Versioning & Compatibility
17
+ - Semantic versioning: MAJOR.MINOR.PATCH.
18
+ - MAJOR: breaking API changes. MINOR: new features, backward compatible. PATCH: bug fixes.
19
+ - CHANGELOG.md maintained with every release.
20
+ - Deprecation warnings before removal (minimum 1 minor version).
21
+
22
+ ### Distribution
23
+ - Package includes only dist/ and necessary runtime files.
24
+ - Types included (declaration files for TypeScript).
25
+ - Peer dependencies used for framework integrations.
26
+ - Minimize runtime dependencies — every dep is a risk.
27
+
28
+ ### Testing
29
+ - Test against the public API, not internals.
30
+ - Test with multiple versions of peer dependencies.
31
+ - Integration tests simulate real consumer usage patterns.
32
+
33
+ ### Documentation
34
+ - README with: install, quick start, API reference, examples.
35
+ - Usage examples for every major feature.
36
+ - Migration guide for every major version bump.
@@ -1,20 +1,20 @@
1
- tag: LIBRARY
2
- section: mcp-servers
3
- servers:
4
- - name: filesystem
5
- description: "Secure file operations — read, write, search, and directory management with configurable access controls"
6
- command: npx
7
- args: ["-y", "@modelcontextprotocol/server-filesystem", "/"]
8
- tags: [CLI, LIBRARY]
9
- category: general
10
- tier: recommended
11
- url: "https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem"
12
-
13
- - name: npm-search
14
- description: "Search npm registry for packages, check versions, and inspect dependencies"
15
- command: npx
16
- args: ["-y", "mcp-server-npm-search"]
17
- tags: [LIBRARY]
18
- category: documentation
19
- tier: optional
20
- url: "https://github.com/nicholasgriffintn/npm-search-mcp-server"
1
+ tag: LIBRARY
2
+ section: mcp-servers
3
+ servers:
4
+ - name: filesystem
5
+ description: "Secure file operations — read, write, search, and directory management with configurable access controls"
6
+ command: npx
7
+ args: ["-y", "@modelcontextprotocol/server-filesystem", "/"]
8
+ tags: [CLI, LIBRARY]
9
+ category: general
10
+ tier: recommended
11
+ url: "https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem"
12
+
13
+ - name: npm-search
14
+ description: "Search npm registry for packages, check versions, and inspect dependencies"
15
+ command: npx
16
+ args: ["-y", "mcp-server-npm-search"]
17
+ tags: [LIBRARY]
18
+ category: documentation
19
+ tier: optional
20
+ url: "https://github.com/nicholasgriffintn/npm-search-mcp-server"
@@ -1,56 +1,56 @@
1
- tag: LIBRARY
2
- section: review
3
- blocks:
4
- - id: library-architecture-review
5
- tier: recommended
6
- dimension: architecture
7
- title: "Library Architecture Review"
8
- description: |
9
- Evaluate public API surface, backward compatibility, and consumer ergonomics.
10
- checklist:
11
- - id: public-api-surface
12
- description: "Public API is minimal and intentional. Every export has a reason. Internal modules are not leaked."
13
- severity: critical
14
- - id: backward-compatibility
15
- description: "Semantic versioning enforced. Breaking changes gated behind major version bumps."
16
- severity: critical
17
- - id: tree-shaking
18
- description: "Package supports tree-shaking: named exports, sideEffects: false, ESM output."
19
- severity: important
20
- - id: type-exports
21
- description: "TypeScript types exported and documented. Declaration files (.d.ts) ship with the package."
22
- severity: important
23
-
24
- - id: library-code-quality-review
25
- tier: recommended
26
- dimension: code-quality
27
- title: "Library Code Quality Review"
28
- description: |
29
- Evaluate API consistency, documentation, and error messages for consumers.
30
- checklist:
31
- - id: api-consistency
32
- description: "Consistent naming conventions and parameter ordering across all public methods."
33
- severity: important
34
- - id: jsdoc-coverage
35
- description: "100% JSDoc coverage on all public APIs with typed params, returns, and examples."
36
- severity: critical
37
- - id: error-messages
38
- description: "Error messages are actionable for consumers: what went wrong, what they should do."
39
- severity: important
40
-
41
- - id: library-test-review
42
- tier: recommended
43
- dimension: tests
44
- title: "Library Test Review"
45
- description: |
46
- Evaluate public API contract tests and cross-environment compatibility.
47
- checklist:
48
- - id: contract-tests
49
- description: "Every public API method has contract tests verifying inputs, outputs, and error cases."
50
- severity: critical
51
- - id: cross-env-testing
52
- description: "Tests run in target environments (Node versions, browser if applicable)."
53
- severity: important
54
- - id: example-tests
55
- description: "README examples are executable tests that stay in sync with the API."
56
- severity: nice-to-have
1
+ tag: LIBRARY
2
+ section: review
3
+ blocks:
4
+ - id: library-architecture-review
5
+ tier: recommended
6
+ dimension: architecture
7
+ title: "Library Architecture Review"
8
+ description: |
9
+ Evaluate public API surface, backward compatibility, and consumer ergonomics.
10
+ checklist:
11
+ - id: public-api-surface
12
+ description: "Public API is minimal and intentional. Every export has a reason. Internal modules are not leaked."
13
+ severity: critical
14
+ - id: backward-compatibility
15
+ description: "Semantic versioning enforced. Breaking changes gated behind major version bumps."
16
+ severity: critical
17
+ - id: tree-shaking
18
+ description: "Package supports tree-shaking: named exports, sideEffects: false, ESM output."
19
+ severity: important
20
+ - id: type-exports
21
+ description: "TypeScript types exported and documented. Declaration files (.d.ts) ship with the package."
22
+ severity: important
23
+
24
+ - id: library-code-quality-review
25
+ tier: recommended
26
+ dimension: code-quality
27
+ title: "Library Code Quality Review"
28
+ description: |
29
+ Evaluate API consistency, documentation, and error messages for consumers.
30
+ checklist:
31
+ - id: api-consistency
32
+ description: "Consistent naming conventions and parameter ordering across all public methods."
33
+ severity: important
34
+ - id: jsdoc-coverage
35
+ description: "100% JSDoc coverage on all public APIs with typed params, returns, and examples."
36
+ severity: critical
37
+ - id: error-messages
38
+ description: "Error messages are actionable for consumers: what went wrong, what they should do."
39
+ severity: important
40
+
41
+ - id: library-test-review
42
+ tier: recommended
43
+ dimension: tests
44
+ title: "Library Test Review"
45
+ description: |
46
+ Evaluate public API contract tests and cross-environment compatibility.
47
+ checklist:
48
+ - id: contract-tests
49
+ description: "Every public API method has contract tests verifying inputs, outputs, and error cases."
50
+ severity: critical
51
+ - id: cross-env-testing
52
+ description: "Tests run in target environments (Node versions, browser if applicable)."
53
+ severity: important
54
+ - id: example-tests
55
+ description: "README examples are executable tests that stay in sync with the API."
56
+ severity: nice-to-have
@@ -1,19 +1,19 @@
1
- tag: LIBRARY
2
- section: structure
3
- language: typescript
4
- entries:
5
- - path: src/index.ts
6
- type: file
7
- description: "Public API barrel — exports only what consumers need"
8
- - path: src/shared
9
- type: directory
10
- description: "Shared internal utilities"
11
- - path: dist
12
- type: directory
13
- description: "Compiled output (not committed)"
14
- - path: README.md
15
- type: file
16
- description: "Install, quick start, API reference"
17
- - path: CHANGELOG.md
18
- type: file
19
- description: "Release history"
1
+ tag: LIBRARY
2
+ section: structure
3
+ language: typescript
4
+ entries:
5
+ - path: src/index.ts
6
+ type: file
7
+ description: "Public API barrel — exports only what consumers need"
8
+ - path: src/shared
9
+ type: directory
10
+ description: "Shared internal utilities"
11
+ - path: dist
12
+ type: directory
13
+ description: "Compiled output (not committed)"
14
+ - path: README.md
15
+ type: file
16
+ description: "Install, quick start, API reference"
17
+ - path: CHANGELOG.md
18
+ type: file
19
+ description: "Release history"
@@ -1,41 +1,41 @@
1
- tag: MEDALLION-ARCHITECTURE
2
- section: instructions
3
- blocks:
4
- - id: bronze-layer
5
- tier: recommended
6
- title: "Bronze Layer — Immutable Raw Ingestion"
7
- content: |
8
- ## Bronze Layer — Immutable Raw Ingestion
9
-
10
- - Bronze is the landing zone. Data arrives exactly as received from source systems — no transformations, no filtering, no deduplication.
11
- - Store Bronze data in append-only, immutable formats (Parquet, Delta Lake, Iceberg). Never overwrite or delete Bronze records.
12
- - Include ingestion metadata on every record: source_system, ingested_at, batch_id, file_origin, raw_checksum.
13
- - Partition Bronze tables by ingestion date for efficient reprocessing. Never partition by business keys at this layer.
14
- - Implement schema-on-read: Bronze accepts any schema from source. Schema validation happens at the Silver promotion step.
15
- - Retain Bronze data indefinitely (or per legal retention policy). Bronze is the recovery point for all downstream reprocessing.
16
-
17
- - id: silver-layer
18
- tier: recommended
19
- title: "Silver Layer — Validated & Conformed"
20
- content: |
21
- ## Silver Layer — Validated & Conformed
22
-
23
- - Silver applies data quality rules: type validation, null checks, range constraints, referential integrity, deduplication.
24
- - Every record in Silver must pass defined quality gates. Records failing validation are routed to a quarantine table, not dropped.
25
- - Conform naming conventions: standardize column names, date formats, currency codes, and enum values across all Silver tables.
26
- - Track record lineage: every Silver record links back to its Bronze source via source_record_id and bronze_batch_id.
27
- - Apply slowly changing dimension (SCD) Type 2 for reference data: maintain history with effective_from and effective_to timestamps.
28
- - Silver tables define explicit schemas enforced on write. Schema changes require a migration plan and backward compatibility check.
29
-
30
- - id: gold-layer
31
- tier: recommended
32
- title: "Gold Layer — Aggregated & Business-Ready"
33
- content: |
34
- ## Gold Layer — Aggregated & Business-Ready
35
-
36
- - Gold tables are purpose-built for specific business use cases: dashboards, ML features, API responses, reports.
37
- - Apply business logic at the Gold layer: aggregations, joins, calculated fields, business rules, KPI definitions.
38
- - Optimize Gold tables for read performance: pre-aggregate, denormalize, partition by access patterns.
39
- - Document every Gold table with its business purpose, refresh cadence, source Silver tables, and SLA.
40
- - Version Gold table definitions: changes to aggregation logic or business rules are tracked, reviewed, and deployed like code.
41
- - Implement data contracts for Gold consumers: define expected schema, update frequency, and quality guarantees.
1
+ tag: MEDALLION-ARCHITECTURE
2
+ section: instructions
3
+ blocks:
4
+ - id: bronze-layer
5
+ tier: recommended
6
+ title: "Bronze Layer — Immutable Raw Ingestion"
7
+ content: |
8
+ ## Bronze Layer — Immutable Raw Ingestion
9
+
10
+ - Bronze is the landing zone. Data arrives exactly as received from source systems — no transformations, no filtering, no deduplication.
11
+ - Store Bronze data in append-only, immutable formats (Parquet, Delta Lake, Iceberg). Never overwrite or delete Bronze records.
12
+ - Include ingestion metadata on every record: source_system, ingested_at, batch_id, file_origin, raw_checksum.
13
+ - Partition Bronze tables by ingestion date for efficient reprocessing. Never partition by business keys at this layer.
14
+ - Implement schema-on-read: Bronze accepts any schema from source. Schema validation happens at the Silver promotion step.
15
+ - Retain Bronze data indefinitely (or per legal retention policy). Bronze is the recovery point for all downstream reprocessing.
16
+
17
+ - id: silver-layer
18
+ tier: recommended
19
+ title: "Silver Layer — Validated & Conformed"
20
+ content: |
21
+ ## Silver Layer — Validated & Conformed
22
+
23
+ - Silver applies data quality rules: type validation, null checks, range constraints, referential integrity, deduplication.
24
+ - Every record in Silver must pass defined quality gates. Records failing validation are routed to a quarantine table, not dropped.
25
+ - Conform naming conventions: standardize column names, date formats, currency codes, and enum values across all Silver tables.
26
+ - Track record lineage: every Silver record links back to its Bronze source via source_record_id and bronze_batch_id.
27
+ - Apply slowly changing dimension (SCD) Type 2 for reference data: maintain history with effective_from and effective_to timestamps.
28
+ - Silver tables define explicit schemas enforced on write. Schema changes require a migration plan and backward compatibility check.
29
+
30
+ - id: gold-layer
31
+ tier: recommended
32
+ title: "Gold Layer — Aggregated & Business-Ready"
33
+ content: |
34
+ ## Gold Layer — Aggregated & Business-Ready
35
+
36
+ - Gold tables are purpose-built for specific business use cases: dashboards, ML features, API responses, reports.
37
+ - Apply business logic at the Gold layer: aggregations, joins, calculated fields, business rules, KPI definitions.
38
+ - Optimize Gold tables for read performance: pre-aggregate, denormalize, partition by access patterns.
39
+ - Document every Gold table with its business purpose, refresh cadence, source Silver tables, and SLA.
40
+ - Version Gold table definitions: changes to aggregation logic or business rules are tracked, reviewed, and deployed like code.
41
+ - Implement data contracts for Gold consumers: define expected schema, update frequency, and quality guarantees.
@@ -1,22 +1,22 @@
1
- tag: MEDALLION-ARCHITECTURE
2
- section: mcp-servers
3
- servers:
4
- - name: postgres
5
- description: "PostgreSQL for medallion layer metadata, quality gate results, and lineage tracking"
6
- command: npx
7
- args: ["-y", "@modelcontextprotocol/server-postgres"]
8
- tags: [MEDALLION-ARCHITECTURE, DATA-PIPELINE]
9
- category: database
10
- tier: recommended
11
- env:
12
- POSTGRES_CONNECTION_STRING: ""
13
- url: "https://github.com/modelcontextprotocol/servers/tree/main/src/postgres"
14
-
15
- - name: filesystem
16
- description: "Filesystem access for Bronze/Silver/Gold layer data files and pipeline configs"
17
- command: npx
18
- args: ["-y", "@modelcontextprotocol/server-filesystem"]
19
- tags: [MEDALLION-ARCHITECTURE, DATA-PIPELINE]
20
- category: filesystem
21
- tier: optional
22
- url: "https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem"
1
+ tag: MEDALLION-ARCHITECTURE
2
+ section: mcp-servers
3
+ servers:
4
+ - name: postgres
5
+ description: "PostgreSQL for medallion layer metadata, quality gate results, and lineage tracking"
6
+ command: npx
7
+ args: ["-y", "@modelcontextprotocol/server-postgres"]
8
+ tags: [MEDALLION-ARCHITECTURE, DATA-PIPELINE]
9
+ category: database
10
+ tier: recommended
11
+ env:
12
+ POSTGRES_CONNECTION_STRING: ""
13
+ url: "https://github.com/modelcontextprotocol/servers/tree/main/src/postgres"
14
+
15
+ - name: filesystem
16
+ description: "Filesystem access for Bronze/Silver/Gold layer data files and pipeline configs"
17
+ command: npx
18
+ args: ["-y", "@modelcontextprotocol/server-filesystem"]
19
+ tags: [MEDALLION-ARCHITECTURE, DATA-PIPELINE]
20
+ category: filesystem
21
+ tier: optional
22
+ url: "https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem"
@@ -1,85 +1,85 @@
1
- tag: ML
2
- section: instructions
3
- blocks:
4
- - id: training-pipelines
5
- tier: recommended
6
- title: "Model Training & Experiment Tracking"
7
- content: |
8
- ## Model Training & Experiment Tracking
9
-
10
- - Track every experiment with a tool like MLflow, Weights & Biases, or DVC. Log hyperparameters, metrics, dataset versions, and the git commit hash for full reproducibility.
11
- - Pin all dependencies (Python version, library versions, CUDA version) in a lockfile or Docker image. A training run from six months ago must be reproducible today.
12
- - Separate data preprocessing, feature engineering, model training, and evaluation into distinct pipeline stages with clear interfaces.
13
- - Use configuration files (YAML/TOML) for hyperparameters rather than hard-coding them. Support overrides via CLI arguments for sweep runs.
14
- - Always hold out a test set that is never used during training or hyperparameter tuning. Report final metrics exclusively on this set.
15
- - Version datasets alongside code. Use content-addressable storage or DVC to track dataset lineage and detect drift between training runs.
16
- - Set random seeds for all sources of non-determinism (NumPy, PyTorch, TensorFlow, data shuffling) to ensure reproducible results on the same hardware.
17
-
18
- - id: feature-engineering
19
- tier: recommended
20
- title: "Feature Engineering & Data Preparation"
21
- content: |
22
- ## Feature Engineering & Data Preparation
23
-
24
- - Build a centralized feature store (or at minimum a shared feature module) to avoid duplicating feature logic across training and serving.
25
- - Document every feature: its definition, data source, expected range, update frequency, and any known caveats or biases.
26
- - Compute feature statistics (mean, std, min, max, null rate) on the training set and persist them. Apply the same transformations at inference time using these saved statistics—never recompute from inference data.
27
- - Handle missing values explicitly. Choose an imputation strategy per feature (mean, median, mode, sentinel value, or model-based) and document the rationale.
28
- - Detect and handle data leakage: ensure no future information leaks into features, and that train/validation/test splits respect temporal or entity boundaries.
29
- - Monitor feature distributions in production. Alert when serving-time distributions diverge significantly from training-time distributions (data/concept drift).
30
-
31
- - id: model-deployment
32
- tier: recommended
33
- title: "Model Versioning & Deployment"
34
- content: |
35
- ## Model Versioning & Serving
36
-
37
- - Store trained model artifacts in a model registry with semantic versioning. Tag each artifact with the training run ID, dataset version, and evaluation metrics.
38
- - Serve models behind a versioned API endpoint. Support A/B testing and canary rollouts by routing a percentage of traffic to a new model version.
39
- - Define minimum performance thresholds (accuracy, latency p99, throughput) as promotion gates. A model must pass automated evaluation before being promoted to production.
40
- - Implement shadow mode: run a new model in parallel with the current production model, compare outputs, and alert on significant divergence before cutting over.
41
- - Log all predictions with input features, model version, and timestamp. This enables debugging, bias auditing, and retraining on production data.
42
- - Set up automated retraining triggers based on performance degradation, data drift detection, or a fixed schedule. Ensure the retraining pipeline is fully automated end-to-end.
43
-
44
- - id: ml-testing
45
- tier: recommended
46
- title: "ML-Specific Testing Requirements"
47
- content: |
48
- ## ML-Specific Testing Requirements
49
-
50
- ### Data Distribution Tests
51
- Assert dataset integrity before any model trains on it:
52
- - Train/val/test split ratios are within configured tolerances.
53
- - Class balance in classification tasks is within acceptable imbalance threshold (document the threshold and the chosen mitigation — oversampling, class weights, threshold tuning).
54
- - No temporal leakage: all records in the validation set postdate all records in the training set for time-series problems.
55
- - Feature null rates are within threshold per column. Schema types match declared types.
56
- These assertions run as a pre-training gate, not as an afterthought during debugging.
57
-
58
- ### Model Regression Tests
59
- A model deployment must not silently degrade the evaluation metric baseline:
60
- - Persist the baseline metric (accuracy, F1, AUC, RMSE, etc.) for the current production model in the model registry.
61
- - On each candidate model: evaluate on the held-out test set; compare to baseline.
62
- - Define the minimum acceptable delta (e.g., F1 must not drop more than 0.01 from baseline).
63
- - A regression below threshold is a failing CI gate. It does not block deployment only if an ADR explicitly accepts the tradeoff.
64
-
65
- ### Inference Latency Tests
66
- Model serving has an SLA. Test it:
67
- - At staging: send representative input at the defined peak request rate.
68
- - Assert p95 latency ≤ SLA threshold (document the threshold).
69
- - Assert throughput ≥ minimum requests/second.
70
- - Assert memory footprint under sustained load stays within spec.
71
- Latency tests run post-deploy to staging, not pre-deploy. They are a promotion gate, not a build gate.
72
-
73
- ### Adversarial Input Tests
74
- Models fail in unexpected ways on distribution-edge inputs:
75
- - **Out-of-distribution inputs**: feature values well outside training range; entirely unseen categories.
76
- - **Corrupted inputs**: nulls in required fields, wrong types, empty sequences, extreme numeric values.
77
- - **Edge-case inputs**: minimum/maximum sequence length, single-token inputs, very long inputs if applicable.
78
- Assert: the model does not crash; output is within plausible range; uncertainty (if modeled) is high for OOD inputs.
79
-
80
- ### Bias / Fairness Assertions
81
- Where the model's output affects people and protected attributes are present in the data:
82
- - Define the protected attributes and the fairness metric (demographic parity, equalized odds, calibration by group).
83
- - Evaluate the fairness metric on the test set per protected-attribute group.
84
- - Assert the fairness gap is within the documented acceptable threshold.
85
- - If no protected attributes are present but the output has downstream human impact, document this determination and its rationale in an ADR.
1
+ tag: ML
2
+ section: instructions
3
+ blocks:
4
+ - id: training-pipelines
5
+ tier: recommended
6
+ title: "Model Training & Experiment Tracking"
7
+ content: |
8
+ ## Model Training & Experiment Tracking
9
+
10
+ - Track every experiment with a tool like MLflow, Weights & Biases, or DVC. Log hyperparameters, metrics, dataset versions, and the git commit hash for full reproducibility.
11
+ - Pin all dependencies (Python version, library versions, CUDA version) in a lockfile or Docker image. A training run from six months ago must be reproducible today.
12
+ - Separate data preprocessing, feature engineering, model training, and evaluation into distinct pipeline stages with clear interfaces.
13
+ - Use configuration files (YAML/TOML) for hyperparameters rather than hard-coding them. Support overrides via CLI arguments for sweep runs.
14
+ - Always hold out a test set that is never used during training or hyperparameter tuning. Report final metrics exclusively on this set.
15
+ - Version datasets alongside code. Use content-addressable storage or DVC to track dataset lineage and detect drift between training runs.
16
+ - Set random seeds for all sources of non-determinism (NumPy, PyTorch, TensorFlow, data shuffling) to ensure reproducible results on the same hardware.
17
+
18
+ - id: feature-engineering
19
+ tier: recommended
20
+ title: "Feature Engineering & Data Preparation"
21
+ content: |
22
+ ## Feature Engineering & Data Preparation
23
+
24
+ - Build a centralized feature store (or at minimum a shared feature module) to avoid duplicating feature logic across training and serving.
25
+ - Document every feature: its definition, data source, expected range, update frequency, and any known caveats or biases.
26
+ - Compute feature statistics (mean, std, min, max, null rate) on the training set and persist them. Apply the same transformations at inference time using these saved statistics—never recompute from inference data.
27
+ - Handle missing values explicitly. Choose an imputation strategy per feature (mean, median, mode, sentinel value, or model-based) and document the rationale.
28
+ - Detect and handle data leakage: ensure no future information leaks into features, and that train/validation/test splits respect temporal or entity boundaries.
29
+ - Monitor feature distributions in production. Alert when serving-time distributions diverge significantly from training-time distributions (data/concept drift).
30
+
31
+ - id: model-deployment
32
+ tier: recommended
33
+ title: "Model Versioning & Deployment"
34
+ content: |
35
+ ## Model Versioning & Serving
36
+
37
+ - Store trained model artifacts in a model registry with semantic versioning. Tag each artifact with the training run ID, dataset version, and evaluation metrics.
38
+ - Serve models behind a versioned API endpoint. Support A/B testing and canary rollouts by routing a percentage of traffic to a new model version.
39
+ - Define minimum performance thresholds (accuracy, latency p99, throughput) as promotion gates. A model must pass automated evaluation before being promoted to production.
40
+ - Implement shadow mode: run a new model in parallel with the current production model, compare outputs, and alert on significant divergence before cutting over.
41
+ - Log all predictions with input features, model version, and timestamp. This enables debugging, bias auditing, and retraining on production data.
42
+ - Set up automated retraining triggers based on performance degradation, data drift detection, or a fixed schedule. Ensure the retraining pipeline is fully automated end-to-end.
43
+
44
+ - id: ml-testing
45
+ tier: recommended
46
+ title: "ML-Specific Testing Requirements"
47
+ content: |
48
+ ## ML-Specific Testing Requirements
49
+
50
+ ### Data Distribution Tests
51
+ Assert dataset integrity before any model trains on it:
52
+ - Train/val/test split ratios are within configured tolerances.
53
+ - Class balance in classification tasks is within acceptable imbalance threshold (document the threshold and the chosen mitigation — oversampling, class weights, threshold tuning).
54
+ - No temporal leakage: all records in the validation set postdate all records in the training set for time-series problems.
55
+ - Feature null rates are within threshold per column. Schema types match declared types.
56
+ These assertions run as a pre-training gate, not as an afterthought during debugging.
57
+
58
+ ### Model Regression Tests
59
+ A model deployment must not silently degrade the evaluation metric baseline:
60
+ - Persist the baseline metric (accuracy, F1, AUC, RMSE, etc.) for the current production model in the model registry.
61
+ - On each candidate model: evaluate on the held-out test set; compare to baseline.
62
+ - Define the minimum acceptable delta (e.g., F1 must not drop more than 0.01 from baseline).
63
+ - A regression below threshold is a failing CI gate. It does not block deployment only if an ADR explicitly accepts the tradeoff.
64
+
65
+ ### Inference Latency Tests
66
+ Model serving has an SLA. Test it:
67
+ - At staging: send representative input at the defined peak request rate.
68
+ - Assert p95 latency ≤ SLA threshold (document the threshold).
69
+ - Assert throughput ≥ minimum requests/second.
70
+ - Assert memory footprint under sustained load stays within spec.
71
+ Latency tests run post-deploy to staging, not pre-deploy. They are a promotion gate, not a build gate.
72
+
73
+ ### Adversarial Input Tests
74
+ Models fail in unexpected ways on distribution-edge inputs:
75
+ - **Out-of-distribution inputs**: feature values well outside training range; entirely unseen categories.
76
+ - **Corrupted inputs**: nulls in required fields, wrong types, empty sequences, extreme numeric values.
77
+ - **Edge-case inputs**: minimum/maximum sequence length, single-token inputs, very long inputs if applicable.
78
+ Assert: the model does not crash; output is within plausible range; uncertainty (if modeled) is high for OOD inputs.
79
+
80
+ ### Bias / Fairness Assertions
81
+ Where the model's output affects people and protected attributes are present in the data:
82
+ - Define the protected attributes and the fairness metric (demographic parity, equalized odds, calibration by group).
83
+ - Evaluate the fairness metric on the test set per protected-attribute group.
84
+ - Assert the fairness gap is within the documented acceptable threshold.
85
+ - If no protected attributes are present but the output has downstream human impact, document this determination and its rationale in an ADR.