From claude-code-dev
Detects reusable code patterns, workflow automations, best practices, and config setups during implementation for potential new skills.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-code-dev:pattern-detectionThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Recognize and note reusable patterns during implementation for potential contribution to Product Forge.
Recognize and note reusable patterns during implementation for potential contribution to Product Forge.
When working on projects, Claude often implements patterns that could benefit the broader Product Forge ecosystem. This skill helps identify those patterns so they can be captured by the feedback hooks and potentially become new skills, commands, or templates.
Implementations that follow consistent, reusable structures:
Multi-step processes that could be automated:
Settings and configurations that are commonly needed:
Note patterns when you observe:
Only patterns worth capturing should be:
| Criterion | Description |
|---|---|
| Reusable | Applies to multiple projects or contexts |
| Non-trivial | More than simple one-liners or obvious code |
| Generalizable | Not too specific to one codebase |
| Documented | Can be explained clearly to others |
| Tested | Validated in at least one real project |
# Consistent factory for test fixtures
class UserFactory:
@classmethod
def create(cls, **overrides):
defaults = {"name": "Test User", "email": "[email protected]"}
defaults.update(overrides)
return User.objects.create(**defaults)
Why it's a good pattern: Reusable across Django projects, reduces test boilerplate, follows established factory pattern.
# Consistent API response format
def api_response(data=None, error=None, status=200):
return {
"success": error is None,
"data": data,
"error": error,
"timestamp": datetime.now().isoformat()
}
Why it's a good pattern: Standardizes API responses, easy to implement, improves API consistency.
# Standard Python project pre-commit
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
hooks:
- id: ruff
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
hooks:
- id: mypy
Why it's a good pattern: Common Python setup, enforces code quality, easy to adapt.
# Only works for this exact database schema
def get_acme_corp_users_with_subscription():
return User.objects.filter(company="ACME", has_subscription=True)
Problem: Too specific to one project/company.
# Just basic Python
def add_numbers(a, b):
return a + b
Problem: Doesn't provide enough value to warrant a pattern.
# Missing error handling and edge cases
def parse_config(path):
return json.load(open(path))
Problem: Not production-ready, would need significant expansion.
When you recognize a valuable pattern:
The Stop hook's Haiku analysis will detect patterns based on:
Captured patterns may become:
| Destination | When |
|---|---|
| Skill | Knowledge/guidelines that Claude applies |
| Command | User-invoked action or wizard |
| Template | Scaffolding for new projects/files |
| Agent | Specialized automated workflow |
/sync-feedback to review captured patternsnpx claudepluginhub jpoutrin/product-forge --plugin claude-code-devDetects, stores, and retrieves project-level task execution patterns like refactoring, bug-fixing, and optimization, enabling self-learning skill recommendations and continuous improvement.
Analyzes codebase patterns and generates custom skills to automate repetitive workflows and enforce project conventions.
Extracts reusable patterns like error resolutions, user corrections, and debugging techniques from Claude Code sessions at end via Stop hook and saves as learned skills.