openclaw-skill-optimizer
v1.0.0
Published
Analyze and optimize OpenClaw skill performance
Maintainers
Readme
openclaw-skill-optimizer
Analyze and optimize OpenClaw skill performance — Identify bottlenecks, suggest performance improvements, and generate optimization reports.
📖 Introduction
After publishing skills, how do you know if they can be improved further? openclaw-skill-optimizer analyzes skills in-depth:
- ✅ Token usage patterns
- ✅ Execution time analysis
- ✅ I/O operation optimization
- ✅ Memory footprint estimation
- ✅ Async/await opportunities
🚀 Quick Start
# Install globally
npm install -g openclaw-skill-optimizer
# Run optimizer
npx openclaw-skill-optimizer --analyze ./my-skill
# Generate report
npx openclaw-skill-optimizer --report JSON📊 What It Does
1. Performance Profiling
Analyzing: my-skill/
├── execution time: 2.3s
├── I/O operations: 47 calls
├── async waiting: 890ms
└── memory: 12MB avg2. Bottleneck Detection
⚠️ Found slow operation:
File: src/optimizer.ts:45
Issue: Synchronous file operations in loop
Impact: 1.2s total delay
Fix: Use Promise.all()3. Optimization Suggestions
✅ Suggested improvements:
1. Replace `readFileSync` with async `readFile`
2. Use memoization for repeated calculations
3. Implement caching layer
4. Add parallel processing for independent tasks🛠️ Technical Architecture
Built with TypeScript:
interface OptimizationReport {
skillName: string;
performanceMetrics: {
executionTime: number;
ioOperations: number;
memoryUsage: number;
};
bottlenecks: Bottleneck[];
suggestions: string[];
}📝 Example Output
$ npx openclaw-skill-optimizer ./example-skill/
🔍 Analyzing: example-skill
├─ Loading skill configuration... ✓
├─ Profiling execution path... ✓
├─ Detecting I/O patterns... ✓
└─ Generating report... ✓
⚡ Performance Summary:
Average run time: 2.3s
Peak memory: 15.4MB
I/O operations: 47
Async wait time: 890ms
🎯 Top 3 Improvements:
1. [High] Replace sync I/O with async operations (saves 1.1s)
2. [Medium] Add caching to hot code paths (saves 210ms)
3. [Low] Optimize string concatenation (saves 40ms)
📄 Full report: analysis-report.json✨ Why This Exists
AI skill performance directly affects:
- Time to completion for tasks
- Token efficiency in API calls
- User experience speed perception
- Cost efficiency of operations
Optimizing skills = Better overall system performance.
📦 Installation Methods
# NPM
npm install openclaw-skill-optimizer
# Yarn
yarn add openclaw-skill-optimizer
# Deno
deno install https://deno.land/x/openclaw-skill-optimizer/mod.ts
# Direct execution
npx openclaw-skill-optimizer --help🤝 Contributing
Contributions welcome! First-time contributors: see good first issue badge.
📄 License
MIT License - See LICENSE file for details.
📞 Support
Issues / PRs: GitHub
Built for the OpenClaw ecosystem - empowering AI agent development.
