agentleFS
bcastelinobcastelino/powerbi-dashboard-generator/skills/project-packager/SKILL.md

project-packager

Skill1 starsChanged 6 months agoMITView on GitHub

Scaffolds a complete Power BI Desktop Project (PBIP) directory structure, assembles TMDL and report artifacts, validates the project integrity, and creates a distributable zip archive. Use this skill when all semantic model and report files are ready and need to be packaged into a valid PBIP. This is Stage 4 of the query-to-pbip pipeline.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. polaralias/skills★ 2same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository8 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Create the full directory hierarchy.

    line 78
  2. Distinctive:

    Run validation to ensure project integrity:

    line 224
  3. Distinctive:

    Before delivering the PBIP:

    line 260
  4. Distinctive:

    If the Databricks connection is configured, visuals will render with live data

    line 291

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Project Packager

Scaffold, assemble, validate, and zip a Power BI Desktop Project (PBIP). This skill takes the TMDL files from the semantic mapper and the report files from the visual generator and packages them into a complete PBIP directory structure that can be opened in Power BI Desktop.

When to Use This Skill

  • Assembling TMDL and report files into a PBIP directory structure
  • Creating pointer files (.pbip, .pbism, .pbir) and .platform files with correct cross-references
  • Validating that all required PBIP files exist and references are consistent
  • Zipping a PBIP project for distribution
  • Packaging artifacts as part of the query-to-pbip pipeline (Stage 4)

Inputs

  • TMDL files — From Stage 1 (database.tmdl, model.tmdl, relationships.tmdl, tables/*.tmdl)
  • Report files — From Stage 3 (visual.json files, one per visual)
  • Project name — Used for directory and pointer file naming

Outputs

  • Complete PBIP directory structure on disk
  • Zipped PBIP archive (.zip) ready for distribution

PBIP Directory Structure

The official Microsoft PBIP format (with TMDL semantic model and PBIR report format):

<ProjectName>/
├── <ProjectName>.pbip                              # Project entry point
├── .gitignore                                      # Excludes local settings and cache
├── <ProjectName>.SemanticModel/
│   ├── .platform                                   # Fabric Git integration (type: SemanticModel)
│   ├── definition.pbism                             # Semantic model pointer (version 4.2 for TMDL)
│   ├── diagramLayout.json                           # Model diagram layout (optional)
│   ├── .pbi/
│   │   └── editorSettings.json                      # Editor configuration
│   └── definition/
│       ├── database.tmdl                            # Database name + compatibility level
│       ├── model.tmdl                               # Model configuration
│       ├── relationships.tmdl                       # Table relationships
│       ├── cultures/
│       │   └── en-US.tmdl                           # Culture/locale definition
│       └── tables/
│           ├── fact_sales.tmdl
│           ├── dim_customer.tmdl
│           └── ...
└── <ProjectName>.Report/
    ├── .platform                                   # Fabric Git integration (type: Report)
    ├── definition.pbir                              # Report pointer (version 4.0, references SemanticModel)
    ├── StaticResources/
    │   └── SharedResources/
    │       └── BaseThemes/
    │           └── CY25SU11.json                    # Default Power BI theme
    └── definition/
        ├── report.json                              # Report-level configuration (schema 3.1.0)
        ├── version.json                             # Report format version metadata
        └── pages/
            ├── pages.json                           # Page ordering and active page
            └── <pageId>/                            # 20-char hex page identifier
                ├── page.json                        # Page definition (schema 2.0.0)
                └── visuals/
                    ├── <visualId>/                  # 20-char hex visual identifier
                    │   └── visual.json              # Visual definition (schema 2.5.0)
                    └── <visualId>/
                        └── visual.json

Packaging Workflow

Step 1: Create Directory Structure

Create the full directory hierarchy. Use scripts/scaffold_pbip.py from the query-to-pbip skill:

python scaffold_pbip.py <ProjectName> --output <output-dir>

This generates all directories, pointer files, .platform files, and stub report files.

Step 2: Generate Pointer Files

<ProjectName>.pbip — Project entry point:

{
  "$schema": "https://developer.microsoft.com/json-schemas/fabric/pbip/pbipProperties/1.0.0/schema.json",
  "version": "1.0",
  "artifacts": [
    {
      "report": {
        "path": "<ProjectName>.Report"
      }
    }
  ],
  "settings": {
    "enableAutoRecovery": true
  }
}

definition.pbism — Semantic model pointer (in <ProjectName>.SemanticModel/):

{
  "$schema": "https://developer.microsoft.com/json-schemas/fabric/item/semanticModel/definitionProperties/1.0.0/schema.json",
  "version": "4.2",
  "settings": {}
}

Version 4.2 indicates the semantic model definition is stored as TMDL in the definition/ folder.

definition.pbir — Report pointer (in <ProjectName>.Report/):

{
  "$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definitionProperties/2.0.0/schema.json",
  "version": "4.0",
  "datasetReference": {
    "byPath": {
      "path": "../<ProjectName>.SemanticModel"
    }
  }
}

Version 4.0 indicates the report definition is stored in PBIR format in the definition/ folder.

Step 3: Generate .platform Files

Each item folder (SemanticModel and Report) requires a .platform file for Fabric Git integration:

{
  "$schema": "https://developer.microsoft.com/json-schemas/fabric/gitIntegration/platformProperties/2.0.0/schema.json",
  "metadata": {
    "type": "SemanticModel",
    "displayName": "<ProjectName>"
  },
  "config": {
    "version": "2.0",
    "logicalId": "<generated-guid>"
  }
}

The type field is "SemanticModel" or "Report" depending on the folder. The logicalId is a unique GUID.

Step 4: Generate Report Definition Files

definition/report.json — Report configuration:

{
  "$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/report/3.1.0/schema.json",
  "themeCollection": {
    "baseTheme": {
      "name": "CY25SU11",
      "reportVersionAtImport": {
        "visual": "2.4.0",
        "report": "3.0.0",
        "page": "2.3.0"
      },
      "type": "SharedResources"
    }
  },
  "resourcePackages": [
    {
      "name": "SharedResources",
      "type": "SharedResources",
      "items": [
        {
          "name": "CY25SU11",
          "path": "BaseThemes/CY25SU11.json",
          "type": "BaseTheme"
        }
      ]
    }
  ],
  "settings": {
    "useStylableVisualContainerHeader": true,
    "exportDataMode": "AllowSummarized",
    "defaultDrillFilterOtherVisuals": true,
    "allowChangeFilterTypes": true,
    "useEnhancedTooltips": true,
    "useDefaultAggregateDisplayName": true
  }
}

definition/version.json:

{
  "$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/versionMetadata/1.0.0/schema.json",
  "version": "2.0.0"
}

definition/pages/pages.json — Page ordering:

{
  "$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/pagesMetadata/1.0.0/schema.json",
  "pageOrder": ["<pageId>"],
  "activePageName": "<pageId>"
}

Step 5: Place Artifact Files

Copy files from previous pipeline stages into the correct locations:

SourceDestination
database.tmdl<ProjectName>.SemanticModel/definition/database.tmdl
model.tmdl<ProjectName>.SemanticModel/definition/model.tmdl
relationships.tmdl<ProjectName>.SemanticModel/definition/relationships.tmdl
tables/*.tmdl<ProjectName>.SemanticModel/definition/tables/
visual.json (per visual)<ProjectName>.Report/definition/pages/<pageId>/visuals/<visualId>/visual.json

Step 6: Validate the Structure

Run validation to ensure project integrity:

python package_pbip.py <ProjectDir> --validate-only

Validation checks:

  1. File existence — .pbip, .pbism, .pbir, database.tmdl, model.tmdl all exist
  2. Pointer consistency — .pbir references the correct .SemanticModel path
  3. PBISM version — Must be 4.x for TMDL format
  4. Platform files — .platform exists in both SemanticModel and Report
  5. Report definition — definition/report.json and definition/version.json exist
  6. Pages — pages.json exists, at least one page directory with page.json
  7. Visuals — Each visual directory contains visual.json
  8. Table files — At least one .tmdl file in tables/

Step 7: Create Zip Archive

Package the validated project into a zip archive:

python package_pbip.py <ProjectDir> --output <ProjectName>.zip

The zip excludes .pbi/localSettings.json and .pbi/cache.abf (local-only files).

File Format Requirements

File TypeEncodingIndentationLine Endings
.tmdlUTF-8 (no BOM)TabLF
.jsonUTF-8 (no BOM)2 spacesLF
.pbip, .pbism, .pbir, .platformUTF-8 (no BOM)2 spacesLF

Validation Checklist

Before delivering the PBIP:

  1. Project file exists — <ProjectName>.pbip is present in root
  2. .gitignore exists — Excludes .pbi/localSettings.json and .pbi/cache.abf
  3. Semantic model complete — .platform, definition.pbism (v4.2), database.tmdl, model.tmdl all exist
  4. Tables present — At least one .tmdl file in tables/
  5. Culture defined — cultures/en-US.tmdl exists
  6. Relationships file exists — relationships.tmdl is present (even if empty)
  7. Report complete — .platform, definition.pbir (v4.0), definition/report.json, definition/version.json
  8. Pages configured — pages.json with at least one page ID, matching page directory with page.json
  9. Visuals present — At least one visual.json in a visual subdirectory
  10. Pointer paths correct — .pbir → ../<ProjectName>.SemanticModel

Error Handling

ErrorResolution
Missing TMDL files from Stage 1Report which files are missing; do not create zip
Missing visual.json files from Stage 3Report which files are missing; do not create zip
Pointer path mismatchAuto-correct the path based on project name
Empty tables directoryWarn but allow packaging (model may have no dimensions)
Missing .platform filesGenerate them with new GUIDs
PBISM version mismatchUpdate to version 4.2 for TMDL format

Opening the PBIP

To use the generated PBIP:

  1. Extract the zip archive
  2. Open <ProjectName>.pbip in Power BI Desktop (June 2023 or later with PBIP preview enabled)
  3. Power BI will load the semantic model and report definition
  4. If the Databricks connection is configured, visuals will render with live data

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.