home/productivity/task-url-slugify

Task: URL slugify

GPTClaudeDeepSeek··283 copies·updated 2026-07-14
task-url-slugify.prompt
# Task: URL slugify

## Deliverable

Implement `slugify(text: str) -> str` in `slugify.py`.

## Spec

- Lowercase the string.
- Replace any run of characters that are **not** ASCII letters or digits with a single `-`.
- Strip leading/trailing `-`.
- Collapse multiple `-` to one (already implied by “run”).
- Empty / all-separator input → `""`.
- Unicode letters: strip them (not kept). Only `[a-z0-9]` remain after processing.
- Do not depend on third-party packages.

## Constraints

- Edit only the starter tree you were given.
- Do not modify hidden tests.

## Done means

`slugify` meets the spec; note how you verified.

when to use it

Community prompt sourced from the open-source GitHub repo TinkerandScribe/gxp (MIT). A "Task: URL slugify" 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

productivitycommunitydeveloper

source

TinkerandScribe/gxp · MIT