Skip to content

anbeime/skill / skills/hairline/hairline

hairline

Flagged

一句话生成跟随鼠标的交互式等轴测线框图(单文件、零依赖、双击即开),或把已有 SVG/Logo 重建为可交互线框。

FileKindSize
.github/FUNDING.ymlconfig20 B
.github/workflows/ci.ymlconfig1.2 KB
.github/workflows/consumers.ymlconfig954 B
.github/workflows/publish.ymlconfig3.0 KB
.gitignoreother351 B
.npmrcother55 B
CHANGELOG.mdmarkdown7.6 KB
CONTRIBUTING.mdmarkdown4.5 KB
LICENSEother1.0 KB
README.mdmarkdown11.5 KB
SKILL.mdskill md1.2 KB
apps/site/.gitignoreother82 B
apps/site/.vitest/json/output.jsonconfig22.3 KB
apps/site/app/docs/page.tsxother2.9 KB
apps/site/app/docs/sections.tsxother8.1 KB
apps/site/app/figures/page.tsxother2.4 KB
apps/site/app/globals.cssother43.7 KB
apps/site/app/inspo/page.tsxother14.0 KB
apps/site/app/layout.tsxother978 B
apps/site/app/llms.txt/route.tsscript228 B
apps/site/app/og/page.tsxother1.5 KB
apps/site/app/page.tsxother1.7 KB
apps/site/app/robots.tsscript382 B
apps/site/app/sitemap.tsscript382 B
apps/site/app/skills/page.tsxother6.2 KB
apps/site/components/anchor.tsxother1.3 KB
apps/site/components/assembly.tsxother10.2 KB
apps/site/components/catalogue.tsxother18.6 KB
apps/site/components/chrome.tsxother2.3 KB
apps/site/components/code-block.tsxother895 B
apps/site/components/command.tsxother1.6 KB
apps/site/components/copy.tsxother2.6 KB
apps/site/components/example-frame.tsxother3.1 KB
apps/site/components/install.tsxother1.7 KB
apps/site/components/made-frame.tsxother2.0 KB
apps/site/components/rail.tsxother11.0 KB
apps/site/components/skill-link.tsxother861 B
apps/site/components/tabs.tsxother4.1 KB
apps/site/next.config.mjsscript493 B
apps/site/package.jsonmanifest927 B
apps/site/playwright.config.tsscript485 B
apps/site/postcss.config.mjsscript60 B
apps/site/public/icon.svgother262 B
apps/site/public/inspo/craft.webpbinary61.9 KB
apps/site/public/inspo/dissection.webpbinary177.4 KB
apps/site/public/inspo/figures.webpbinary56.9 KB
apps/site/public/inspo/linear.webpbinary15.6 KB
apps/site/public/inspo/tune.webpbinary58.5 KB
apps/site/public/og.pngbinary94.3 KB
apps/site/public/skill/hairline-clearance.htmlother39.5 KB
apps/site/public/skill/hairline-cursor-tab.htmlother43.4 KB
apps/site/public/skill/hairline-deploy-liftoff.htmlother43.3 KB
apps/site/public/skill/hairline-firecrawl-reader.htmlother46.6 KB
apps/site/public/skill/hairline-funnel.htmlother40.4 KB
apps/site/public/skill/hairline-linear-cycle.htmlother43.5 KB
apps/site/public/skill/hairline-mastra.htmlother44.6 KB
apps/site/public/skill/hairline-notion.htmlother41.5 KB
apps/site/public/skill/hairline-resend-belt.htmlother46.5 KB
apps/site/public/skill/hairline-sidings.htmlother43.1 KB
apps/site/public/skill/hairline-storm.htmlother42.6 KB
apps/site/public/skill/hairline-vercel.htmlother40.6 KB
apps/site/test/catalogue.test.tsscript2.7 KB
apps/site/test/docs.test.tsscript8.9 KB
apps/site/test/figures.spec.tsscript15.0 KB
apps/site/test/share.test.tsscript652 B
apps/site/test/site.spec.tsscript44.8 KB
apps/site/test/skill.spec.tsscript17.8 KB
apps/site/test/skill.test.tsscript5.4 KB
apps/site/tsconfig.jsonconfig444 B
apps/site/turbo.jsonconfig364 B
apps/site/vercel.jsonconfig214 B
apps/site/vitest.config.tsscript265 B
assets/hero.gifbinary3.7 MB
fixtures/next-app/.gitignoreother123 B
fixtures/next-app/app/layout.tsxother281 B
fixtures/next-app/app/page.tsxother587 B
fixtures/next-app/app/registry/page.tsxother714 B
fixtures/next-app/app/vanilla.tsxother353 B
fixtures/next-app/next.config.mjsscript104 B
fixtures/next-app/package.jsonmanifest364 B
fixtures/next-app/tsconfig.jsonconfig590 B
fixtures/vite-vanilla/.gitignoreother38 B
fixtures/vite-vanilla/index.htmlother1.3 KB
fixtures/vite-vanilla/package.jsonmanifest245 B
fixtures/vite-vanilla/src/main.tsscript1.3 KB
fixtures/vite-vanilla/tsconfig.jsonconfig248 B
package.jsonmanifest895 B
packages/hairline/package.jsonmanifest2.4 KB
packages/hairline/playwright.config.tsscript637 B
packages/hairline/src/core/iso.tsscript9.1 KB
packages/hairline/src/core/motion.tsscript3.8 KB
packages/hairline/src/core/stage.tsscript15.0 KB
packages/hairline/src/core/styles.tsscript4.1 KB
packages/hairline/src/figures/basket.tsscript9.5 KB
packages/hairline/src/figures/branches.tsscript7.7 KB
packages/hairline/src/figures/cabinet.tsscript7.8 KB
packages/hairline/src/figures/dish.tsscript9.7 KB
packages/hairline/src/figures/drawer.tsscript7.5 KB
packages/hairline/src/figures/elevator.tsscript7.6 KB
packages/hairline/src/figures/exploded.tsscript5.2 KB
packages/hairline/src/figures/format.tsscript6.2 KB
packages/hairline/src/figures/hub.tsscript8.6 KB
packages/hairline/src/figures/keyboard.tsscript6.3 KB
packages/hairline/src/figures/laptop.tsscript7.3 KB
packages/hairline/src/figures/lockers.tsscript7.6 KB
packages/hairline/src/figures/loupe.tsscript6.1 KB
packages/hairline/src/figures/padlock.tsscript7.7 KB
packages/hairline/src/figures/patch.tsscript10.1 KB
packages/hairline/src/figures/phone.tsscript9.6 KB
packages/hairline/src/figures/phosphor.tsscript5.6 KB
packages/hairline/src/figures/plot.tsscript5.4 KB
packages/hairline/src/figures/plug.tsscript9.7 KB
packages/hairline/src/figures/query.tsscript8.8 KB
packages/hairline/src/figures/rail.tsscript4.9 KB
packages/hairline/src/figures/rebuild.tsscript10.3 KB
packages/hairline/src/figures/relay.tsscript8.0 KB
packages/hairline/src/figures/riffle-geometry.tsscript4.2 KB
packages/hairline/src/figures/riffle.tsscript5.2 KB
packages/hairline/src/figures/router.tsscript6.4 KB
packages/hairline/src/figures/settle.tsscript8.6 KB
packages/hairline/src/figures/sieve.tsscript5.9 KB
packages/hairline/src/figures/slow.tsscript7.2 KB
packages/hairline/src/figures/stack.tsscript5.5 KB
packages/hairline/src/figures/terminal.tsscript8.1 KB
packages/hairline/src/figures/terrain.tsscript4.4 KB
packages/hairline/src/figures/turntable-geometry.tsscript3.9 KB
packages/hairline/src/figures/turntable.tsscript6.5 KB
packages/hairline/src/figures/vault.tsscript9.8 KB
packages/hairline/src/index.tsscript17.9 KB
packages/hairline/src/intensity.tsscript3.2 KB
packages/hairline/src/mount.tsscript6.5 KB
packages/hairline/src/react.tsxother9.5 KB
packages/hairline/src/slab.tsscript3.1 KB
packages/hairline/test/browser/entry.tsscript1.4 KB
packages/hairline/test/browser/figures.spec.tsscript6.3 KB
packages/hairline/test/browser/harness.htmlother321 B
packages/hairline/test/browser/look.spec.tsscript9.5 KB
packages/hairline/test/browser/parity.spec.tsscript2.4 KB
packages/hairline/test/browser/read.spec.tsscript8.9 KB
packages/hairline/test/browser/serve.mjsscript1.7 KB
packages/hairline/test/browser/skill.spec.tsscript12.3 KB
packages/hairline/test/browser/theme.spec.tsscript3.9 KB
packages/hairline/test/dom.tsscript3.0 KB
packages/hairline/test/geometry.test.tsscript2.8 KB
packages/hairline/test/intensity.test.tsscript2.1 KB
packages/hairline/test/mount.test.tsscript33.1 KB
packages/hairline/test/parity/capture.mjsscript3.6 KB
packages/hairline/test/parity/clock.jsscript3.8 KB
packages/hairline/test/parity/driver.mjsscript1.9 KB
packages/hairline/test/parity/golden/exploded.jsonconfig24.7 KB
packages/hairline/test/parity/golden/phosphor.jsonconfig28.5 KB
packages/hairline/test/parity/golden/riffle.jsonconfig137.5 KB
packages/hairline/test/parity/golden/slow.jsonconfig41.4 KB
packages/hairline/test/parity/golden/terrain.jsonconfig216.7 KB
packages/hairline/test/parity/golden/turntable.jsonconfig32.3 KB
packages/hairline/test/parity/scripts.mjsscript2.8 KB
packages/hairline/test/react.test.tsxother7.5 KB
packages/hairline/test/skill/adopt.test.tsscript1.4 KB
packages/hairline/test/skill/build.test.tsscript3.3 KB
packages/hairline/test/skill/fixtures/broken.txtmarkdown19 B
packages/hairline/test/skill/fixtures/compound.svgother148 B
packages/hairline/test/skill/fixtures/illustrator.svgother334 B
packages/hairline/test/skill/fixtures/light.svgother123 B
packages/hairline/test/skill/fixtures/mark.svgother226 B
packages/hairline/test/skill/fixtures/mixed.svgother530 B
packages/hairline/test/skill/fixtures/moved.svgother182 B
packages/hairline/test/skill/fixtures/nested.svgother274 B
packages/hairline/test/skill/fixtures/rocket.svgother577 B
packages/hairline/test/skill/fixtures/scripted.svgother199 B
packages/hairline/test/skill/kernel.test.tsscript1.8 KB
packages/hairline/test/skill/look.test.tsscript2.2 KB
packages/hairline/test/skill/read.test.tsscript9.5 KB
packages/hairline/test/skill/shape.test.tsscript8.6 KB
packages/hairline/test/skill/validate.test.tsscript10.1 KB
packages/hairline/test/ssr.test.tsxother1.1 KB
packages/hairline/test/stage.test.tsscript11.6 KB
packages/hairline/test/types.test-d.tsxother4.9 KB
packages/hairline/tsconfig.jsonconfig212 B
packages/hairline/tsup.config.tsscript844 B
packages/hairline/vitest.config.tsscript163 B
pnpm-lock.yamlmanifest129.1 KB
pnpm-workspace.yamlconfig142 B
registry/build.mjsscript1.8 KB
registry/src/hairline.tsxother4.7 KB
registry/validate.mjsscript2.2 KB
scripts/base-url.mjsscript1.4 KB
scripts/changelog.mjsscript1.3 KB
scripts/consumers.mjsscript7.4 KB
scripts/kernel.mjsscript8.8 KB
scripts/og.mjsscript1.7 KB
scripts/release.mjsscript8.0 KB
tsconfig.base.jsonconfig442 B
turbo.jsonconfig620 B

apps/site/test/skill.spec.ts

View on GitHub
import { expect, test, type FrameLocator, type Page } from "@playwright/test";

const INSTALL = "npx skills add lucasmarkes/hairline";
const IDEAS = [
  "a sales funnel",
  "a rate limiter",
  "git branches",
  "weather over a city",
];
/** What was typed after /hairline-adopt, in page order: the SVG, then what the pointer does. */
const ADOPTED = [
  "deploy.svg the pointer's height is the thrust; raised high enough, the rocket lifts off",
  "firecrawl.svg the flame reads a page: point down it, and each part peels off onto a sheet of markdown",
  "resend.svg the R is the sender: while the pointer is over it, a belt runs out of its block and each letter rides it into a tray",
  "linear.svg the stripes are lanes: point up across them, and the issues move lane to lane until they are done",
  "cursor.svg the mark is the caret over code: point down the page, and each suggested line is accepted",
];
/** Every example on the page: hairline-create's, then hairline-adopt's. */
const ALL = IDEAS.length + ADOPTED.length;
/** A line as a pattern that matches only itself: the marks' prompts hold full stops. */
const literal = (text: string) => text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");

function watch(page: Page): string[] {
  const noise: string[] = [];
  page.on("console", (m) => {
    // Vercel Analytics' script exists only on Vercel
    if (m.location().url.includes("/_vercel/")) return;
    if (m.type() === "error" || m.type() === "warning") noise.push(`${m.type()}: ${m.text()}`);
  });
  page.on("pageerror", (e) => noise.push(`pageerror: ${e}`));
  return noise;
}

/** The frames are lazy: each is brought on screen, then waited for until its figure is drawn. */
async function frames(page: Page): Promise<FrameLocator[]> {
  const out: FrameLocator[] = [];
  for (let i = 0; i < ALL; i++) {
    const row = page.locator("[data-example]").nth(i);
    await row.scrollIntoViewIfNeeded();
    const frame = row.frameLocator("iframe");
    await expect(frame.locator("#stage svg")).toHaveCount(1);
    out.push(frame);
  }
  return out;
}

/**
 * Measured inside the frame, apart from how the frame is fitted: whether its page scrolls, and the band left under
 * its column beyond the page's own 24px of padding.
 */
const fit = (frame: FrameLocator) => frame.locator("main").evaluate((main) => ({
  scrolls: document.documentElement.scrollHeight > document.documentElement.clientHeight,
  band: window.innerHeight - main.getBoundingClientRect().bottom - 24,
}));

test("/skills opens with the install command, nine prompts and nine live figures, and a clean console", async ({ page }) => {
  const noise = watch(page);
  await page.goto("/skills");
  await expect(page).toHaveTitle("Make your own figure · hairline");
  await expect(page.getByRole("heading", { level: 1 })).toHaveText("Make your own figure");
  await expect(page.locator('[data-command="install"]')).toHaveText(new RegExp(INSTALL));
  await expect(page.locator('[data-command="prompt"]')).toHaveText([
    ...IDEAS.map((idea) => new RegExp(`/hairline-create ${literal(idea)}$`)),
    ...ADOPTED.map((idea) => new RegExp(`/hairline-adopt ${literal(idea)}$`)),
  ]);
  await expect(page.locator("#how [data-steps] > li")).toHaveCount(5);
  await expect(page.locator("#adopt-how [data-steps] > li")).toHaveCount(5);
  await expect(page.locator('#adopt-use [data-command="usage"]')).toHaveText(/\/hairline-adopt <file\.svg>/);
  // only hairline-adopt's examples start from companies' marks
  await expect(page.locator("#adopt-examples")).toContainText("Hairline is not affiliated with them.");
  await expect(page.locator("#examples")).not.toContainText("Hairline is not affiliated with them.");
  for (const name of ["vercel", "mastra", "notion"]) await expect(page.locator(`[data-example="${name}"]`)).toHaveCount(0);
  await frames(page);
  expect(noise).toEqual([]);
});

test("a figure on /skill answers the pointer and goes back to rest", async ({ page }) => {
  await page.goto("/skills");
  for (const frame of await frames(page)) {
    const read = frame.locator("#read");
    await expect(read).toHaveText("rest");
    // the frames were each brought on screen in turn; this one has to be on screen again for the pointer to reach it
    await frame.locator("#stage").scrollIntoViewIfNeeded();
    const box = (await frame.locator("#stage").boundingBox())!;
    // somewhere on the stage the figure picks something; walk a grid until it does
    let answered = false;
    for (const fy of [0.5, 0.35, 0.65]) {
      for (const fx of [0.5, 0.35, 0.65]) {
        await page.mouse.move(box.x + box.width * fx, box.y + box.height * fy, { steps: 4 });
        if ((await read.textContent()) !== "rest") { answered = true; break; }
      }
      if (answered) break;
    }
    expect(answered).toBe(true);
    await page.mouse.move(2, 2);
    await expect(read).toHaveText("rest");
  }
});

test("each frame is named by what its figure means, and shows the page the skill wrote, light", async ({ page, request }) => {
  await page.goto("/skills");
  await expect(page.locator("[data-example]")).toHaveCount(ALL);
  for (const row of await page.locator("[data-example]").all()) {
    const frame = row.locator("iframe");
    expect((await frame.getAttribute("title"))!.length).toBeGreaterThan(20);
    const src = (await frame.getAttribute("src"))!;
    expect(src).toMatch(/^\/skill\/hairline-[a-z0-9-]+\.html\?theme=light$/);
    const res = await request.get(src.replace(/\?.*$/, ""));
    expect(res.status()).toBe(200);
    expect(res.headers()["content-type"]).toContain("text/html");
    expect(await res.text()).toContain('id="hl-figure"');
  }
});

test("each example shows the figure, its controls and what it means, without the page's name tags or rules line", async ({ page }) => {
  await page.goto("/skills");
  await expect(page.getByRole("link", { name: "Open the page" })).toHaveCount(0);
  for (const frame of await frames(page)) {
    for (const hidden of ["#name", "#read", "#rules"]) await expect(frame.locator(hidden)).toBeHidden();
    await expect(frame.locator("#means")).toBeVisible();
    await expect(frame.locator("#intensity")).toBeVisible();
  }
});

test("each example is named by its prompt, and each copy button says which line it copies", async ({ page }) => {
  await page.goto("/skills");
  for (const idea of IDEAS) {
    const row = page.getByRole("article", { name: `/hairline-create ${idea}`, exact: true });
    await expect(row).toHaveCount(1);
    await expect(row.getByRole("button", { name: `Copy prompt: ${idea}`, exact: true })).toHaveCount(1);
  }
  for (const idea of ADOPTED) {
    const row = page.getByRole("article", { name: `/hairline-adopt ${idea}`, exact: true });
    await expect(row).toHaveCount(1);
    await expect(row.getByRole("button", { name: `Copy prompt: ${idea}`, exact: true })).toHaveCount(1);
  }
  await expect(page.getByRole("button", { name: "Copy follow-up: git branches", exact: true })).toHaveCount(1);
  await expect(page.getByRole("button", { name: "Copy follow-up: weather over a city", exact: true })).toHaveCount(1);
});

test("the install command and a prompt copy as they are written", async ({ page, context }) => {
  await context.grantPermissions(["clipboard-read", "clipboard-write"]);
  await page.goto("/skills");
  await page.locator('[data-command="install"] .icopy').click();
  expect(await page.evaluate(() => navigator.clipboard.readText())).toBe(INSTALL);
  await page.locator('[data-command="prompt"] .icopy').nth(2).click();
  expect(await page.evaluate(() => navigator.clipboard.readText())).toBe("/hairline-create git branches");
});

for (const width of [1200, 320]) {
  test(`at ${width}px /skill does not scroll sideways, and no frame scrolls inside`, async ({ page }) => {
    await page.setViewportSize({ width, height: 800 });
    await page.goto("/skills");
    const list = await frames(page);
    expect(await page.evaluate(() => document.documentElement.scrollWidth - document.documentElement.clientWidth)).toBe(0);
    for (const frame of list) {
      await expect.poll(async () => { const f = await fit(frame); return !f.scrolls && f.band < 1; }).toBe(true);
    }
  });
}

for (const width of [320, 900]) {
  test(`at ${width}px every prompt reads whole, and the install line fades while more of it is hidden`, async ({ page }) => {
    await page.setViewportSize({ width, height: 800 });
    await page.goto("/skills");
    const lines = page.locator('[data-command="prompt"] .pill-line');
    await expect(lines).toHaveCount(ALL);
    for (const over of await lines.evaluateAll((els) => els.map((el) => el.scrollWidth - el.clientWidth))) expect(over).toBeLessThanOrEqual(0);
    const install = page.locator('[data-command="install"] .pill-line');
    expect(await install.evaluate((el) => getComputedStyle(el).whiteSpace)).toBe("nowrap");
    const hidden = await install.evaluate((el) => el.scrollWidth - el.clientWidth > 1);
    if (hidden) {
      await expect(install).toHaveAttribute("data-more", "");
      await install.evaluate((el) => { el.scrollLeft = el.scrollWidth; });
      await expect(install).not.toHaveAttribute("data-more");
    } else {
      await expect(install).not.toHaveAttribute("data-more");
    }
  });
}

test("at 1200px each card stacks its words over its figure, and the plate sits centred in the card", async ({ page }) => {
  await page.goto("/skills");
  await frames(page);
  await page.evaluate(() => window.scrollTo(0, 0));
  for (const row of await page.locator("[data-example]").all()) {
    const m = await row.evaluate((el) => {
      const frame = el.querySelector("iframe")!;
      const at = frame.getBoundingClientRect();
      const plate = frame.contentDocument!.querySelector(".plate")!.getBoundingClientRect();
      const figure = el.querySelector(".example-figure")!.getBoundingClientRect();
      const words = el.querySelector(".ex-b")!.getBoundingClientRect();
      return { under: figure.top - words.bottom, left: at.left + plate.left - figure.left, right: figure.right - (at.left + plate.right) };
    });
    expect(Math.abs(m.under)).toBeLessThan(1);
    expect(m.left).toBeGreaterThanOrEqual(0);
    expect(Math.abs(m.left - m.right)).toBeLessThan(1);
  }
});

test.describe("on a dark system", () => {
  test.use({ colorScheme: "dark" });

  test("every frame is still light, as the site is", async ({ page }) => {
    await page.goto("/skills");
    for (const frame of await frames(page)) {
      expect(await frame.locator("body").evaluate((body) => getComputedStyle(body).backgroundColor)).toBe("rgb(255, 255, 255)");
    }
  });
});

test.describe("without JavaScript", () => {
  test.use({ javaScriptEnabled: false });

  test("/skills still gives the install command, the prompts and the frames with the pages", async ({ page }) => {
    await page.goto("/skills");
    await expect(page.locator('[data-command="install"]')).toHaveText(new RegExp(INSTALL));
    await expect(page.locator('[data-command="prompt"]')).toHaveCount(ALL);
    await expect(page.locator('[data-example] iframe[src^="/skill/hairline-"]')).toHaveCount(ALL);
  });
});

test("the top bar's Skills link opens /skills", async ({ page }) => {
  await page.goto("/");
  await page.getByRole("banner").getByRole("link", { name: "Skills" }).click();
  await expect(page).toHaveURL(/\/skills$/);
  await expect(page.getByRole("heading", { level: 1 })).toHaveText("Make your own figure");
});

test("the top bar fits a 320px screen on one row, the version left out so the name stands clear of the links", async ({ page }) => {
  await page.setViewportSize({ width: 320, height: 700 });
  await page.goto("/skills");
  await expect(page.locator(".topbar [data-version]")).toBeHidden();
  // from the name's last letter to the Skills link's first: at least the 20px the links keep between each other
  const gap = await page.evaluate(() => {
    const text = (el: Element) => { const r = document.createRange(); r.selectNodeContents(el); return r.getBoundingClientRect(); };
    return text(document.querySelector(".topbar-link")!).left - text(document.querySelector(".topbar-name")!).right;
  });
  expect(gap).toBeGreaterThanOrEqual(20);
  expect(await page.evaluate(() => document.documentElement.scrollWidth - document.documentElement.clientWidth)).toBe(0);
  const tops = await page.locator(".topbar nav > *").evaluateAll((els) => els.filter((el) => getComputedStyle(el).display !== "none").map((el) => Math.round(el.getBoundingClientRect().top)));
  expect(new Set(tops).size).toBe(1);
  const bar = (await page.locator(".topbar").boundingBox())!;
  const last = (await page.locator(".topbar nav > *").last().boundingBox())!;
  expect(last.x + last.width).toBeLessThanOrEqual(bar.x + bar.width);
});

test("the home's hero points to the skills in one line between the buttons and the drawing, and it reaches /skills", async ({ page }) => {
  for (const width of [1200, 320]) {
    await page.setViewportSize({ width, height: 800 });
    await page.goto("/");
    const link = page.locator(".hero-rise").getByRole("link", { name: "Or draw your own with the skill" });
    await expect(link).toHaveAttribute("href", "/skills");
    expect(await page.evaluate(() => document.documentElement.scrollWidth - document.documentElement.clientWidth)).toBe(0);
    const get = (await page.locator(".hero-get").boundingBox())!;
    const box = (await link.boundingBox())!;
    const art = (await page.locator("[data-assembly]").boundingBox())!;
    expect(box.y).toBeGreaterThanOrEqual(get.y + get.height);
    expect(box.y + box.height).toBeLessThanOrEqual(art.y);
  }
  await page.locator(".hero-rise").getByRole("link", { name: "Or draw your own with the skill" }).click();
  await expect(page).toHaveURL(/\/skills$/);
  await expect(page.getByRole("heading", { level: 1 })).toHaveText("Make your own figure");
});

test("a hover on the skill's link draws the hexagon's three inner edges into a cube", async ({ page }) => {
  await page.goto("/");
  const edges = page.locator(".skill-link-edge");
  await expect(edges).toHaveCount(3);
  for (const edge of await edges.all()) await expect(edge).toHaveCSS("stroke-dashoffset", "1px");
  await page.locator(".skill-link").hover();
  for (const edge of await edges.all()) await expect(edge).toHaveCSS("stroke-dashoffset", "0px");
});

const FOLLOW_UPS: Record<string, string | undefined> = {
  funnel: undefined,
  clearance: undefined,
  sidings: "The rails almost disappear and the trains read as loose blocks. Make it read as a railway at a glance.",
  storm: "The cloud looks like a stack of cylinders. Make it read as a cloud at a glance.",
  "deploy-liftoff": undefined,
  "firecrawl-reader": undefined,
  "resend-belt": undefined,
  "linear-cycle": undefined,
  "cursor-tab": undefined,
};

test("a follow-up sits under its prompt as a second line that wraps instead of scrolling, and copies on its own", async ({ page, context }) => {
  await context.grantPermissions(["clipboard-read", "clipboard-write"]);
  await page.setViewportSize({ width: 320, height: 800 });
  await page.goto("/skills");
  for (const [name, text] of Object.entries(FOLLOW_UPS)) {
    const row = page.locator(`[data-example="${name}"]`);
    const line = row.locator('[data-command="follow-up"]');
    if (!text) { await expect(line).toHaveCount(0); continue; }
    await expect(line).toHaveText(text);
    const prompt = (await row.locator('[data-command="prompt"]').boundingBox())!;
    expect((await line.boundingBox())!.y).toBeGreaterThanOrEqual(prompt.y + prompt.height);
    expect(await line.locator(".pill-line").evaluate((el) => el.scrollWidth - el.clientWidth)).toBeLessThanOrEqual(0);
    await line.locator(".icopy").click();
    expect(await page.evaluate(() => navigator.clipboard.readText())).toBe(text);
  }
});

test("/skill, the page's old address, moves for good to /skills, and the examples stay where they were", async ({ page, request }) => {
  const res = await request.get("/skill", { maxRedirects: 0 });
  expect(res.status()).toBe(308);
  expect(res.headers()["location"]).toBe("/skills");
  await page.goto("/skill");
  await expect(page).toHaveURL(/\/skills$/);
  await expect(page.getByRole("heading", { level: 1 })).toHaveText("Make your own figure");
  expect((await request.get("/skill/hairline-funnel.html", { maxRedirects: 0 })).status()).toBe(200);
});

test("the rail holds a group for each skill, and hairline-adopt's reaches its sections", async ({ page }) => {
  await page.setViewportSize({ width: 1400, height: 900 });
  await page.goto("/skills");
  await expect(page.locator(".rail-title")).toHaveText(["hairline-create", "hairline-adopt"]);
  for (const id of ["adopt-use", "adopt-how", "adopt-examples"]) await expect(page.locator(`#${id}`)).toHaveCount(1);
  await expect(page.locator(".col-end").getByRole("link", { name: "hairline-adopt" })).toHaveAttribute("href", /\/tree\/main\/skills\/hairline-adopt$/);
});

test("the Linear issues glide while the pointer moves, in a frame that loaded late", async ({ page }) => {
  await page.goto("/skills");
  // read down the page, so the frame loads long after the page did, where a frame's clock lags performance.now()
  const row = page.locator('[data-example="linear-cycle"]');
  for (let i = 0; i < 40 && !(await row.isVisible() && (await row.boundingBox())!.y < 300); i++) {
    await page.mouse.wheel(0, 500);
    await page.waitForTimeout(150);
  }
  await row.scrollIntoViewIfNeeded();
  const frame = row.frameLocator("iframe");
  await expect(frame.locator("#stage svg")).toHaveCount(1);
  const shapes = () => frame.locator("#stage svg").evaluate((svg) => [...svg.querySelectorAll("path")].map((p) => p.getAttribute("d")).join("|"));
  const box = (await row.locator("iframe").boundingBox())!;
  const at = (await frame.locator("#stage").boundingBox())!;
  await page.mouse.move(box.x + 10, box.y + 10);
  const rest = await shapes();
  // up across the stripes, toward the disc, the way the mark moves; the cards leave while the pointer is still going
  for (let k = 0; k <= 10; k++) await page.mouse.move(at.x + at.width * (0.3 + 0.04 * k), at.y + at.height * (0.8 - 0.05 * k), { steps: 2 });
  await page.waitForTimeout(600);
  expect(await shapes()).not.toBe(rest);
});

slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall