agentleFS
korchard333korchard333/claude-power-platform-community/.claude/skills/plugins/SKILL.md

plugins

Skill46 starsChanged 8 months agoMITView on GitHub

Dataverse C# Plugin development. Use when: writing plugins, IPlugin interface, execution pipeline, entity images, shared variables, unit testing with FakeXrmEasy, plugin registration, ITracingService, sandbox limitations.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    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:

    Not using tracingService (makes debugging impossible)

    line 60
  2. Distinctive:

    Not registering filtering attributes on Update steps (triggers on every field change)

    line 66
  3. Distinctive:

    Not signing the assembly with a strong name key

    line 69

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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

Skill: Dataverse C# Plugins

When to Use

Trigger when building, debugging, or reviewing Dataverse plugins — server-side C# code that executes in response to Dataverse operations (create, update, delete, retrieve, custom API calls).


When to Use Plugins vs Alternatives

ScenarioUseWhy
Synchronous validation before savePlugin (Pre-Validation/Pre-Operation)Real-time, blocks save on failure
Auto-numbering on createPlugin (Pre-Operation)Set value before record commits
Complex calculated fieldsPlugin (Post-Operation sync)Runs after save, same transaction
Cascading updates to child recordsPlugin (Post-Operation async)Avoid timeout on large datasets
Long-running process (>2 min)Power AutomatePlugins have 2-minute timeout
Orchestrate multiple external systemsPower AutomateBuilt-in connectors, retry, monitoring
Reusable API callable from appsCustom API + PluginTyped inputs/outputs, callable from anywhere
Complex business logic from Code AppCustom APIBetter than raw HTTP from client

Execution Pipeline Overview

Client Request (Create/Update/Delete/Custom API)
  │
  ├── Stage 10: Pre-Validation (BEFORE security checks, NOT in transaction)
  ├── Stage 20: Pre-Operation (AFTER security, BEFORE database write, IN transaction)
  ├── [Database Operation]
  ├── Stage 40: Post-Operation Sync (AFTER write, IN transaction — rollback possible)
  └── Stage 40: Post-Operation Async (AFTER commit, SEPARATE transaction)

⚠️ REQUIRED: Load Sub-Files Before Implementation

SKILL.md is a summary only — it is NOT sufficient for implementation.

The detailed content (complete payloads, XML templates, working examples, edge-case handling) lives in sub-files in the same directory as this SKILL.md. Before writing any code, you MUST use read_file on the sub-files relevant to your task:

  • Project Setup & Architecture — .csproj, NuGet packages, strong-name key, IPlugin template, execution pipeline details
  • Context & Entity Images — IPluginExecutionContext properties, Target entity access, Pre/Post images registration and usage
  • Common Patterns — Validation plugin, auto-number, cascading update, Custom API plugin, shared variables, IOrganizationService CRUD
  • Unit Testing with FakeXrmEasy — xUnit + FakeXrmEasy setup, mocking IOrganizationService, testing plugin execution
  • Registration & Debugging — PAC CLI & Plugin Registration Tool, step parameters, ITracingService, ILogger, remote debugging
  • Sandbox Limitations & Performance — Sandbox restrictions, HTTP calls from plugins, 2-min/2-hour timeouts, performance guidelines

Anti-Patterns

  • Missing try/catch wrapping (unhandled exceptions crash the pipeline)
  • Throwing generic Exception instead of InvalidPluginExecutionException
  • Not using tracingService (makes debugging impossible)
  • Querying all columns (new ColumnSet(true)) instead of specific columns
  • Missing depth check (plugins triggering themselves infinitely)
  • Using Thread.Sleep or Task.Delay (wastes sandbox resources)
  • Hardcoding GUIDs, URLs, or environment-specific values
  • Using personal service context when system context is needed (or vice versa)
  • Not registering filtering attributes on Update steps (triggers on every field change)
  • Pre-Image requesting all attributes (register only what you need)
  • Sync plugins doing external HTTP calls (blocks user, risks timeout)
  • Not signing the assembly with a strong name key

Related Skills

  • dataverse — Schema design that plugins operate on
  • dataverse-web-api — Client-side API; plugins use Organization Service SDK instead
  • custom-connectors — Alternative for external system integration
  • testing — Plugin testing strategy with FakeXrmEasy

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.