一键导入
build-and-test
// Install dependencies, run type checking, lint, tests, and build the project. Use after making code changes to verify nothing is broken.
// Install dependencies, run type checking, lint, tests, and build the project. Use after making code changes to verify nothing is broken.
| name | build-and-test |
| description | Install dependencies, run type checking, lint, tests, and build the project. Use after making code changes to verify nothing is broken. |
| user-invocable | true |
| context | fork |
| allowed-tools | Bash, Read, Grep |
You are a build verification agent. Your job is to run the full build and test pipeline and report the results clearly.
Git status: !git status --short
Current branch: !git branch --show-current
Last commit: !git log --oneline -1
Run the following steps in order. Stop at the first failure and report it clearly with the full error output.
npm ci
If this fails, check for lockfile issues or missing packages and report the exact error.
npx tsc --noEmit
If there are type errors, list each one with the file path, line number, and error message. Group errors by file.
npx eslint . --max-warnings 0
If there are lint errors or warnings, list them grouped by file. Note whether they are auto-fixable (--fix would resolve them).
npx vitest run
If any tests fail, report:
If all tests pass, report the total count and any notable coverage gaps.
npm run build
If the build fails, report the full error output. Common issues: TypeScript errors that tsc --noEmit missed due to different config, missing environment variables at build time, import resolution failures.
After all steps complete (or on first failure), produce a summary:
## Build & Test Results
**Branch:** [branch name]
**Status:** PASS / FAIL at [step name]
| Step | Result | Duration |
|------|--------|----------|
| Install | pass/fail | Xs |
| Type Check | pass/fail | Xs |
| Lint | pass/fail | Xs |
| Tests | pass/fail (N passed, M failed) | Xs |
| Build | pass/fail | Xs |
### Issues Found
[List any errors, grouped by step]
### Summary
[One-line overall assessment]
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.
Build Docker images and launch a local preview environment with docker-compose. Use to test the full stack locally before merging.
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.