oberconcejo/VS-CODE / .agents/skills/app-store-screenshots
app-store-screenshots
FlaggedUse when building App Store or Google Play screenshot pages, generating exportable marketing screenshots for iOS, macOS, and/or Android apps, or scaffolding a screenshot editor with Next.js. Triggers on app store, mac app store, play store, screenshots, marketing assets, html-to-image, phone mockup, mac mockup, android screenshots, feature graphic.
template/src/lib/request-body.ts
View on GitHubimport { NextResponse } from "next/server";
/** Bound the stream itself: Content-Length is optional and caller-controlled. */
export async function readJsonBody(req: Request, maxBytes: number): Promise<
{ value: unknown; response?: never } | { value?: never; response: NextResponse }
> {
// The unread remainder is cancelled. Do not advertise a reusable HTTP/1
// connection that could reset the client's next (otherwise valid) request.
const tooLarge = () => NextResponse.json({ ok: false, error: "Request body too large" }, { status: 413, headers: { Connection: "close" } });
if (Number(req.headers.get("content-length")) > maxBytes) return { response: tooLarge() };
const reader = req.body?.getReader();
if (!reader) return { response: NextResponse.json({ ok: false, error: "Invalid JSON" }, { status: 400 }) };
try {
const chunks: Uint8Array[] = [];
let length = 0;
for (;;) {
const { done, value } = await reader.read();
if (done) break;
length += value.byteLength;
if (length > maxBytes) {
void reader.cancel().catch(() => undefined);
return { response: tooLarge() };
}
chunks.push(value);
}
return { value: JSON.parse(Buffer.concat(chunks).toString("utf8")) };
} catch {
return { response: NextResponse.json({ ok: false, error: "Invalid JSON" }, { status: 400 }) };
} finally {
reader.releaseLock();
}
}
export function decodeBase64(value: string): Buffer | null {
// Buffer.from silently ignores invalid characters and truncated quartets.
if (!value || value.length % 4 !== 0 || !/^[A-Za-z0-9+/]*={0,2}$/.test(value)) return null;
const bytes = Buffer.from(value, "base64");
return bytes.toString("base64") === value ? bytes : null;
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 198k | Updated | Claude CodeCodex | Verified | Install |
| 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: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| 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: 194k | Updated | Claude CodeCodex | Verified | Install |