Globalize Mcp Project Setup
ASecuritySet up Globalize translation for a repository using only the Globalize MCP server's tools: publish a Workflow that translates a GitHub or gitlab.com repository's catalogs and start its first translation as a pull request. Use when the user asks to connect their repo to Globalize, set up a Globalize Workflow, or wire their translation catalogs to the Globalize platform, and the Globalize MCP server is connected. Driven by globalize-mcp-guide at the end of its run. Needs no CLI and no sign-in: ...
- 4 stars
- 0 votes
- 0 copies
- 1 view
- Added December 1, 2026
Works with
Security analysis
100/100Pro scans all 2 files and shows the line behind each finding
npx -y skills add globalize-now/globalize-skills --skill globalize-mcp-project-setup --agent claude-codeAre you the author of Globalize Mcp Project Setup?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/globalize-now-globalize-mcp-project-setup)---
name: globalize-mcp-project-setup
description: >-
Set up Globalize translation for a repository using only the Globalize MCP server's
tools: publish a Workflow that translates a GitHub or gitlab.com repository's catalogs
and start its first translation as a pull request. Use when the user asks to connect
their repo to Globalize, set up a Globalize Workflow, or wire their translation
catalogs to the Globalize platform, and the Globalize MCP server is connected. Driven
by globalize-mcp-guide at the end of its run. Needs no CLI and no sign-in: the MCP
connection is already authenticated.
metadata:
internal: "true"
---
# Globalize project setup (MCP)
This skill sets up a Globalize **Workflow** for a GitHub or `gitlab.com` repository: Globalize previews what it finds in the repository (catalog patterns, source and target languages), you confirm, it publishes the Workflow, and — in orchestrated mode — the skill starts the first translation, delivered as a pull request (a merge request on GitLab). The Workflow watches the repository's default branch. "Pull request" below means a merge request on GitLab.
**Every Globalize step is a Globalize MCP tool call** on the server that serves this skill: `list_github_installations`, `start_github_install`, `list_gitlab_connections`, `start_gitlab_connection`, `list_gitlab_repositories`, `list_repository_branches`, `preview_workflow_setup`, `set_up_workflow`, `get_workflow`, `list_workflow_runs`, `start_workflow_run`, `get_workflow_run`. Never install or run the Globalize CLI and never start a separate sign-in: the MCP connection is the credential. Local `git` reads the remote and branch; `gh` / `glab` are used only where Step 5 says, and only once the user confirms.
When you talk to the user, name Workflows, repositories and languages by their names and locales ("French (fr-FR)"); ids are for tool calls only.
---
## Choose the path
Read the remote first, before any Globalize call: the supplied inputs' `provider` / `owner` / `repo` in orchestrated mode, otherwise `git rev-parse --is-inside-work-tree` and `git remote get-url origin`.
| `origin` | Path |
|---|---|
| `github.com` | Steps 1–5, with Step 1's "GitHub" |
| `gitlab.com` | Steps 1–5, with Step 1's "GitLab" |
| None, or not a git repository | **No-remote stop** |
| Any other host (Bitbucket, self-hosted GitLab, …) | **Unsupported host stop** |
Extract `<OWNER>/<REPO>` from HTTPS (`https://github.com/OWNER/REPO.git`) or SSH (`git@github.com:OWNER/REPO.git`). On `gitlab.com` it is the project's whole path, nested groups included: `https://gitlab.com/GROUP/SUBGROUP/PROJECT.git` → `GROUP/SUBGROUP/PROJECT`.
**Stops** (no Globalize call; the local i18n setup stays exactly as it is). In orchestrated runs `globalize-mcp-guide` owns them (its §4.2) and calls this skill only with a GitHub or GitLab remote.
- **No remote**: "Globalize translates from a GitHub repository or a gitlab.com one, and this project has none. Your local i18n setup is done and kept." When `gh auth status` succeeds and this is a git repository with at least one commit, offer: "I can create a private GitHub repository **{directory name}** with `gh` and push `{current branch}` to it, then carry on setting up Globalize. Create it? (**yes** / **no**)". Run `gh repo create <name> --private --source=. --remote=origin --push` only once the user confirms, then continue with Step 1. **no**, or no signed-in `gh` → stop: "Once this project is on GitHub, run this skill again." **Headless**: never offer or run `gh`; stop with the message.
- **Not a git repository**: the same message and stop, without the `gh` offer.
- **Unsupported host**: "Globalize translates from a GitHub repository or a gitlab.com one, and this project's remote is on {host}. Your local i18n setup is done and kept." Stop.
---
## Inputs
**Orchestrated** — `.globalize/globalize-inputs.json` exists in the project root (written by `globalize-mcp-guide` §4.1), or the invoking prompt supplies the same fields. Treat its fields as authoritative, ask nothing it answers, and run unguided through Steps 1–5:
| Field | Used as |
|---|---|
| `provider`, `owner`, `repo` | which repository (`"owner/repo"`; on GitLab `owner` is the whole namespace, `"acme/platform"`) |
| `workflowName` | `name` |
| `sourceLocale`, `targetLocales` | `sourceLanguage`, `targetLanguages` |
| `patterns` | `patterns` — `[{ pattern, format, pathLocales? }]`, passed through unchanged |
| `import` | `import` |
| `firstTranslationBranch` | the branch Step 5 translates; `null` or absent → skip Step 5 |
An older inputs file is read the same way: `projectName` for `workflowName`, `importMode` for `import`, and `localePathPattern` + `fileFormat` as the one pattern (a `pathLocales` array of `{pattern, locale, pathLocale}` becomes the pattern's `{locale: pathLocale}` map); `importScope` is ignored.
**When `patterns` is absent or empty** (the caller connected a project's existing catalogs and could not resolve their pattern or format), leave `patterns` off the preview so Globalize detects the catalogs itself, and answer `no_confident_group` / `no_locale_patterns` as standalone mode does. The preview detects from the default branch only, so here `no_locale_files` does not mean the project has none: the catalogs may exist only on `firstTranslationBranch`. Don't stop with "Set up i18n first". Propose patterns from this working copy (`references/local-detection.md`), confirm them with the user, and preview again with `patterns`. Headless: stop and report it. Never set up a Workflow with a guessed pattern.
**Standalone** — no inputs file. Use the remote read above; leave `patterns`, languages and name unset: the preview detects the locale files on the default branch and answers what it could not find in `needs`. Uncommitted or unpushed changes (`git status --porcelain`, `git log @{u}..HEAD --oneline`) → warn that Globalize reads the remote only. Confirm the repository with the user before Step 2.
---
## Step 1 — Connect the repository
The one step that may need a browser approval, so it comes first.
### GitHub
1. `list_github_installations`. Pick the installation whose `accountLogin` equals `<OWNER>` (case-insensitive); its numeric `installationId` is what every later GitHub call takes.
2. None matches → `start_github_install`. **Browser step — pause in every mode:** show the returned URL and ask the user to open it, choose the `<OWNER>` account, approve the Globalize GitHub App with access to `<REPO>`, and say when it's done. Then `list_github_installations` again. Still no match → ask once more; then stop with "The Globalize GitHub App isn't installed on `<OWNER>` yet."
3. `list_repository_branches` with `installationId`, `owner`, `repo` — it proves the App can see the repository. Refused or not found → the installation lacks access: ask the user to add `<REPO>` to the App's repository access on GitHub, then check again. Unguided runs that can't get access stop here and say why in the summary.
### GitLab
Globalize reaches a `gitlab.com` repository through a person's **GitLab connection** (OAuth). Setup registers a webhook on the repository through it, which takes the **Maintainer** role (or Owner).
1. `list_gitlab_connections`. For each `active` one, `list_gitlab_repositories` with its `connectionId` and `search: "<REPO>"` (the last path segment). The entry whose `pathWithNamespace` equals `<OWNER>/<REPO>` (case-insensitive) is the repository: keep its numeric `id` and the `connectionId`. Several connections reach it → standalone asks which, naming each `username`; orchestrated takes the one whose `username` is the path's first segment, else the first.
2. No `active` connection reaches it → `start_gitlab_connection`. **Browser step — pause in every mode:** show the URL, ask the user to sign in to GitLab as a Maintainer of `<OWNER>/<REPO>`, authorize Globalize, and say when it's done. Then list again. The new connection can't see the repository either → that GitLab account isn't a member of it: ask for a Maintainer's account. Unguided runs that can't get access stop here and say why in the summary.
---
## Step 2 — Preview the Workflow
Call `preview_workflow_setup` with:
- GitHub: `installationId`, `repository: "<OWNER>/<REPO>"`. GitLab: `provider: "gitlab"`, `connectionId`, `repository` (the numeric id).
- Orchestrated: every value the inputs supply — `name`, `sourceLanguage`, `targetLanguages`, `patterns`, `import`. Standalone: only the repository, then the arguments that answer `needs`.
- **Never pass `branches`**: the Workflow watches the repository's default branch.
The preview writes nothing and starts nothing. Read the answer:
- **`alreadySetUp`** — a Workflow already holds this repository (an earlier run, or someone else's setup). Use it: skip Step 3, tell the user "Already set up as **{workflowName}**", and go to Step 4. This is how a rerun resumes.
- **Refused `REPOSITORY_HELD_BY_PROJECT`** — a Project (the older setup) already translates this repository; the refusal names it. Projects are deprecated, so this skill never continues on one. **Stop** in every mode, skipping Steps 3–5: "Project **{projectName}** already translates `<OWNER>/<REPO>`, so Globalize won't set up a Workflow for it. An organisation admin can move the Project to a Workflow in the Globalize web app; it keeps its translations. Run this again after that, and it picks up the Workflow."
- **`ready: false` with `needs`** — each need names its `code`, the argument that answers it, and what it `found`. Answer every need, then preview again with the answers added:
- `no_source_language`, `unsupported_source_language` → ask the user for the source language (`sourceLanguage`).
- `no_target_languages` → ask the user for the target languages (`targetLanguages`).
- `no_confident_group` → `found` lists the groups detection rated unlikely: offer each with its evidence and patterns, and pass the one the user picks as `patterns`.
- `no_locale_patterns` → `found` lists catalog files no pattern covers: propose patterns for them (`references/local-detection.md`), confirm with the user, pass `patterns`.
- `no_locale_files` → standalone: the repository has no catalogs yet. **Stop**: "Set up i18n first with the `globalize-mcp-guide` skill, push it, then run this again." (Orchestrated without `patterns`: see Inputs.)
Ask in every mode, unguided included — **never guess a language**. **Headless**: stop and report each need verbatim.
- **`ready: true`** — note its `definition`, `excludedGroups`, `warnings`, `takeovers` and `previewHash`. Standalone: show what it will set up (source and target languages, the file patterns, delivery by pull request, files left out as unlikely) and get a yes. Orchestrated: no question — the user approved the plan — unless `warnings` or `takeovers` is non-empty: then show them verbatim and ask before Step 3.
- **`namespaceClashes`** with a **`suggestedPattern`** → offer it in one question ("Globalize suggests `{suggestedPattern}` instead of `{pattern}` so each folder keeps its own namespace — use it?"). Apply it only on a yes, by previewing again with the changed `patterns`; never silently. Headless: keep the supplied patterns and report the suggestion.
- **Refused `GITHUB_RATE_LIMITED`** → wait `details.retryAfterSeconds`, then call again.
- GitLab: **`WORKFLOW_NO_GITLAB_CONNECTION`** → the connection needs authorising again: `start_gitlab_connection` as the same GitLab user renews it; then preview again. **`GITLAB_UNREACHABLE`** → preview once more; failing again → report it and stop.
- Any other refusal → show it verbatim and stop; orchestrated, report it in the summary.
## Step 3 — Set up the Workflow
Call `set_up_workflow` with **exactly the arguments of the preview that answered `ready: true`** plus its `previewHash`. It publishes the definition as version 1, creates a translation memory named after the Workflow, and starts no run. On GitLab it also registers the repository's webhook. Keep the returned Workflow id and name.
- **`WORKFLOW_PREVIEW_STALE`** → the repository changed since the preview. Re-read the fresh preview as in Step 2 (orchestrated: proceed when it is still `ready` with the same languages and patterns) and set up with its `previewHash`. Stale a second time → report it and stop.
- **`WORKFLOW_REPOSITORY_CLAIMED`** → another setup claimed the repository first. Preview again: it answers `alreadySetUp`, and that Workflow is the one to use.
- **`REPOSITORY_HELD_BY_PROJECT`** → as in Step 2.
- **`WORKFLOW_DEFINITION_INVALID` (`gitlab_hook_registration_failed`)** → GitLab refused the webhook: the connection's user isn't a Maintainer. Nothing was published. "Globalize needs a Maintainer's GitLab connection to watch `<OWNER>/<REPO>`. Give **{username}** the Maintainer role, or connect a Maintainer's account." Standalone: offer `start_gitlab_connection` now, then preview and set up again. Unguided: stop and say why in the summary.
---
## Step 4 — Before the first translation
Runs when the inputs carry a `firstTranslationBranch` and Step 2 or 3 gave a Workflow; otherwise skip Steps 4–5 and give the reason in the summary ("setup not pushed"). Standalone runs skip them too and name `start_workflow_run` under next steps.
1. **Look for a run first**, so a rerun spends no credits twice: `list_workflow_runs` with the Workflow id and `limit: 1`. A run exists → report it (its number and status, and its pull request once delivered) and start nothing.
2. **Find the primary branch**: the first watched branch of the Workflow definition (`input.config.branches[0]`) — the ready preview's `definition`, or after `alreadySetUp`, `currentVersion.definition` from `get_workflow`. It is the repository's default branch.
3. **Ask before spending credits** — a run spends Globalize credits, so it starts only when the user agrees, in every mode:
- `firstTranslationBranch` is the primary branch → "Ready to start the first translation of `{branch}` into {target languages}? It uses Globalize credits and arrives as a pull request. (**start** / **not now**)"
- another branch → see Step 5's second case; its question carries the same credit note.
**not now**, or headless with nobody to answer → skip Step 5: "Not started — waiting for your go-ahead."
## Step 5 — Start the first translation
- **`firstTranslationBranch` is the primary branch** → `start_workflow_run` with the Workflow id, plus `delivery: "pr"` on GitHub (GitLab takes neither `branch` nor `delivery`). It returns the run at once; call `get_workflow_run` once for its page in the Globalize app and report its number and status. Don't wait for it: a `completed` run has finished translating, and the pull request comes after delivery.
- **`firstTranslationBranch` is another branch** → the setup reaches the Workflow as a pull request into the primary branch: Globalize translates that pull request and adds the translations to it, so the user reviews the setup and its translations together.
- GitHub, `gh auth status` succeeds → check for an open pull request from that branch (`gh pr view <BRANCH> --json url,state,baseRefName,isDraft`). One exists → report it, and say Globalize translates it on its next push, since it was opened before the Workflow existed (a draft once it is marked ready for review). None → ask: "Open a pull request from `{branch}` into `{primary}`? Globalize translates it, which uses credits, and adds the translations to it. (**yes** / **no**)". Only on yes, run `gh pr create --base <PRIMARY> --head <BRANCH> --title "Set up i18n" --body "Sets up i18n. Globalize adds the translations to this pull request."` — a ready pull request, since Globalize skips drafts — and report its URL.
- GitLab, `glab auth status` succeeds → the same with `glab mr list --source-branch <BRANCH> --output json`, and on yes `glab mr create --source-branch <BRANCH> --target-branch <PRIMARY> --title "Set up i18n" --description "Sets up i18n. Globalize adds the translations to this merge request." --push=false --yes` (not a draft).
- No signed-in `gh` / `glab`, or the user says no → tell the user to open a pull request from `{branch}` into `{primary}`, and that Globalize translates it once opened.
- **Headless**: never open one. Report "First translation skipped — open a pull request from `{branch}` into `{primary}` and Globalize translates it."
Refusals of `start_workflow_run` are reported verbatim as "First translation not started — {reason}", never retried: `INSUFFICIENT_CREDITS` (out of credits — add credits in Globalize, then ask again), `WORKFLOW_AWAITING_CONVERSION_MERGE` (names a pull request to merge first).
---
## Summary
```
## Globalize setup complete
- [x] Repository — {GitHub App on {owner} | GitLab connection {username}} ({owner}/{repo})
- [x] Workflow — {set up | already set up as} "{name}": {source} → {targets}; patterns: {patterns}; import: {mode}
- [x] First translation — {run #{number} started, pull request delivery ({run page}) | pull request {url} into {primary} | skipped — {reason}}
Warnings: {excluded file groups, a declined pattern suggestion, uncommitted changes — Globalize reads the remote only, …}
```
Held by a Project → the summary is the Step 2 stop message.
Then: "Merge the pull request Globalize opens to ship the translations. Ask me any time to check a run (`get_workflow_run`), add languages (`set_workflow_languages`) or start another run (`start_workflow_run`)." On GitLab add: "Globalize's `Globalize` commit status holds a merge only when the project has **Pipelines must succeed** turned on."
Files in this skill
- SKILL.md
- references/local-detection.md
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.