/alemtuzlak-skills:reuse-firstfrom alemtuzlak-skills
Searches for an existing helper, util, type guard, or mapper before writing a new one. Prevents duplicate code by encouraging import or extraction.
Ships in alemtuzlak-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Search for an existing helper before writing a new one. Prefer import, then extract, then write. Less code wins.
This skill owns the reuse decision and the helper’s home. It does not implement the rest of the feature. It does not load the next skill in a pipeline.
Load when the agent is about to add:
if (object.isCancelled || object.isRefunded) in two functions)Skip UI copy, comments, and one-off JSX that is not a helper.
Decide before choosing a file.
Order, Invoice, Cart)? → domain. Keep it next to that type (isCancelledOrder in order.ts).isRecord, isDate, assertNever)? → generic. Put it in the shared utils home. Do not leave it at the top of a domain file.Repeated inline logic uses the same two tests. isCancelledOrRefunded(order) stays next to Order. It does not go to shared utils.ts.
Search these areas, in order. Stop when a match is found or the list is done:
shared / utils / lib areasDo not open the whole monorepo for a 3-line local helper. Do not search only the current file.
Print one reuse line, then do the matching step. Do not wait.
Exact match
reuse: import isRecord from packages/shared/src/isRecord.ts
Import and call it. Do not copy it. Do not wrap it to make it nicer. Do not re-export it under a new name in this package.
Close match (same job, missing a case)
Prefer extend the existing function (option, overload, extra case). Write a new function only when the job is actually different. Do not grow a util into a second product. If the extend would change a public API, ask first.
Repeated inline logic (two or more copies in files this change already opened)
reuse: extracted isCancelledOrRefunded from 2 copies in order.ts
Extract one small function. Replace every copy in the files already opened. Do not mechanical-replace the rest of the monorepo. Classify domain vs generic, then place with Procedure 4.
No match
reuse: no match in current package / neighbors / shared. writing isRecord in src/utils.ts
Write it. Place it with Procedure 4.
Generic (isRecord, isDate):
utils.ts, lib/utils, packages/shared, or similar).src/utils.ts or lib/utils.ts).utils/ tree unless the user asked.Domain (isCancelledOrder in order.ts):
After the import, extract, or write, stop. Do not implement the rest of the feature from this skill.
if / guard in opened files → Procedure 3 extract path.| Signal | What it means | Do instead |
|---|---|---|
Writing isRecord in order.ts | Generic parked in a domain file | Procedure 4 generic path. |
Putting isCancelledOrder in utils.ts | Domain helper in shared | Keep it next to Order. |
| Copying an existing helper | Second isRecord | Import it. |
| Wrapping an existing helper with a new name | Unasked abstraction | Call the original. |
| "Might be reused later" into shared | Speculative extract | Domain stays local until two real copies. |
Adding packages/shared for one guard | New package nobody asked for | Ask, or use the existing utils home. |
Replacing similar ifs repo-wide | Drive-by refactor | Only files this change already opened. |
| No reuse line | Search was skipped | Procedure 3. Print the line first. |
| Loading the next pipeline skill | Leaves compose at the workflow | Procedure 5. Stop. |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Generated from the plugin's indexed repository (alemtuzlak/skills) — no native marketplace selected
npx claudepluginhub p/alemtuzlak-alemtuzlak-skills41 skills in this plugin
/accessible-htmlUse whenever writing, editing, or reviewing markup or UI code — HTML, JSX/TSX, Vue/Svelte/Angular templates, web components, email HTML, or CSS that affects text size, color, focus, motion, layout order, or hit area. Also use when adding a button, link, form, input, modal, dropdown, menu, tabs, tooltip, toast, icon, image, iframe, table, list, keyboard shortcut, drag interaction, or any click handler; when a design has to become code; and when the user says "accessibility", "a11y", "WCAG", "screen reader", "keyboard navigation", "focus", "aria", "contrast", "alt text", or "axe"./amazing-videoUse only when the user runs /amazing-video or names the amazing-video skill. The text after the command is the video topic, such as a PR, a feature, or an API./Other plugins' skills for the same job