skills/dnyoussef/ml-expert/SKILL.md
Implement machine learning solutions including model architectures, training pipelines, optimization strategies, and performance improvements. This skill spawns a specialist ML implementation agent...
npx skillsauth add aiskillstore/marketplace ml-expertInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Version: 1.0.0 Type: Agent-based skill with SDK implementation Domain: Machine learning model implementation, training, and optimization
Implement machine learning solutions including model architectures, training pipelines, optimization strategies, and performance improvements. This skill spawns a specialist ML implementation agent with deep expertise in PyTorch, deep learning architectures, training techniques, and production ML systems.
Use this skill when implementing new ML models, fixing training issues, optimizing performance, implementing research papers, or building production ML pipelines.
This skill activates when users request:
The skill handles:
The ML expert agent handles:
{
"task": "Implement TRM × Titans-MAG architecture",
"requirements": {
"model_type": "transformer",
"parameters": "25M target",
"features": ["sliding_window_attention", "long_term_memory", "ACT"],
"framework": "pytorch",
"constraints": {
"vram": "6GB",
"inference_speed": "real-time"
}
},
"existing_code": {
"files": ["model.py", "config.py"],
"status": "partial_implementation"
},
"reference_materials": {
"papers": ["TRM.pdf", "Titans-MAG.pdf"],
"implementations": ["reference_model.py"]
}
}
{
"status": "implementation_complete",
"deliverables": {
"code_files": [
{
"path": "src/model/titans_mag.py",
"description": "Titans-MAG backbone implementation",
"loc": 350,
"tested": true
}
],
"tests": [
{
"path": "tests/test_model.py",
"coverage": 95,
"all_passing": true
}
],
"documentation": {
"architecture_diagram": "docs/architecture.md",
"usage_examples": "examples/train.py"
}
},
"performance_metrics": {
"parameter_count": "25.6M",
"inference_time": "45ms (GPU)",
"vram_usage": "5.2GB"
},
"validation": {
"unit_tests": "48/48 passing",
"integration_tests": "12/12 passing",
"manual_verification": "Forward/backward pass successful"
}
}
from claude_agent_sdk import ClaudeSDKClient, ClaudeAgentOptions
import asyncio
async def execute_ml_expert(context: dict):
"""Spawn ML implementation specialist agent."""
# Load specialist agent prompt
with open('agents/ml-expert-specialist.prompt', 'r') as f:
specialist_prompt = f.read()
# Configure agent with write permissions (plan mode for safety)
options = ClaudeAgentOptions(
model='claude-sonnet-4-5',
system_prompt=specialist_prompt,
permission_mode='plan', # Show intent before editing
allowed_tools=['Read', 'Write', 'Edit', 'Bash', 'Grep'],
setting_sources=['project']
)
client = ClaudeSDKClient(options)
try:
await client.connect()
# Format task for agent
task = f"""Implement ML solution:
Requirements: {context['requirements']}
Existing code: {context['existing_code']}
Reference materials: {context['reference_materials']}
Deliver production-quality implementation with tests and documentation."""
await client.query(task)
# Collect implementation results
results = []
async for message in client.receive_messages():
if message.type == 'assistant':
results.append(message.content)
return parse_implementation(results)
finally:
await client.disconnect()
scripts/init_model_template.py - Generate model boilerplatescripts/test_model.py - Model testing utilitiesscripts/profile_performance.py - Performance profilingscripts/validate_architecture.py - Architecture validationreferences/pytorch-best-practices.md - PyTorch coding standardsreferences/architecture-patterns.md - Common ML architecture patternsreferences/optimization-techniques.md - Training optimization guidereferences/testing-guide.md - ML testing best practicestemplates/model_template.py - Base model class templatetemplates/trainer_template.py - Training loop templatetemplates/config_template.py - Configuration dataclass templatecreate_model_skeleton() - Generate model file structureadd_tests() - Create test cases for model componentsbenchmark_model() - Performance benchmarkingUser: "Implement the TRM × Titans-MAG architecture from these papers with 25M parameters"
Skill gathers:
- Paper PDFs with architecture details
- Target parameter count constraint
- PyTorch as framework
- GPU memory constraint (6GB)
Agent implements:
- Titans-MAG backbone (sliding window attention, LMM, MAG gate)
- TRM wrapper (multi-pass reasoning)
- ACT head (adaptive computation)
- Full model integration
- Unit tests (95% coverage)
- Usage examples
- Architecture documentation
Deliverables:
- src/model/titans_mag.py (350 LOC)
- src/model/trm_wrapper.py (180 LOC)
- src/model/act_head.py (120 LOC)
- src/model/full_model.py (200 LOC)
- tests/test_*.py (48 tests, all passing)
- docs/architecture.md
User: "The ACT head has variance=0 issue. Add diversity regularization."
Skill gathers:
- Current ACT head implementation
- Diagnosis from ml-training-debugger skill
- Recommended fix (diversity loss)
Agent implements:
- Modify compute_act_loss() method
- Add diversity regularization term
- Update docstrings
- Add test for variance>0
- Verify training runs without warning
Deliverables:
- Modified src/model/act_head.py
- New test: tests/test_act_diversity.py
- Validation: Warning eliminated in training
User: "Model inference is too slow. Optimize for real-time performance."
Skill gathers:
- Current model code
- Profiling results
- Performance requirements (< 100ms)
Agent optimizes:
- Enable gradient checkpointing
- Fuse operations where possible
- Use torch.compile() for JIT optimization
- Optimize tensor operations
- Add caching for repeated computations
Deliverables:
- Optimized model code
- Performance benchmarks (45ms → 28ms)
- Memory usage reduced (6.2GB → 5.2GB)
- All tests still passing
The ML expert agent must:
This skill works with:
If the agent cannot implement the solution:
The agent should NEVER:
Test the skill with:
agents/ml-expert-specialist.promptindex.pyml-expert-process.dottests/README.mdNext Steps:
development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.