E2e Swap logo

E2e Swap

Organization
LedgerHQ
e2e-swap

Write or update Swap E2E tests for Ledger Live Desktop (Playwright) and Mobile (Detox). Use for swap spec updates, provider flows, multi-step approvals, page-object refactors, swap-history checks, KYC/validation banners, and review-driven cleanup.

Overview

PublisherLedgerHQ
Repositoryledger-live
Skill namee2e-swap
Stars
622
Forks
491
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by LedgerHQ on GitHub. Read the source before you install it.

Installation

Install the E2e Swap AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/LedgerHQ/ledger-live/tree/develop/.agents/skills/e2e-swap
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/LedgerHQ/ledger-live.git /tmp/ledger-live
mkdir -p .claude/skills
cp -r /tmp/ledger-live/.agents/skills/e2e-swap .claude/skills/e2e-swap
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable E2e Swap in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads E2e Swap on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so E2e Swap is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Swap E2E Skill

Use this skill when

  • Updating swap tests in e2e/desktop or e2e/mobile.
  • Refactoring swap page objects or moving reusable flow logic out of specs.
  • Fixing PR review comments about dead code, selector ownership, brittle amounts, or multi-step approval assertions.

Current source of truth

  • Desktop specs: e2e/desktop/tests/specs/*swap*.spec.ts
  • Desktop swap shared utils:
    • e2e/desktop/tests/utils/swapUtils.ts
  • Desktop page objects:
    • e2e/desktop/tests/page/swap.page.ts
    • e2e/desktop/tests/page/drawer/swap.confirmation.drawer.ts
  • Mobile builders/specs:
    • e2e/mobile/specs/swap/otherTestCases/swap.other.ts
    • e2e/mobile/specs/swap/**/*.spec.ts
  • Mobile page objects:
    • e2e/mobile/page/liveApps/swapLiveApp.ts
    • e2e/mobile/page/trade/swap.page.ts

Platform model

  • Desktop:
    • Electron can expose multiple windows (main app + one or more webviews).
    • Resolve swap webview via WebViewAppPage.getWebView() using webviewIdentifier title matching, not fixed electronApp.windows()[N] indexes.
    • SwapPage methods usually receive electronApp.
    • SwapConfirmationDrawer methods act on the main window.
  • Mobile:
    • Webview operations use Detox web helpers.
    • Native operations use regular Detox matchers.

Implementation rules

  • Keep selectors centralized in page objects, not inline in specs.
  • Keep test IDs as class properties in page objects (avoid repeated string literals in methods).
  • Do not define reusable workflow methods in spec files. Put them in page objects (for atomic UI actions) or shared utils (for multi-step flows).
  • Remove dead methods/fields quickly; do not keep unused helpers.
  • Keep single-use constants local to the narrowest scope that uses them.
  • Reuse existing provider helper selectSpecificProvider(...) before adding new variants.
  • Prefer runtime UI assertions over cross-repo filesystem assertions.
  • Prefer if/else in @Step methods over early return branches for readability and reporting consistency.
  • When replacing all occurrences in strings, prefer replaceAll() over regex-based replace() where equivalent.
  • Avoid unnecessary non-null assertions (!); prefer type-safe narrowing/guards.
  • For fragile swap amounts, fetch minimum dynamically with:
    • app.swap.getMinimumAmount(...) (desktop)
    • app.swapLiveApp.getMinimumAmount(...) (mobile)

Desktop patterns (current API)

  • Keep assertion method prefixes consistent within a page object (check*).
  • In SwapPage, prefer const webview = await this.getWebView() for swap webview context. Do not pass electronApp unless a method explicitly needs non-webview Electron windows/events.
  • Current Changelly UI swap pattern:
    • performSwapUntilQuoteSelectionStep(...)
    • app.swap.selectSpecificProvider(Provider.CHANGELLY, electronApp)
    • const amountToSend = await app.swap.getAmountToSend(electronApp) (only when needed by follow-up assertions)
  • Avoid reintroducing removed generic/dead helpers:
    • checkBannerVisibility(...) (removed)
    • verifyContinueButtonVisible() in desktop swap page (removed)
    • selectProviderQuoteWithRetry(...) in swap utils (removed)

Mobile patterns (current API)

  • Multi-step flow should assert progression, not only click:
    • tapExecuteSwap()
    • tapExecuteSwapOnStepApproval() (includes post-click wait to send summary)
  • Do not reintroduce removed JS-click helper tapSwapOnMultiStepApproval() unless there is a proven regression and a documented reason.
  • Swap history feedback link assertion should be page-object driven:
    • app.swap.checkSwapHistoryFeedbackFormUrl(expectedUrl)
    • Prefer platform-specific attributes for URL assertion (value on iOS, label on Android).
  • Do not add unused icon selector fields (networkFeesInfoIcon, rateInfoIcon).

Validation before finishing

Run validation for the impacted E2E package(s), not the whole monorepo:

  • Desktop:
    • pnpm --filter ledger-live-desktop-e2e-tests typecheck
    • Run targeted Playwright tests for changed swap specs when environment allows.
  • Mobile:
    • pnpm --filter ledger-live-mobile-e2e-tests typecheck
    • Run targeted Detox tests for changed swap specs when environment allows.

Validation workflow notes:

  • Reuse an existing watch terminal when available before starting a new watcher.
  • Prefer watch mode where scripts support it.

If unrelated pre-existing failures appear, explicitly report them as pre-existing and keep scope focused on swap changes.

PR review comment workflow

For each comment:

  1. Verify current code and usages (rg for symbol usage).
  2. Classify:
    • real change needed,
    • duplicate comment,
    • stale/already addressed.
  3. Implement only real changes.
  4. Prepare explicit PR replies for stale/duplicate/already-fixed comments.

Quick checklist

  • No inline repeated test IDs in specs when page object exists.
  • No dead selectors/helpers added.
  • Multi-step mobile flow has a post-click state assertion.
  • Amounts are not hardcoded where minimum is provider-dependent.
  • Desktop assertions use correct window context.
  • Typecheck and relevant test commands were attempted/reported.

Frequently asked questions

What does the E2e Swap AI skill do?

Write or update Swap E2E tests for Ledger Live Desktop (Playwright) and Mobile (Detox). Use for swap spec updates, provider flows, multi-step approvals, page-object refactors, swap-history checks, KYC/validation banners, and review-driven cleanup.

Why use E2e Swap on TypingMind?

Because you install it once and use it with any model. E2e Swap is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install E2e Swap in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/LedgerHQ/ledger-live/tree/develop/.agents/skills/e2e-swap. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use E2e Swap?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with E2e Swap?

As many as you like. As long as a model supports skills, you can use E2e Swap with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the E2e Swap AI skill free?

Yes. It is published on GitHub by LedgerHQ under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇