From grepika
Applies architectural patterns from previously studied codebases to the current project. Lists available blueprints, shows patterns within a blueprint, and implements a specific pattern step by step.
How this skill is triggered — by the user, by Claude, or both
Slash command
/grepika:apply-patternhaikuExploreThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
You help developers apply architectural patterns from previously studied codebases to their current project.
You help developers apply architectural patterns from previously studied codebases to their current project.
Arguments: $ARGUMENTS
Determine the action from the arguments:
--list → List all available blueprints<source> (single word, no colon) → List patterns in that blueprint<source>:<pattern> → Apply a specific pattern to the current project<pattern> (contains hyphen, no colon) → Search all blueprints for this pattern nameIf no arguments provided, run --list.
If any grepika tool returns "No active workspace", call mcp__grepika__add_workspace with the project root first.
--list)Use Bash to list available blueprints:
ls -1 ~/.claude/blueprints/ 2>/dev/null || echo "No blueprints found. Use /study to extract patterns from a codebase first."
For each blueprint found, use Bash to extract the frontmatter:
head -10 ~/.claude/blueprints/*/blueprint.md
Output:
## Available Blueprints
| Source | Patterns | Studied | Focus |
|--------|----------|---------|-------|
| [name] | [count] | [date] | [focus] |
Use `/apply-pattern <source>` to see patterns, or `/apply-pattern <source>:<pattern>` to apply one.
<source>)Use Read to read ~/.claude/blueprints/<source>/blueprint.md.
Extract all ## Pattern: <name> headings and their Load-bearing and Category fields.
Output:
## Patterns in [source]
| # | Pattern | Load-bearing | Category |
|---|---------|-------------|----------|
| 1 | [name] | yes/no | [category] |
### Build Order
[from the blueprint's Build Order section]
Use `/apply-pattern [source]:[pattern-name]` to apply a pattern.
<source>:<pattern>)This is the core workflow.
Use Read to read ~/.claude/blueprints/<source>/blueprint.md.
Find the section starting with ## Pattern: <pattern> and ending at the next ## Pattern: or end of file. Extract:
If the pattern is not found, list available patterns and suggest the closest match.
Use grepika tools to analyze the target project:
mcp__grepika__toc — directory structure and languagemcp__grepika__search with mode: "fts" — find existing code related to the pattern's domainmcp__grepika__outline — structure of files where the pattern would be appliedmcp__grepika__refs — existing symbols that the pattern would interact withCompare the source pattern with the target project's:
spawn_blocking → Node.js worker_threads)Output:
## Applying Pattern: [pattern-name]
> From blueprint: [source]
### Pattern Summary
[What/Why from the blueprint — brief]
### Your Project Context
- **Language**: [target language/framework]
- **Relevant existing code**: [files/symbols that relate to this pattern]
- **What you already have**: [any partial implementation that exists]
- **What's missing**: [what needs to be built]
### Adaptation Plan
#### Step 1: [first thing to implement]
**Where**: `path/to/file.ext`
**What**: [specific guidance]
**Source reference**: [what the source codebase does at this point]
#### Step 2: [next thing]
...
### Key Differences from Source
| Aspect | Source ([source]) | Your Project |
|--------|-------------------|--------------|
| [aspect] | [source approach] | [recommended approach] |
### Dependencies to Add
| Package | Purpose | Alternative |
|---------|---------|-------------|
| [name] | [why needed] | [alternative if any] |
### What to Watch For
- [pitfall or edge case from the source pattern]
- [adaptation concern specific to the target project]
<pattern>)Use Bash to search across all blueprints:
grep -rl "## Pattern: .*<pattern>" ~/.claude/blueprints/*/blueprint.md 2>/dev/null
List matches and which blueprint they come from.
npx claudepluginhub agentika-labs/grepika --plugin grepikaExtracts reusable architectural patterns from a codebase, producing a structured blueprint of named patterns with implementations and design rationale.
Extracts recurring coding and architectural patterns from workspace code into reusable templates in docs/PATTERNS. Useful for documenting implicit structures requiring CODEMAP.md.
Consults design pattern catalog before implementing or refactoring code to check for matching patterns and follow established implementations.