agentleFS
OwnOpticOwnOptic/power-automate-mcp/.claude/skills/dataverse-schema/SKILL.md

dataverse-schema

Skill0 starsChanged 11 days agoMITView on GitHub

Create Dataverse tables, columns, choices and lookups inside a new or existing solution, from a JSON spec, with scripts/dataverse_schema.py. Use when asked to create a table, add columns, design a data model, "make a schema", or set up a publisher and solution for a new project. Then hand over to solution-from-base to export it with pac.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

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

    Start from schema/orders.example.json.

    line 21
  2. Very specific:

    Run it with the repo's venv interpreter, and with AZURE_CONFIG_DIR set if the user keeps a separate az profile for this tenant (the MCP …

    line 48

≈ “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

Create Dataverse schema in a solution

The script does the API work; your job is the spec, and reading the plan before you apply it. Everything lands INSIDE the spec's solution, so pac solution export picks it up afterwards.

1. Agree the target before anything else

  • Which environment? list_environments (power-platform-extras) shows ids and which have Dataverse (has_dataverse: true). The script uses PA_ENV_ID, or --env <id>.
  • Say the tenant and environment name back to the user and get a yes. The script acts as them and creates real metadata. Never a production environment for a demo.

2. Write the spec

Start from schema/orders.example.json. Keep the same publisher and solution for one project; the prefix (3 to 8 lowercase letters) ends up on every schema name.

  • Column types: text, memo, integer, decimal, boolean, date, datetime, choice (with options), lookup (with target, a table logical name such as account or pmd_order).
  • Display names are what makers see; schema names are derived (Due date -> pmd_DueDate). Pick display names you will not want to rename: renaming is fine, the schema name never changes.
  • A lookup is named after its target (pmd_accountid). Do not name a text column <target>name (pmd_accountname): a lookup reserves that name.
  • One table per real-world thing. Status as a choice, never free text.

Save it as schema/<project>.json.

3. Plan, read, apply

python scripts/dataverse_schema.py plan  schema/<project>.json --env <id>
python scripts/dataverse_schema.py apply schema/<project>.json --env <id>

plan is read-only and lists what would be created. Show it to the user. apply takes about 10 to 15 seconds per column (metadata calls are slow) and ends by publishing the tables it touched. It is idempotent: re-running reports exists and changes nothing, so to grow the model, add to the spec and apply again.

Run it with the repo's venv interpreter, and with AZURE_CONFIG_DIR set if the user keeps a separate az profile for this tenant (the MCP config shows it).

4. Hand over

  • To ship it or keep it in source control: the solution-from-base skill exports and unpacks it with pac.
  • To use it from an agent: build an agent flow on it with create_agent_flow (the agent-tool skill).

When it fails

  • 0x80047013 attribute already exists: a lookup reserved that name. Rename the column.
  • 0x80040217 solution unique name is not valid on the solution itself: a header leaked onto the solution POST. The script only sends it on metadata calls; do not add it.
  • A + in a value used in a URL path returns an IIS HTML 404, not a Dataverse error.
  • 401 or AADSTS errors: the az session for this tenant expired. az login --tenant <id> (with the same AZURE_CONFIG_DIR).

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.