modscape-codegen

Generate dbt, SQLMesh, or Spark SQL implementation code from Modscape YAML data models.

Updated Feb 25, 2026
One-click install
npx skills add https://github.com/yujikawa/modscape --skill modscape-codegen-yujikawa
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: modscape-codegen
Source: https://github.com/yujikawa/modscape/tree/main/src/templates/gemini/modscape-codegen
Command: npx skills add https://github.com/yujikawa/modscape --skill modscape-codegen-yujikawa

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing pipeline code by hand from a data model is repetitive and error-prone, especially when business context like grain, glossary terms, and architecture decisions lives in separate documents. This Skill converts a Modscape YAML model directly into implementation code while incorporating that surrounding specification context. ## Core Features & Use Cases - Multi-target code generation: Produce models for dbt, SQLMesh, Spark SQL, or plain SQL from a single YAML source. - Dependency-ordered output: Generates models upstream-first based on the lineage.upstream definitions in the YAML. - SDD context integration: Loads architecture decisions, business glossaries, Q&A, and per-table specs from .modscape/specs/ to reduce speculative TODO comments. - Use Case: A data engineer maintains a star schema in model.yaml and needs dbt staging and mart models; the Skill reads the YAML plus table specs and emits ordered SQL files with TODOs only where information is genuinely missing. ## Quick Start Ask the assistant to generate dbt models from model.yaml using the modscape-codegen skill.

Frequently Asked Questions about modscape-codegen

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate dbt models from a YAML data model?▼

Invoke the skill with your Modscape model.yaml and specify dbt as the target, for example with the --target dbt flag. The skill reads the YAML, applies codegen rules, and emits models in dependency order based on lineage.upstream.

What target tools does Modscape code generation support?▼

The skill supports dbt, SQLMesh, Spark SQL, and plain SQL as generation targets. If you do not specify a target, it will ask which tool to generate code for before proceeding.

How does the skill use the .modscape/specs directory?▼

It loads _context.yaml for architecture decisions, _glossary.yaml for business term definitions, _questions.yaml for open and answered questions, and per-table spec.md files. This context improves column semantics and reduces speculative TODO comments in generated code.

Why does generated SQL contain TODO comments?▼

TODO comments appear only where neither the YAML model nor the SDD specification context resolves an ambiguity. Answered or assumed questions in _questions.yaml reduce TODOs, while open questions become TODO markers.

In what order are SQL models generated?▼

Models are generated in dependency order, upstream first, based on the lineage.upstream field defined in the Modscape YAML. This ensures referenced tables exist before downstream models that depend on them.