From react-ai-infra
Deploys cross-platform agent assets into an already-created React project. ACTIVATE when a React/Next.js/TanStack Start/Vite repo (existing or freshly bootstrapped by its own CLI) needs APM-managed dependencies, bundled skills/rules, and a framework-specific AGENTS.md wired in for Claude Code, GitHub Copilot, and the cross-client `.agents/skills/` bus. Asks which React framework is in use, generates apm.yml at the project root, runs `apm install`, and writes assets to .claude/skills/, .agents/skills/, .claude/rules/, .github/instructions/, and the project root. Does NOT create the React app itself.
How this skill is triggered — by the user, by Claude, or both
Slash command
/react-ai-infra:react-ai-infraThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
A meta-skill that wires [APM](https://github.com/microsoft/apm) (Agent Package Manager) and the team's curated React skill set into an existing React project across Claude Code and GitHub Copilot.
A meta-skill that wires APM (Agent Package Manager) and the team's curated React skill set into an existing React project across Claude Code and GitHub Copilot.
This skill does not scaffold the React project itself — the user is expected to have already run create-next-app, create-tsrouter-app, npm create vite, or equivalent. What this skill owns is the agent-asset layer: apm.yml, bundled skills and rules, and the framework-specific AGENTS.md.
| Step | Action | Tool |
|---|---|---|
| 0 | Verify apm CLI is installed; abort with install instructions if not | Shell |
| 1 | Detect target environments at the project root | Glob / Shell |
| 2 | Ask which React framework is in use (Next.js / TanStack Start / Vite + React) | Prompt |
| 3 | Generate (or merge) apm.yml at project root from templates/apm.yml | Read / Write |
| 4 | Run apm install --target <list> (with user confirmation) | Shell |
| 5 | Copy bundled skills to .claude/skills/ and .agents/skills/ | Read / Write |
| 6 | Copy bundled rules to .claude/rules/ and (with frontmatter transform) .github/instructions/<name>.instructions.md | Read / Write |
| 7 | Deploy framework-specific AGENTS.md to project root (Next.js only currently — others skip cleanly) | Read / Write |
| 8 | Verify deployment and report | Glob / Shell |
react-best-practices) into a project.create-next-app / create-tsrouter-app / npm create vite first, then come back.apm install <pkg> directly.package.json lives — this skill does not create it).apm CLI installed and on PATH (verified in Step 0).apm is installedBefore any other step, run apm --version (or apm targets) via whichever shell has apm on PATH. On Windows the installer typically registers apm only for PowerShell, so Git Bash / WSL-style shells may report command not found even when apm is installed — fall back to PowerShell before declaring it missing. If the command is not found in any available shell OR returns a non-zero exit code, stop immediately and print this message to the user verbatim:
APM (Agent Package Manager) is not installed or not on PATH.
Install it first:
Windows (PowerShell): irm https://aka.ms/apm-windows | iex
macOS / Linux: curl -sSL https://aka.ms/apm-unix | sh
Homebrew: brew install microsoft/apm/apm
pip: pip install apm-cli
After installing, re-run this skill.
Docs: https://github.com/microsoft/apm
Do not generate apm.yml, do not copy bundled assets — exit cleanly so the user can install APM and retry.
Inspect the project root for these markers:
| Marker | Target |
|---|---|
.claude/ directory or CLAUDE.md | claude |
.github/ directory or .github/copilot-instructions.md | copilot |
.agents/skills/ | cross-client skill bus (always included alongside other targets) |
If neither .claude/ nor .github/ exists, ask the user which targets to scaffold (default: both). Record the chosen target list — it drives apm install --target and the local-copy steps.
Extending targets later. The detected list is committed to
apm.ymlin Step 3, and Step 3's merge rule keeps an existingtargets:block untouched (seereferences/install-workflow.md§ 3b). If the user later adds.github/to a Claude-only setup and re-runs the skill, the new target will NOT be added automatically — they must manually edittargets:inapm.ymland re-runapm install. This is intentional conservative behavior; the union-on-extend variant is tracked separately.
Prompt the user to pick exactly one framework:
Which React framework is this project using?
1) Next.js (slug: nextjs)
2) TanStack Start (slug: tanstack-start)
3) Vite + React (slug: vite-react)
Record the chosen slug as <framework>. Step 7 is the only consumer — apm.yml and the bundled skills/rules in Steps 3–6 are framework-agnostic for now. The slug also decides whether Step 7 deploys anything at all: only nextjs ships an AGENTS.md template; the other two skip Step 7 with a logged notice (see references/agents-md-deployment.md).
Do NOT auto-detect. The user is the source of truth — a repo may have leftover config from a previous framework, or be mid-migration.
Non-interactive runs (e.g. CI without a TTY): fail fast with react-ai-infra requires a framework choice (nextjs / tanstack-start / vite-react). Re-run in an interactive session or pass the framework explicitly. Do not guess and do not proceed past this step.
apm.yml<project-root>/apm.yml does not exist:
templates/apm.yml (relative to this skill).package.json name, or fall back to the directory basename. Strip any @scope/ prefix (@org/foo → foo) and replace whitespace with -.<project-name> with the resolved value.targets: field (plural, block-style list) to the detected target list. The list MUST always include agent-skills alongside any per-client targets. Do NOT use the singular target: or inline-array form [a, b] — current APM CLI versions reject both.<project-root>/apm.yml exists:
dependencies.apm and dependencies.mcp (deduplicate by canonical string).See references/apm-yml-template.md for schema details.
apm installBuild the command:
apm install --target <comma-separated-targets>
Example: apm install --target claude,copilot,agent-skills
apm on PATH (see Step 0 — usually PowerShell on Windows, Bash on macOS/Linux/WSL).Side effects to expect:
apm installwrites installed packages toapm_modules/at the project root, and recent APM versions auto-appendapm_modules/to.gitignore(creating one if missing). Surface this in the Step 8 report so the user is not surprised by the new ignore entry.
Heads-up for Step 7: when the
copilottarget is active,apm installmay itself emit anAGENTS.mdat the project root. Before running this command, recordagents_md_existed_pre_apm = file_exists(<project-root>/AGENTS.md)so Step 7 can distinguish "APM just wrote this" from "the user had it before we got here." Seereferences/agents-md-deployment.mdfor why this matters.
For each subdirectory <name> under <this-skill>/skills/:
<project-root>/.agents/skills/<name>/ (cross-client target).claude target is active, also copy to <project-root>/.claude/skills/<name>/.Skills are copied verbatim — no frontmatter transformation needed (Claude Code and Copilot both consume SKILL.md with the same frontmatter shape).
For each <name>.md under <this-skill>/rules/:
claude selected): copy verbatim to <project-root>/.claude/rules/<name>.md. Source paths: frontmatter is kept as-is.copilot selected): transform frontmatter and write to <project-root>/.github/instructions/<name>.instructions.md.
paths: ["src/**/*.{tsx,jsx}"] becomes applyTo: "src/**/*.tsx,src/**/*.jsx"references/frontmatter-transform.md for the full algorithm and edge cases.Create destination directories if they do not exist.
AGENTS.mdSource: <this-skill>/templates/agents/<framework>.md. Destination: <project-root>/AGENTS.md.
Step 7 is specified in references/agents-md-deployment.md.
nextjs), skip cleanly with a logged notice. Not an error.agents_md_existed_pre_apm captured in Step 4), and report strings.apm install exit status.<project-root>/apm_modules/ was created or updated by apm install (Step 4 side effect).<project-root>/.gitignore was created or updated by apm install (specifically whether apm_modules/ was appended).apm.yml (Step 3) or AGENTS.md (Step 7)./reload-plugins; Copilot: restart VS Code) so new skills are picked up.Targets detected: claude, copilot, agent-skills
Framework: nextjs
apm.yml: created (or: merged — added 1 dependency)
apm install: success
Side effects:
- apm_modules/: created
- .gitignore: updated (appended `apm_modules/`)
# both come from `apm install` itself; omit a line if the corresponding
# path was unchanged on this run.
Deployed skills:
- .claude/skills/no-use-effect/SKILL.md
- .agents/skills/no-use-effect/SKILL.md
Deployed rules:
- .claude/rules/react-components.md
- .github/instructions/react-components.instructions.md (frontmatter: paths -> applyTo)
AGENTS.md:
- <one of the report strings from references/agents-md-deployment.md>
# e.g. "AGENTS.md: created (template nextjs.md)"
# or "AGENTS.md: appended managed block below APM-generated content"
# or "No AGENTS.md template for vite-react yet — skipped"
Next steps:
- Reload your agent so it picks up the new skills/rules.
| Open when... | Read |
|---|---|
| Need step-by-step install commands or target detection details | references/install-workflow.md |
| Implementing Step 7 — full branch table, APM coexistence, marker logic, AGENTS.md failure modes | references/agents-md-deployment.md |
Transforming paths: frontmatter to Copilot applyTo: | references/frontmatter-transform.md |
| Mapping source files to destination paths across targets | references/path-mapping.md |
Customizing the generated apm.yml (extra deps, MCP servers, scripts) | references/apm-yml-template.md |
| Path | Purpose |
|---|---|
templates/apm.yml | Source manifest copied to project root and customized |
templates/agents/nextjs.md | Next.js AGENTS.md template (verbatim from the official guide) |
skills/no-use-effect/SKILL.md | Bundled skill: ban useEffect, prescribe replacement patterns |
rules/react-components.md | Bundled rule: scoped to src/**/*.{tsx,jsx} files |
To add a new bundled skill: drop it under skills/<name>/. To add a new rule: drop it under rules/<name>.md with paths: frontmatter. To add an AGENTS.md template for another framework: drop it under templates/agents/<framework-slug>.md wrapped in <!-- BEGIN:<framework-slug>-agent-rules --> / <!-- END:<framework-slug>-agent-rules --> markers, then update the framework → template table in references/agents-md-deployment.md. All three are picked up automatically by Steps 5 / 6 / 7.
Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
npx claudepluginhub gn00678465/meta-skills --plugin react-ai-infra