Lokalise Performance TuningSAFE
Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com.
Overview
Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com.
4f83675ca38aOBSERVED · 2026-10-09Host compatibility
What the documentation claims. We have not run a compatibility test.
| Host | Status | Notes |
|---|---|---|
| claude-code | mentioned | |
| cursor | mentioned |
What it tells the agent
The instruction file, verbatim from the audited commit — this is the text the model reads, and the surface the audit's instruction layer examines. Quoted here so you can judge it without cloning anything.
--- name: lokalise-performance-tuning description: 'Optimize Lokalise API performance with caching, pagination, and bulk operations. Use when experiencing slow API responses, implementing caching strategies, or optimizing request throughput for Lokalise integrations. Trigger with phrases like "lokalise performance", "optimize lokalise", "lokalise latency", "lokalise caching", "lokalise slow", "lokalise batch". ' allowed-tools: Read, Write, Edit, Bash(npm:*), Bash(node:*), Bash(curl:*), Bash(jq:*), Grep version: 1.14.0 license: MIT author: Jeremy Longshore <[email protected]> tags: - saas - lokalise - api - performance compatibility: Designed for Claude Code --- # Lokalise Performance Tuning ## Overview Optimize Lokalise API throughput for translation pipelines by implementing cursor pagination, local caching, batch key operations (500/request), request throttling under the 6 req/s rate limit, and selective language downloads. ## Prerequisites - `@lokalise/node-api` SDK v9+ (ESM) or REST API access - `LOKALISE_API_TOKEN` environment variable set - Understanding of project size (key count, language count) to calibrate batch sizes - Optional: Redis or LRU cache library for persistent caching ## Instructions ### Step 1: Use Cursor Pagination for Large Datasets Cursor pagination is significantly faster than offset pagination for projects with 5K+ keys. Offset pagination degrades as page numbers increase because the server must skip rows; cursor pagination uses a pointer. ```typescript import { LokaliseApi } from '@lokalise/node-api'; const lok = new LokaliseApi({ apiKey: process.env.LOKALISE_API_TOKEN! }); // Generator that yields all keys using cursor pagination async function* getAllKeys(projectId: string) { let cursor: string | undefined; do { const result = await lok.keys().list({ project_id: projectId, limit: 500, // Maximum allowed per request pagination: 'cursor', cursor, }); for (const key of result.items) yield key; cursor = result.hasNextCursor() ? result.nextCursor : undefined; } while (cursor); } // Usage: 10,000 keys = 20 API calls (vs 100 with default limit=100) let count = 0; for await (const key of getAllKeys('PROJECT_ID')) { count++; } console.log(`Fetched ${count} keys`); ``` **Offset pagination comparison (avoid for large projects):** | Keys | Offset (limit=100) | Cursor (limit=500) | Time saved | |------|--------------------|--------------------|-----------| | 1,000 | 10 requests | 2 requests | 80% | | 10,000 | 100 requests | 20 requests | 80% | | 50,000 | 500 requests (~84s) | 100 requests (~17s) | 80% | ### Step 2: Cache Translation Downloads Locally Translation file downloads are the most expensive Lokalise operation. Cache them locally and use project `last_activity` timestamps to invalidate. ```typescript import { LokaliseApi } from '@lokalise/node-api'; import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'fs'; const lok = new LokaliseApi({ apiKey: process.env.LOKALISE_API_TOKEN! }); const CACHE_DIR = '.lokalise-cache'; interface CacheEntry { url: string; timestamp: string; languages: string[]; } function getCachePath(projectId: string, langIso: string): string { return `${CACHE_DIR}/${projectId}/${langIso}.json`; } function getMetaPath(projectId: string): string { return `${CACHE_DIR}/${projectId}/meta.json`; } async function downloadWithCache(projectId: string, langIso: string, format = 'json') { mkdirSync(`${CACHE_DIR}/${projectId}`, { recursive: true }); const cachePath = getCachePath(projectId, langIso); const metaPath = getMetaPath(projectId); // Check if project was modified since last cache const project = await lok.projects().get(projectId); const lastActivity = project.statistics?.last_activity ?? project.created_at; if (existsSync(metaPath)) { const meta: CacheEntry = JSON.parse(readFileSync(metaPath, 'utf8')); if (meta.timestamp === lastActivity && existsSync(cachePath)) { console.log(`Cache hit: ${langIso} (unchanged since ${lastActivity})`); return JSON.parse(readFileSync(cachePath, 'utf8')); } } // Cache miss — download fresh const bundle = await lok.files().download(projectId, { format, filter_langs: [langIso], original_filenames: false, }); // bundle.bundle_url contains a temporary download URL const response = await fetch(bundle.bundle_url); const data = await response.arrayBuffer(); writeFileSync(cachePath, Buffer.from(data)); writeFileSync(metaPath, JSON.stringify({ url: bundle.bundle_url, timestamp: lastActivity, languages: [langIso], })); console.log(`Cache miss: downloaded ${langIso} (${data.byteLength} bytes)`); return data; } ``` ### Step 3: Batch Key Operations Lokalise supports creating, updating, and deleting up to 500 keys per request. Always batch instead of making individual requests. ```typescript // Bulk create keys — 500 per batch with rate limit awareness async function createKeysBatched(projectId: string, keys: any[]) { const BATCH_SIZE = 500; const results = []; for (let i = 0; i < keys.length; i += BATCH_SIZE) { const batch = keys.slice(i, i + BATCH_SIZE); const result = await lok.keys().create({ project_id: projectId, keys: batch, }); results.push(...result.items); console.log(`Batch ${Math.floor(i / BATCH_SIZE) + 1}: created ${result.items.length} keys`); await new Promise(r => setTimeout(r, 200)); // Stay under 6 req/s } return results; } // Bulk update keys — same 500-key batch limit async function updateKeysBatched(projectId: string, updates: Array<{key_id: number; [k: string]: any}>) { const BATCH_SIZE = 500; for (let i = 0; i < updates.length; i += BATCH_SIZE) { const batch = updates.slice(i, i + BATCH_SIZE); await lok.keys().bulk_update({ project_id: projectId, keys: batch, }); await new Promise(r => setTimeout(r, 200))
Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- none-observed
- Shell
- none-observed
- Dependencies
- pinned
- Secrets in source
- none-found
Findings (0)
No findings outside the package's declared scope.
Gates applied: no_behavioural_pass.
4f83675ca38afull audit observations/trust-audit/skill/jeremylongshore__lokalise-performance-tuning.json · Report an issue / request a re-scanAudit history
Every audit this skill has had.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-09 | 4f83675ca38a | SAFE | B | 89 | first audit |
Questions
What does the Lokalise Performance Tuning skill do?
Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com.
Is Lokalise Performance Tuning safe to install?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean skill reads B.
What can Lokalise Performance Tuning access on my machine?
The audit observed no filesystem, network or shell use at all in its source.
Which assistants does Lokalise Performance Tuning work with?
Its documentation mentions claude-code and cursor. That is what the text claims, not a compatibility test we ran.
How current is this page?
The grade is for one exact copy of the source (4f83675ca38a), read on 2026-10-09. The repository is watched, and a new audit runs when it changes — this is the first audit.