migrate-gitlab-flags
Migrates a codebase from GitLab Feature Flags (the Unleash-compatible legacy API authenticated with UNLEASH-INSTANCEID) to a modern Unleash v8 server…
от CognitionAI★ 42 звезды на GitHub
Установить migrate-gitlab-flags в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Migrate GitLab Feature Flags to Unleash (v8+)
Migrate one app or service off GitLab's Unleash-compatible legacy flag API onto a real Unleash v8 server: recreate the flag definitions, rewrite the SDK wiring, and prove behavior parity. There is no automated import/export mechanism from GitLab to Unleash, therefore recreating definitions is always part of the job.
Non-negotiable invariants
- State carries over exactly. A flag enabled in GitLab is enabled in Unleash; a disabled flag arrives disabled (per environment). Always — never ship flags "off for safety" or "on for convenience".
- Flag names are unchanged (the only exception: a collision prefix agreed with the user when sharing an OSS
defaultproject — see Inputs step 3). - Minimal code diff. Mirror the existing patterns; the migration is not a refactoring opportunity (see Phase 5).
- Least-privilege credentials. The app gets an Unleash backend/frontend token scoped to its project + environment; the migration itself uses only the access level its provisioning mechanism requires. Never assume an admin token (admin tokens are deprecated by Unleash anyway, so automation uses personal access tokens or service accounts).
Inputs
- Resolve
$ARGUMENTSto the target directory. If empty or ambiguous, ask the user which app/service to migrate before touching anything. - Detect the stack from manifests:
package.json,go.mod,pom.xml/build.gradle,Gemfile,composer.json,*.csproj,requirements.txt/pyproject.toml, or plain shell scripts. - Ask the user for the target topology and mechanism (skip whatever the request already states; never assume the rest):
- Unleash edition — OSS, or Enterprise/Cloud. Determines what is possible: OSS has a single
defaultproject and its Admin API cannot create environments; Enterprise/Cloud supports multiple projects, environments, change requests. - Project topology — Enterprise/Cloud best practice: one project per service/application (separation of concerns, per-project tokens and permissions). OSS: everything shares
default, so agree on a collision-avoiding flag prefix (team/domain prefix, e.g.checkout_…) if the flags aren't already distinctly named. - Provisioning mechanism — one of the three in references/provisioning.md: Unleash MCP server (local or remote), import-file generation, or direct Admin API. Before asking, check whether an Unleash MCP server is already connected to this session — tools prefixed
mcp__unleash__ormcp__plugin_unleash_mcp__(the latter is the Unleash plugin's bundled server, registered automatically on plugin installs;claude mcp listshows standalone entries) — and propose it if so. The mechanisms differ in the access the migration needs (PAT vs none vs elevated) — on a governed instance the user may not be able to hand an AI direct API access at all; import files are the least-privilege default there. - Credentials — only what the chosen mechanism needs, plus the project+environment-scoped backend token (
{project}:{environment}.{hash}) the app itself will run with (it can also be created during Phase 4).
- Unleash edition — OSS, or Enterprise/Cloud. Determines what is possible: OSS has a single
- Run
${CLAUDE_SKILL_DIR}/scripts/preflight.sh <target-dir> --mode <api|import|mcp>and stop on failure. Add--frontendonly when the browser will talk to Unleash directly (Frontend API/Edge) — a BFF whose browser code never touches Unleash needs no frontend token.
Phase 1 — Discover
Find every GitLab flag touchpoint in the target:
grep -rniE "feature_flags/unleash|UNLEASH-INSTANCEID|instance_?id|InstanceTag" <target-dir>
Also look for the appName-as-environment trick (an appName / app_name config value naming a GitLab environment like production rather than the application) and for SDK version pins that only exist to keep instance-id auth working. Read references/gitlab-flags-primer.md for the before-state model and the per-SDK trap table before judging what you find.
Record: SDK + pinned version, abstraction style (direct calls, thin wrapper, DI service, port/adapter, OpenFeature provider, proxy, BFF), and every call site.
Phase 2 — Inventory
Enumerate the flags the app depends on. Prefer the live source when GitLab credentials (GITLAB_API_TOKEN PAT + project id) are available:
curl -fsS -H "PRIVATE-TOKEN: $GITLAB_API_TOKEN" \
"$GITLAB_API_URL/projects/$GITLAB_PROJECT_ID/feature_flags?per_page=100"
curl -fsS -H "PRIVATE-TOKEN: $GITLAB_API_TOKEN" \
"$GITLAB_API_URL/projects/$GITLAB_PROJECT_ID/feature_flags_user_lists"
Fall back to code and any flag manifest in the repo. Do not inventory from the Unleash-compatible wire endpoint — it inlines user lists as userWithId, so the real construct is invisible there. Scope the inventory to the flags the target app actually references (the Phase 1 call sites) — a shared GitLab project often holds other services' flags and user lists, which
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
- 01
mcp__unleash__list_projects - 02
mcp__unleash__list_flags - 03
mcp__unleash__detect_flag - 04
mcp__unleash__get_flag_state - 05
mcp__plugin_unleash_mcp__list_projects - 06
mcp__plugin_unleash_mcp__list_flags - 07
mcp__plugin_unleash_mcp__detect_flag - 08
mcp__plugin_unleash_mcp__get_flag_state
Вложенные файлы
- README.md
- evals/README.md
- evals/evals.json
- references/concept-mapping.md
- references/gitlab-flags-primer.md
- references/provisioning.md
- references/sdk-cheatsheet.md
- references/verification.md
- scripts/preflight.sh
FAQ
Что делает скилл migrate-gitlab-flags?
Migrates a codebase from GitLab Feature Flags (the Unleash-compatible legacy API authenticated with UNLEASH-INSTANCEID) to a modern Unleash v8 server. Inventories flags and strategies, maps GitLab constructs to Unleash equivalents, provisions flags via multiple mechanisms (Unleash MCP server, import files, or direct Admin API), rewrites SDK configuration with minimal code changes, and verifies behavior parity. Use when asked to migrate off GitLab feature flags, move flags to Unleash, or port GitLab flag definitions to an Unleash server.
Как установить скилл migrate-gitlab-flags?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл migrate-gitlab-flags запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…