agentleFS
korchard333korchard333/claude-power-platform-community/CLAUDE.md

claude-power-platform-community

CLAUDE.md46 starsChanged 8 months agoMITView on GitHub

These rules are always active. They apply to every skill, every interaction. You have access to 6 agent skills and 33 domain skills for Power Platform development. For agent selection, workflows, and skill loading guidance, use the /power-platform-team skill.

  • Sends data out

The file

Show its rules and text

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

15 rules. About 0 are common, 8 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

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

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

    Always use PAC CLI-generated services — never raw fetch/axios

    line 15
  2. Very specific:

    Always use $select on every Dataverse query — never fetch all columns

    line 16
  3. Distinctive:

    Always handle loading, error, and empty states in every component

    line 17
  4. Very specific:

    Always use TypeScript strict mode — no any types

    line 18
  5. Distinctive:

    Never hardcode environment URLs, GUIDs, or secrets

    line 19
  6. Distinctive:

    Never embed secrets in source code (published Code Apps are publicly accessible)

    line 20
  7. Very specific:

    Every form input has a label, every icon button has aria-label

    line 27
  8. Distinctive:

    When building Power Platform solutions from Claude Code, the primary workflow is:

    line 105
  9. Very specific:

    ALWAYS include MSCRM.SolutionUniqueName header on component creation

    line 144
  10. Very specific:

    ALWAYS include @odata.type on attribute/column creation payloads

    line 145
  11. Distinctive:

    ALWAYS create publisher + solution FIRST

    line 146
  12. Very specific:

    ALWAYS publish after form/view/sitemap changes

    line 147
  13. Distinctive:

    Every significant design decision must be documented as an ADR:

    line 155
  14. Distinctive:

    Use Mermaid erDiagram syntax

    line 161
  15. Distinctive:

    Every Power Platform project should include:

    line 167

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

Power Platform — Non-Negotiable Standards

These rules are always active. They apply to every skill, every interaction.

Three-Layer Architecture (Code Apps)

src/components/  → Presentation only. Props in, callbacks out. Zero service calls.
src/hooks/       → Business logic. The ONLY layer that calls generated services.
src/generated/   → Auto-generated by PAC CLI. NEVER manually edit.

Hard Rules

  • Always use PAC CLI-generated services — never raw fetch/axios
  • Always use $select on every Dataverse query — never fetch all columns
  • Always handle loading, error, and empty states in every component
  • Always use TypeScript strict mode — no any types
  • Never hardcode environment URLs, GUIDs, or secrets
  • Never embed secrets in source code (published Code Apps are publicly accessible)
  • Router basename must be normalized for Power Apps hosting
  • Provider stack order: ThemeProvider → SonnerProvider → QueryProvider → RouterProvider

Accessibility (WCAG 2.2 AA — Mandatory)

  • Semantic HTML first (<button>, <nav>, <main>) — ARIA is a last resort
  • Every form input has a label, every icon button has aria-label
  • Visible :focus-visible on all interactive elements
  • Skip-to-main-content link, aria-live regions for dynamic content
  • 4.5:1 text contrast, 3:1 for UI elements, never color alone for information
  • Content reflows at 320px and 200% zoom without horizontal scroll
  • Accessibility is part of EVERY code review, not a separate pass

ALM (Always — From Day One)

  • Solution-aware from the start
  • Environment variables for all environment-specific values
  • Managed solutions for test/prod — never import unmanaged to production
  • Connection references for all flow connections
  • Version increment on every deployment

Agent Team

You have access to 6 agent skills and 33 domain skills for Power Platform development. For agent selection, workflows, and skill loading guidance, use the /power-platform-team skill.

Naming Conventions

Publisher & Solution

ObjectConventionExample
Publisher prefix3-5 chars, lowercase, no underscorescontoso, prj
Solution unique namePascalCase, descriptiveContosoProjectManagement
Solution display nameSpace-separated, proper caseContoso Project Management

Dataverse Schema

ObjectConventionExample
Table logical name{prefix}_{noun} (singular)contoso_project
Table display nameSingular noun, proper caseProject
Table plural namePlural nounProjects
Column logical name{prefix}_{noun/adjective}contoso_startdate
Column display nameSpace-separated, proper caseStart Date
Relationship name{prefix}_{parent}_{child}contoso_project_task
Global option set{prefix}_{name}contoso_projectstatus
Alternate key{prefix}_{keyname}contoso_ordernumber

Components

ObjectConventionExample
Cloud flow[Solution] - [Trigger] - [Action]CRM - OnCreate Contact - Send Welcome Email
Environment variable schema{prefix}_{PascalCaseName}contoso_ApiBaseUrl
Connection reference{prefix}_{ConnectorName}contoso_SharedOutlook
Security role[App] [Level]CRM Admin, CRM User
Web resource{prefix}_/scripts/{entity}{Purpose}.jscontoso_/scripts/contactForm.js
Plugin class{Namespace}.{Entity}.{Event}{Action}Contoso.Project.PreCreate.SetDefaults
Custom API{prefix}_{VerbNoun}contoso_CalculateProjectHealth

Code Apps (React/TypeScript)

ObjectConventionExample
Component filesPascalCaseContactList.tsx, ProjectForm.tsx
Hook filescamelCase, use prefixuseContacts.ts, useProjectForm.ts
Store filescamelCase, Store suffixappStore.ts, filterStore.ts
Type filescamelCasecontact.types.ts
Test files.test. or .spec.ContactList.test.tsx

Canvas Apps

ObjectConventionExample
Screens[Feature]ScreenContactBrowseScreen
Galleriesgal[Name]galContacts
Buttonsbtn[Action]btnSave
Text inputstxt[Field]txtFirstName
Global variablesgbl[Name]gblCurrentUser
Collectionscol[Name]colPendingChanges

Web API-First Development Workflow

When building Power Platform solutions from Claude Code, the primary workflow is:

  1. Authenticate via Azure CLI
  2. Create publisher + solution (if not exists)
  3. Build schema via Web API HTTP calls (tables → columns → relationships → views → forms → app)
  4. Components land in the solution in real-time (via MSCRM.SolutionUniqueName header)
  5. Publish customizations
  6. Verify in the maker portal

When to Use Each Approach

ApproachWhen
Direct Web APINew development, schema creation, programmatic builds
pac code pushCode Apps deployment
pac pcf pushPCF control deployment
pac solution sync/exportWorking on existing solutions, syncing to source control
MCPData queries, schema discovery, Copilot Studio integration

Authentication

# Azure CLI (interactive — for development)
az account get-access-token \
  --resource "https://[org].crm6.dynamics.com/" \
  --tenant "[tenant-id]" \
  --query accessToken -o tsv

# Service Principal (CI/CD — for automation)
TOKEN=$(curl -s -X POST "https://login.microsoftonline.com/${TENANT_ID}/oauth2/v2.0/token" \
  -d "grant_type=client_credentials" \
  -d "client_id=${CLIENT_ID}" \
  -d "client_secret=${CLIENT_SECRET}" \
  -d "scope=https://${ORG}.crm.dynamics.com/.default" \
  | jq -r '.access_token')

Critical Web API Rules

  • ALWAYS include MSCRM.SolutionUniqueName header on component creation
  • ALWAYS include @odata.type on attribute/column creation payloads
  • ALWAYS create publisher + solution FIRST
  • ALWAYS publish after form/view/sitemap changes
  • On Windows, use PowerShell .ps1 scripts (bash mangles OData params)
  • Some decisions are PERMANENT: table logical name, column data type, ownership type

Documentation Standards

Architecture Decision Records (ADR)

Every significant design decision must be documented as an ADR:

  • File naming: docs/adr/ADR-NNN-description.md
  • ADRs are never deleted — superseded ADRs are marked as such

Entity Relationship Diagrams

  • Use Mermaid erDiagram syntax
  • Include: PK/FK markers, data types, relationship cardinality
  • Separate diagrams for: core domain, security model, integration points

Project README

Every Power Platform project should include:

  • Solution overview and business context
  • Environment URLs (dev/test/prod)
  • Service principal details (client IDs, not secrets)
  • Deployment instructions
  • Required environment variables and connection references
  • Known limitations and technical debt

Deployment Runbook

For production deployments:

  • Pre-deployment checklist (backups, approvals, change window)
  • Step-by-step deployment process
  • Post-deployment verification steps
  • Rollback procedure
  • Emergency contacts

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.