Skip to content

paperclipai/paperclip / .agents/skills/directions-lab

directions-lab

Verified

Scaffold a directions lab that shows shipped UI (Today) beside 2-3 design directions, with surface tabs, theme and animation toggles and the V1 MVP hover motion, registered in design-proposals Storybook. Use for a directions page or lab, or to explore design directions next to production.

FileKindSize
SKILL.mdskill md15.4 KB
agents/openai.yamlconfig291 B
assets/PRECEDENTother187 B
assets/motion/v1-mvp-motion.cssother787 B
assets/templates/api-routes.ts.mjsscript531 B
assets/templates/api-stub.ts.mjsscript1.9 KB
assets/templates/build-info.ts.mjsscript220 B
assets/templates/define-lab.ts.mjsscript3.9 KB
assets/templates/direction/MotionSpecimen.tsx.mjsscript2.3 KB
assets/templates/direction/SlotBody.tsx.mjsscript521 B
assets/templates/direction/index.tsx.mjsscript445 B
assets/templates/direction/tokens.css.mjsscript1.1 KB
assets/templates/entry.html.mjsscript752 B
assets/templates/fixtures.ts.mjsscript1.2 KB
assets/templates/frames/AppShell.tsx.mjsscript5.2 KB
assets/templates/frames/Board.tsx.mjsscript4.8 KB
assets/templates/frames/LabToolbar.tsx.mjsscript4.4 KB
assets/templates/frames/Slot.tsx.mjsscript329 B
assets/templates/frames/SurfaceFrame.tsx.mjsscript1.3 KB
assets/templates/frames/SurfaceView.tsx.mjsscript540 B
assets/templates/kit.ts.mjsscript1.9 KB
assets/templates/lab-state.ts.mjsscript1.8 KB
assets/templates/lab.css.mjsscript74 B
assets/templates/launch-entries.json.mjsscript680 B
assets/templates/main.tsx.mjsscript6.2 KB
assets/templates/providers.tsx.mjsscript920 B
assets/templates/registry.ts.mjsscript1.6 KB
assets/templates/shot.cjs.mjsscript10.0 KB
assets/templates/stories/compare.stories.tsx.mjsscript3.4 KB
assets/templates/tests/api-stub.test.ts.mjsscript1.6 KB
assets/templates/tests/lab-state.test.ts.mjsscript3.1 KB
assets/templates/tests/motion-contract.test.ts.mjsscript5.7 KB
assets/templates/tests/registry.test.ts.mjsscript2.5 KB
assets/templates/tests/today.test.tsx.mjsscript2.0 KB
assets/templates/today/SlotBody.tsx.mjsscript972 B
assets/templates/today/adapters.ts.mjsscript748 B
assets/templates/today/index.tsx.mjsscript387 B
assets/templates/vite.config.mjs.mjsscript2.9 KB
evals/asks-how-many-directions/case.yamlconfig343 B
evals/asks-how-many-directions/graders/01-expected-output.mdmarkdown347 B
evals/asks-how-many-directions/prompt.mdmarkdown197 B
evals/multi-surface-three-directions/case.yamlconfig674 B
evals/multi-surface-three-directions/graders/01-expected-output.mdmarkdown672 B
evals/multi-surface-three-directions/prompt.mdmarkdown510 B
evals/single-surface-two-directions/case.yamlconfig398 B
evals/single-surface-two-directions/graders/01-expected-output.mdmarkdown397 B
evals/single-surface-two-directions/prompt.mdmarkdown284 B
references/canonical-directory.mdmarkdown15.5 KB
references/design-proposals-storybook.mdmarkdown29.2 KB
references/drawing-phases.mdmarkdown21.7 KB
references/generator.mdmarkdown25.7 KB
references/lab-anatomy.mdmarkdown28.7 KB
references/lifecycle.mdmarkdown18.9 KB
references/motion-spec.mdmarkdown21.1 KB
references/questions-and-defaults.mdmarkdown15.6 KB
references/repo-gates.mdmarkdown20.8 KB
references/today-fixtures-and-build.mdmarkdown34.9 KB
scripts/lib/args.mjsscript2.4 KB
scripts/lib/capabilities.mjsscript2.1 KB
scripts/lib/check.mjsscript10.6 KB
scripts/lib/context.mjsscript8.6 KB
scripts/lib/modes.mjsscript1001 B
scripts/lib/ports.mjsscript1.9 KB
scripts/lib/registry-edit.mjsscript5.2 KB
scripts/lib/render.mjsscript3.6 KB
scripts/lib/shared-files.mjsscript2.9 KB
scripts/lib/verify.mjsscript1.8 KB
scripts/lib/write.mjsscript2.3 KB
scripts/scaffold.mjsscript14.3 KB
scripts/scaffold.test.mjsscript33.7 KB

assets/templates/frames/Board.tsx.mjs

View on GitHub
export default () => `import { useCallback, useEffect, useRef, useState, type CSSProperties, type SyntheticEvent } from "react";
import { DIRECTION_IDS, KIT_META, SURFACE_IDS, surfaceOf, type DirectionId, type SurfaceId } from "../kit";
import { labSearch, type LabTheme, type LabView } from "../lab-state";

const FRAME_WIDTH = 1440;
const FRAME_MIN_HEIGHT = 900;

const LABEL = "font-mono text-(length:--text-nano) uppercase tracking-(--tracking-label) text-muted-foreground";

interface Toggles {
  theme: LabTheme;
  anim: boolean;
  proposal: boolean;
}

interface TileProps extends Toggles {
  direction: DirectionId;
  view: SurfaceId;
  maxHeight?: number;
}

function Tile({ direction, view, theme, anim, proposal, maxHeight }: TileProps) {
  const wrapRef = useRef<HTMLAnchorElement>(null);
  const contentObserver = useRef<ResizeObserver | null>(null);
  const [scale, setScale] = useState(0);
  const [height, setHeight] = useState(FRAME_MIN_HEIGHT);

  useEffect(() => {
    const wrap = wrapRef.current;
    if (!wrap) return;
    const observer = new ResizeObserver(([entry]) => setScale(entry.contentRect.width / FRAME_WIDTH));
    observer.observe(wrap);
    return () => observer.disconnect();
  }, []);

  useEffect(() => () => contentObserver.current?.disconnect(), []);

  const onLoad = useCallback((event: SyntheticEvent<HTMLIFrameElement>) => {
    const root = event.currentTarget.contentDocument?.getElementById("root");
    if (!root) return;
    const measure = () => setHeight(Math.max(FRAME_MIN_HEIGHT, Math.ceil(root.getBoundingClientRect().height)));
    contentObserver.current?.disconnect();
    contentObserver.current = new ResizeObserver(measure);
    contentObserver.current.observe(root);
    measure();
  }, []);

  const search = labSearch({ direction, view, theme, chrome: false, anim, proposal });
  const shown = Math.min(height, maxHeight ?? height);
  return (
    <a
      ref={wrapRef}
      href={labSearch({ direction, view, theme, chrome: true, anim, proposal })}
      title={\`Open \${KIT_META[direction].name} · \${view}\`}
      className="block overflow-hidden rounded-sm border border-border outline-none focus-visible:ring-2 focus-visible:ring-ring"
      style={{ height: scale ? shown * scale : undefined }}
    >
      <iframe
        src={search}
        title={\`\${KIT_META[direction].name} · \${view}\`}
        tabIndex={-1}
        scrolling="no"
        onLoad={onLoad}
        className="pointer-events-none block origin-top-left border-0"
        style={{ width: FRAME_WIDTH, height, transform: \`scale(\${scale})\` }}
      />
    </a>
  );
}

function ColumnHead({ children }: { children: string }) {
  return <span className={LABEL}>{children}</span>;
}

const columns = (count: number, head: string) => ({ "--gtc-board": \`\${head}repeat(\${count}, minmax(0, 1fr))\` }) as CSSProperties;

function KitBoard({ direction, ...toggles }: Toggles & { direction: DirectionId }) {
  return (
    <div className="grid grid-cols-(--gtc-board) items-start gap-4" style={columns(SURFACE_IDS.length, "")}>
      {SURFACE_IDS.map((view) => (
        <div key={view} className="flex min-w-0 flex-col gap-2">
          <ColumnHead>{surfaceOf(view).label}</ColumnHead>
          <Tile direction={direction} view={view} {...toggles} maxHeight={2 * FRAME_MIN_HEIGHT} />
        </div>
      ))}
    </div>
  );
}

function AllBoard({ view, ...toggles }: Toggles & { view: LabView }) {
  const surfaces: readonly SurfaceId[] = view === "board" ? SURFACE_IDS : [view];
  return (
    <div className="grid grid-cols-(--gtc-board) items-start gap-x-4 gap-y-8" style={columns(surfaces.length, "7rem ")}>
      <span />
      {surfaces.map((surface) => (
        <ColumnHead key={surface}>{surfaceOf(surface).label}</ColumnHead>
      ))}
      {DIRECTION_IDS.map((direction) => (
        <div key={direction} className="contents">
          <div className="flex flex-col gap-1">
            <span className="text-sm font-semibold text-foreground">{KIT_META[direction].name}</span>
            <span className="text-xs text-muted-foreground">{KIT_META[direction].tagline}</span>
          </div>
          {surfaces.map((surface) => (
            <Tile key={surface} direction={direction} view={surface} {...toggles} maxHeight={2 * FRAME_MIN_HEIGHT} />
          ))}
        </div>
      ))}
    </div>
  );
}

export function Board({ direction, view, ...toggles }: Toggles & { direction: DirectionId | "all"; view: LabView }) {
  return (
    <div className="flex min-h-225 flex-col gap-6 bg-background p-6 text-foreground">
      <header className="flex flex-col gap-1">
        <p className={LABEL}>Contact sheet · {toggles.theme}</p>
        <h1 className="text-lg font-semibold">{direction === "all" ? "All directions" : KIT_META[direction].name}</h1>
      </header>
      {direction === "all" ? <AllBoard view={view} {...toggles} /> : <KitBoard direction={direction} {...toggles} />}
    </div>
  );
}
`;
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: 322kUpdated 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