Run project tests by detecting the environment and fixing failures.
Process
Identify context:
-
If code changes are involved: run jj diff -s first to see changed files; then use jj diff -- path to restrict to specific files/directories
-
If the user specified specific files or paths, focus on those
Detect the preferred way to run tests: a. Check existing instructions: README.md , CONTRIBUTING.md , CLAUDE.md , AGENTS.md , GEMINI.md , CODEX.md
b. Check task runners: Makefile , justfile , Taskfile.yml for test target c. Check for scripts in bin/ , .my/bin/ (test, *-test, etc.) d. Check package manager scripts (package.json scripts, etc.) e. Fall back to standard: npm test , pytest , go test ./... , cargo test
Run the detected test command
Analyze and fix any failures
Failure Handling
For any test failures:
-
Identify the root cause
-
Provide specific fixes
-
Explain why the fix works
-
Re-run tests to verify
Stop Condition
- If a fix fails twice, stop and ask for guidance.
Output
-
Test command used
-
Failures and fixes (if any)
-
Verification