Copilot-Managed-Runtime / copilot-managed-runtime
AGENTS.md4 starsChanged 8 days agoMITView on GitHub
This file provides instructions for assistants working on the Copilot Managed Runtime plugin itself (not for end-users of the plugin). The Copilot Managed Runtime plugin wraps @microsoft/cmr-cli (binary ms) to scaffold, develop, and ship apps on Copilot Managed Runtime end-to-end. It provides skills for: This plugin uses a memory bank (memory-bank.md) to persist state across sessions.
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,843 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository38 other files it gives its agents.
- github-actions/AGENTS.mdAGENTS.md
- samples/CodeFlow/AGENTS.mdAGENTS.md
- samples/LearningHub/AGENTS.mdAGENTS.md
- samples/TaskManager/AGENTS.mdAGENTS.md
- add-azuredevopsSkill
- add-backendSkill
- add-data-sourceSkill
- add-dataverseSkill
- add-excelSkill
- add-mcscopilotSkill
- add-office365Skill
- add-office365-usersSkill
- add-onedriveSkill
- add-sharepointSkill
- add-teamsSkill
- add-workiqSkill
- create-appSkill
- delete-appSkill
- deploySkill
- devSkill
- list-appsSkill
- list-connectorsSkill
- playSkill
- share-linkSkill
- shareSkill
- stateSkill
- add-data-sourceSkill
- setup-codeflowSkill
- add-data-sourceSkill
- setup-codeflowSkill
- add-data-sourceSkill
- setup-learninghubSkill
- add-data-sourceSkill
- setup-learninghubSkill
- add-data-sourceSkill
- setup-taskmanagerSkill
- add-data-sourceSkill
- setup-taskmanagerSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
19 rules. About 0 are common, 5 are distinctive, and 14 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
14
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 36
Create the file in shared/ (e.g., new-policy.md).
- Very specific: line 37
Add a section to shared/shared-instructions.md referencing it.
- Very specific: line 38
No changes needed to individual SKILL.md files — they already link to shared-instructions.md.
- Distinctive: line 85
All Rayfin work requires the Rayfin feature gate.
- Very specific: line 124
Use only Agent Skills frontmatter fields.
- Very specific: line 125
Keep one skill set for all clients.
- Distinctive: line 137
After modifying this plugin:
- Very specific: line 139
Update the canonical plugin.json at this plugin's root, including its version.
- Very specific: line 141
Update the matching version and description in the repo-root .claude-plugin/marketplace.json.
- Very specific: line 142
Keep the repo-root .agents/plugins/marketplace.json entry pointed at this same plugin directory.
- Very specific: line 143
Run node scripts/validate-plugin-compatibility.mjs from the repository root.
- Distinctive: line 149
Follow the client test matrix in README.md before claiming runtime compatibility.
- Very specific: line 150
Verify any new allowed-tools entries are minimal — request only what the skill needs.
- Very specific: line 152
Keep agents/microsoft-apps-architect.md as the source for the architect.
- Very specific: line 157
Keep executable hooks in hooks/.
- Very specific: line 162
Only the native Copilot entry point passes --github-copilot / -GitHubCopilot to report MS_PLUGIN_REPORT_AGENT=github-copilot.
- Very specific: line 164
Keep the agent report independent of MS_CLI_ORIGIN=plugin and user-provided origin overrides.
- Distinctive: line 165
Keep both hook payload contracts when editing a script.
- Distinctive: line 172
Add future PR checks as separate jobs in this workflow.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.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.
Files
Copilot Managed Runtime Plugin — Development Guidelines
This file provides instructions for assistants working on the Copilot Managed Runtime plugin itself (not for end-users of the plugin).
Overview
The Copilot Managed Runtime plugin wraps @microsoft/cmr-cli (binary ms) to scaffold, develop, and ship apps on Copilot Managed Runtime end-to-end. It provides skills for:
- Creating a new app (
/create-app) — global install of the CLI, scaffold, local dev loop. - Iterating locally (
/dev) —ms app dev, hot reload against the App Player. - Lifecycle ops (
/deploy,/share,/delete-app,/list-apps). - Defining an app backend database (
/add-backend) — entities and a typed runtime client. - Binding data sources (
/add-dataverse,/add-sharepoint, etc.) — generates typed TypeScript services undersrc/.
Memory Bank System
This plugin uses a memory bank (memory-bank.md) to persist state across sessions.
- Location:
<PROJECT_ROOT>/memory-bank.md(in the user's project, not the plugin). - Instructions: See
shared/memory-bank.mdfor the full schema. - Skills read the memory bank at start and update it after major steps. The schema records the environment id the CLI resolved for reference only (e.g. reconstructing the App Player URL); it is not used to re-target
ms app create, which resolves an environment automatically each run.
Shared Resources
| File | Purpose |
shared/shared-instructions.md | Meta file aggregating all cross-cutting concerns — every skill links to it. |
shared/planning-policy.md | When to enter plan mode and what to include in the plan. |
shared/memory-bank.md | Memory bank schema + read/update protocol. |
shared/development-standards.md | Theme, CLI install pattern, build rules, TypeScript strict mode. |
shared/allowed-actions.md | allowedActions authoring for shared connection references — required before pack/deploy. |
shared/version-check.md | Daily plugin-version check against the marketplace. |
Adding new shared instructions
- Create the file in
shared/(e.g.,new-policy.md). - Add a section to
shared/shared-instructions.mdreferencing it. - No changes needed to individual SKILL.md files — they already link to
shared-instructions.md.
Skills
Stage 1: scaffold
| Skill | What it does |
/create-app | Installs the CLI globally, scaffolds, ends on ms app dev. |
Stage 2: lifecycle
| Skill | Wraps |
/dev | ms app dev (local App Player, hot reload). |
/deploy | ms app deploy (default) plus optional ms app build / ms app build-status traceability flow. |
/play | ms app play — open live or preview URL in browser. |
/share | ms app share / unshare. |
/share-link | ms app share link create / list / revoke. |
/delete-app | ms app delete (idempotent). |
/list-apps | ms app list / ms app show. |
Stage 3: data sources
| Skill | What it adds |
/state | Built-in app state schema via ms project state and generated TypeScript services. |
/add-dataverse | Dataverse tables (typed services). |
/add-sharepoint | SharePoint Online lists/documents. |
/add-excel | Excel Online (Business) workbooks. |
/add-office365 | Office 365 Outlook (calendar, email). |
/add-office365-users | Office 365 Users (profiles, org relationships, profile photos). |
/add-teams | Teams messaging. |
/add-onedrive | OneDrive for Business files. |
/add-azuredevops | Azure DevOps work items / pipelines. |
/add-mcscopilot | Microsoft Copilot Studio agents. |
/add-workiq | Work IQ Copilot MCP for Microsoft 365 knowledge-grounded search/chat. |
/add-data-source | Generic fallback for any other connector. |
/list-connectors | Enumerate connectors / bound data sources for discovery. |
App backend database
Setup: /add-backend scaffolds backend configuration and code with ms app add backend --provider rayfin; scaffolding does not provision the database. Its local references use the installed SDK docs for API guidance.
Select it only for an explicit app backend database request (including
/add-backend or Rayfin).
All Rayfin work requires the Rayfin feature gate.
| Reference | Purpose |
| Data modeling | Write entities and the typed runtime client using installed SDK docs. |
| CRUD UI | Write database-backed lists, forms and CRUD operations; check UI behavior and persistence. |
Workflow
/create-app
└── /dev (default loop)
└── /add-backend (when explicitly requested)
└── /add-data-source (or a specific connector skill)
└── /deploy (explicit, requires confirmation)
└── /share, /delete-app (explicit, require confirmation)Skill structure
skills/<skill-name>/
├── SKILL.md # Workflow
└── references/ # Optional deep-dive docs
└── <topic>-reference.mdSkill header
---
name: kebab-case-name
description: Short, action-oriented sentence the model uses for retrieval. Mention `ms` CLI verbs explicitly.
allowed-tools: Read Edit Write Grep Glob Bash AskUserQuestion
---
**📋 Shared Instructions: [shared-instructions.md](../../shared/shared-instructions.md)** — Cross-cutting concerns.Use only Agent Skills frontmatter fields.
Keep one skill set for all clients. Do not add model or user-invocable.
Skills inherit the client's selected model. Claude's default keeps skills user-invocable.
Resolve resource links relative to the containing Markdown file, not the user's project.
Agent
| Agent | Purpose |
microsoft-apps-architect | Architecture advisor for connector selection, codegen patterns, deploy. |
Testing changes
After modifying this plugin:
- Update the canonical
plugin.jsonat this plugin's root, including its version. - Copy its metadata to
.claude-plugin/plugin.json, excluding only$schema. Keep both files as regular JSON files, never symlinks. - Update the matching version and description in the repo-root
.claude-plugin/marketplace.json. Preserve its marketplace name, plugin name, and source path. - Keep the repo-root
.agents/plugins/marketplace.jsonentry pointed at this same plugin directory. - Run
node scripts/validate-plugin-compatibility.mjsfrom the repository root. - Run
node --test scripts/validate-plugin-compatibility.test.mjsfrom the repository root. - Install validation dependencies with
python -m pip install -r scripts/requirements-plugin-validation.txtin a virtual environment. - Run
python scripts/validate_plugin_skills.py. - Run
python -m unittest discover -s scripts -p "*_test.py". - Run
node --test scripts/plugin-hooks.test.mjs. - Follow the client test matrix in README.md before claiming runtime compatibility.
- Verify any new
allowed-toolsentries are minimal — request only what the skill needs.
Keep agents/microsoft-apps-architect.md as the source for the architect.
Copy it to com.github.copilot/agents/microsoft-apps-architect.agent.md after each edit.
Change its ../shared/ links to ../../shared/ and ../skills/ links to ../../skills/ in the copy.
The validator rejects any other difference.
Keep executable hooks in hooks/. Do not copy their scripts.
Claude and legacy Copilot discover hooks/hooks.json.
Agent Plugins Copilot discovers com.github.copilot/hooks/hooks.json.
The latter uses native Copilot events, ${PLUGIN_ROOT}, and the same scripts.
Validation checks both configurations for equivalent scripts, matchers, and timeouts.
Only the native Copilot entry point passes --github-copilot / -GitHubCopilot to report MS_PLUGIN_REPORT_AGENT=github-copilot.
Shared hooks must remove inherited reports. Do not detect the host from environment markers or shell type.
Keep the agent report independent of MS_CLI_ORIGIN=plugin and user-provided origin overrides.
Keep both hook payload contracts when editing a script.
The canonical manifest follows Agent Plugins 1.0.0.
That version requires root plugin.json, not the older .plugin/plugin.json layout.
The generic PR pipeline workflow in .github/workflows/pr.yml contains one job: plugin compatibility.
This job checks manifests, component compatibility, resource links, skill validity, and hooks on Windows and Ubuntu.
The Python dependency is the Agent Skills reference validator, pinned to a Git commit.
Add future PR checks as separate jobs in this workflow.
Client installation, updates, shared-resource resolution, and hook behavior still need host-level checks before claiming support for a new client.
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
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.

