setup-codeflow
Skill4 starsChanged 8 days agoMITView on GitHub
Sets up a fresh copy of the CodeFlow sample so it runs as an app hosted on Copilot Managed Runtime — copies the sample into its own folder, signs in with the ms CLI, creates the app and its platform-managed git repository (which writes ms.config.json), applies its settings, adds the GitHub connector, configures .env.local, starts local development, and commits and pushes to the app's repository. Use when someone has just cloned CodeFlow, or when `npm run dev` / `npm run build` stops at "CodeFlow setup is incomplete".
- Reads credentials
- Commits and pushes
In this repository38 other files it gives its agents.
- github-actions/AGENTS.mdAGENTS.md
- plugins/copilot-managed-runtime/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
- 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
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 1 is distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 30
Check the installed CLI before using any command below, because flags change between versions:
- Very specific: line 53
Don't pass --repo: with no git repository in the folder, init creates the app's platform-managed git repository and sets it up as origin.
- Very specific: line 79
If the CLI reports actions "skipped due to your organization's connector policy", continue: npm run check-setup (Step 6) reports any …
- Very specific: line 82
No other connectors are needed.
- Very specific: line 88
If the generated service or method names differ from what src/connectors/github.ts expects, adapt only that file (it is the single module …
- Very specific: line 98
All values are optional. Leave VITE_GITHUB_HOST at https://github.com: the public GitHub connector this app uses talks to github.com.
- Very specific: line 113
Commit everything (including ms.config.json, generated/ and .ms/) and push to the app's repository.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
Set up CodeFlow
CodeFlow ships without ms.config.json, without connector code and without any
environment identifiers. This skill creates them for the user's own environment. Run every
command from the sample folder (the one that contains package.json).
The app gets its own platform-managed git repository. Commit ms.config.json, generated/ and
.ms/ to it with the rest of the app; only .env.local stays local (it is gitignored).
Background: Quickstart https://go.microsoft.com/fwlink/?LinkId=2368962 and documentation https://go.microsoft.com/fwlink/?LinkId=2372842 for Copilot Managed Runtime (public preview).
Prerequisites
- Node.js 24.11 or later, npm and git.
- Access to a Power Platform environment where the user can create apps on Copilot Managed Runtime.
- A GitHub account the app will act as (the GitHub connector signs in with it).
- The sample must be in its own folder, not inside a clone of the samples repository: that
folder becomes the app's repository. If
git rev-parse --show-toplevelsucceeds in the sample folder, copy the folder out first (for examplecp -r Copilot-Managed-Runtime/samples/CodeFlow my-codeflow; PowerShell:Copy-Item -Recurse) and continue from the copy. - Install dependencies once:
npm install.
Check the installed CLI before using any command below, because flags change between versions:
npx ms --help
npx ms app init --help
npx ms app add data-source --helpStep 1: Sign in
npx ms auth loginnpx ms auth status shows cached accounts. Ask the user which environment to use if they have
more than one, and note its environment id.
Step 2: Create the app
npx ms app init --display-name "CodeFlow" --icon-path ./public/codeflow-logo.pngDon't pass --repo: with no git repository in the folder, init creates the app's
platform-managed git repository and sets it up as origin. Add --environment-id <id> to pick
the environment without a prompt. Leave --build-path (./dist) and --build-command
(npm run build) at their defaults.
This writes ms.config.json. Confirm it contains an appId, an environmentId and
"repoType": "native" (npx ms app info shows the app).
Step 3: Apply app settings
CodeFlow draws its own header, so hide the host header:
npx ms app set-setting --show-header falseStep 4: Add the GitHub connector (always required)
CodeFlow reads and writes pull requests only through the public GitHub connector
(shared_github). Add it as an action data source; the CLI prompts for (or creates) a GitHub
connection and generates generated/:
npx ms app add data-source --connector shared_github --as actionIf the CLI reports actions "skipped due to your organization's connector policy", continue:
npm run check-setup (Step 6) reports any operation CodeFlow needs that is missing.
No other connectors are needed. The app uses exactly these GitHub connector operations (least
privilege — do not add others): GetUser, GetPullRequest, GetPullRequests,
MergePullRequest, SearchIssues, CompareRepositoryCommits, ListCollaborators,
checkCollaborator, CreateReference, CreatePullRequest and SearchGithubWithQuery
(GraphQL queries and mutations for comments, reviews, files, branches and cherry-pick commits).
If the generated service or method names differ from what src/connectors/github.ts expects,
adapt only that file (it is the single module that imports generated/), then run
npm run typecheck.
Step 5: Local configuration
cp .env.example .env.localAll values are optional. Leave VITE_GITHUB_HOST at https://github.com: the public GitHub
connector this app uses talks to github.com. Set VITE_APP_URL to the deployed app URL (from
npx ms app play) once the app is deployed, so shared deep links point at it.
Step 6: Verify and run
npm run check-setup # must print "CodeFlow setup looks complete."
npm run typecheck
npm test
npm run dev # or: npx ms app dev — open the "Local Play" URL it printsStep 7: Commit and push
Commit everything (including ms.config.json, generated/ and .ms/) and push to the app's
repository. Git asks the user to sign in the first time.
git fetch origin
git reset origin/main # start from the new repository's initial commit; your files stay as they are
git branch -M main
git add -A
git commit -m "Set up CodeFlow"
git push -u origin mainDeploy only when the user asks, from a pushed commit: npm run build, then npx ms app deploy.
Storage
By default CodeFlow keeps its own data (seen marks, review notes, app-only approvals,
notes/feedback, settings) in the browser (VITE_STORAGE_PROVIDER=local), and shows
"Local mode: data stays in this browser". Nothing else is needed for local mode.
To share that data between people or devices (SharePoint lists, Dataverse, your own API), follow
.github/skills/add-data-source/SKILL.md. Users can move existing data with
Settings → Data → Export / Import.
Done checklist
- Sample in its own folder;
ms.config.jsoncreated bynpx ms app init(no--repo), withappId,environmentIdand"repoType": "native" - Host header hidden (
npx ms app set-setting --show-header false) - GitHub connector added;
npm run check-setuppasses .env.localcreated (optional values reviewed)npm run typecheckandnpm testpassnpm run devopens the app and the dashboard loads pull requests- Everything committed and pushed to
origin
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.

