Skip to content

zaheer037/job-search / .agents/skills/jobindex-search

jobindex-search

Verified

Make sure to use this skill whenever the user wants to search for jobs in Denmark, find Danish job listings, look up a specific job posting, or asks anything about the Danish job market — even if they don't mention jobindex.dk explicitly. Invoke this skill for questions about open positions, job vacancies, hiring in Denmark, job opportunities in Danish cities or sectors, or when the user wants to find work in Denmark. Also trigger for phrases like "find me a job", "are there any jobs for X in Copenhagen", or "what jobs are available in Aarhus" when the context is Denmark. Trigger phrases include: jobindex, jobsøgning, job i Danmark, ledige stillinger, job opslag, find job, stillingopslag, jobannonce, job vacancy denmark, danish jobs, jobs in denmark, job search denmark, work in denmark, find work denmark, IT jobs denmark, engineer jobs denmark, developer jobs copenhagen, marketing jobs aarhus, jobs aarhus, jobs copenhagen, jobs odense, jobs aalborg, job openings denmark, hiring denmark, job listings denmark, python jobs denmark, grafisk designer job, data engineer job, softwareudvikler job, full stack developer job danmark.

cli/tests/retry-backoff.test.ts

View on GitHub
import { afterEach, describe, expect, test } from "bun:test";
import { apiFetch, htmlFetch } from "../src/helpers";

// The portal contract requires backoff on 429/5xx. These tests pin the retry
// loop offline: a stubbed fetch counts attempts, and a stubbed setTimeout
// fires immediately so the exhaustion case does not sleep through the real
// 500ms -> 5s backoff schedule. apiFetch and htmlFetch carry separate copies
// of the loop, so both are exercised to keep them from drifting apart.

const originalFetch = globalThis.fetch;
const originalSetTimeout = globalThis.setTimeout;

afterEach(() => {
  globalThis.fetch = originalFetch;
  globalThis.setTimeout = originalSetTimeout;
});

function instantTimers() {
  globalThis.setTimeout = ((fn: () => void) =>
    originalSetTimeout(fn, 0)) as unknown as typeof setTimeout;
}

function stubFetch(responses: Array<() => Response>): { calls: number } {
  const state = { calls: 0 };
  globalThis.fetch = (async () => {
    const i = Math.min(state.calls, responses.length - 1);
    state.calls++;
    return responses[i]();
  }) as unknown as typeof fetch;
  return state;
}

describe("htmlFetch retry/backoff", () => {
  test("retries a 429 and succeeds on the next attempt", async () => {
    instantTimers();
    const state = stubFetch([
      () => new Response("", { status: 429 }),
      () => new Response("<html>ok</html>", { status: 200 }),
    ]);

    const html = await htmlFetch("https://www.jobindex.dk/x");
    expect(html).toContain("ok");
    expect(state.calls).toBe(2);
  });

  test("does not retry a plain 4xx", async () => {
    const state = stubFetch([() => new Response("", { status: 400 })]);

    await expect(htmlFetch("https://www.jobindex.dk/x")).rejects.toThrow(/400/);
    expect(state.calls).toBe(1);
  });

  test("gives up after the initial attempt plus six retries on persistent 5xx", async () => {
    instantTimers();
    const state = stubFetch([() => new Response("", { status: 500 })]);

    await expect(htmlFetch("https://www.jobindex.dk/x")).rejects.toThrow(/500/);
    expect(state.calls).toBe(7);
  });
});

describe("apiFetch retry/backoff", () => {
  test("retries a 429 and succeeds on the next attempt", async () => {
    instantTimers();
    const state = stubFetch([
      () => new Response("", { status: 429 }),
      () => new Response('{"ok":true}', { status: 200 }),
    ]);

    const data = await apiFetch<{ ok: boolean }>("/x");
    expect(data.ok).toBe(true);
    expect(state.calls).toBe(2);
  });

  test("does not retry a plain 4xx", async () => {
    const state = stubFetch([() => new Response("", { status: 400 })]);

    await expect(apiFetch("/x")).rejects.toThrow(/400/);
    expect(state.calls).toBe(1);
  });

  test("gives up after the initial attempt plus six retries on persistent 5xx", async () => {
    instantTimers();
    const state = stubFetch([() => new Response("", { status: 500 })]);

    await expect(apiFetch("/x")).rejects.toThrow(/500/);
    expect(state.calls).toBe(7);
  });
});
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 323kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall