Extract reusable patterns from business code into permanent skill assets. Use when the user asks to extract, dehydrate, distill, or generalize a pattern, solution, or architectural approach into a reusable skill or document.
Every hard-won insight must be stripped of business coupling and crystallized into a permanent, reusable asset. Don't let it rot in chat history.
Dehydration Progress:
- [ ] Step 1: Identify the reusable pattern
- [ ] Step 2: Strip business coupling
- [ ] Step 3: Write a clean, generic demo
- [ ] Step 4: Package as a Skill or Pattern doc
- [ ] Step 5: Verify the asset is self-contained
Analyze the business code and extract the core mechanism:
Remove all project-specific references:
TelegramChannel with SomeChannelChatMessage with Message or ItemCreate a minimal, self-contained Go example that demonstrates the pattern:
// Example: Worker Pool pattern
// - Configurable concurrency limit
// - Graceful shutdown via context
// - Error collection with errgroup
func ExampleWorkerPool() {
pool := NewWorkerPool(maxWorkers)
results, err := pool.Process(ctx, items)
// ...
}
The demo must:
Choose the storage location based on scope:
Option A: Cursor Skill (for coding patterns the AI should apply)
Create in .cursor/skills/<pattern-name>/:
<pattern-name>/
├── SKILL.md # When and how to apply this pattern
└── reference.md # Detailed implementation guide
Option B: Pattern Document (for design decisions and architecture patterns)
Create in docs/patterns/:
docs/patterns/<pattern-name>.md
The asset must be usable without reading the original business code:
# Pattern Name
## Problem
[What general problem does this solve?]
## Solution
[Core mechanism in 2-3 sentences]
## Key Constraints
- [Constraint 1]
- [Constraint 2]
## Implementation
[Code with comments]
## When to Use
[Specific scenarios where this pattern applies]
## When NOT to Use
[Anti-patterns or scenarios where this is overkill]