home/roleplay/prompt-197

PROMPT

GPTClaudeGemini··1,386 copies·updated 2026-07-14
prompt-197.prompt
Implement `slugify(s: string): string` in a file named exactly `slugify.ts`, and
write tests for it in a file named exactly `slugify.test.ts`.

`slugify` should: lowercase the input; replace runs of whitespace with a single
hyphen; strip any character that is not a-z, 0-9, or hyphen; collapse runs of
hyphens into one; and trim leading/trailing hyphens. So `"  Hello,  World!! "`
becomes `"hello-world"` and `"Crème brûlée"` becomes `"crme-brle"`.

Write thorough tests covering the normal case and the edge cases (empty string,
all-punctuation input, leading/trailing spaces, repeated separators).

Write both files into the current directory.

when to use it

Community prompt sourced from the open-source GitHub repo christopherlouet/claude-base (MIT). A "PROMPT" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.

tags

roleplaycommunitygeneral

source

christopherlouet/claude-base · MIT