local-environment
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLocal Environment Skill
本地环境Skill
This skill enables Claude to help manage the Polar local development environment using Docker. Use this when the user needs to start, stop, debug, or understand the local development stack.
该Skill可让Claude帮助使用Docker管理Polar本地开发环境。当用户需要启动、停止、调试或了解本地开发栈时使用此Skill。
Instance Auto-Detection
实例自动检测
The command automatically detects the correct instance number. No manual flag is needed in most cases.
dev docker-iDetection priority:
- env var →
CONDUCTOR_PORT(port - 55000) / 10 + 1 - Workspace path hash → stable instance derived from the repo root path
You can override with if needed, but auto-detection handles Conductor workspaces automatically.
-i Ndev docker-i检测优先级:
- 环境变量 →
CONDUCTOR_PORT(port - 55000) / 10 + 1 - 工作区路径哈希 → 从仓库根路径生成的稳定实例编号
如有需要,你可以使用覆盖自动检测,但自动检测可自动处理Conductor工作区。
-i NWhen to Use
使用场景
- User asks to start/stop the local environment
- User needs to view logs or debug issues
- User wants to run multiple isolated instances
- User needs to understand the service architecture
- User encounters container or service errors
- 用户要求启动/停止本地环境
- 用户需要查看日志或调试问题
- 用户希望运行多个隔离实例
- 用户需要了解服务架构
- 用户遇到容器或服务错误
Quick Reference
快速参考
| Task | Command |
|---|---|
| Start full stack | |
| Stop services | |
| View all logs | |
| View service logs | |
| Follow logs | |
| Check status | |
| Restart service | |
| Shell access | |
| Fresh start | |
| With monitoring | |
| Force rebuild | |
| 任务 | 命令 |
|---|---|
| 启动完整栈 | |
| 停止服务 | |
| 查看所有日志 | |
| 查看服务日志 | |
| 实时查看日志 | |
| 检查状态 | |
| 重启服务 | |
| 进入Shell | |
| 全新启动 | |
| 带监控启动 | |
| 强制重建 | |
Services
服务列表
| Service | Default Port | Description |
|---|---|---|
| api | 8000 | FastAPI backend |
| worker | - | Background job processor |
| web | 3000 | Next.js frontend |
| db | 5432 | PostgreSQL database |
| redis | 6379 | Redis cache |
| minio | 9000/9001 | S3-compatible storage |
| prometheus | 9090 | Metrics (optional) |
| grafana | 3001 | Dashboards (optional) |
| 服务 | 默认端口 | 描述 |
|---|---|---|
| api | 8000 | FastAPI后端 |
| worker | - | 后台任务处理器 |
| web | 3000 | Next.js前端 |
| db | 5432 | PostgreSQL数据库 |
| redis | 6379 | Redis缓存 |
| minio | 9000/9001 | 兼容S3的存储服务 |
| prometheus | 9090 | 指标监控(可选) |
| grafana | 3001 | 可视化面板(可选) |
Instance Port Mapping
实例端口映射
Port = Base Port + (Instance × 100)
| Instance | API | Web | DB | Redis | MinIO |
|---|---|---|---|---|---|
| 0 | 8000 | 3000 | 5432 | 6379 | 9000 |
| 1 | 8100 | 3100 | 5532 | 6479 | 9100 |
| 2 | 8200 | 3200 | 5632 | 6579 | 9200 |
端口 = 基础端口 + (实例编号 × 100)
| 实例 | API | Web | DB | Redis | MinIO |
|---|---|---|---|---|---|
| 0 | 8000 | 3000 | 5432 | 6379 | 9000 |
| 1 | 8100 | 3100 | 5532 | 6479 | 9100 |
| 2 | 8200 | 3200 | 5632 | 6579 | 9200 |
Rules Index
规则索引
| Rule | Category | Description |
|---|---|---|
| service-architecture | Reference | Service details |
| 规则 | 分类 | 描述 |
|---|---|---|
| service-architecture | 参考 | 服务详情 |