agentleFS
aidevmeaidevme/power-platform-claude-skills/CLAUDE.md

power-platform-claude-skills

CLAUDE.md2 starsChanged 8 months agoMITView on GitHub

You have 1 domain skill: When developing and testing Dataverse plugins:

The file

We split this CLAUDE.md into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Always use FakeXrmEasy framework for unit testing Dataverse plugins.

    line 13
  2. Distinctive:

    Test both positive and negative scenarios for each plugin.

    line 16
  3. Distinctive:

    When registering plugins on Update events, ALWAYS define filtering attributes to avoid triggering on autosave.

    line 17
  4. Distinctive:

    Use proper assertion patterns to validate plugin behavior.

    line 19
  5. Distinctive:

    Verify expected exceptions are thrown for invalid inputs.

    line 20
  6. Distinctive:

    Test pipeline execution order when multiple plugins are registered.

    line 21
  7. Distinctive:

    Always include test cases for security context and privilege validation.

    line 22
  8. Distinctive:

    When developing and testing Dataverse plugins:

    line 41
  9. Distinctive:

    Use Visual Studio or VS Code with C# Dev Kit for plugin development

    line 53

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md 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
CLAUDE.md

Project Instructions

Available Skills (load automatically)

You have 1 domain skill:

SkillWhen to Use
dataverse-plugins-unit-testingUnit testing Dataverse plugins with FakeXrmEasy framework — covers test setup, in-memory context, pipeline simulation, entity images, mocking, and assertion patterns.

Rules for Plugin Unit Testing

  • Always use FakeXrmEasy framework for unit testing Dataverse plugins.
  • Set up in-memory XrmFakedContext to simulate Dataverse environment.
  • Properly configure pipeline simulation with images (PreImage/PostImage) where needed.
  • Test both positive and negative scenarios for each plugin.
  • When registering plugins on Update events, ALWAYS define filtering attributes to avoid triggering on autosave.
  • Mock external dependencies (web service calls, custom APIs) to keep tests isolated and fast.
  • Use proper assertion patterns to validate plugin behavior.
  • Verify expected exceptions are thrown for invalid inputs.
  • Test pipeline execution order when multiple plugins are registered.
  • Always include test cases for security context and privilege validation.

Best Practices for Plugin Unit Testing

  • Test setup isolation — Each test should have its own isolated XrmFakedContext. Never share context between tests.
  • Entity initialization — Always create test entities with required attributes populated. Missing primary name fields cause silent failures.
  • Pipeline simulation — Configure proper MessageName, Stage, and PipelineStage in XrmFakedContext to match real plugin registration.
  • Entity images — Add PreEntityImages and PostEntityImages to PluginExecutionContext when testing Update messages to simulate real scenarios.
  • Mock external calls — Use interfaces and dependency injection to mock external web service calls, custom APIs, and third-party integrations.
  • Assertion patterns — Verify entity attribute values, related record creation, and state transitions. Don't just assert no exceptions were thrown.
  • Exception testing — Use Assert.Throws<T> or try-catch patterns to verify plugins throw appropriate exceptions for invalid inputs.
  • Query testing — When plugins execute QueryExpression or FetchXml, populate XrmFakedContext with test data to validate query logic.
  • Relationship testing — Test Many-to-Many associations and lookup field updates using FakeXrmEasy's relationship simulation.
  • Security context — Test with different user privileges by configuring InitiatingUserId and UserId in PluginExecutionContext.
  • Async patterns — For testing async plugins and Code Activities, configure proper async operation simulation.
  • Never silently swallow errors — At minimum console.error in plugins, ideally throw InvalidPluginExecutionException with user-friendly messages.

Plugin Development Workflow

When developing and testing Dataverse plugins:

  1. Write unit tests first — Define expected behavior using FakeXrmEasy before implementing plugin logic (TDD approach).
  2. Run tests locally — Use Visual Studio Test Explorer or dotnet test to run unit tests during development.
  3. Add test coverage — Aim for 80%+ code coverage. Test all branches, error conditions, and edge cases.
  4. Register plugin — Use Plugin Registration Tool or pac plugin CLI to deploy to Dataverse environment.
  5. Integration test — Verify plugin behavior in real environment using Power Apps Monitor or Application Insights.
  6. Debug if needed — Use Plugin Profiler to capture execution context for failing scenarios, then create unit tests to reproduce.

Environment

  • Platform: Windows
  • Use Visual Studio or VS Code with C# Dev Kit for plugin development
  • FakeXrmEasy framework for unit testing (NuGet package)
  • Plugin Registration Tool or pac plugin CLI for deployment

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.