paperclipai/paperclip / .agents/skills/directions-lab
directions-lab
VerifiedScaffold 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.
assets/templates/api-stub.ts.mjs
View on GitHubexport default (ctx) => `import { COMPANY } from "./fixtures";
export type ApiRoute = (pathname: string, method: string) => unknown | undefined;
const routes: ApiRoute[] = [];
export function registerApiRoute(route: ApiRoute): void {
routes.push(route);
}
const json = (body: unknown) =>
new Response(JSON.stringify(body), { status: 200, headers: { "content-type": "application/json" } });
function respond(pathname: string, method: string): Response {
for (const route of routes) {
const body = route(pathname, method);
if (body !== undefined) return json(body);
}
if (pathname.endsWith("/auth/get-session")) {
return json({ session: { id: "lab-session", userId: "lab-user" }, user: { id: "lab-user", name: "Lab", email: \`lab@\${COMPANY.name}.example\` } });
}
if (pathname.endsWith("/companies")) return json([COMPANY]);
console.debug("${ctx.tag} unhandled", method, pathname);
return json({});
}
let holders = 0;
let realFetch: typeof window.fetch | null = null;
let stubFetch: typeof window.fetch | null = null;
export function installApiStub(): () => void {
if (holders === 0) {
const original = window.fetch;
const real = original.bind(window);
realFetch = original;
stubFetch = (async (input: RequestInfo | URL, init?: RequestInit) => {
const url = typeof input === "string" ? input : input instanceof URL ? input.href : input.url;
if (!url.includes("/api/")) return real(input as RequestInfo, init);
const { pathname } = new URL(url, window.location.origin);
return respond(pathname, (init?.method ?? "GET").toUpperCase());
}) as typeof window.fetch;
window.fetch = stubFetch;
}
holders += 1;
let released = false;
return () => {
if (released) return;
released = true;
holders -= 1;
if (holders === 0 && realFetch && window.fetch === stubFetch) window.fetch = realFetch;
};
}
`;
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 322k | Updated | Claude CodeCodex | Verified | Install |
| 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: 198k | Updated | Claude CodeCodex | Verified | Install |
| 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: 198k | Updated | Claude CodeCodex | Verified | Install |
| 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: 198k | Updated | Claude CodeCodex | Verified | Install |