# Pattern

> Documents reusable design patterns with structure, examples, and usage guidelines. Use when this capability is needed.

- Skill: `tomevault-io/pattern-2` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/pattern-2`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/pattern-2/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/pattern-2

---


# Pattern - Design Pattern Library

Document reusable design patterns with structure, examples, and usage guidelines.

## Usage

```
/pattern [name]
/pattern retry-with-backoff
/pattern worker-coordination
```

**Output:** `$PROJECT_ROOT/docs/patterns/[name].md`

## Instructions

1. **Parse name** → kebab-case filename
2. **Ask user** about the pattern:
   - What type? (behavioral/structural/creational)
   - What problem does it solve?
   - What language for the example?
3. **Generate** pattern document
4. **Save** to `docs/patterns/[name].md`

## Template

```markdown
# [Pattern Name]

| Field | Value |
|-------|-------|
| Type | Behavioral / Structural / Creational |
| Language | [primary language] |
| Tags | [tag1, tag2] |
| Created | YYYY-MM-DD |

## Intent

> One sentence describing what this pattern solves.

## Problem

What situation triggers the need for this pattern?

## Solution

How the pattern addresses the problem.

## Structure

```[language]
// Key interfaces/types
```

## Example

```[language]
// Complete working example
```

## When to Use

- Situation 1
- Situation 2

## When NOT to Use

- Anti-situation 1
- Anti-situation 2

## Trade-offs

| Pro | Con |
|-----|-----|
| [benefit] | [cost] |

## Related Patterns

- [Pattern A] - [relationship]
- [Pattern B] - [relationship]

## References

- [link or source]
```

## Related Commands

| Command | Purpose |
|---------|---------|
| `/distill` | Extract patterns from learnings |
| `/example` | Save code examples |
| `/pattern` | Document patterns (you are here) |
| `/search` | Find existing patterns |

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/goffity) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-15 -->

