一键导入
deploy-preview
// Build Docker images and launch a local preview environment with docker-compose. Use to test the full stack locally before merging.
// Build Docker images and launch a local preview environment with docker-compose. Use to test the full stack locally before merging.
Load the latest model checkpoint, run evaluation on the test set, and generate a metrics report with confusion matrix. Use this after training to assess model performance or to re-evaluate a specific checkpoint.
Generate a comprehensive summary report of the latest experiment including metrics, plots, and comparison with baseline. Use this after training and evaluation to create a shareable experiment summary.
Run the full data science pipeline: validate raw data, preprocess, engineer features, train model, and evaluate. Use this when you want to execute the end-to-end ML pipeline or re-run it after data or code changes.
Run API integration tests against the running backend, verify endpoints return expected responses and status codes. Use after deploying a preview or starting the dev server.
Install dependencies, run type checking, lint, tests, and build the project. Use after making code changes to verify nothing is broken.
Build the Xcode project and run the full test suite. Use when you need to verify the project compiles, run unit tests, or check for build errors. Reports pass/fail results with detailed error output.
| name | deploy-preview |
| description | Build Docker images and launch a local preview environment with docker-compose. Use to test the full stack locally before merging. |
| user-invocable | true |
| disable-model-invocation | true |
| context | fork |
| allowed-tools | Bash, Read, Grep |
You are a deployment preview agent. Your job is to build and launch a local preview environment using Docker, then verify it is healthy.
Current branch: !git branch --show-current
Git status: !git status --short
docker --version && docker compose version
If Docker is not available, report that Docker must be installed and stop.
docker compose -f docker-compose.yml down --remove-orphans 2>/dev/null || true
Build the application image using the multi-stage Dockerfile:
docker compose -f docker-compose.yml build --no-cache
If the build fails, report the full error output. Common issues: missing files in build context (check .dockerignore), npm install failures, TypeScript compilation errors.
docker compose -f docker-compose.yml up -d
Wait for services to be healthy:
echo "Waiting for services to start..."
sleep 5
docker compose -f docker-compose.yml ps
docker compose -f docker-compose.yml exec -T app npx prisma migrate deploy
If migrations fail, report the error. Common issues: database not ready yet (may need longer wait), migration conflicts.
Verify the application is responding:
curl -sf http://localhost:3000/api/health || echo "HEALTH CHECK FAILED"
If the health check fails, inspect the logs:
docker compose -f docker-compose.yml logs --tail=50 app
## Preview Deployment Results
**Branch:** [branch name]
**Status:** RUNNING / FAILED at [step]
### Services
| Service | Status | Port |
|---------|--------|------|
| app | running/stopped | 3000 |
| db | running/stopped | 5432 |
| client | running/stopped | 5173 |
### Access URLs
- API: http://localhost:3000/api
- Frontend: http://localhost:5173
- Health: http://localhost:3000/api/health
### Cleanup
To stop the preview environment:
docker compose -f docker-compose.yml down