microsoft/terraform-provider-fabric/schema-model-generator
Claude Code and agent skill by microsoft/terraform-provider-fabric
- vendor
Checking that the SKILL.md file is still in the repository.
Given a Go SDK contract (DTOs), generate the corresponding Terraform schema attributes and model structs with high fidelity. USE FOR: creating schema_*.go and models.go files from SDK DTOs, mapping Go types to Terraform attribute types and custom types.
Install
npx vskill@latest install microsoft/terraform-provider-fabric/schema-model-generatorSKILL.md
The same SKILL.md was published earlier as microsoft/terraform-provider-fabric/schema-model-generator.
Skill: Schema & Model Generator
Given a Go SDK contract (DTOs), generate the corresponding Terraform schema attributes and model structs with high fidelity.
Prerequisites
- SDK DTO struct fields have been identified (from
#skill:sdk-contract-navigator) - You know the item archetype (basic, definition, properties, etc.)
- If the issue contains a ๐ณ DTO Nesting Depth Map, use it to determine:
- One model struct per tree node that introduces
[]Typeor*Type - Each such struct needs its own
set()method - Which fields use
supertypes.ListNestedObjectValueOf(nested objects) vssupertypes.ListValueOf(scalars) vssupertypes.SingleNestedObjectValueOf(optional nested)
Step 1 โ Classify Each SDK Field
For each field in the SDK DTO struct, determine its category using the "Attribute Behaviors" table in .github/instructions/schema-model-patterns.instructions.md.
Classification criteria:
| Category | Criterion | |
|---|---|---|
| Read-only | Only appears in Get response Properties struct | |
| Create-time-only | Appears in CreationPayload and cannot be updated | |
| Updatable required | User must provide, can be changed after create | |
| Updatable optional | User may provide, can be changed after create | |
| Optional with default | Server sets a default if not provided |
Step 2 โ Generate Model Struct Fields
Map each SDK field type to the corresponding Terraform model type using the "SDK Type โ Model Type Mapping" table in .github/instructions/schema-model-patterns.instructions.md.
Every field must have a tfsdk:"<snake_case_name>" tag.
Naming Conventions
- Model struct:
<item><purpose>Modelโ e.g.lakehousePropertiesModel,lakehouseConfigurationModel - Nested model:
<item><nested>Modelโ e.g.lakehouseSQLEndpointPropertiesModel - Field names: PascalCase in Go, with
tfsdk:"snake_case"tag - SDK PascalCase โ Terraform snake_case:
OneLakeFilesPathโonelake_files_path
Example Properties Model
Example Configuration Model (CreationPayload)
Example Nested Model
Step 3 โ Generate Model Methods
Generate both directions of mapping: response `set()` (SDK โ TF) and request builders (TF โ SDK).
3a. Response set() โ SDK โ TF (both Fabric Items and non-items)
Every model struct needs a set() method that maps SDK response DTO โ TF model.
Top-level `set()` (with nested objects):
Signature includes context.Context and returns diag.Diagnostics:
Leaf `set()` (no nested objects):
Simpler signature without context.Context or diag.Diagnostics:
Setter patterns by type: Use the "Setter Pattern" column in the "SDK Type โ Model Type Mapping" table and collection iteration templates in schema-model-patterns.instructions.md.
3b. Request Builders โ TF โ SDK (Create/Update)
Both Fabric Items and non-items need TFโSDK mapping for writable fields. The pattern differs by category:
- Fabric Items: Inline in
creationPayloadSetterclosure (simple โ typically 1-3 fields from configuration model). Seefabric-item-patterns.instructions.mdยง "Closure Examples". - Non-items: Dedicated request builder structs with
set()method that builds the SDK request directly (complex โ full request DTOs)
Non-item request builder struct โ embeds the SDK request type, set() populates it:
Usage: r.client.Create<Type>(ctx, reqCreate.Create<Type>Request, nil)
Inverse mapping rules: Use the inverse of the "SDK Type โ Model Type Mapping" table in schema-model-patterns.instructions.md. For each TF type, call its Value*Pointer() method (e.g., types.String โ .ValueStringPointer(), types.Bool โ .ValueBoolPointer()).
Non-obvious cases:
| TF Model Type | SDK Type | Pattern | |
|---|---|---|---|
types.Int64 | *int32 | ptr.To(int32(from.Field.ValueInt64())) โ type narrowing required | |
supertypes.SingleNestedObjectValueOf[M] | *NestedDTO | .Get(ctx) โ construct nested DTO from sub-model | |
supertypes.ListNestedObjectValueOf[M] | []NestedDTO | .Get(ctx) โ iterate slice, build each DTO |
Reference: internal/services/connection/models_resource_connection.go
Step 4 โ Generate Schema Attributes
For Fabric Item resources, schema attributes go in separate functions:
Resource Properties Schema
Resource Configuration Schema (for CreationPayload)
Schema Attribute Type Mapping
Use the "SDK Type โ Schema Mapping" table in .github/instructions/schema-model-patterns.instructions.md.
Rules for All Schema Attributes
For attribute behavior flags, plan modifiers, and validators, refer to the "Attribute Behaviors", "Plan Modifiers", and "Validators" sections in .github/instructions/schema-model-patterns.instructions.md.
Additional rules:
- Always use
MarkdownDescription(neverDescription) - Nested objects: Must include
CustomType: supertypes.NewSingleNestedObjectTypeOf[<model>](ctx) - UUID fields: Must include
CustomType: customtypes.UUIDType{}
Example Nested Attribute
Canonical References
- Model struct patterns:
internal/services/lakehouse/models.go - Resource schema patterns:
internal/services/lakehouse/schema_resource_lakehouse.go - Data source schema patterns:
internal/services/lakehouse/schema_data_lakehouse.go - Non-item schema (superschema):
internal/services/connection/schema.go - Request builder patterns:
internal/services/connection/models_resource_connection.go
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 25 Sep 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/schema-model-generator/SKILL.md
Popularity
- Repository stars
- 128
- Repository forks
- 30
- 7-day trend score
- 24
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microsoft/terraform-provider-fabric/schema-model-generator)