agentleFS
MicrosoftKnown publishermicrosoft/Copilot-Managed-Runtime/plugins/copilot-managed-runtime/skills/init-app/SKILL.md

init-app

Skill16 starsChanged 27 days agoMITView on GitHub

Initializes an existing app on Copilot Managed Runtime using `ms app init` and native Git. Use when bringing existing code, a cloned sample or an exported app to the platform, including first-time deployment when ms.config.json is missing.

  • Installs packages

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. About 0 are common, 4 are distinctive, and 11 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 11

    Very specific

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

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

    Check for memory-bank.md per shared-instructions.md.

    line 32
  2. Very specific:

    Use the known project path or discover the existing app root.

    line 33
  3. Very specific:

    Use /create-app only when the user wants a new app from a template.

    line 36
  4. Very specific:

    Run prerequisite checks first, following the shared prerequisites reference.

    line 40
  5. Very specific:

    If Node or Git is missing or unsupported, report the requirement and STOP.

    line 50
  6. Very specific:

    If ms is missing, ask before installing npm install -g @microsoft/cmr-cli@latest, then re-probe it.

    line 51
  7. Distinctive:

    Follow the planning policy.

    line 76
  8. Distinctive:

    If native onboarding is not approved, clarify rather than choosing another mode.

    line 87
  9. Very specific:

    Use auth status as the source of truth.

    line 95
  10. Distinctive:

    Ask before switching a signed-in account.

    line 96
  11. Very specific:

    Run ms app init with no environment flags and let the CLI resolve the environment automatically.

    line 100
  12. Very specific:

    Read ms.config.json back and verify app/environment IDs, repoType: "native", repository ID and build/dev settings.

    line 119
  13. Distinctive:

    If registration succeeded but local setup failed, keep the app/config and repair only that setup using the returned native remote.

    line 124
  14. Very specific:

    Use matching /add-* skills for required data sources and /add-backend only when explicitly requested.

    line 138
  15. Very specific:

    Create/update memory-bank.md per the shared template.

    line 164

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

📋 Shared Instructions: shared-instructions.md — Cross-cutting concerns.

References:

  • prerequisites-reference.md — Node, Git and CLI installation.
  • troubleshooting.md — First-run Git Credential Manager recovery.

Initialize a Microsoft App

Package baseline: this workflow targets @microsoft/cmr-cli 1.0.0 and the CMR 1.0.0 app package baseline. Backend apps also require @microsoft/cmr-apps 1.0.0 or later. See CMR package baseline; verify installed versions before continuing if registry tags lag behind the release. This is the package baseline, not the version that introduced init.

This skill registers an existing web app without scaffolding over its source. The default outcome is a running local dev server, not a deployed cloud app. Deploying is a separate, explicit user choice via /deploy.

Workflow

  1. Memory Bank → 2. Prerequisites → 3. Inspect App → 4. Plan → 5. Auth → 6. Environment → 7. Initialize → 8. Verify Integration → 9. Local Dev → 10. Summary → 11. Memory Bank Update

Step 1: Check Memory Bank

Check for memory-bank.md per shared-instructions.md. Use the known project path or discover the existing app root. If CMR configuration already exists, resume /dev or /deploy as requested; do not delete configuration or rerun init. Inspect unfamiliar config layouts before creating another registration. Use /create-app only when the user wants a new app from a template.

Step 2: Validate Prerequisites

Run prerequisite checks first, following the shared prerequisites reference. Node.js 24.11.0+, Git 2.27.0+ and Git Credential Manager are required.

node --version
git --version
ms --version

If Node or Git is missing or unsupported, report the requirement and STOP. If ms is missing, ask before installing npm install -g @microsoft/cmr-cli@latest, then re-probe it. Otherwise run the shared CLI freshness gate; reuse a calling skill's outcome rather than checking or prompting again. Let the CLI's native-flow preflight validate GCM installation and configured helpers: it supports both manager and manager-core. Do not reject an installation based on a single git credential-manager --version probe.

Step 3: Inspect the App

Infer the display name from existing source, package.json, lockfiles and framework configuration. Preserve the UI, scripts, package manager and business logic. Inspect Git root, branch, status and remotes, including hidden entries. Ask only when the app root remains ambiguous or progress requires information that cannot be discovered or safely inferred. For an app inside a parent repository or linked worktree, agree on a standalone copy before init rather than nesting repositories or changing shared remotes.

Confirm the app produces browser-hostable assets. SSR/server-dependent apps need an agreed adaptation; init does not convert them. For Power Apps or another platform's SDK/configuration, identify the necessary migration and connector bindings instead of assuming registration migrates them.

Step 4: Plan

Follow the planning policy. Present one plan: existing app root/name, native Git setup, necessary integration changes, build verification and local dev. Use the CLI's build/local defaults unless the existing app needs an override; do not ask for optional settings separately. Include a /deploy handoff only if requested. Do not redesign the app.

Native platform-managed Git is the recommended path. When no origin is detected, plain ms app init selects native. With an existing origin, omission follows remote detection and accepts that remote in non-interactive mode. Obtain approval to preserve the old remote under an unused name and use --repo native for this native-rebinding case. Never discard an existing URL or change branches silently. If native onboarding is not approved, clarify rather than choosing another mode.

Step 5: Auth

ms auth status

Use auth status as the source of truth. If signed out, run ms auth login. Ask before switching a signed-in account; otherwise continue.

Step 6: Environment

Run ms app init with no environment flags and let the CLI resolve the environment automatically. Pass --environment-id <id> only when explicitly provided by the user; never infer one from a memory bank or another app. Surface routing errors rather than attempting an environment workaround.

Step 7: Initialize

From the existing app root, run with the display name, quoted for the active shell. Do not create a child/sibling template or substitute ms app create.

ms app init --display-name "<name>" --non-interactive

For approved native rebinding, first preserve the old remote as agreed and append --repo native. Otherwise omit --repo when no origin is detected. Let the CLI supply build/local defaults. Add optional build/local overrides only when requested or needed for the existing app, not to fill every available flag.

Read ms.config.json back and verify app/environment IDs, repoType: "native", repository ID and build/dev settings. Verify actual Git root, branch, origin and preserved source remote: init can warn about Git setup failure after creating the app. Preserve its automatic CLI pin in package.json.

If registration succeeded but local setup failed, keep the app/config and repair only that setup using the returned native remote. Do not rerun init or create a duplicate app. For first-run Git authentication failure, use git fetch origin per the shared troubleshooting reference, then retry the failed Git operation. Record the app identity and setup results in the memory bank.

Step 8: Verify Integration

Init does not rewrite SDK imports, configure Vite, add connectors or migrate connection references. Make only the approved compatibility changes. For Vite runtime integration, follow installed @microsoft/cmr-apps-vite-plugin docs and use copilotManagedRuntime() alongside existing plugins; do not force a framework rewrite. Add the SDK only when app features require it.

Use matching /add-* skills for required data sources and /add-backend only when explicitly requested. Forward approved identifiers, project root and CLI freshness outcome. Preserve migrated bindings, resolve shared-connection policies before cloud preview/deploy, and complete backend startup prerequisites.

Step 9: Build and Start Local Dev

Restore dependencies with the existing package manager after init's manifest change. Run the existing build and verify the configured output/HTML entry point; fix or report failures before starting local dev.

Invoke /dev with the app root and CLI freshness outcome; verify the existing app loads and required interactions work. If called from /dev, return that context so the caller starts it once. If called from /deploy, return after verification instead of invoking deploy recursively.

Step 10: Summary

Report app name/GUID, project path, verified local App Player URL and blockers. State that nothing has been deployed to the cloud. Follow the shared Ready-to-Ship Gate when the user signals readiness, or resume /deploy for an explicit deployment request, retaining its confirmation. Do not claim completion while Git setup, build or runtime verification is blocked.

Step 11: Update Memory Bank

Create/update memory-bank.md per the shared template. Record app identity, CLI-resolved environment, native and preserved source remotes, branch, build/dev settings, integration changes and actual verification results.

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.