@intentsolutionsio/ai-ml-engineering-pack 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +31 -0
- package/LICENSE +113 -0
- package/README.md +698 -0
- package/package.json +50 -0
- package/skills/optimizing-prompts/SKILL.md +88 -0
- package/skills/optimizing-prompts/assets/README.md +7 -0
- package/skills/optimizing-prompts/assets/example_prompts.md +246 -0
- package/skills/optimizing-prompts/assets/optimization_report_template.md +104 -0
- package/skills/optimizing-prompts/assets/prompt_template.json +54 -0
- package/skills/optimizing-prompts/references/README.md +4 -0
- package/skills/optimizing-prompts/scripts/README.md +11 -0
package/README.md
ADDED
|
@@ -0,0 +1,698 @@
|
|
|
1
|
+
# AI/ML Engineering Pack
|
|
2
|
+
|
|
3
|
+
**Professional toolkit for building production-ready AI/ML systems with Claude Code**
|
|
4
|
+
|
|
5
|
+
Master prompt engineering, LLM integration, RAG systems, and AI safety with 12 specialized plugins that accelerate AI development by 10x.
|
|
6
|
+
|
|
7
|
+
[](https://opensource.org/licenses/MIT)
|
|
8
|
+
[](https://github.com/jeremylongshore/claude-code-plugins)
|
|
9
|
+
[](https://claude.ai/code)
|
|
10
|
+
|
|
11
|
+
## What's Included
|
|
12
|
+
|
|
13
|
+
**12 specialized plugins across 4 AI/ML categories:**
|
|
14
|
+
|
|
15
|
+
### 1. Prompt Engineering (3 plugins)
|
|
16
|
+
- **prompt-architect** (agent) - Expert in CoT reasoning, few-shot learning, and advanced prompt patterns
|
|
17
|
+
- **prompt-optimizer** (agent) - Reduce LLM costs by 60-90% while maintaining quality
|
|
18
|
+
- **prompt-template-gen** (command: `/ptg`) - Generate production-ready prompt templates with type safety
|
|
19
|
+
|
|
20
|
+
### 2. LLM Integration (3 plugins)
|
|
21
|
+
- **llm-integration-expert** (agent) - Production API patterns, error handling, streaming, rate limiting
|
|
22
|
+
- **model-selector** (agent) - Choose optimal models based on cost, quality, latency requirements
|
|
23
|
+
- **llm-api-scaffold** (command: `/las`) - Generate complete LLM API with FastAPI, Docker, monitoring
|
|
24
|
+
|
|
25
|
+
### 3. RAG Systems (3 plugins)
|
|
26
|
+
- **rag-architect** (agent) - Design RAG systems, chunking strategies, retrieval optimization
|
|
27
|
+
- **vector-db-expert** (agent) - Select and configure vector databases (Pinecone, Qdrant, Weaviate, etc.)
|
|
28
|
+
- **rag-pipeline-gen** (command: `/rpg`) - Generate complete RAG pipeline with embeddings and retrieval
|
|
29
|
+
|
|
30
|
+
### 4. AI Safety (3 plugins)
|
|
31
|
+
- **ai-safety-expert** (agent) - Content filtering, PII detection, bias mitigation, compliance
|
|
32
|
+
- **prompt-injection-defender** (agent) - Defend against prompt injection and jailbreak attacks
|
|
33
|
+
- **ai-monitoring-setup** (command: `/ams`) - Set up LLM monitoring, cost tracking, and alerts
|
|
34
|
+
|
|
35
|
+
## Quick Start
|
|
36
|
+
|
|
37
|
+
### Installation
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Add the marketplace (if not already added)
|
|
41
|
+
claude plugin marketplace add jeremylongshore/claude-code-plugins
|
|
42
|
+
|
|
43
|
+
# Install AI/ML Engineering Pack
|
|
44
|
+
claude plugin install ai-ml-engineering-pack@claude-code-plugins-plus
|
|
45
|
+
|
|
46
|
+
# Verify installation
|
|
47
|
+
claude plugin list
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Full installation guide:** [INSTALLATION.md](./INSTALLATION.md)
|
|
51
|
+
|
|
52
|
+
### 10-Minute Tutorial
|
|
53
|
+
|
|
54
|
+
Build your first AI feature in 10 minutes:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# Start Claude Code
|
|
58
|
+
claude
|
|
59
|
+
|
|
60
|
+
# Inside Claude, optimize a prompt
|
|
61
|
+
"Optimize this prompt for cost and quality:
|
|
62
|
+
'I would like you to create a detailed product description for...'"
|
|
63
|
+
# Claude uses prompt-optimizer agent to reduce tokens by 70%
|
|
64
|
+
|
|
65
|
+
# Generate a reusable prompt template
|
|
66
|
+
/ptg
|
|
67
|
+
|
|
68
|
+
# Build a production LLM API
|
|
69
|
+
/las
|
|
70
|
+
|
|
71
|
+
# Create a complete RAG system
|
|
72
|
+
/rpg
|
|
73
|
+
|
|
74
|
+
# Add AI safety guardrails
|
|
75
|
+
"Implement PII detection and toxicity filtering for my chatbot"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**Complete tutorial:** [QUICK_START.md](./QUICK_START.md)
|
|
79
|
+
|
|
80
|
+
## ROI & Value Proposition
|
|
81
|
+
|
|
82
|
+
Real-world results from production deployments:
|
|
83
|
+
|
|
84
|
+
| Use Case | Time Saved | Cost Savings | ROI |
|
|
85
|
+
|----------|-----------|--------------|-----|
|
|
86
|
+
| E-Commerce Recommendations | 12.5 hours | $249,250/year | 11,891% |
|
|
87
|
+
| Legal Document Analysis | 12 hours | $781,500/year | 34,192% |
|
|
88
|
+
| Customer Support Automation | 16 hours | $350,400/year | 11,283% |
|
|
89
|
+
| Content Moderation | 19 hours | $1,872,000/year | 40,781% |
|
|
90
|
+
| Code Documentation | 145 hours | $14,100 (one-time) | 2,565% |
|
|
91
|
+
| Medical Diagnosis Assistant | 28 hours | $44,600,000/year | 75,392% |
|
|
92
|
+
|
|
93
|
+
**Average ROI: 29,351%** | **Average payback period: 3 days**
|
|
94
|
+
|
|
95
|
+
**Detailed case studies:** [USE_CASES.md](./USE_CASES.md)
|
|
96
|
+
|
|
97
|
+
## Plugin Reference
|
|
98
|
+
|
|
99
|
+
### Prompt Engineering
|
|
100
|
+
|
|
101
|
+
#### `prompt-architect` (Agent)
|
|
102
|
+
Expert in advanced prompt engineering techniques and patterns.
|
|
103
|
+
|
|
104
|
+
**Capabilities:**
|
|
105
|
+
- Chain-of-Thought (CoT) reasoning
|
|
106
|
+
- Few-shot and zero-shot learning
|
|
107
|
+
- Prompt composition patterns
|
|
108
|
+
- Meta-prompting and self-improvement
|
|
109
|
+
- Multi-modal prompts (text + images)
|
|
110
|
+
|
|
111
|
+
**When to use:**
|
|
112
|
+
- "Design a prompt for [complex task]"
|
|
113
|
+
- "Improve this prompt: [existing prompt]"
|
|
114
|
+
- "What's the best prompting technique for [use case]?"
|
|
115
|
+
|
|
116
|
+
**Activation triggers:** Prompt design, CoT, few-shot learning, prompt patterns
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
#### `prompt-optimizer` (Agent)
|
|
121
|
+
Optimize prompts for cost reduction (60-90% savings) while maintaining quality.
|
|
122
|
+
|
|
123
|
+
**Capabilities:**
|
|
124
|
+
- Token reduction techniques (remove verbosity, use abbreviations)
|
|
125
|
+
- Prompt caching strategies
|
|
126
|
+
- Model selection guidance (cheap vs expensive)
|
|
127
|
+
- Cost-quality trade-off analysis
|
|
128
|
+
- ROI calculation
|
|
129
|
+
|
|
130
|
+
**When to use:**
|
|
131
|
+
- "Reduce the cost of this prompt: [prompt]"
|
|
132
|
+
- "Optimize my prompts for $1000/month budget"
|
|
133
|
+
- "How can I reduce token usage by 70%?"
|
|
134
|
+
|
|
135
|
+
**Example:**
|
|
136
|
+
```
|
|
137
|
+
Before (52 tokens): "I would like you to please analyze..."
|
|
138
|
+
After (15 tokens): "Analyze and summarize main points."
|
|
139
|
+
Savings: 71% token reduction = $0.15/1000 calls (GPT-4)
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Activation triggers:** Cost optimization, token reduction, prompt efficiency
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
#### `/ptg` - Prompt Template Generator (Command)
|
|
147
|
+
Generate production-ready prompt templates with type safety and validation.
|
|
148
|
+
|
|
149
|
+
**Usage:**
|
|
150
|
+
```bash
|
|
151
|
+
/ptg
|
|
152
|
+
|
|
153
|
+
# Claude asks:
|
|
154
|
+
# - Use case (e.g., product descriptions, customer support, code review)
|
|
155
|
+
# - Variables (e.g., product_name, features, tone)
|
|
156
|
+
# - Output format (Python, TypeScript)
|
|
157
|
+
# - Validation requirements
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**Generated output:**
|
|
161
|
+
- Python: Pydantic models with type safety
|
|
162
|
+
- TypeScript: Zod schemas with validation
|
|
163
|
+
- Usage examples
|
|
164
|
+
- Cost estimation
|
|
165
|
+
- Unit tests
|
|
166
|
+
|
|
167
|
+
**Example output:**
|
|
168
|
+
```python
|
|
169
|
+
@dataclass
|
|
170
|
+
class ProductDescriptionInput:
|
|
171
|
+
product_name: str
|
|
172
|
+
features: List[str]
|
|
173
|
+
target_audience: str
|
|
174
|
+
tone: Literal["professional", "casual"] = "professional"
|
|
175
|
+
|
|
176
|
+
class ProductDescriptionGenerator:
|
|
177
|
+
TEMPLATE = """..."""
|
|
178
|
+
|
|
179
|
+
def generate(self, input: ProductDescriptionInput) -> str:
|
|
180
|
+
# Validates input, generates prompt, calls LLM
|
|
181
|
+
...
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
### LLM Integration
|
|
187
|
+
|
|
188
|
+
#### `llm-integration-expert` (Agent)
|
|
189
|
+
Production patterns for LLM API integration with error handling and reliability.
|
|
190
|
+
|
|
191
|
+
**Capabilities:**
|
|
192
|
+
- Multi-provider integration (OpenAI, Anthropic, Google, Cohere)
|
|
193
|
+
- Exponential backoff retry logic
|
|
194
|
+
- Rate limiting (token bucket, sliding window)
|
|
195
|
+
- Response streaming (Server-Sent Events)
|
|
196
|
+
- Fallback systems (multi-provider)
|
|
197
|
+
- Circuit breaker patterns
|
|
198
|
+
- Token counting and cost tracking
|
|
199
|
+
|
|
200
|
+
**When to use:**
|
|
201
|
+
- "Implement LLM API integration with retry logic"
|
|
202
|
+
- "Add streaming support to my chatbot"
|
|
203
|
+
- "Build multi-provider fallback system"
|
|
204
|
+
|
|
205
|
+
**Code examples:**
|
|
206
|
+
```python
|
|
207
|
+
# Retry with exponential backoff
|
|
208
|
+
@retry_with_backoff(max_retries=3, base_delay=1.0)
|
|
209
|
+
async def complete(prompt: str):
|
|
210
|
+
return await llm.complete(prompt)
|
|
211
|
+
|
|
212
|
+
# Token bucket rate limiting
|
|
213
|
+
rate_limiter = TokenBucketRateLimiter(capacity=100, refill_rate=10)
|
|
214
|
+
await rate_limiter.wait_for_token()
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
**Activation triggers:** LLM API, error handling, streaming, rate limiting, fallback
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
#### `model-selector` (Agent)
|
|
222
|
+
Guide model selection based on cost, quality, latency, and use case requirements.
|
|
223
|
+
|
|
224
|
+
**Capabilities:**
|
|
225
|
+
- Model comparison matrix (GPT-4, Claude 3, Gemini)
|
|
226
|
+
- Pricing analysis (per 1M tokens)
|
|
227
|
+
- Latency benchmarks
|
|
228
|
+
- Quality assessments by task type
|
|
229
|
+
- Model cascading strategies
|
|
230
|
+
- A/B testing frameworks
|
|
231
|
+
|
|
232
|
+
**When to use:**
|
|
233
|
+
- "Which model should I use for customer support?"
|
|
234
|
+
- "Compare GPT-4 vs Claude 3 Opus for code generation"
|
|
235
|
+
- "How can I reduce costs with model cascading?"
|
|
236
|
+
|
|
237
|
+
**Model comparison:**
|
|
238
|
+
| Model | Input ($/1M) | Output ($/1M) | Latency | Best For |
|
|
239
|
+
|-------|-------------|---------------|---------|----------|
|
|
240
|
+
| GPT-4 Turbo | $10 | $30 | 3-5s | Complex reasoning |
|
|
241
|
+
| GPT-3.5 Turbo | $0.50 | $1.50 | 1-2s | Simple tasks |
|
|
242
|
+
| Claude 3 Opus | $15 | $75 | 4-6s | Highest quality |
|
|
243
|
+
| Claude 3 Haiku | $0.25 | $1.25 | 0.5-1s | Speed & cost |
|
|
244
|
+
|
|
245
|
+
**Activation triggers:** Model selection, cost optimization, performance comparison
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
#### `/las` - LLM API Scaffold (Command)
|
|
250
|
+
Generate complete production-ready LLM API integration code.
|
|
251
|
+
|
|
252
|
+
**Usage:**
|
|
253
|
+
```bash
|
|
254
|
+
/las
|
|
255
|
+
|
|
256
|
+
# Claude asks:
|
|
257
|
+
# - Provider (OpenAI, Anthropic, Google)
|
|
258
|
+
# - Features (streaming, rate limiting, caching, error handling)
|
|
259
|
+
# - Framework (FastAPI, Express.js)
|
|
260
|
+
# - Deployment (Docker, Kubernetes)
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
**Generated files:**
|
|
264
|
+
```
|
|
265
|
+
llm-api/
|
|
266
|
+
├── main.py # FastAPI application
|
|
267
|
+
├── llm_client.py # LLM client with retry logic
|
|
268
|
+
├── rate_limiter.py # Token bucket rate limiting
|
|
269
|
+
├── cache.py # Redis caching
|
|
270
|
+
├── monitoring.py # Prometheus metrics
|
|
271
|
+
├── Dockerfile # Production container
|
|
272
|
+
├── docker-compose.yml # Redis + app
|
|
273
|
+
├── requirements.txt # Dependencies
|
|
274
|
+
└── tests/ # Unit and integration tests
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
**Features included:**
|
|
278
|
+
- Exponential backoff retry (3 attempts)
|
|
279
|
+
- Rate limiting (token bucket algorithm)
|
|
280
|
+
- Response caching (Redis, 5 min TTL)
|
|
281
|
+
- Streaming support (SSE)
|
|
282
|
+
- Cost tracking
|
|
283
|
+
- Prometheus metrics
|
|
284
|
+
- Docker deployment
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
### RAG Systems
|
|
289
|
+
|
|
290
|
+
#### `rag-architect` (Agent)
|
|
291
|
+
Expert in designing and optimizing Retrieval-Augmented Generation systems.
|
|
292
|
+
|
|
293
|
+
**Capabilities:**
|
|
294
|
+
- RAG architecture patterns
|
|
295
|
+
- Chunking strategies (fixed, recursive, semantic)
|
|
296
|
+
- Embedding model selection
|
|
297
|
+
- Retrieval optimization (hybrid search, reranking)
|
|
298
|
+
- Query expansion techniques
|
|
299
|
+
- Evaluation metrics (MRR, NDCG)
|
|
300
|
+
|
|
301
|
+
**When to use:**
|
|
302
|
+
- "Design a RAG system for customer support knowledge base"
|
|
303
|
+
- "What chunking strategy should I use for legal documents?"
|
|
304
|
+
- "How can I improve retrieval accuracy?"
|
|
305
|
+
|
|
306
|
+
**Chunking strategies:**
|
|
307
|
+
```python
|
|
308
|
+
# Fixed-size (simple, fast)
|
|
309
|
+
chunks = [text[i:i+512] for i in range(0, len(text), 512)]
|
|
310
|
+
|
|
311
|
+
# Recursive (respects structure)
|
|
312
|
+
splitter = RecursiveCharacterTextSplitter(
|
|
313
|
+
chunk_size=512,
|
|
314
|
+
chunk_overlap=50,
|
|
315
|
+
separators=["\n\n", "\n", ". ", " ", ""]
|
|
316
|
+
)
|
|
317
|
+
|
|
318
|
+
# Semantic (context-aware)
|
|
319
|
+
chunks = semantic_splitter.split_by_meaning(text)
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
**Activation triggers:** RAG architecture, chunking, retrieval, embeddings
|
|
323
|
+
|
|
324
|
+
---
|
|
325
|
+
|
|
326
|
+
#### `vector-db-expert` (Agent)
|
|
327
|
+
Select and optimize vector databases for RAG systems.
|
|
328
|
+
|
|
329
|
+
**Capabilities:**
|
|
330
|
+
- Database comparison (Pinecone, Qdrant, Weaviate, ChromaDB, pgvector, Milvus)
|
|
331
|
+
- HNSW index tuning
|
|
332
|
+
- Scaling strategies (sharding, replication)
|
|
333
|
+
- Query optimization
|
|
334
|
+
- Migration planning
|
|
335
|
+
|
|
336
|
+
**When to use:**
|
|
337
|
+
- "Which vector database should I use for 10M documents?"
|
|
338
|
+
- "How do I tune HNSW parameters for better performance?"
|
|
339
|
+
- "Compare Pinecone vs Qdrant for my use case"
|
|
340
|
+
|
|
341
|
+
**Database comparison:**
|
|
342
|
+
| Database | Best For | Pricing | Hosting |
|
|
343
|
+
|----------|---------|---------|---------|
|
|
344
|
+
| Pinecone | Managed, auto-scaling | $0.096/GB/month | Cloud only |
|
|
345
|
+
| Qdrant | Performance, self-hosted | Open source | Self/cloud |
|
|
346
|
+
| Weaviate | GraphQL, hybrid search | Open source | Self/cloud |
|
|
347
|
+
| ChromaDB | Local development | Open source | Local only |
|
|
348
|
+
| pgvector | Existing PostgreSQL | Open source | Self-hosted |
|
|
349
|
+
|
|
350
|
+
**Activation triggers:** Vector database, HNSW, scaling, performance
|
|
351
|
+
|
|
352
|
+
---
|
|
353
|
+
|
|
354
|
+
#### `/rpg` - RAG Pipeline Generator (Command)
|
|
355
|
+
Generate complete RAG pipeline with all components.
|
|
356
|
+
|
|
357
|
+
**Usage:**
|
|
358
|
+
```bash
|
|
359
|
+
/rpg
|
|
360
|
+
|
|
361
|
+
# Claude asks:
|
|
362
|
+
# - Document types (PDFs, docs, web pages)
|
|
363
|
+
# - Vector database (Pinecone, Qdrant, Weaviate)
|
|
364
|
+
# - Embedding model (OpenAI, open-source)
|
|
365
|
+
# - LLM (GPT-4, Claude, Gemini)
|
|
366
|
+
# - Features (reranking, hybrid search, caching)
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
**Generated files:**
|
|
370
|
+
```
|
|
371
|
+
rag-system/
|
|
372
|
+
├── document_loader.py # PDF/DOCX/TXT loaders
|
|
373
|
+
├── chunker.py # Recursive text splitter
|
|
374
|
+
├── embedder.py # OpenAI embeddings
|
|
375
|
+
├── vector_store.py # Qdrant integration
|
|
376
|
+
├── retriever.py # Hybrid search + reranking
|
|
377
|
+
├── generator.py # LLM response generation
|
|
378
|
+
├── pipeline.py # End-to-end orchestration
|
|
379
|
+
├── api.py # FastAPI endpoints
|
|
380
|
+
├── docker-compose.yml # Vector DB + app
|
|
381
|
+
└── example_usage.py # Complete examples
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
**Features included:**
|
|
385
|
+
- Multi-format document loading (PDF, DOCX, TXT, MD)
|
|
386
|
+
- Recursive chunking (512 tokens, 50 overlap)
|
|
387
|
+
- Vector similarity search
|
|
388
|
+
- Cohere reranking (optional)
|
|
389
|
+
- Source attribution with page numbers
|
|
390
|
+
- Query expansion
|
|
391
|
+
- Caching
|
|
392
|
+
- FastAPI REST endpoints
|
|
393
|
+
- Docker deployment
|
|
394
|
+
|
|
395
|
+
---
|
|
396
|
+
|
|
397
|
+
### AI Safety
|
|
398
|
+
|
|
399
|
+
#### `ai-safety-expert` (Agent)
|
|
400
|
+
Comprehensive AI safety with content filtering, PII protection, and bias mitigation.
|
|
401
|
+
|
|
402
|
+
**Capabilities:**
|
|
403
|
+
- Toxicity detection (BERT-based classification)
|
|
404
|
+
- PII detection and redaction (Presidio)
|
|
405
|
+
- Bias detection (gender, racial, age)
|
|
406
|
+
- Content moderation (OpenAI Moderation API)
|
|
407
|
+
- Safety guardrails (input/output filtering)
|
|
408
|
+
- GDPR/CCPA/HIPAA compliance
|
|
409
|
+
|
|
410
|
+
**When to use:**
|
|
411
|
+
- "Implement PII detection for user inputs"
|
|
412
|
+
- "Add toxicity filtering to my chatbot"
|
|
413
|
+
- "Detect and mitigate bias in LLM outputs"
|
|
414
|
+
- "Ensure HIPAA compliance for medical data"
|
|
415
|
+
|
|
416
|
+
**Safety pipeline:**
|
|
417
|
+
```python
|
|
418
|
+
class SafetyGuardrails:
|
|
419
|
+
async def safe_completion(self, user_input: str, llm):
|
|
420
|
+
# 1. Input checks
|
|
421
|
+
if not await self.check_input(user_input):
|
|
422
|
+
return {"error": "Input blocked"}
|
|
423
|
+
|
|
424
|
+
# 2. Redact PII
|
|
425
|
+
safe_input = self.pii_detector.redact(user_input)
|
|
426
|
+
|
|
427
|
+
# 3. Generate response
|
|
428
|
+
response = await llm.complete(safe_input)
|
|
429
|
+
|
|
430
|
+
# 4. Output checks
|
|
431
|
+
safe_response = await self.check_output(response)
|
|
432
|
+
|
|
433
|
+
return safe_response
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
**PII detection:**
|
|
437
|
+
- Email addresses, phone numbers, SSN
|
|
438
|
+
- Credit card numbers
|
|
439
|
+
- IP addresses
|
|
440
|
+
- Names, addresses
|
|
441
|
+
- Medical record numbers (for HIPAA)
|
|
442
|
+
|
|
443
|
+
**Activation triggers:** AI safety, PII, toxicity, bias, content moderation
|
|
444
|
+
|
|
445
|
+
---
|
|
446
|
+
|
|
447
|
+
#### `prompt-injection-defender` (Agent)
|
|
448
|
+
Defend against prompt injection attacks and jailbreaks.
|
|
449
|
+
|
|
450
|
+
**Capabilities:**
|
|
451
|
+
- Pattern-based detection (regex for common attacks)
|
|
452
|
+
- ML classification (fine-tuned BERT model)
|
|
453
|
+
- Input sanitization
|
|
454
|
+
- Output validation
|
|
455
|
+
- System prompt protection
|
|
456
|
+
- Jailbreak detection (DAN, Developer Mode, etc.)
|
|
457
|
+
|
|
458
|
+
**When to use:**
|
|
459
|
+
- "Protect my chatbot from prompt injection"
|
|
460
|
+
- "Detect jailbreak attempts"
|
|
461
|
+
- "Validate user inputs for manipulation"
|
|
462
|
+
|
|
463
|
+
**Attack patterns detected:**
|
|
464
|
+
```python
|
|
465
|
+
ATTACK_PATTERNS = [
|
|
466
|
+
r'ignore\s+(all\s+)?(previous|prior|above)\s+instructions',
|
|
467
|
+
r'(repeat|print|show)\s+(your\s+)?(system\s+)?prompt',
|
|
468
|
+
r'(pretend|act)\s+(you\'?re|to\s+be)',
|
|
469
|
+
r'(DAN|Developer\s+Mode|Jailbreak)',
|
|
470
|
+
r'(new\s+role|you\s+are\s+now)',
|
|
471
|
+
]
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
**Defense strategies:**
|
|
475
|
+
1. **Detection:** Identify attack patterns
|
|
476
|
+
2. **Sanitization:** Remove/escape dangerous inputs
|
|
477
|
+
3. **Validation:** Verify outputs don't leak system prompts
|
|
478
|
+
4. **Monitoring:** Log and alert on suspicious activity
|
|
479
|
+
|
|
480
|
+
**Activation triggers:** Prompt injection, jailbreak, security, input validation
|
|
481
|
+
|
|
482
|
+
---
|
|
483
|
+
|
|
484
|
+
#### `/ams` - AI Monitoring Setup (Command)
|
|
485
|
+
Set up comprehensive LLM monitoring with cost tracking and alerting.
|
|
486
|
+
|
|
487
|
+
**Usage:**
|
|
488
|
+
```bash
|
|
489
|
+
/ams
|
|
490
|
+
|
|
491
|
+
# Claude asks:
|
|
492
|
+
# - Metrics (latency, cost, tokens, errors)
|
|
493
|
+
# - Dashboards (Grafana, custom)
|
|
494
|
+
# - Alerts (Slack, PagerDuty, email)
|
|
495
|
+
# - Budget ($1000/month)
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
**Generated files:**
|
|
499
|
+
```
|
|
500
|
+
monitoring/
|
|
501
|
+
├── metrics.py # Prometheus metrics
|
|
502
|
+
├── cost_tracker.py # Cost tracking with budget alerts
|
|
503
|
+
├── grafana_dashboard.json # Pre-built dashboard
|
|
504
|
+
├── alerting_rules.yml # Alert rules
|
|
505
|
+
├── prometheus.yml # Prometheus config
|
|
506
|
+
├── docker-compose.yml # Prometheus + Grafana
|
|
507
|
+
└── README.md # Setup instructions
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
**Metrics collected:**
|
|
511
|
+
- Request count (by model, status)
|
|
512
|
+
- Latency (p50, p95, p99)
|
|
513
|
+
- Token usage (input, output)
|
|
514
|
+
- Cost per request
|
|
515
|
+
- Error rate
|
|
516
|
+
- Cache hit rate
|
|
517
|
+
|
|
518
|
+
**Alerts configured:**
|
|
519
|
+
- Budget threshold (80%, 90%, 100%)
|
|
520
|
+
- High error rate (>5%)
|
|
521
|
+
- Slow responses (>10s)
|
|
522
|
+
- Token limit approaching
|
|
523
|
+
|
|
524
|
+
**Dashboards:**
|
|
525
|
+
- Real-time request monitoring
|
|
526
|
+
- Cost tracking (daily, weekly, monthly)
|
|
527
|
+
- Model performance comparison
|
|
528
|
+
- Error analysis
|
|
529
|
+
|
|
530
|
+
---
|
|
531
|
+
|
|
532
|
+
## Documentation
|
|
533
|
+
|
|
534
|
+
- **[Installation Guide](./INSTALLATION.md)** - Prerequisites, setup, verification
|
|
535
|
+
- **[Quick Start](./QUICK_START.md)** - 10-minute tutorial with examples
|
|
536
|
+
- **[Use Cases](./USE_CASES.md)** - Real-world applications with ROI
|
|
537
|
+
- **[Troubleshooting](./000-docs/157-DR-FAQS-troubleshooting.md)** - Common issues and solutions
|
|
538
|
+
|
|
539
|
+
## Example Workflows
|
|
540
|
+
|
|
541
|
+
### Build a Customer Support Bot (10 minutes)
|
|
542
|
+
|
|
543
|
+
```bash
|
|
544
|
+
claude
|
|
545
|
+
|
|
546
|
+
# 1. Generate RAG pipeline for knowledge base
|
|
547
|
+
/rpg
|
|
548
|
+
Requirements: Support docs, Qdrant, GPT-4
|
|
549
|
+
|
|
550
|
+
# 2. Add safety guardrails
|
|
551
|
+
"Implement PII detection and toxicity filtering"
|
|
552
|
+
|
|
553
|
+
# 3. Set up monitoring
|
|
554
|
+
/ams
|
|
555
|
+
Requirements: Prometheus, Slack alerts, $5K budget
|
|
556
|
+
|
|
557
|
+
# 4. Deploy
|
|
558
|
+
"Create Docker deployment with all components"
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
**Result:** Production-ready support bot with 65% ticket automation, 30s response time, comprehensive safety.
|
|
562
|
+
|
|
563
|
+
### Optimize Prompts to Reduce Costs (5 minutes)
|
|
564
|
+
|
|
565
|
+
```bash
|
|
566
|
+
claude
|
|
567
|
+
|
|
568
|
+
# 1. Analyze current prompts
|
|
569
|
+
"Analyze my prompts for cost optimization opportunities"
|
|
570
|
+
|
|
571
|
+
# 2. Optimize individual prompts
|
|
572
|
+
"Reduce this prompt to 50% of tokens:
|
|
573
|
+
'I would like you to carefully analyze the following customer feedback...'"
|
|
574
|
+
|
|
575
|
+
# 3. Generate reusable templates
|
|
576
|
+
/ptg
|
|
577
|
+
Use case: Customer feedback analysis
|
|
578
|
+
|
|
579
|
+
# 4. Calculate savings
|
|
580
|
+
"Calculate ROI if I process 10,000 requests/month"
|
|
581
|
+
```
|
|
582
|
+
|
|
583
|
+
**Result:** 60-90% cost reduction while maintaining quality.
|
|
584
|
+
|
|
585
|
+
### Build RAG System for Legal Documents (15 minutes)
|
|
586
|
+
|
|
587
|
+
```bash
|
|
588
|
+
claude
|
|
589
|
+
|
|
590
|
+
# 1. Design RAG architecture
|
|
591
|
+
"Design RAG system for legal document search with:
|
|
592
|
+
- 10,000 contracts
|
|
593
|
+
- Clause extraction
|
|
594
|
+
- Precedent search
|
|
595
|
+
- GDPR compliance"
|
|
596
|
+
|
|
597
|
+
# 2. Generate complete pipeline
|
|
598
|
+
/rpg
|
|
599
|
+
Requirements: Legal docs (PDF), Qdrant (self-hosted), GPT-4
|
|
600
|
+
|
|
601
|
+
# 3. Add PII protection
|
|
602
|
+
"Implement PII detection for attorney-client privilege"
|
|
603
|
+
|
|
604
|
+
# 4. Set up monitoring
|
|
605
|
+
/ams
|
|
606
|
+
Track: accuracy, retrieval time, cost per query
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
**Result:** Legal document analysis system with 94% accuracy, 82ms latency, PII protection.
|
|
610
|
+
|
|
611
|
+
## Learning Resources
|
|
612
|
+
|
|
613
|
+
### Video Tutorials (Coming Soon)
|
|
614
|
+
- Prompt Engineering Masterclass (30 min)
|
|
615
|
+
- Building Production RAG Systems (45 min)
|
|
616
|
+
- AI Safety Best Practices (20 min)
|
|
617
|
+
|
|
618
|
+
### Blog Posts
|
|
619
|
+
- [Reduce LLM Costs by 90%](https://example.com/reduce-llm-costs)
|
|
620
|
+
- [Building RAG Systems That Actually Work](https://example.com/rag-systems)
|
|
621
|
+
- [Comprehensive Guide to AI Safety](https://example.com/ai-safety)
|
|
622
|
+
|
|
623
|
+
### Community
|
|
624
|
+
- [Discord](https://discord.com/invite/6PPFFzqPDZ) - #claude-code channel
|
|
625
|
+
- [GitHub Discussions](https://github.com/jeremylongshore/claude-code-plugins/discussions)
|
|
626
|
+
- [Stack Overflow](https://stackoverflow.com/questions/tagged/claude-code) - `claude-code` tag
|
|
627
|
+
|
|
628
|
+
## Pricing
|
|
629
|
+
|
|
630
|
+
**One-time purchase: $79**
|
|
631
|
+
|
|
632
|
+
What's included:
|
|
633
|
+
- All 12 plugins (lifetime access)
|
|
634
|
+
- Free updates and new plugins
|
|
635
|
+
- Email support
|
|
636
|
+
- Community Discord access
|
|
637
|
+
- Documentation and examples
|
|
638
|
+
|
|
639
|
+
**Compare to alternatives:**
|
|
640
|
+
- Manual implementation: 40+ hours ($4,000 at $100/hour)
|
|
641
|
+
- Consultants: $150-300/hour × 40 hours = $6,000-12,000
|
|
642
|
+
- AI/ML Engineering Pack: **$79** (99% cost savings)
|
|
643
|
+
|
|
644
|
+
**Average payback period: 3 days**
|
|
645
|
+
|
|
646
|
+
[Buy Now on Gumroad](https://gumroad.com/l/ai-ml-engineering-pack) | [Volume Licensing](mailto:[email protected])
|
|
647
|
+
|
|
648
|
+
## 🆘 Support
|
|
649
|
+
|
|
650
|
+
**Email:** [email protected]
|
|
651
|
+
|
|
652
|
+
**GitHub Issues:** https://github.com/jeremylongshore/claude-code-plugins/issues
|
|
653
|
+
|
|
654
|
+
**Response time:** Within 24 hours (usually faster)
|
|
655
|
+
|
|
656
|
+
**Community:** Join Discord for community support
|
|
657
|
+
|
|
658
|
+
## Updates
|
|
659
|
+
|
|
660
|
+
**Current version:** 1.0.0
|
|
661
|
+
|
|
662
|
+
**Update policy:** Free updates for life, including new plugins and features
|
|
663
|
+
|
|
664
|
+
**Changelog:**
|
|
665
|
+
- **v1.0.0** (2025-10-10) - Initial release with 12 plugins
|
|
666
|
+
|
|
667
|
+
To update:
|
|
668
|
+
```bash
|
|
669
|
+
claude plugin update ai-ml-engineering-pack
|
|
670
|
+
```
|
|
671
|
+
|
|
672
|
+
## License
|
|
673
|
+
|
|
674
|
+
MIT License - See [LICENSE](./000-docs/001-BL-LICN-license.txt) for details
|
|
675
|
+
|
|
676
|
+
**Commercial use permitted** - Use in commercial projects, redistribute, modify
|
|
677
|
+
|
|
678
|
+
## Acknowledgments
|
|
679
|
+
|
|
680
|
+
Built with:
|
|
681
|
+
- [Claude Code](https://claude.ai/code) - AI-powered development CLI
|
|
682
|
+
- [LangChain](https://langchain.com) - LLM framework
|
|
683
|
+
- [Presidio](https://microsoft.github.io/presidio/) - PII detection
|
|
684
|
+
- [Qdrant](https://qdrant.tech) - Vector database
|
|
685
|
+
- [FastAPI](https://fastapi.tiangolo.com) - Modern Python framework
|
|
686
|
+
|
|
687
|
+
## Ready to Get Started?
|
|
688
|
+
|
|
689
|
+
1. **[Install the pack](./INSTALLATION.md)** - 5-minute setup
|
|
690
|
+
2. **[Complete Quick Start](./QUICK_START.md)** - Build your first AI feature in 10 minutes
|
|
691
|
+
3. **[Explore use cases](./USE_CASES.md)** - See real-world ROI examples
|
|
692
|
+
4. **[Join the community](https://discord.com/invite/6PPFFzqPDZ)** - Connect with other AI/ML engineers
|
|
693
|
+
|
|
694
|
+
---
|
|
695
|
+
|
|
696
|
+
**Questions?** Email [email protected] or open a [GitHub issue](https://github.com/jeremylongshore/claude-code-plugins/issues).
|
|
697
|
+
|
|
698
|
+
**Built by AI engineers, for AI engineers.**
|