Skip to content
Development
Skill

/add-sample-data

Use when the user wants to seed Dataverse tables with realistic sample records so a freshly-scaffolded code app shows real-looking data on first launch. Generates contextually appropriate rows from each table's schema and inserts them in dependency order. Mirrors

From plugin
power-platform-skills
1.1k110 skills25 agents5 MCP

Claude Code

$ npx -y skills add microsoft/power-platform-skills --skill add-sample-data --agent claude-code

SKILL.md

add-sample-data.SKILL.md
name: add-sample-data
description: Use when the user wants to seed Dataverse tables with realistic sample records so a freshly-scaffolded code app shows real-looking data on first launch. Generates contextually appropriate rows from each table's schema and inserts them in dependency order. Mirrors microsoft/power-platform-skills/power-pages/add-sample-data, adapted for mobile apps.
user-invocable: true
allowed-tools: Read, Edit, Write, Grep, Glob, Bash, AskUserQuestion
model: sonnet

> **Plugin check**: Run `node "${PLUGIN_ROOT}/scripts/check-version.js"` - if it outputs a message, show it to the user before proceeding.

**📋 Shared instructions: [shared-instructions.md](${PLUGIN_ROOT}/shared/shared-instructions.md)** — read first.

Add Sample Data

**App root:** before any project read or command, execute [app-working-directory.md](${PLUGIN_ROOT}/shared/references/app-working-directory.md). Use its resolved absolute `working_dir` for every shell call and file tool, including media paths and retries; never inherit a prior `cd`.

Populate Dataverse tables with realistic sample records so a freshly-scaffolded code app shows real-looking data on first launch. Generates rows from each table's schema and inserts them in dependency order. Use after `/add-dataverse` (or `/setup-datamodel`) has created the tables.

Core principles

  • **Coverage within approved scope, not the entire manifest.** Cover each eligible

approved table with a small useful dataset. The manifest is verified app inventory and can include retiring or unrelated tables; its presence is not permission to seed them. Scope and retirement exclusions override every coverage, fanout, prototype-reuse, media, and retry rule below.

  • **Insertion order matters.** Parent / referenced tables must be inserted before child / referencing tables so lookup IDs are available.
  • **Contextual data, not Lorem Ipsum.** Generate values that match column names + types. A `cr3e9_sitename` column in an inspection app gets "Westside Construction Site", not "Sample Name 1".
  • **Scenario-aware rows.** Read `native-app-plan.md` when present, especially `### Shared Conventions` and per-screen `Operational pattern` values defined in [screen-templates.md](${PLUGIN_ROOT}/shared/references/screen-templates.md); otherwise use the current data request and verified schema. Seed rows should exercise the app's actual workflow: statuses, dates, relationships, priority/severity, media metadata, and edge cases that make the planned first viewport light up.
  • **Fail gracefully.** On insertion failure, log the error and continue with remaining records — never auto-rollback. The user can re-run after fixing the issue.
  • **Idempotent re-runs.** If a previous run partially completed, the second run reads `memory-bank.md`'s seeded-data table and skips records already inserted.
  • **Solution-scoped inserts.** Always pass `--solution <uniqueName>` so records land in our solution, not the default.

Workflow

0. Resolve approved seed scope → 1. Verify project + auth → 2. Discover scoped tables → 3. Select tables + count → 4. Generate + preview → 5. Insert → 6. Summary

Step 0 — Resolve approved seed scope

Inputs are skill arguments, not flags for `dataverse-request.js`:

  • `--working-dir <absolute-root>`: inherit the caller's root; reject conflicting

explicit/inherited roots. Never default to shell cwd in a nested invocation.

  • `--tables <comma-separated-logical-names>`: the exact approved seed-table

allowlist. Required for every orchestrated call, including fresh creation.

  • `--exclude-tables <comma-separated-logical-names>`: retiring table names from

the approved edit; omit or pass an explicit empty string only when none retire.

For an orchestrated call, require the scoped handoff and matching `--tables` before auth, record-count queries, or generation. A missing or malformed allowlist returns `NEEDS_CONTEXT`; never fall back to all manifest tables. An explicitly empty allowlist is a no-op: report no approved seed tables and return without cloud calls or writes.

Validate logical names against the manifest and the approved plan/caller scope. Build `retiringTables` from the caller's retirement set plus any pending removals recorded in the current plan/history; include these in `--exclude-tables`. If an allowlisted name is absent/unverified or overlaps `retiringTables`, stop before insertion and return the scope mismatch. Do not silently drop unknown names or infer permission from a transitional manifest entry.

For a standalone request, honor explicit `--tables` and exclusions. If no table list was supplied, discover candidates in Step 2 and ask the user to approve the specific table set/counts before Step 5, then freeze that selection as `seedTables`. For this standalone discovery path, validate against verified metadata when the local manifest is absent; never treat the discovery result itself as approval. Pending retirement always excludes a candidate; if that state is unclear, ask rather than treating the manifest as approval. Read-only fallback discovery is not permission to seed the environment.

Keep a fixed `seedTables` allowlist throughout the invocation. All later selection, batches, media jobs, and resume operations must remain within it. Do not edit `.datamodel-manifest.json` or the app plan to make an excluded table eligible. Expanding scope requires returning to the owning approval gate.

For `--plan-only` or a planning-phase handoff, use the supplied proposed table scope for read-only checks and return the proposed counts, dependency needs, and media policy before Step 5. Planning approval is not insertion approval. Do not generate media files, insert/update/upload records, or change the app plan, manifest, or seeded-data history on this path.

Prototype Seed Reuse

`--from-seed` is used by `/prototype-to-real-app` after a mock prototype is converted to Dataverse. In this mode, prefer existing prototype seed files before gen

Read more
@microsoft
Ships withpower-platform-skills

Plugins from Microsoft that teach AI assistants, such as GitHub Copilot and Claude Code, to build on Power Platform.

1.1k110 skills25 agents5 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
1.1k
Star history of microsoft/power-platform-skills on GitHub, a chart by star-history.com

Other skills on power-platform-skills.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills13d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react4d252k
@facebook@facebookInstall Skill

Questions about add-sample-data.

Which coding agents can use add-sample-data?
add-sample-data installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.