Maintainx 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: maintainx-performance-tuning description: 'Optimize MaintainX API integration performance. Use when experiencing slow API responses, optimizing data fetching, or improving integration throughput with MaintainX. Trigger with phrases like "maintainx performance", "maintainx slow", "optimize maintainx", "maintainx caching", "maintainx faster". ' allowed-tools: Read, Write, Edit, Bash(npm:*) version: 1.11.0 license: MIT author: Jeremy Longshore <[email protected]> tags: - saas - maintainx - api - performance compatibility: Designed for Claude Code --- # MaintainX Performance Tuning ## Overview Optimize MaintainX integration performance with caching, connection pooling, efficient pagination, and request deduplication. ## Prerequisites - MaintainX integration working - Node.js 18+ - Redis (recommended for production caching) - Performance baseline measurements ## Instructions ### Step 1: Connection Pooling with Keep-Alive ```typescript // src/performance/pooled-client.ts import axios from 'axios'; import http from 'node:http'; import https from 'node:https'; // Reuse TCP connections instead of opening new ones per request const httpAgent = new http.Agent({ keepAlive: true, maxSockets: 10 }); const httpsAgent = new https.Agent({ keepAlive: true, maxSockets: 10 }); const client = axios.create({ baseURL: 'https://api.getmaintainx.com/v1', headers: { Authorization: `Bearer ${process.env.MAINTAINX_API_KEY}`, 'Content-Type': 'application/json', }, httpAgent, httpsAgent, timeout: 30_000, }); // Benefit: Eliminates TCP handshake + TLS negotiation per request // Typical improvement: 100-200ms saved per request ``` ### Step 2: Multi-Level Caching ```typescript // src/performance/cache.ts interface CacheLayer<T> { get(key: string): Promise<T | undefined>; set(key: string, value: T, ttlMs: number): Promise<void>; } // L1: In-memory (fastest, per-process) class MemoryCache<T> implements CacheLayer<T> { private store = new Map<string, { value: T; expiresAt: number }>(); async get(key: string) { const entry = this.store.get(key); if (entry && entry.expiresAt > Date.now()) return entry.value; this.store.delete(key); return undefined; } async set(key: string, value: T, ttlMs: number) { this.store.set(key, { value, expiresAt: Date.now() + ttlMs }); } } // L2: Redis (shared across processes) class RedisCache<T> implements CacheLayer<T> { constructor(private redis: any) {} async get(key: string) { const data = await this.redis.get(`mx:${key}`); return data ? JSON.parse(data) : undefined; } async set(key: string, value: T, ttlMs: number) { await this.redis.setex(`mx:${key}`, Math.ceil(ttlMs / 1000), JSON.stringify(value)); } } // Multi-level cache: check L1 first, then L2, then fetch class MultiCache<T> { constructor(private l1: CacheLayer<T>, private l2: CacheLayer<T>) {} async getOrFetch(key: string, ttlMs: number, fetcher: () => Promise<T>): Promise<T> { // Check L1 let value = await this.l1.get(key); if (value !== undefined) return value; // Check L2 value = await this.l2.get(key); if (value !== undefined) { await this.l1.set(key, value, ttlMs / 2); // L1 shorter TTL return value; } // Fetch from API value = await fetcher(); await this.l1.set(key, value, ttlMs / 2); await this.l2.set(key, value, ttlMs); return value; } } ``` ### Step 3: DataLoader for Batch Loading When multiple parts of your app need the same work order, batch and deduplicate: ```typescript // src/performance/dataloader.ts import DataLoader from 'dataloader'; const workOrderLoader = new DataLoader<number, any>( async (ids: readonly number[]) => { // Batch: fetch multiple work orders in parallel const results = await Promise.all( ids.map((id) => client.get(`/workorders/${id}`).then((r) => r.data) ), ); // Return in same order as input ids return ids.map((id) => results.find((r) => r.id === id) || null); }, { maxBatchSize: 25, cacheKeyFn: (id) => String(id), }, ); // These 3 calls collapse into 1 batched operation: const [wo1, wo2, wo3] = await Promise.all([ workOrderLoader.load(100), workOrderLoader.load(200), workOrderLoader.load(100), // deduped, same as first ]); ``` ### Step 4: Efficient Pagination ```typescript // Fetch only the fields you need (if API supports field selection) // Use larger page sizes to reduce round trips async function efficientFetchAll(client: any, endpoint: string, key: string) { const all = []; let cursor: string | undefined; let pageCount = 0; const startTime = Date.now(); do { const { data } = await client.get(endpoint, { params: { limit: 100, cursor }, // Max page size }); all.push(...data[key]); cursor = data.cursor; pageCount++; } while (cursor); const elapsed = Date.now() - startTime; console.log(`Fetched ${all.length} items in ${pageCount} pages (${elapsed}ms)`); return all; } // Parallel pagination for independent resources async function fetchAllResources(client: any) { const [workOrders, assets, locations] = await Promise.all([ efficientFetchAll(client, '/workorders', 'workOrders'), efficientFetchAll(client, '/assets', 'assets'), efficientFetchAll(client, '/locations', 'locations'), ]); return { workOrders, assets, locations }; } ``` ### Step 5: Request Deduplication ```typescript // src/performance/dedup.ts class RequestDeduplicator { private inflight = new Map<string, Promise<any>>(); async dedupe<T>(key: string, fetcher: () => Promise<T>): Promise<T> { if (this.inflight.has(key)) { return this.inflight.get(key)! as Promise<T>; } const promise = fetcher().finally(() => { this.inflight.delete(key); }); this.inflight.set(key, promise); return promise; } } const dedup = new RequestDeduplicator(); // 10 concurrent calls to getWork
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__maintainx-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 Maintainx 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 Maintainx 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 Maintainx Performance Tuning access on my machine?
The audit observed no filesystem, network or shell use at all in its source.
Which assistants does Maintainx 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.