You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+28-8Lines changed: 28 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,18 +4,21 @@ This file provides guidance to AI Agents when working with code in this reposito
4
4
5
5
## What This Repo Is
6
6
7
-
A **plugin marketplace** for Power Platform development by Microsoft. The marketplace manifest (`.claude-plugin/marketplace.json`) references individual plugins in `plugins/`. Each plugin has its own `AGENTS.md` with plugin-specific guidance.
7
+
A **plugin marketplace** for Power Platform development by Microsoft. The Open Plugins marketplace manifest (`marketplace.json`) references individual plugins in `plugins/`. Legacy `.claude-plugin` manifest mirrors are kept for existing subscriptions. Each plugin has its own `AGENTS.md` with plugin-specific guidance.
8
8
9
9
## Repository Structure
10
10
11
-
```text
11
+
```
12
12
power-platform-skills/
13
-
├── .claude-plugin/
14
-
│ └── marketplace.json # Marketplace manifest (lists all available plugins)
13
+
├── marketplace.json # Open Plugins marketplace manifest (lists all available plugins)
14
+
├── .claude-plugin/ # Legacy manifest mirrors for existing subscriptions
-`.plugin/plugin.json` — Open Plugins metadata (name, version, keywords)
49
+
-`.claude-plugin/plugin.json` — legacy mirror of `.plugin/plugin.json` kept for existing subscriptions
46
50
-`.mcp.json` — MCP server configuration (optional)
47
51
-`agents/` — Agent definitions (`.md` files with YAML frontmatter)
48
52
-`skills/` — Skill definitions, each in its own subdirectory with a `SKILL.md`
@@ -59,20 +63,36 @@ Do not mark a plugin as ready for internal publication until it has a completed
59
63
60
64
## Cross-Plugin Shared Skills
61
65
62
-
Skills that apply to all plugins live in `shared/skills/<skill-name>/`. The workflow logic is written once in a shared `.md` file, and each plugin has a thin `skills/<skill-name>/SKILL.md` that contains only the YAML frontmatter and a reference to the shared workflow file.
66
+
Skills that apply to all plugins live in `shared/skills/<skill-name>/`. The workflow logic is written once in a shared `.md` file, and each plugin has a thin `skills/<skill-name>/SKILL.md` that contains only the YAML frontmatter and a reference to the workflow path bundled inside that plugin at install time.
63
67
64
68
**Pattern:**
65
69
66
70
-`shared/skills/<skill-name>/<workflow>.md` — Full workflow (phases, instructions, field definitions)
-`plugins/<plugin>/skills/<skill-name>/SKILL.md` — Per-plugin wrapper generated from the template above
73
+
-`plugins/<plugin>/skills/<skill-name>/<workflow>.md` — Bundled workflow file copied into the plugin so installs work without repo-root shared paths
74
+
75
+
This keeps the skill discoverable in each plugin while preserving install-time portability. Marketplace installs copy only the plugin directory, so per-plugin wrappers must not reference repo-root `shared/` paths at runtime. Instead, point the wrapper at `${PLUGIN_ROOT}/skills/<skill-name>/<workflow>.md` and keep a physical copy of the shared workflow at that per-plugin path. Do not use Git symlinks for shared content; Windows and plugin-host installs can materialize them as plain link files. When updating a shared skill, edit the workflow file and/or `SKILL.template.md` in `shared/`, then refresh the per-plugin wrappers (frontmatter + bundled workflow reference, with `{{PLUGIN_NAME}}` substituted) and copy the workflow content into each adopting plugin. Commit the shared source and per-plugin copies together.
76
+
77
+
## Legacy Marketplace Compatibility
69
78
70
-
This keeps the skill discoverable in each plugin while avoiding content duplication. When updating a shared skill, edit the workflow file and/or `SKILL.template.md` in `shared/`, then update the per-plugin wrappers (frontmatter + reference pointing to the shared workflow, with `{{PLUGIN_NAME}}` substituted) and commit them alongside the shared change.
79
+
Keep the root `.claude-plugin/marketplace.json` and each plugin's `.claude-plugin/plugin.json` as JSON mirrors of their Open Plugins counterparts. The shared root marketplace must stay dual-compatible while keeping per-plugin entries minimal: each plugin entry should include only the required `name` and repository-root-relative `source` fields. Keep marketplace-level `owner` and `metadata` because they describe the collection, but store per-plugin display/update metadata (description, version, license, keywords, and similar fields) in each `.plugin/plugin.json` instead of duplicating or overriding it in the marketplace index. Existing marketplace subscriptions may still resolve the legacy paths during auto-update, so removing or drifting these files can force users to reinstall. Because mirrors are committed files, update both source and legacy copies together, then run `node scripts/validate-legacy-compatibility.js` after metadata changes.
71
80
72
81
## Code Conventions
73
82
74
83
**DRY (Don't Repeat Yourself):** Never duplicate logic across files. Each plugin has shared utilities (e.g., `scripts/lib/`) and shared reference docs (e.g., `references/`). Always check for and reuse existing helpers before writing new code. When adding shared logic, put it in the plugin's shared modules — not in individual skill directories.
75
84
85
+
### Code comments
86
+
87
+
Most code in this repo is Node.js scripts and hooks that shell out to `pac`/`az`, call the Dataverse and Power Platform APIs, and parse loosely structured CLI output. The reasoning behind a line is rarely obvious from the line alone, so comments matter.
88
+
89
+
- Err on the side of over-commenting when the reasoning is not obvious. Comments should explain **why** code is written a particular way.
90
+
- Comment non-obvious implementation details: concurrency hazards, lifecycle constraints, compatibility requirements, platform quirks, upstream PAC CLI or Dataverse workarounds, and intentional deviations from the obvious helper or API.
91
+
- When parsing strings, logs, CLI output, OData payloads, or other loosely structured data, include a comment with an example of the raw format being parsed.
92
+
- When code follows an external standard, protocol, or Power Platform convention, include links to the relevant documentation so future readers can verify the rule.
93
+
- When code touches auth tokens or other privacy/security-sensitive flows, explain the scope and fail-closed behavior.
94
+
- Do not add comments that only narrate clear code.
95
+
76
96
## Maintaining This File
77
97
78
98
When you add new plugins or change the repository-level structure, update this file. For plugin-specific changes, update the plugin's own `AGENTS.md` (e.g., `plugins/power-pages/AGENTS.md`).
0 commit comments