Skip to content
OpenSmartRoute
Skillv1.0.0

hex-local-dev-loop

Configure Hex local development with hot reload and testing. Use when setting up a development environment, configuring test workflows, or establishing a fast iteration cycle with Hex. Trigger with ph

by jeremylongshore(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from jeremylongshore/tons-of-skills-marketplace (skills/.curated/hex-local-dev-loop/SKILL.md). Install upstream with npx skills add jeremylongshore/tons-of-skills-marketplace --skill hex-local-dev-loop. Copyright stays with the author (MIT).

Hex Local Dev Loop

Overview

Set up a development workflow for Hex API orchestration with mocked API responses and testing.

Instructions

Step 1: Project Structure

hex-orchestrator/
├── src/hex/
│   ├── client.ts       # API client
│   ├── orchestrator.ts # Pipeline runner
│   └── types.ts        # TypeScript interfaces
├── tests/
│   ├── fixtures/       # Mock API responses
│   └── orchestrator.test.ts
├── .env.local
└── package.json

Step 2: Typed Hex Client

// src/hex/client.ts
export class HexClient {
  constructor(private token: string, private baseUrl = 'https://app.hex.tech/api/v1') {}

  async listProjects() {
    return this.get('/projects');
  }

  async runProject(projectId: string, inputParams?: Record<string, any>) {
    return this.post(`/project/${projectId}/run`, { inputParams: inputParams || {}, updateCacheResult: true });
  }

  async getRunStatus(projectId: string, runId: string) {
    return this.get(`/project/${projectId}/run/${runId}`);
  }

  async cancelRun(projectId: string, runId: string) {
    return this.delete(`/project/${projectId}/run/${runId}`);
  }

  private async get(path: string) {
    const res = await fetch(`${this.baseUrl}${path}`, { headers: { 'Authorization': `Bearer ${this.token}` } });
    if (!res.ok) throw new Error(`Hex API ${res.status}`);
    return res.json();
  }

  private async post(path: string, body: any) {
    const res = await fetch(`${this.baseUrl}${path}`, { method: 'POST', headers: { 'Authorization': `Bearer ${this.token}`, 'Content-Type': 'application/json' }, body: JSON.stringify(body) });
    if (!res.ok) throw new Error(`Hex API ${res.status}`);
    return res.json();
  }

  private async delete(path: string) {
    const res = await fetch(`${this.baseUrl}${path}`, { method: 'DELETE', headers: { 'Authorization': `Bearer ${this.token}` } });
    return res.ok;
  }
}

Step 3: Mocked Tests

import { describe, it, expect, vi } from 'vitest';
const mockFetch = vi.fn();
vi.stubGlobal('fetch', mockFetch);

describe('HexClient', () => {
  it('should list projects', async () => {
    mockFetch.mockResolvedValueOnce({ ok: true, json: async () => [{ projectId: 'p1', name: 'Test' }] });
    const client = new HexClient('test-token');
    const projects = await client.listProjects();
    expect(projects).toHaveLength(1);
  });

  it('should trigger a run', async () => {
    mockFetch.mockResolvedValueOnce({ ok: true, json: async () => ({ runId: 'r1', projectId: 'p1' }) });
    const client = new HexClient('test-token');
    const run = await client.runProject('p1', { date: '2025-01-01' });
    expect(run.runId).toBe('r1');
  });
});

Prerequisites

  • A mock or sandbox endpoint, safe project fixture, no production token in source/history/test output, and a fixture-reset command.
  • A parameter/data-minimization assertion plus a change record and rollback path for future promotion.

Output

Return a local-loop receipt with fixture revision, environment, project scope, test totals, aggregate assertion outcome, temporary credential reference, and cleanup state. Exclude SQL, output, tokens, and identities.

Error Handling

Stop on production destination, missing data-minimization assertion, unbounded fixture, or failed cleanup. Do not use production output as a fallback test fixture.

Examples

fixtures=v7; mode=mock->sandbox; project=proj-dev-1; tests=12/12; assertions=pass; cleanup=complete is a safe promotion candidate.

Resources

Next Steps

See hex-sdk-patterns for production patterns.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/jeremylongshore-tons-of-skills-marketplace-hex-local-dev-loop/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

jeremylongshore-tons-of-skills-marketplace-hex-local-dev-loop.ocm.jsonjson
{
  "ocm": "1",
  "id": "jeremylongshore-tons-of-skills-marketplace-hex-local-dev-loop",
  "kind": "skill",
  "name": "hex-local-dev-loop",
  "description": "Configure Hex local development with hot reload and testing. Use when setting up a development environment, configuring test workflows, or establishing a fast iteration cycle with Hex. Trigger with phrases like \"hex dev setup\", \"hex local development\", \"hex dev environment\", \"develop with hex\".",
  "publisher": "jeremylongshore",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "saas",
      "hex",
      "data",
      "analytics",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Configure Hex local development with hot reload and testing. Use when setting up a development environment, configuring test workflows, or establishing a fast iteration cycle with Hex. Trigger with phrases like \"hex dev setup\", \"hex local development\", \"hex dev environment\", \"develop with hex\"."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/jeremylongshore/tons-of-skills-marketplace",
      "path": "skills/.curated/hex-local-dev-loop/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/HEAD/skills/.curated/hex-local-dev-loop/SKILL.md",
      "key": "jeremylongshore/tons-of-skills-marketplace/skills/.curated/hex-local-dev-loop/SKILL.md"
    },
    "compatibility": "Designed for Claude Code",
    "allowed_tools": [
      "Read,",
      "Write,",
      "Edit,",
      "Bash(npm:*),",
      "Bash(pnpm:*),",
      "Grep"
    ],
    "license": "MIT"
  },
  "instructions": "# Hex Local Dev Loop\n\n## Overview\n\nSet up a development workflow for Hex API orchestration with mocked API responses and testing.\n\n## Instructions\n\n### Step 1: Project Structure\n\n```\nhex-orchestrator/\n├── src/hex/\n│   ├── client.ts       # API client\n│   ├── orchestrator.ts # Pipeline runner\n│   └── types.ts        # TypeScript interfaces\n├── tests/\n│   ├── fixtures/       # Mock API responses\n│   └── orchestrator.test.ts\n├── .env.local\n└── package.json\n```\n\n### Step 2: Typed Hex Client\n\n```typescript\n// src/hex/client.ts\nexport class HexClient {\n  constructor(private token: string, private ba",
  "cost": {
    "context_tokens": 911
  }
}

Fetch it by URL: GET /api/v1/registry/jeremylongshore-tons-of-skills-marketplace-hex-local-dev-loop/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.