test-location-strategy

Decides whether tests and lint run on GitHub Actions self-hosted runners or locally.

Updated Jun 11, 2026
One-click install
npx skills add https://github.com/marcocpt/trae_skills --skill test-location-strategy-marcocpt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-location-strategy
Source: https://github.com/marcocpt/trae_skills/tree/main/test-location-strategy
Command: npx skills add https://github.com/marcocpt/trae_skills --skill test-location-strategy-marcocpt

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When a project has self-hosted CI, developers waste time re-running tests locally that CI already passed, or incorrectly fall back to local runs when CI triggering fails. This Skill provides a deterministic decision flow for choosing where tests and lint execute. ## Core Features & Use Cases - CI Result Reuse: Checks existing GitHub Actions runs via gh run list and reuses successful results when the commit SHA matches the working tree HEAD, including baseline-branch checks for unpushed fix branches. - Strict No-Downgrade Rules: Distinguishes CI trigger failures (missing ref, auth errors) from CI unavailability, routing failures through AskUserQuestion instead of silently falling back to local runs. - Multi-Workflow Scheduling: Handles projects with separate workflows (e.g., macos-ci.yml for XCTest/lint, macos-xcuitest.yml for UI tests), triggering XCUITest only when UI behavior changes. - Use Case: Before pushing a bug fix on a new branch, the Skill detects the branch is unpushed, queries the base branch's CI run for the same commit, and reuses the passing result instead of running the full suite locally. ## Quick Start Ask the AI to decide whether to run the test suite on CI or locally for the current branch before pushing.

Frequently Asked Questions about test-location-strategy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I decide whether to run tests on CI or locally?

Check for existing GitHub Actions runs whose headSha matches your working tree HEAD using gh run list. If a successful run exists, reuse it; otherwise trigger the workflow with gh workflow run and only run locally under a closed list of conditions.

How to reuse GitHub Actions results instead of rerunning tests?

Query gh run list for the workflow on your current branch, then the base branch if unpushed. Reuse is valid when conclusion is success and headSha equals your local HEAD; record the run ID and source branch as evidence.

What happens when gh workflow run fails to trigger?

Trigger failure is not treated as CI unavailability, so local fallback is forbidden. Depending on the error, the flow asks the user to push the branch first, run gh auth login, retry, or terminate.

When should XCUITest workflows run versus XCTest?

XCTest and lint workflows run for every change, while the XCUITest workflow (macos-xcuitest.yml) triggers only when UI behavior changes, such as new interactions, overlays, or shortcut handling. Both can run in parallel when needed.

When is local test execution allowed with self-hosted CI?

Local runs are allowed only when the project has no workflow files, gh is unavailable and the user declines to fix auth, or CI results are unreusable and the user explicitly chooses local after a trigger failure. Single test files may also run locally, except XCUITest.