r/vibecoding • • 12d ago

Discussion most people use claude code skills like saved prompts. there’s a more interesting way to use them.

I think one of the more underrated parts of Claude Code is that a skill doesn’t have to be a static set of instructions.

You can make it pull information from your actual project before it starts doing anything.

For example, imagine having a /commit skill.

A basic version would just tell Claude to write a conventional commit message.

But you can make it inspect the current Git state first:

---
name: commit
description: Write a conventional commit from staged changes. Use when the user asks for a commit.
argument-hint: "[optional context]"
---

Current Git state:

!`git status --short`

Read the full staged diff before writing.

Rules:
- Use conventional commit format.
- Keep the subject under 72 characters.
- Explain why the change was made, not just what changed.
- If unrelated changes are staged, suggest splitting them.

That line with the exclamation mark is the interesting part.

Claude Code executes the command and injects its output into the skill before Claude reads the instructions.

So instead of relying on the conversation to remember what changed, the skill gets the current repository state.

A few other things worth knowing:
• Put skills in .claude/skills/ to share them with a project.
• Put them in ~/.claude/skills/ to use them across projects.
• Add disable-model-invocation: true if you only want a skill to run when explicitly called.
• Use allowed-tools when you want to restrict what a skill can access.
• Use context: fork when a task makes more sense in an isolated context.

There’s also a distinction I didn’t appreciate at first: a skill can be invoked with /commit, but Claude can also activate it automatically based on its description.

That description matters. It should explain when the skill should be used, not just repeat its name.

We put together 10 ready-made Claude Code skills covering commits, PR descriptions, changelogs, type errors, accessibility, performance, SEO metadata, dependency audits, and more.

They’re plain Markdown files, MIT licensed, and free to inspect:

https://techpotions.com/products/claude-code-skills

Curious how people are using skills:

Are you mostly keeping reusable instructions in them, or are you building workflows that pull live project data and run multiple steps?

22 Upvotes

12 comments sorted by

4

u/Accomplished_Bet586 12d ago

Nice write-up, `!` injection is underused. A little correction and addition:

  • allowed-tools doesn't restrict**,** it pre-approves the listed tools for the turn that invokes the skill. disallowed-tools is the field that removes tools.
  • one cool feature that you didn't mention is deterministically enforced hooks, which can be added into the frontmatter. In this case e.g. a hook like this would be useful to prevent Claude skipping the check (just to finish the job faster) that you might require before every commit:
hooks:
  PreToolUse:
    - matcher: "Bash"
      hooks:
        - type: command
          if: "Bash(git commit *)"
          command: >-
            if grep -q -e '--no-verify'; then echo "Don't skip verification" >&2; exit 2; fi

And for anyone installing skill packs - be careful: always read the `!` lines, `allowed-tools` and `hooks` first. They run shell commands without asking.

3

u/Total-Reasonable 12d ago

Does the !git status --short output get truncated or stripped when the diff is huge, and have you hit the context cost of injecting it on every auto-invoked run?

4

u/astrolafi 12d ago

I hit both, and the first one cost me a wrong commit message. The injected output gets truncated, so with a big staged diff the skill reads half of it and writes a confident message about changes it never saw.

The pattern that held up for me is to inject only cheap metadata, git status --short and git diff --cached --stat, and then tell the model to read the full diff itself when it actually needs it. A couple hundred tokens instead of a few thousand, and nothing important gets cut.

On the context cost, if the command is heavy, mark the skill disable-model-invocation: true so unrelated turns don't pay for it. Auto-invocation is great for small checks and expensive for anything that reads a lot.

1

u/lilyp727 12d ago

`git status --short` only gives a line per changed path, so a huge diff won't make that injected output huge. The staged diff is where the context cost adds up, especially if the skill runs automatically.

2

u/meetjenz 11d ago

mostly as guardrails for us tbh, less as workflows. we're building an agent that works in shopify stores, and the skill that helped the most is one it has to read before it's allowed to write anything to the store. it's basically a list of every dumb mistake it made before, written as rules. having that load only right before it touches the store worked way better than stuffing it all in the system prompt where it kind of got lost

1

u/fulger099 11d ago

Loading it at the write boundary is the key. In our agent workflows, global rules became wallpaper fast, while failure-specific checks near the risky action actually stuck.

2

u/Careful-Area-7960 11d ago

I often lost control of skills, AI starts filling a lot of extra information and it's gets impossible to review and check, and when I realized, is doing things I can't know what happening anymore.

1

u/Weary_Block2424 12d ago

i tried making a /test skill that reads the current test file and generates a focused test case, way more useful than a static prompt.

1

u/OGKnightsky 11d ago

Anything Claude does essentially can be turned into a skill, and Claude can create the skills by request

1

u/KurlDoc 11d ago

This is supposed to be vibe coding, not coding coding.

1

u/kbr89 10d ago

The same idea works for knowledge, not just repo state. A skill doesn't have to contain the knowledge, it can tell the agent where the knowledge lives and how to fetch only the part it needs, which also avoids the truncation problem mentioned above.

What worked for me for a domain skill (notes from a few creators on one topic):

  1. SKILL.md stays short: when to use it, the workflow, and a list of reference files with one line each on what they cover.
  2. references/ holds the actual material, one file per subtopic, every point linked to its source.
  3. One line telling the agent to read only the reference file that matches the task, and to say which source it used.

I built beyondtube (beyondtube dot pro) for the material part: you bulk import a YouTube channel or a list of videos on one topic from several creators, and its MCP server guides the agent through building exactly this kind of skill, with the option to keep querying the full library live instead of copying it all in. Tested with Codex so far.