npm package: @kwasati/strategylab
Description: AI-Powered EA Development Framework for MetaTrader 5 - Claude Code Edition (New Architecture)
Author: StrategyLab Team
Latest version: 1.1.5

# StrategyLab Framework v1.1.0

[![npm version](https://img.shields.io/npm/v/@kwasati/strategylab.svg)](https://www.npmjs.com/package/@kwasati/strategylab)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)

<pre style="display: inline-block; text-align: left;">
███████╗████████╗██████╗  █████╗ ████████╗███████╗ ██████╗██╗   ██╗    ██╗      █████╗ ██████╗ 
██╔════╝╚══██╔══╝██╔══██╗██╔══██╗╚══██╔══╝██╔════╝██╔════╝╚██╗ ██╔╝    ██║     ██╔══██╗██╔══██╗
███████╗   ██║   ██████╔╝███████║   ██║   █████╗  ██║  ███╗╚████╔╝     ██║     ███████║██████╔╝
╚════██║   ██║   ██╔══██╗██╔══██║   ██║   ██╔══╝  ██║   ██║ ╚██╔╝      ██║     ██╔══██║██╔══██╗
███████║   ██║   ██║  ██║██║  ██║   ██║   ███████╗╚██████╔╝  ██║       ███████╗██║  ██║██████╔╝
╚══════╝   ╚═╝   ╚═╝  ╚═╝╚═╝  ╚═╝   ╚═╝   ╚══════╝ ╚═════╝   ╚═╝       ╚══════╝╚═╝  ╚═╝╚═════╝ 
                                                                    ᴇxᴘᴇʀᴛ ᴀᴅᴠɪsᴏʀ ғᴀᴄᴛᴏʀʏ
</pre>

## 🚨 Major Update: New Architecture in v1.1.0

**BREAKING CHANGE**: StrategyLab v1.1.0 introduces a new architecture that separates framework files from user data:

- **Framework Files**: `~/.claude/StrategyLab/` (read-only)
- **User Data**: `~/StrategyLab/` (your files)

This change ensures clean uninstallation, easier updates, and better data protection.

## 🎯 Overview

StrategyLab Framework เป็นเครื่องมือสำหรับพัฒนา Expert Advisor (EA) บน MetaTrader 5 ด้วยพลังของ AI จาก Claude Code ช่วยให้คุณสร้าง trading strategies ได้อย่างง่ายดายผ่านการสนทนาภาษาธรรมชาติ

## ✨ What's New in v1.1.0

### 🏗️ Architecture Redesign
- **Clean Separation**: Framework files separate from user data
- **Safe Updates**: Update framework without touching your data
- **Better Uninstall**: Remove framework while preserving your work

### 🔄 Automatic Migration
- **Smart Detection**: Automatically detects v1.0.x installations
- **Safe Migration**: Backs up before moving files
- **Zero Data Loss**: All your ideas, plans, and strategies preserved

### 🛠️ Improved Installation
- **One Command**: `npm install -g @kwasati/strategylab`
- **Auto Migration**: Handles upgrade from v1.0.x automatically
- **Progress Tracking**: Clear visual feedback during installation

## ✨ Key Features

### 🧠 AI-Powered Intelligence
- **Strategy Generation**: AI สร้าง trading strategies จากไอเดียง่ายๆ ของคุณ
- **Deep Analysis**: Sequential thinking สำหรับการวิเคราะห์เชิงลึก
- **Smart Planning**: วางแผนการพัฒนา strategy อย่างเป็นระบบ
- **Code Generation**: สร้างโค้ด EA อัตโนมัติตาม best practices

### 🌐 Multi-Language Support
- **ภาษาไทย**: รองรับการใช้งานภาษาไทยเต็มรูปแบบด้วย `--lang TH`
- **English**: ภาษาเริ่มต้นสำหรับผู้ใช้ทั่วโลก

### 📊 Trading Personas (5 บุคลิกภาพ)
- **quant-trader**: นักวิเคราะห์เชิงสถิติและ systematic trading
- **risk-manager**: ผู้เชี่ยวชาญด้านการจัดการความเสี่ยงและการรักษาเงินทุน
- **ea-developer**: ผู้เชี่ยวชาญ MQL5 และการ optimize โค้ด
- **analyzer**: นักวิเคราะห์ root cause และการวางแผน
- **scribe**: ผู้เชี่ยวชาญด้านการเขียนเอกสารและการจดบันทึก

## 🚀 Installation

### For New Users
```bash
npm install -g @kwasati/strategylab
```

### For Existing Users (v1.0.x)
The installer will automatically:
1. Detect your existing installation
2. Prompt for migration
3. Back up your data
4. Move framework files to new location
5. Keep your user data in place

## 📁 New Directory Structure

### Framework Files (Read-Only)
```
~/.claude/StrategyLab/
├── scripts/          # All Python scripts
├── knowledge/        # Trading knowledge base
├── config/           # Configuration files
└── templates/        # EA templates and Core modules
```

### User Data (Your Files)
```
~/StrategyLab/
├── ideas/            # Your strategy ideas
│   ├── current/
│   ├── used/
│   └── archived/
├── planning/         # Your strategy plans
│   ├── ready/
│   ├── used/
│   └── archived/
├── strategies/       # Generated EAs
└── notes/           # Your notes
    ├── active/
    ├── archived/
    └── exports/
```

## 🛠️ Core Commands

### Claude Code Commands
```bash
/strategylab          # Main command
/ea:help             # Show help
/ea:idea             # Generate ideas
/ea:plan             # Create plans
/ea:create           # Generate EA
/ea:note             # Manage notes
```

### Command Line Usage
```bash
sl idea              # Generate trading ideas
sl plan              # Manage strategy plans
sl create            # Create EA from plan
sl note              # Manage notes
```

### Supported Flags
- `--lang TH|EN` - เลือกภาษา (ไทย/อังกฤษ)
- `--think` - วิเคราะห์แบบละเอียด (4K tokens)
- `--think-hard` - วิเคราะห์แบบลึกมาก (10K tokens)
- `--mt4/--mt5` - เลือก platform (default: MT5)

## 📋 Requirements

- Python 3.8+
- Claude Code CLI
- MetaTrader 5
- 4GB RAM minimum
- 100MB disk space

## 🔄 Upgrading from v1.0.x

### What Happens During Migration

1. **Backup**: Creates timestamped backup of your current installation
2. **Move Framework**: Moves scripts, knowledge, config, templates to `~/.claude/StrategyLab/`
3. **Preserve User Data**: Keeps your ideas, plans, strategies, notes in `~/StrategyLab/`
4. **Update Paths**: All scripts updated to use new paths
5. **Validate**: Checks that everything works correctly

### Migration Safety

- **Automatic Backup**: Before any changes
- **Dry Run Option**: Preview changes without making them
- **Rollback**: Can restore from backup if needed
- **Zero Data Loss**: All your work is preserved

## 🐛 Troubleshooting

### Migration Issues

If migration fails:
```bash
# List available backups
sl migrate --list-backups

# Restore from backup
sl migrate --restore [backup_path]
```

### Permission Errors

If you get permission errors:
```bash
# Check permissions
ls -la ~/.claude/

# Fix permissions if needed
chmod 755 ~/.claude
```

### Command Not Found

After installation:
1. Restart Claude Code
2. Check that `/strategylab` command is available
3. Try `/ea:help` to verify installation

## 📝 Documentation

- [Installation Guide](docs/INSTALLATION.md)
- [Command Reference](docs/COMMANDS.md)
- [Architecture Design](ARCHITECTURE_REDESIGN_v1.1.0.md)
- [Migration Guide](docs/MIGRATION.md)

## 🤝 Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

## 📄 License

MIT License - see [LICENSE](LICENSE) file for details.

## 🙏 Acknowledgments

- Claude AI by Anthropic for powering the intelligence
- MetaTrader 5 community for trading insights
- All contributors and users of StrategyLab

---

**Note**: This is a breaking change from v1.0.x. Please ensure you have backups before upgrading.