ClaudeHack
0.000

Parameterize skills with $ARGUMENTS instead of editing prompts

Terminal / Productivity / Cost Optimization·13 hours ago·verified 13 hours ago·easy·~10 min setup·verified

Build slash skills that accept issue numbers, branch names, or formats via $ARGUMENTS / $0 so one command covers many cases.

The problem

You duplicate near-identical skills or paste details into a generic prompt every time the target changes.

The hack

Write a skill that uses `$ARGUMENTS` (or `$0`, `$1`, named `arguments`) and invoke it as `/fix-pr 123` or `/deploy staging`.

Why it works

Skills already support argument substitution. Parameterized commands stay short, reusable, and consistent across the team.

Setup

1. Create `.claude/skills/fix-pr/SKILL.md`. 2. Reference `$ARGUMENTS` or declare `arguments: [issue]` and use `$issue`. 3. Invoke `/fix-pr 4821` (quote multi-word values). 4. Add `argument-hint: [issue-number]` so autocomplete shows what to pass.

Code

---
name: fix-pr
description: Investigate and fix a GitHub PR by number
argument-hint: "[pr-number]"
---
Investigate PR #$ARGUMENTS:
1. Fetch the PR diff and failing checks.
2. Reproduce locally if possible.
3. Implement the smallest fix and summarize.

Additional details

If `$ARGUMENTS` is omitted from the skill body, Claude Code appends the typed args as `ARGUMENTS: …` automatically.

Source

anthropic·View original →·by Anthropic Docs

Does this still work?

0 said it works · 0 said it's broken

Related

Discussion

No comments yet. Be the first to say whether this worked for you.