## Output Format

<output_format>
Provide your pattern extraction in this structure:

<extraction_summary>
**Codebase:** [name/path]
**Extraction Date:** [date]
**Files Analyzed:** [count]
**Pattern Categories:** [count]/15
</extraction_summary>

<pattern_catalog>

## 1. Code Architecture Patterns

| Pattern | Location      | Confidence     | Instances |
| ------- | ------------- | -------------- | --------- |
| [name]  | [/path:lines] | [High/Med/Low] | [count]   |

**Example:**

```typescript
// From /path:lines
```

## 2. Component Patterns

| Pattern | Location      | Confidence     | Instances |
| ------- | ------------- | -------------- | --------- |
| [name]  | [/path:lines] | [High/Med/Low] | [count]   |

**Example:**

```typescript
// From /path:lines
```

## 3. State Management Patterns

| Pattern | Location      | Confidence     | Instances |
| ------- | ------------- | -------------- | --------- |
| [name]  | [/path:lines] | [High/Med/Low] | [count]   |

**Example:**

```typescript
// From /path:lines
```

## 4. API Patterns

| Pattern | Location      | Confidence     | Instances |
| ------- | ------------- | -------------- | --------- |
| [name]  | [/path:lines] | [High/Med/Low] | [count]   |

**Example:**

```typescript
// From /path:lines
```

## 5. Database Patterns

| Pattern | Location      | Confidence     | Instances |
| ------- | ------------- | -------------- | --------- |
| [name]  | [/path:lines] | [High/Med/Low] | [count]   |

**Example:**

```typescript
// From /path:lines
```

## 6. Testing Patterns

| Pattern | Location      | Confidence     | Instances |
| ------- | ------------- | -------------- | --------- |
| [name]  | [/path:lines] | [High/Med/Low] | [count]   |

**Example:**

```typescript
// From /path:lines
```

## 7. Error Handling Patterns

| Pattern | Location      | Confidence     | Instances |
| ------- | ------------- | -------------- | --------- |
| [name]  | [/path:lines] | [High/Med/Low] | [count]   |

**Example:**

```typescript
// From /path:lines
```

## 8. Styling Patterns

| Pattern | Location      | Confidence     | Instances |
| ------- | ------------- | -------------- | --------- |
| [name]  | [/path:lines] | [High/Med/Low] | [count]   |

**Example:**

```scss
// From /path:lines
```

## 9. Build/Tooling Patterns

| Pattern | Location      | Confidence     | Instances |
| ------- | ------------- | -------------- | --------- |
| [name]  | [/path:lines] | [High/Med/Low] | [count]   |

## 10. CI/CD Patterns

| Pattern | Location      | Confidence     | Instances |
| ------- | ------------- | -------------- | --------- |
| [name]  | [/path:lines] | [High/Med/Low] | [count]   |

## 11. Environment/Config Patterns

| Pattern | Location      | Confidence     | Instances |
| ------- | ------------- | -------------- | --------- |
| [name]  | [/path:lines] | [High/Med/Low] | [count]   |

## 12. Security Patterns

| Pattern | Location      | Confidence     | Instances |
| ------- | ------------- | -------------- | --------- |
| [name]  | [/path:lines] | [High/Med/Low] | [count]   |

## 13. Logging/Observability Patterns

| Pattern | Location      | Confidence     | Instances |
| ------- | ------------- | -------------- | --------- |
| [name]  | [/path:lines] | [High/Med/Low] | [count]   |

## 14. Performance Patterns

| Pattern | Location      | Confidence     | Instances |
| ------- | ------------- | -------------- | --------- |
| [name]  | [/path:lines] | [High/Med/Low] | [count]   |

## 15. Documentation Patterns

| Pattern | Location      | Confidence     | Instances |
| ------- | ------------- | -------------- | --------- |
| [name]  | [/path:lines] | [High/Med/Low] | [count]   |

</pattern_catalog>

<anti_patterns>

## Anti-Patterns Observed

| Anti-Pattern | Location      | Why Problematic | Occurrences |
| ------------ | ------------- | --------------- | ----------- |
| [name]       | [/path:lines] | [reason]        | [count]     |

</anti_patterns>

<consistency_analysis>

## Consistency Score

| Category       | Consistency    | Notes         |
| -------------- | -------------- | ------------- |
| Naming         | [High/Med/Low] | [observation] |
| Error handling | [High/Med/Low] | [observation] |
| Testing        | [High/Med/Low] | [observation] |

**Coverage Gaps:**

- [Missing pattern category]
- [Inconsistent area]
  </consistency_analysis>

<raw_patterns_export>

## Machine-Readable Export

```yaml
patterns:
  code_architecture:
    - name: [name]
      file: [/path]
      lines: [start-end]
      confidence: [high|medium|low]
  # ... all categories
```

</raw_patterns_export>
</output_format>
