# Shared Patterns

> Reusable patterns and templates for Claude Code skill and hook development. Triggers: validation patterns, error handling, testing templates, workflow patterns, shared patterns, reusable templates, DRY patterns, common workflows Use when: creating new skills or hooks that need consistent patterns, implementing validation logic, setting up error handling, creating test scaffolding, referencing standard workflow structures DO NOT use when: pattern is specific to one skill only. DO NOT use when: pattern is still evolving - wait for stability. DO NOT use when: pattern is context-dependent requiring variations. Reference these patterns to validate consistency across the ecosystem.

- Skill: `majiayu000/shared-patterns-2` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add majiayu000/shared-patterns-2`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/shared-patterns-2/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/shared-patterns-2

---


# Shared Patterns

Reusable patterns and templates for skill and hook development.

## Purpose

This skill provides shared patterns that are referenced by other skills in the abstract plugin. It follows DRY principles by centralizing common patterns.

## Pattern Categories

### Validation Patterns

See [modules/validation-patterns.md](modules/validation-patterns.md) for:
- Input validation templates
- Schema validation patterns
- Error reporting formats

### Error Handling

See [modules/error-handling.md](modules/error-handling.md) for:
- Exception hierarchies
- Error message formatting
- Recovery strategies

### Testing Templates

See [modules/testing-templates.md](modules/testing-templates.md) for:
- Unit test scaffolding
- Integration test patterns
- Mock fixtures

### Workflow Patterns

See [modules/workflow-patterns.md](modules/workflow-patterns.md) for:
- Checklist templates
- Feedback loop patterns
- Progressive disclosure structures

## Usage

Reference these patterns from other skills:

```markdown
For validation patterns, see the `shared-patterns` skill's
[validation-patterns](../shared-patterns/modules/validation-patterns.md) module.
```

