ar-optimize-tests

Audit a test suite's cost by classifying test classes by execution layer and applying mechanical fixes.

1|2|Updated Jul 11, 2026
One-click install
npx skills add https://github.com/mahsanamin/agentic-repos --skill ar-optimize-tests-mahsanamin
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ar-optimize-tests
Source: https://github.com/mahsanamin/agentic-repos/tree/main/skills/ar-optimize-tests
Command: npx skills add https://github.com/mahsanamin/agentic-repos --skill ar-optimize-tests-mahsanamin

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Test suites become slow because tests that need no framework end up paying for a full application context, and nothing in a green suite reports that waste. This Skill audits a project's test suite for cost using the per-class timing files the test runner already wrote, classifies every test class by the layer it actually runs at, and reports which tests pay for a framework they do not need and which no pipeline runs at all. ## Core Features & Use Cases - Measured cost analysis: Reads per-class time from existing runner result files instead of re-running the suite, and flags unmeasured or stale data explicitly. - Layer classification: Derives each test class's rung (no framework, sliced context, real database, full application) from its own markers, with no manually maintained list. - Six work-list views: Reports context-load-only classes, misplaced full-context tests, substitutes claiming database authority, tests run by no pipeline job, distinct heavyweight contexts, and necessity verdicts. - Gated execution: Applies only mechanical fixes (stripping cache-defeating flags, removing image-build wipe steps) on its own, and stages semantic rewrites behind a coverage-preserving invariant with a red control. - Use Case: A team's CI pipeline takes 40 minutes and nobody knows why. Run this Skill to get a per-class cost census, discover that 30% of unit tests boot a full application context, and receive a staged plan to move them to cheaper layers without reducing coverage. ## Quick Start Ask the AI to run ar-optimize-tests to audit the test suite and report which test classes are paying for a framework they do not need.

Frequently Asked Questions about ar-optimize-tests

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

FAQPage Schema
How do I find which tests are slowing down my CI pipeline?▼

Run the audit to parse the per-class timing files your test runner already wrote, producing per-class and per-module cost totals without re-running the suite. It then classifies each test by execution layer so you can see which cheap tests are paying for expensive framework contexts.

How to detect tests that boot a full application context unnecessarily?▼

The classification phase assigns each test class a rung from its own markers, highest matching rung wins. Tests driving only the request surface at the full-context rung are reported in a dedicated work-list as candidates to move to a sliced context layer.

Does the test audit re-run the test suite to measure cost?▼

No, cost is read from the result files the runner already emitted, never estimated or re-measured, unless the user explicitly asks. If no result output exists, the cost column is labelled UNMEASURED and cost-ranked steps are reported as unavailable.

Can the audit delete redundant tests automatically?▼

No, semantic changes like deletions and layer moves are never applied unattended. Every deletion naming a covering test must pass a red control: the pinned production line is broken and the named replacement must fail, proving it actually covers the deleted path.

What happens when no test layer marker configuration exists?▼

The skill derives a candidate marker map from the target's own test sources and installed rules, reports the seam as UNCONFIGURED, and withholds every dependent phase. It proceeds only after the map is confirmed, avoiding a confident census of the wrong thing.

When should I not use this test suite audit?▼

Do not use it to re-decide what a test asserts; assertion quality belongs to the test scope policy and is recorded as external, deferred. It also cannot produce cost rankings for a suite that has never been run, since no timing data exists.