modscape-spec-implement

Implements pending data modeling tasks from spec task lists into dbt or SQL code.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Turning a data model design into actual dbt or SQL implementation code is repetitive and error-prone, especially when tracking which tables are done, which are context-only, and how lineage and join keys should map to SQL. This Skill automates that implementation loop one task at a time. ## Core Features & Use Cases - Task-driven code generation: Reads pending tasks from .modscape/changes/<name>/tasks.md and generates dbt/SQL code for staging, core, and mart tables in lineage dependency order. - Spec-aware SQL generation: Builds SELECT expressions, JOIN clauses from relationships, incremental WHERE filters, and SCD Type 2 merge patterns directly from spec-model.yaml. - Governance and safety: Skips Context Only tables, records open questions in questions.md with PII-safe investigation queries, and never edits generated files directly. - Use Case: After designing a new mart layer with @modscape-spec-design, run this Skill repeatedly to implement each table task, with checkboxes updated automatically after every generation. ## Quick Start Ask the AI to run @modscape-spec-implement with your spec name to implement the next pending task from the change's tasks.md file.

Frequently Asked Questions about modscape-spec-implement

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

FAQPage Schema
How do I implement a Modscape spec change into dbt models?▼

Run @modscape-spec-implement with the spec name after generating the task list with @modscape-spec-design. It reads tasks.md, generates code for the first pending task in lineage order, checks it off, and stops so you can invoke it again for the next task.

How does the skill generate JOIN clauses between tables?▼

It runs modscape relationship list on spec-model.yaml to get ON columns and cardinality for each table pair, then applies the join_type from lineage entries: inner, left, cross, or none. Missing relationships produce a TODO comment and a recorded question.

Does it support incremental models and SCD Type 2?▼

Yes. When physical.strategy is incremental with a filter_key, it generates a WHERE clause with an optional lookback interval. For logical.scd type2, it generates a MERGE or snapshot pattern using business_key, valid_from, valid_to, and current_flag columns.

What happens if something unexpected is found during implementation?▼

The Skill appends a question with a Q-NNN ID to questions.md and asks whether to pause or proceed with an assumption. Data-quality signals that could mislead analysts are logged as ai-detected entries with PII-safe aggregate investigation queries.

Can I modify the design mid-implementation?▼

Yes. Requested changes are applied in order: update design/<table-id>.md, mutate spec-model.yaml via the modscape CLI and validate, then surgically update tasks.md by unchecking or adding affected tasks before continuing.

Why are some tables skipped during implementation?▼

Tables marked Downstream — Context Only in the design.md Affected Tables section are added to a skip list. The Skill outputs a skip notice for these IDs and generates no code for them, treating them as read-only context.