skills/mp-setup-react-native/SKILL.md
Create a React + React Native monorepo from template with GitHub repo, branch protection, and CI. Use when: "setup React Native project", "new mobile project", "create React Native monorepo"
npx skillsauth add MartinoPolo/mpx-claude-code mp-setup-react-nativeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Create a React + React Native monorepo from template, configure GitHub repo with branch protection and CI. $ARGUMENTS
If $ARGUMENTS does not contain a project name, ask the user for:
gh repo create <project-name> --template <github-user>/template-react-native-monorepo --public|--private --clone
Detect the authenticated GitHub user:
gh api user --jq .login
If the template repo template-react-native-monorepo does not exist under the user's account, inform the user:
Template repo
<user>/template-react-native-monoreponot found. Create it first, then re-run this skill.
Stop execution if template is missing.
git -C <project-path> checkout -b dev
git -C <project-path> push -u origin dev
gh repo edit <owner/project-name> --default-branch dev
Apply protection rules to both main and dev branches.
For each branch:
gh api repos/<owner>/<project-name>/branches/<branch>/protection \
--method PUT \
--input - <<'EOF'
{
"required_status_checks": {
"strict": true,
"contexts": ["ci"]
},
"enforce_admins": false,
"required_pull_request_reviews": {
"required_approving_review_count": 0
},
"restrictions": null
}
EOF
Protection rules:
pnpm --dir <project-path> install
pnpm --dir <project-path> --filter web run check:all
pnpm --dir <project-path> --filter shared run check:all
If checks fail, report errors but do NOT abort. Continue to next steps.
Create .mpx/CONTEXT.md and .mpx/DECISIONS.md (see skills/shared/DOCUMENTATION_STRATEGY.md for format):
.mpx/CONTEXT.md:
# [Project Name] Context
## What This Is
[3-sentence project summary]
## Domain Language
[Terms added via `/mp-grill` or `/mp-vocabulary`]
## Core Features
[Feature index: name + status + PRD#]
## Key Constraints
[Settled facts about the system]
.mpx/DECISIONS.md:
# Decisions
Settled architectural and design decisions. Updated via `/mp-grill` and `/mp-harvest-decisions`.
Set up .claude/rules/ in the new project with the React rule file from the central mpx-claude-code repo. This gives Claude framework-specific guidance when editing .tsx/.jsx files.
Source: <mpx-claude-code-repo>/rules-per-project/react.md
Destination: <project-path>/.claude/rules/react.md
mkdir -p <project-path>/.claude/rules
Detect the OS and create the appropriate link:
Linux / macOS:
ln -s /path/to/mpx-claude-code/rules-per-project/react.md <project-path>/.claude/rules/react.md
Windows: Symlinks require Administrator privileges (or Developer Mode enabled). Claude Code must be running in an elevated Git Bash or elevated cmd.exe terminal.
WINDOWS-SETUP.md in the mpx-claude-code repo for full Windows symlink reference.ln -s does NOT create real Windows symlinks. Use cmd.exe:cmd.exe //c "mklink <project-path>\.claude\rules\react.md <mpx-claude-code-repo>\rules-per-project\react.md"
If the current terminal is not elevated, inform the user:
Cannot create symlink — Administrator privileges required. Run this command in an elevated Git Bash or cmd.exe (Run as Administrator):
mklink "<project-path>\.claude\rules\react.md" "<mpx-claude-code-repo>\rules-per-project\react.md"Alternatively, enable Windows Developer Mode to allow symlinks without admin.
Do NOT abort setup if symlinking fails — report the manual command and continue.
Check in order:
$HOME/.claude/rules/ exists and is a symlink → resolve its target to find the repo root/c/projects/mpx-claude-code, ~/mpx-claude-codeStage any new or modified files (e.g., lockfile, .mpx/):
git -C <project-path> add -A
git -C <project-path> commit -m "$(cat <<'EOF'
chore: initialize monorepo from template
EOF
)"
git -C <project-path> push -u origin dev
Display:
https://github.com/<user>/<project-name>)The template creates:
apps/
web/ # React + Vite Plus
mobile/ # Expo + React Native + Expo Router
api/ # Hono backend
packages/
shared/ # Types, hooks, API clients, Zod schemas
ui/ # Gluestack UI + NativeWind components
config/ # Shared ESLint, TSConfig
template-react-native-monorepo (user's GitHub account)git -C <path> instead of cd <path> && git| Problem | Action |
| ------------------------ | ----------------------------------------------- |
| Template repo not found | Inform user to create it first, stop execution |
| Repo creation fails | Report gh error and stop |
| Branch protection fails | Report error, continue with remaining steps |
| pnpm install fails | Report error, continue with remaining steps |
| Checks fail | Report errors, continue with remaining steps |
| Push fails | Report git error and remediation |
After completion, display:
development
Audit all active skills for consistency, convention drift, and common issues. Auto-fixes where possible, reports remaining issues. Use when: "audit skills", "skill audit", "check skills", "lint skills"
testing
Ship finished work: sync base, commit, push, PR, wait for CI green, merge. Use when: "ship it", "ship and merge", "ship this"
development
Scan recent Claude Code sessions for grilling/design discussions, extract decisions, and update CONTEXT.md + DECISIONS.md. Use when: "harvest decisions", "extract decisions from sessions", "update docs from sessions", "sync decisions"
tools
Consolidate CONTEXT.md: remove duplicates, outdated items, tighten language. Use when: "consolidate context", "clean up context", "simplify context", "consolidate requirements"