Back to Skills

pattern-detector

verified

Universal pattern detector - learns from ANY codebase through sample analysis

View on GitHub

Marketplace

local-plugins

jhlee0409/claude-plugins

Plugin

oas

Repository

jhlee0409/claude-plugins
2stars

plugins/oas/skills/pattern-detector/SKILL.md

Last Verified

January 23, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/jhlee0409/claude-plugins/blob/main/plugins/oas/skills/pattern-detector/SKILL.md -a claude-code --skill pattern-detector

Installation paths:

Claude
.claude/skills/pattern-detector/
Powered by add-skill CLI

Instructions

# Pattern Detector

Analyze ANY codebase to learn existing API patterns. Works with any framework, structure, or convention.

---

## EXECUTION INSTRUCTIONS

When this skill is invoked, Claude MUST perform these steps in order:

### Step 1: Read package.json

1. Use `Read` tool to read `package.json` in project root
2. Extract dependency information:
   - `dependencies`
   - `devDependencies`
3. If package.json not found โ†’ Report error and abort

### Step 2: Detect Framework Stack

From package.json, identify:

| Category | Check for | Result |
|----------|-----------|--------|
| Framework | `react`, `vue`, `@angular/core`, `svelte` | Set `framework` |
| HTTP Client | `axios`, `ky`, `got` | Set `httpClient` |
| Data Fetching | `@tanstack/react-query`, `swr`, `@reduxjs/toolkit` | Set `dataFetching` |
| Language | `typescript` in devDeps | Set `language` to `typescript` or `javascript` |

Report findings:
```
๐Ÿ“ฆ package.json analysis:
  Framework: <framework> + <language>
  HTTP Client: <httpClient or "fetch (native)">
  Data Fetching: <dataFetching or "none detected">
```

### Step 3: Search for Existing API Code

Use `Glob` tool with these patterns in order:

```
1. src/**/api/**/*.{ts,js,tsx,jsx}
2. src/**/services/**/*.{ts,js}
3. src/**/hooks/**/*{api,query,fetch}*.{ts,js}
4. lib/api/**/*.{ts,js}
5. api/**/*.{ts,js}
```

If NO files found:
- Report: `๐Ÿ” No existing API code found`
- Skip to Step 6 (Interactive Fallback)

If files found:
- Report: `๐Ÿ” Found <count> potential API files`
- Continue to Step 4

### Step 4: Analyze Sample Files

For each discovered file (max 5 files):

1. Use `Read` tool to read file content
2. Extract patterns:
   - **Import patterns**: What modules are imported, how (named, default, namespace)
   - **Export patterns**: Named exports, default exports, barrel exports
   - **Function patterns**: Arrow vs declaration, async, parameter style
   - **HTTP call patterns**: How HTTP requests are made
   - **Type patterns**: Interface vs type, 

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
6893 chars