MA

maintainx-debug-bundle

A diagnostic toolkit for resolving MaintainX API and integration issues.

Install

mkdir -p .claude/skills/maintainx-debug-bundle && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/4097" && unzip -o skill.zip -d .claude/skills/maintainx-debug-bundle && rm skill.zip

Installs to .claude/skills/maintainx-debug-bundle

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Comprehensive debugging toolkit for MaintainX integrations.
59 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Perform environment diagnostic checks
  • Log API request and response data with timing
  • Execute health checks across major endpoints
  • Validate data quality for work orders
  • Generate support bundles for troubleshooting

How it works

It provides diagnostic scripts and interceptors to log API interactions, verify connectivity, and validate data integrity against MaintainX endpoints.

Inputs & outputs

You give it
API endpoint configuration and environment context
You get back
Diagnostic report or JSON support bundle

When to use maintainx-debug-bundle

  • Diagnosing API connection errors
  • Retrieving detailed MaintainX request logs
  • Verifying environment variable configuration
  • Checking system dependency status

About this skill

MaintainX Debug Bundle

Current State

!node --version 2>/dev/null || echo 'N/A' !python3 --version 2>/dev/null || echo 'N/A' !echo "API key set: $([ -n "$MAINTAINX_API_KEY" ] && echo 'yes' || echo 'no')"

Overview

Complete debugging toolkit for diagnosing and resolving MaintainX integration issues with diagnostic scripts, request logging, and health checks.

Prerequisites

  • MaintainX API access configured
  • Node.js 18+ or curl
  • MAINTAINX_API_KEY environment variable set

Instructions

Step 1: Environment Diagnostic Script

#!/bin/bash
echo "=== MaintainX Debug Report ==="
echo "Timestamp: $(date -u +%Y-%m-%dT%H:%M:%SZ)"
echo "Node.js: $(node --version 2>/dev/null || echo 'not installed')"
echo "npm: $(npm --version 2>/dev/null || echo 'not installed')"
echo "API key set: $([ -n "$MAINTAINX_API_KEY" ] && echo 'yes (length: '${#MAINTAINX_API_KEY}')' || echo 'NO')"
echo ""

echo "=== API Connectivity ==="
HTTP_CODE=$(curl -s -o /tmp/mx-debug.json -w "%{http_code}" \
  "https://api.getmaintainx.com/v1/users?limit=1" \
  -H "Authorization: Bearer $MAINTAINX_API_KEY")
echo "Auth status: $HTTP_CODE"

if [ "$HTTP_CODE" = "200" ]; then
  echo "Response: $(cat /tmp/mx-debug.json | jq -c '{users: (.users | length)}')"
else
  echo "Error: $(cat /tmp/mx-debug.json | jq -r '.message // .error // "unknown"')"
fi

echo ""
echo "=== DNS Resolution ==="
nslookup api.getmaintainx.com 2>/dev/null | grep -A1 "Name:"

echo ""
echo "=== Response Timing ==="
curl -s -o /dev/null -w "DNS: %{time_namelookup}s\nConnect: %{time_connect}s\nTTFB: %{time_starttransfer}s\nTotal: %{time_total}s\n" \
  "https://api.getmaintainx.com/v1/users?limit=1" \
  -H "Authorization: Bearer $MAINTAINX_API_KEY"

Step 2: Request/Response Logger

// src/debug/request-logger.ts
import axios, { AxiosInstance, AxiosError } from 'axios';

export function createDebugClient(): AxiosInstance {
  const client = axios.create({
    baseURL: 'https://api.getmaintainx.com/v1',
    headers: {
      Authorization: `Bearer ${process.env.MAINTAINX_API_KEY}`,
      'Content-Type': 'application/json',
    },
  });

  // Request interceptor
  client.interceptors.request.use((config) => {
    const startTime = Date.now();
    (config as any).__startTime = startTime;
    console.log(`[REQ] ${config.method?.toUpperCase()} ${config.url}`);
    if (config.data) console.log('  Body:', JSON.stringify(config.data).slice(0, 200));
    if (config.params) console.log('  Params:', config.params);
    return config;
  });

  // Response interceptor
  client.interceptors.response.use(
    (response) => {
      const duration = Date.now() - (response.config as any).__startTime;
      console.log(`[RES] ${response.status} (${duration}ms)`);
      console.log('  Data keys:', Object.keys(response.data));
      return response;
    },
    (error: AxiosError) => {
      const duration = Date.now() - (error.config as any)?.__startTime;
      console.error(`[ERR] ${error.response?.status || 'NETWORK'} (${duration}ms)`);
      console.error('  Message:', (error.response?.data as any)?.message || error.message);
      console.error('  Headers:', JSON.stringify(error.response?.headers || {}));
      throw error;
    },
  );

  return client;
}

Step 3: API Health Check

// src/debug/health-check.ts
interface HealthResult {
  endpoint: string;
  status: 'ok' | 'error';
  statusCode?: number;
  latencyMs: number;
  error?: string;
}

async function healthCheck(apiKey: string): Promise<HealthResult[]> {
  const endpoints = [
    { path: '/users?limit=1', name: 'Users' },
    { path: '/workorders?limit=1', name: 'Work Orders' },
    { path: '/assets?limit=1', name: 'Assets' },
    { path: '/locations?limit=1', name: 'Locations' },
    { path: '/teams?limit=1', name: 'Teams' },
  ];

  const results: HealthResult[] = [];

  for (const ep of endpoints) {
    const start = Date.now();
    try {
      const res = await fetch(`https://api.getmaintainx.com/v1${ep.path}`, {
        headers: { Authorization: `Bearer ${apiKey}` },
      });
      results.push({
        endpoint: ep.name,
        status: res.ok ? 'ok' : 'error',
        statusCode: res.status,
        latencyMs: Date.now() - start,
      });
    } catch (err: any) {
      results.push({
        endpoint: ep.name,
        status: 'error',
        latencyMs: Date.now() - start,
        error: err.message,
      });
    }
  }

  // Print report
  console.log('\n=== MaintainX Health Check ===');
  for (const r of results) {
    const icon = r.status === 'ok' ? 'PASS' : 'FAIL';
    console.log(`  [${icon}] ${r.endpoint}: ${r.statusCode || 'N/A'} (${r.latencyMs}ms)`);
    if (r.error) console.log(`        Error: ${r.error}`);
  }

  return results;
}

// Run: npx tsx src/debug/health-check.ts
healthCheck(process.env.MAINTAINX_API_KEY!);

Step 4: Data Validation Checker

// src/debug/validate-data.ts
async function validateWorkOrders(client: any) {
  const { workOrders } = await client.getWorkOrders({ limit: 50 });
  const issues: string[] = [];

  for (const wo of workOrders) {
    if (!wo.title) issues.push(`WO #${wo.id}: missing title`);
    if (wo.status === 'COMPLETED' && !wo.completedAt) {
      issues.push(`WO #${wo.id}: COMPLETED but no completedAt timestamp`);
    }
    if (wo.dueDate && new Date(wo.dueDate) < new Date() && wo.status === 'OPEN') {
      issues.push(`WO #${wo.id}: overdue (due ${wo.dueDate})`);
    }
    if (wo.assignees?.length === 0 && wo.priority === 'HIGH') {
      issues.push(`WO #${wo.id}: HIGH priority but no assignees`);
    }
  }

  console.log(`\n=== Data Validation (${workOrders.length} work orders) ===`);
  if (issues.length === 0) {
    console.log('  All checks passed');
  } else {
    for (const issue of issues) {
      console.log(`  WARNING: ${issue}`);
    }
  }
  return issues;
}

Step 5: Generate Support Bundle

// src/debug/support-bundle.ts
import { writeFileSync } from 'fs';

async function generateSupportBundle(client: any) {
  const bundle: Record<string, any> = {
    generated: new Date().toISOString(),
    environment: {
      node: process.version,
      platform: process.platform,
      apiKeyPrefix: process.env.MAINTAINX_API_KEY?.slice(0, 8) + '...',
    },
    health: await healthCheck(process.env.MAINTAINX_API_KEY!),
    sampleData: {
      workOrderCount: (await client.getWorkOrders({ limit: 1 })).workOrders.length,
      assetCount: (await client.getAssets({ limit: 1 })).assets.length,
    },
  };

  const filename = `maintainx-debug-${Date.now()}.json`;
  writeFileSync(filename, JSON.stringify(bundle, null, 2));
  console.log(`Support bundle saved to ${filename}`);
  return filename;
}

Output

  • Environment diagnostic report (Node.js version, API key status, connectivity)
  • Request/response logging with timing for every API call
  • Health check results for all major MaintainX endpoints
  • Data validation warnings (overdue WOs, missing assignees, etc.)
  • Support bundle JSON file for sharing with MaintainX support

Error Handling

IssueDiagnostic StepSolution
401 on all endpointsRun Step 1 diagnostic scriptRegenerate API key
High latency (> 5s)Check Step 1 response timingVerify network, check MaintainX status
Intermittent 500sEnable Step 2 request loggerReport to MaintainX with request IDs
Missing dataRun Step 4 data validatorFix data quality issues, re-sync

Resources

Next Steps

For rate limit handling, see maintainx-rate-limits.

Examples

One-liner diagnostic:

curl -w "\nHTTP: %{http_code} | Time: %{time_total}s\n" \
  "https://api.getmaintainx.com/v1/users?limit=1" \
  -H "Authorization: Bearer $MAINTAINX_API_KEY" | jq .

When not to use it

  • Performing production work order updates
  • Handling rate limit configuration

Prerequisites

MaintainX API accessNode.js 18+ or curlMAINTAINX_API_KEY environment variable

Limitations

  • Requires API key for connectivity checks
  • High latency may indicate network or status issues

How it compares

It provides automated diagnostic reporting and request logging instead of manual curl debugging.

Compared to similar skills

maintainx-debug-bundle side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
maintainx-debug-bundle (this skill)127dCautionIntermediate
optimizing-performance12moReviewIntermediate
error-tracking19moCautionIntermediate
fireflies-debug-bundle127dCautionBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

You might also like

optimizing-performance

CloudAI-X

Analyzes and optimizes application performance across frontend, backend, and database layers. Use when diagnosing slowness, improving load times, optimizing queries, reducing bundle size, or when asked about performance issues.

113

error-tracking

diet103

Add Sentry v8 error tracking and performance monitoring to your project services. Use this skill when adding error handling, creating new controllers, instrumenting cron jobs, or tracking database performance. ALL ERRORS MUST BE CAPTURED TO SENTRY - no exceptions.

14

fireflies-debug-bundle

jeremylongshore

Collect Fireflies.ai debug evidence for support tickets and troubleshooting. Use when encountering persistent issues, preparing support tickets, or collecting diagnostic information for Fireflies.ai problems. Trigger with phrases like "fireflies debug", "fireflies support bundle", "collect fireflies logs", "fireflies diagnostic".

13

sentry-debug-bundle

jeremylongshore

Execute collect debug information for Sentry support tickets. Use when preparing support requests, debugging complex issues, or gathering diagnostic information. Trigger with phrases like "sentry debug info", "sentry support ticket", "gather sentry diagnostics", "sentry debug bundle".

13

sentry-error-capture

jeremylongshore

Execute advanced error capture and context enrichment with Sentry. Use when implementing detailed error tracking, adding context, or customizing error capture behavior. Trigger with phrases like "sentry error capture", "sentry context", "enrich sentry errors", "sentry exception handling".

11

autotel

jagreehal

Use when instrumenting with trace/span/track, reviewing code for logging and observability patterns, converting console.log to wide events, adding structured errors, setting up canonical log lines, configuring init(), adding subscribers, or working in the autotel monorepo.

00

Search skills

Search the agent skills registry