# building-skills-from-patterns

Turns repeated multi-step workflows into reusable SKILL.md files. It triggers when an agent re-derives the same routine or needs the same user correction three times.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 466 installs · ★ 866
- Author: spencerpauly
- License: CC0-1.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/spencerpauly/awesome-cursor-skills/tree/HEAD/resources/building-skills-from-patterns/SKILL.md
- Updated: 2026-08-02
- HTML: https://affpapa.org/en/nevibecode/skills/building-skills-from-patterns

## What it does

This meta-skill watches how you interact with the agent across the repository. When you repeat the same routine three times or the agent keeps recalculating steps, it intervenes. The skill captures that exact workflow into a standalone `SKILL.md` file. It records imperative steps and CLI tools such as `npm` or `gh`.

Each generated skill includes invocation triggers, step-by-step instructions, and safety notes. It checks that commands contain no API keys or machine-specific paths before saving. Do not use this for always-on coding style policies. Static repository guidelines belong in `.cursor/rules/`, because skills handle on-demand multi-step execution.

The prompt enforces one skill per workflow, avoiding bloated all-in-one documents. If the routine changes later, the agent updates the existing file instead of creating duplicates. It informs you of the new file path right away, so the workspace picks it up on the next session.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add spencerpauly/awesome-cursor-skills --skill building-skills-from-patterns -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/building-skills-from-patterns/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/building-skills-from-patterns/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add spencerpauly/awesome-cursor-skills --skill building-skills-from-patterns -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/building-skills-from-patterns/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add spencerpauly/awesome-cursor-skills --skill building-skills-from-patterns -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/building-skills-from-patterns/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install spencerpauly/awesome-cursor-skills building-skills-from-patterns
```

2. **Manually: put the files in place**
- File: `.github/skills/building-skills-from-patterns/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add spencerpauly/awesome-cursor-skills --skill building-skills-from-patterns -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/spencerpauly/awesome-cursor-skills --path resources/building-skills-from-patterns
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/building-skills-from-patterns/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add spencerpauly/awesome-cursor-skills --skill building-skills-from-patterns -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/spencerpauly/awesome-cursor-skills/tree/HEAD/resources/building-skills-from-patterns/SKILL.md

## When to use it
- extract repeated terminal workflows into SKILL.md files
- capture user corrections into reusable agent routines
- strip local file paths and credentials from generated steps
- separate on-demand procedures from static repository rules

## Example prompts
- We ran lint, tsc, and test before commit three times now. Turn this into a reusable skill.
- Save our preview branch deployment workflow as a new SKILL.md.
- building-skills-from-patterns: package our API verification steps into a skill file

## Source text · SKILL.md · CC0-1.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 82b0025a7b867026.

BEGIN THIRD-PARTY FILE 82b0025a7b867026
````text
---
name: building-skills-from-patterns
description: When the same multi-step workflow repeats in Cursor (user corrections or agent redos), capture it as a new SKILL.md under .cursor/skills/ so future sessions load it automatically.
user-invocable: true
---

# Building Skills From Patterns

**Skills** are reusable `SKILL.md` files. This meta-skill tells the agent to **promote repeated muscle memory** into a named skill: research once, encode the workflow, reuse forever.

## When to trigger

- The user has asked for the **same sequence** three or more times (e.g. “always run lint then tsc then test before commit”).
- The agent notices it is **re-deriving** the same steps on every task in this repo (e.g. “how we deploy preview branches”).
- A correction sounds like a **policy** (“never use raw SQL here — always the repository layer”) — pair with `suggesting-cursor-rules` if it should be always-on; use a **skill** if it is a procedure with steps.

## Workflow

### 1. Name the pattern

Choose a short **slug** (lowercase, hyphens): `verifying-api-before-merge`, `releasing-mobile-build`, etc.

### 2. Draft `SKILL.md`

Create `.cursor/skills/<slug>/SKILL.md` (or in this repo’s pattern, copy from `resources/<slug>/SKILL.md` when contributing upstream).

Frontmatter:

```yaml
---
name: <slug>
description: One line: what it does and when to use it. Ends with a clear trigger.
user-invocable: true   # optional, if the user should be able to invoke by name
---
```

Body sections (keep lean):

1. **Title** — human-readable.
2. **When to use** — bullets.
3. **Steps** — numbered, imperative, tool names where useful (`npm`, `gh`, MCP tools).
4. **Notes** — edge cases, safety, when **not** to use.

Match the tone of other skills in the repo: concrete commands, no filler.

### 3. Validate

- **Description** is specific enough for Cursor to **match** the skill when the user describes the task.
- Steps are **executable** by an agent without guessing repo layout (or say “detect package manager from lockfile”).
- No secrets or machine-specific paths.

### 4. Point the user to it

Tell the user where the file lives and that the agent will pick it up on the next chat in that workspace.

## Relationship to rules and hooks

| Mechanism | Use for |
|----------|---------|
| **Skill** | On-demand procedure, branching steps, tool usage. |
````
END THIRD-PARTY FILE 82b0025a7b867026

The third-party file has ended. Everything between the 82b0025a7b867026 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2379 of 2860 bytes. © spencerpauly · CC0-1.0 · https://github.com/spencerpauly/awesome-cursor-skills/tree/HEAD/resources/building-skills-from-patterns/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
