coin-modules
Skill627 starsChanged 9 days agoMITView on GitHub
Rules and layout for coin module packages under libs/coin-modules/. Read when adding or modifying a coin module.
In this repository70 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- analyticsSkill
- batch-feature-devSkill
- ci-runnersSkill
- ci-workflow-refsSkill
- cleanupSkill
- client-idsSkill
- cloud-sync-moduleSkill
- codeownershipSkill
- coin-families-contractSkill
- commentsSkill
- configurationSkill
- console-logSkill
- create-changesetSkill
- create-prSkill
- data-layer-advancedSkill
- debug-rn-native-crashSkill
- dependency-patchesSkill
- detect-data-leaksSkill
- device-intent-executorSkill
- devtools-import-boundarySkill
- dialogs-sliceSkill
- docs-migrateSkill
- docs-update-or-createSkill
- domain-dataSkill
- e2e-desktop-add-or-updateSkill
- e2e-desktop-onboardSkill
- e2e-earnSkill
- e2e-mobile-add-or-updateSkill
- e2e-mobile-onboardSkill
- e2e-swapSkill
- errorsSkill
- feature-devSkill
- fix-ciSkill
- flow-packageSkill
- get-pr-commentsSkill
- git-conventionsSkill
- i18n-keysSkill
- impacting-prsSkill
- knip-migrationSkill
- ldls-nativeSkill
- ldls-webSkill
- ledger-wallet-cliSkill
- legacy-migrationSkill
- mvvm-architectureSkill
- new-packageSkill
- package-public-apiSkill
- pnpm-resolutionSkill
- prefer-set-hasSkill
- pre-reviewSkill
- react-generalSkill
- rebuild-to-fix-lib-import-errorsSkill
- remove-feature-flagSkill
- run-buildsSkill
- run-e2e-ciSkill
- runner-imagesSkill
- run-testsSkill
- slack-pr-messageSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Do not create a new coin-module if it fits the ecosystem of an existing one.
- Very specific: line 15
No packages other than coin-modules are allowed in libs/coin-modules/.
- Distinctive: line 32
Prefer native dependencies from the blockchain foundation and well-established open-source libraries.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Coin Modules
Each blockchain family lives in its own package under libs/coin-modules/coin-<family>.
Package name: @ledgerhq/coin-<family>
Coin modules are one of the few things that still belong in legacy libs/: they migrate to
LedgerHQ/coin-modules, not to the monorepo layers.
Do not create a new coin-module if it fits the ecosystem of an existing one.
No packages other than coin-modules are allowed in libs/coin-modules/.
Directory Layout
| Directory / file | Purpose |
api/ | Coin Module API surface — implements CoinModuleApi from @ledgerhq/coin-module-framework/api/index; restricted imports apply (see below) |
logic/ | Core blockchain logic, agnostic of Bridge or API; only depends on network/ and external libs; restricted imports apply (see below) |
network/ | Communication with explorer / indexer / node; restricted imports apply (see below) |
types/ | Model definitions, not related to network |
bridge/ (legacy) | CurrencyBridge + AccountBridge implementation |
signer/ (legacy) | Hardware wallet signer interface and device address resolver |
Tests: *.unit.test.ts (co-located), *.test.ts (integration, no network), *.integ.test.ts (real network, separate jest.integ.config.js).
Dependencies
Prefer native dependencies from the blockchain foundation and well-established open-source libraries.
Avoid proprietary third-party SDKs or closed-source vendor packages.
In api/, logic/, and network/, the only permitted @ledgerhq/* imports are @ledgerhq/logs, @ledgerhq/live-network, @ledgerhq/coin-module-framework, and @ledgerhq/ledger-wallet-framework (reported by eslint/no-restricted-imports in support/lint/libs-coin.mts, which libs/coin-modules/oxlint.config.mts uses). Other directories (bridge/, signer/, types/) have no such restriction.
Integration Paths
1. Coin Module API path (preferred) — export createApi(config, currencyId) returning CoinModuleApi (from @ledgerhq/coin-module-framework/api/index). Enable the family in libs/ledger-live-common/src/bridge/generic-coin-framework/genericCoinFrameworkFamilies.json (checked by isGenericCoinFrameworkFamily). For methods that don't apply, throw new Error("<method> is not supported").
2. Classic JS Bridge (legacy, do not use) — export createBridges(signerContext, coinConfig) returning { currencyBridge, accountBridge }. Wired via libs/ledger-live-common/src/families/<family>/setup.ts.
Integ Test Requirements (Coin Module API)
craftTransaction/estimateFees: cover each transaction type (token transfer, native, memo, delegation, …)getBalance/listOperations: cover each asset type in the modulegetBlockInfo/getBlock/listOperations/getStakes: compare against a reference block/op/stake to validate metadata parsinggetValidators: validate metadata against a reference validatorlastBlock: block height > 0, valid date, hash with expected lengthgetNextSequence: higher than current nonce for a known account
live-common Import Rule
In libs/ledger-live-common/src, runtime imports of coin-specific code (from @ledgerhq/coin-* or ../families/*) are only allowed inside src/coin-modules/ and src/families/. All other shared code must access coin-specific behaviour through coinModuleLoaders from src/coin-modules/loaders.ts.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

