snippet-manager
БесплатноБез исполняемых скриптовНе проверенSave, organize, search, and retrieve code snippets with tags, categories, and smart search capabi...
Об этом скилле
Snippet Manager Skill
Save, organize, search, and retrieve code snippets with tags, categories, and smart search capabilities.
Instructions
You are a code snippet management expert. When invoked:
Save Code Snippets:
- Extract reusable code patterns
- Add metadata (language, tags, description)
- Organize by category and use case
- Version snippet variations
Search and Retrieve:
- Search by language, tags, or keywords
- Find similar patterns
- Suggest relevant snippets based on context
- Filter by framework or library
Snippet Organization:
- Categorize snippets logically
- Tag with relevant keywords
- Group related snippets
- Create snippet collections
Snippet Enhancement:
- Add usage examples
- Document parameters and options
- Include edge cases
- Provide alternative implementations
Snippet Categories
- Language Basics: Common patterns, idioms, syntax helpers
- Data Structures: Arrays, objects, maps, sets manipulation
- Algorithms: Sorting, searching, recursion, dynamic programming
- API Patterns: REST clients, error handling, authentication
- Database: Queries, migrations, ORM patterns
- Testing: Test setups, mocks, assertions
- React/Vue/Angular: Component patterns, hooks, directives
- Node.js: Express middleware, streams, file operations
- Python: Decorators, context managers, generators
- DevOps: Docker, CI/CD, deployment scripts
- Utilities: Date/time, string manipulation, validation
Usage Examples
@snippet-manager Save API error handler
@snippet-manager --search "react hooks"
@snippet-manager --category testing
@snippet-manager --language python
@snippet-manager --tag async
@snippet-manager --collection "authentication patterns"
Snippet Format
Basic Snippet Structure
# Snippet: Async Error Handler Wrapper
**Language**: JavaScript/TypeScript
**Category**: Error Handling
**Tags**: async, error-handling, middleware, express
**Framework**: Express.js
**Use Case**: Wrap async route handlers to catch errors
## Code
```javascript
const asyncHandler = (fn) => (req, res, next) => {
Promise.resolve(fn(req, res, next)).catch(next);
};
// Usage
app.get('/users/:id', asyncHandler(async (req, res) => {
const user = await User.findById(req.params.id);
res.json(user);
}));
Parameters
fn: Async function to wrap (Request, Response, NextFunction) => Promise
Returns
Express middleware function that handles promise rejections
Notes
- Eliminates try-catch blocks in route handlers
- Passes errors to Express error handler middleware
- Works with any async function
Related Snippets
## JavaScript/TypeScript Snippets
### Debounce Function
```javascript
// Snippet: Debounce
// Category: Performance
// Tags: debounce, performance, optimization
function debounce(func, wait, immediate = false) {
let timeout;
return function executedFunction(...args) {
const later = () => {
timeout = null;
if (!immediate) func.apply(this, args);
};
const callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (callNow) func.apply(this, args);
};
}
// Usage
const handleSearch = debounce((query) => {
fetchResults(query);
}, 300);
// In React
const [searchTerm, setSearchTerm] = useState('');
const debouncedSearch = useMemo(
() => debounce((term) => {
// Perform search
console.log('Searching for:', term);
}, 500),
[]
);
useEffect(() => {
debouncedSearch(searchTerm);
}, [searchTerm, debouncedSearch]);
Deep Clone Object
// Snippet: Deep Clone
// Category: Data Structures
// Tags: clone, deep-copy, objects
// Method 1: JSON (simple objects only)
const deepClone = (obj) => JSON.parse(JSON.stringify(obj));
// Method 2: Structured Clone (modern browsers/Node.js)
const deepClone2 = (obj) => structuredClone(obj);
// Method 3: Custom recursive (handles complex types)
function deepClone3(obj, hash = new WeakMap()) {
if (Object(obj) !== obj) return obj; // primitives
if (hash.has(obj)) return hash.get(obj); // cyclic reference
const result = Array.isArray(obj)
? []
: obj.constructor
? new obj.constructor()
: Object.create(null);
hash.set(obj, result);
return Object.assign(
result,
...Object.keys(obj).map(key => ({
[key]: deepClone3(obj[key], hash)
}))
);
}
// Usage
const original = { a: 1, b: { c: 2 }, d: [3, 4] };
const cloned = deepClone(original);
cloned.b.c = 999; // original.b.c remains 2
Retry with Exponential Backoff
// Snippet: Retry with Exponential Backoff
// Category: Error Handling
// Tags: retry, async, error-handling, resilience
async function retryWithBackoff<T>(
fn: () => Promise<T>,
options: {
maxRetries?: num
Установить snippet-manager в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл snippet-manager?
Save, organize, search, and retrieve code snippets with tags, categories, and smart search capabi...
Как установить скилл snippet-manager?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл snippet-manager запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic