Tech debt ci review

From ZaxbyHub/opencode-swarm · View interactive version

Tech debt ci review is an AI agent skill from the GitHub repository ZaxbyHub/opencode-swarm. Deep technical debt and CI stability audit for identifying test theater, missing or mis-scoped tests, actual and potential test failures, flaky-test risk, dependency/toolchain brittleness, and structural debt that prevents PRs from going green safely.

How to use this skill

Skill file

/tech-debt-ci-review

Run a deep technical debt and CI stability audit of the current repository.

Mission

Identify every meaningful source of:

Do not build features.

Do not do opportunistic cleanup for its own sake.

Do not preserve noisy tests or workflows just because they make dashboards look busy.

Operating stance

Quality-over-speed directive

Confidence in the test and CI signal is the main success metric.

There is no time pressure.

There is no reward for finishing in fewer passes.

Do not batch more aggressively, skip validation, or stop early because the repository is large or the audit feels expensive.

Large codebases require more disciplined verification, not less.

Required workflow

Phase 0 — Inventory first

In this repository, start from the authoritative contracts: AGENTS.md

(especially invariant 6 — never validate the whole repo through broad

test_runner scopes; use the per-file isolation loops from TESTING.md and

contributing.md) and .github/workflows/ci.yml for what CI actually

enforces.

Read enough of the repo to build a quality and CI map:

Build a map of:

Phase 1 — Parallel exploration

Use subagents for breadth so the main context stays clean.

Split the repo into disjoint scopes and/or audit families.

Prefer small, focused scopes over giant repo-wide sweeps.

Recommended exploration lanes:

Explorer-style subagents should:

Phase 2 — Candidate validation in a fresh reviewer context

Treat exploration output as a hypothesis engine, not a final verdict.

Use one or more fresh reviewer contexts to validate candidate findings.

For each candidate finding, classify exactly one:

Reviewer must:

  1. Re-open the exact files and lines referenced by the explorer
  2. Read enough surrounding context to judge correctly
  3. Check callers, callees, tests, config, CI jobs, manifests, scripts, docs, and runtime assumptions as needed
  4. Check whether a mitigating control invalidates the candidate
  5. Run the smallest safe validation loop available when the claim depends on runtime behavior, timing, sequencing, or environment state
  6. Reclassify severity if the explorer overclaimed it
  7. Record the reason for disproof when rejecting a candidate

If the issue cannot be proven due to ambiguity or missing context, mark it UNVERIFIED, not DISPROVED.

Phase 3 — Audit checklist

Apply this checklist across the repo:

  1. Actual CI failure risk
  1. Test theater
  1. Need for tests
  1. Actual and potential test failures
  1. Flaky-test risk
  1. Mutation-minded test quality

Use mutation thinking even if no mutation tool exists.

For important tests, ask:

If not, the test is likely theater or too weak.

  1. Technical debt with CI impact
  1. Dependency, build, and toolchain brittleness
  1. Intended-vs-actual verification for CI and testing

For every important workflow claim, verify whether the repo actually does what it claims, for example:

Phase 4 — Runtime-aware validation

Use runtime validation selectively, not blindly.

If a candidate depends on actual behavior, timing, workflow sequencing, role/state transitions, or environment interaction, use the smallest safe validation loop available.

Do not use retries as proof of correctness.

Retries can help separate flaky from deterministic failures, but they are not a fix.

Phase 5 — Final output

Write the final report to .claude/reports/tech-debt-report.md (create the

directory if needed). Do not write it to the repository root, and do not

commit it unless the user asks — it is working output, not a deliverable.

Use this structure:

Technical Debt and CI Stability Report

Generated: [timestamp]

Scope: [scopes and artifacts covered]

Files reviewed: [count]

Parallel exploration used: YES | NO

Independent reviewer validation used: YES | NO

Runtime validation used: YES | NO

Executive Summary

[2-4 sentences]

Current PR/CI Blockers

[only issues actively breaking or very likely to break PR CI]

Critical and High Findings

[full detail for CONFIRMED and PRE_EXISTING only]

Test Theater Findings

[tests that create confidence without protection]

Missing or Mis-Scoped Tests

[where tests are needed, where they are not needed, and where the testing pyramid is wrong]

Flaky-Test Risks

[confirmed or likely nondeterminism sources]

Structural Debt with CI Impact

[coupling, brittle setup, outdated tooling, duplicated logic, etc.]

Dependency and Toolchain Risks

[build/install/runtime brittleness]

Coverage Notes

[what remained unverified and why]

Validation Notes

Green-PR Remediation Order

  1. current red-build blockers
  2. flaky tests and nondeterministic CI failures
  3. test theater in critical paths
  4. missing tests for expensive regressions
  5. structural debt directly causing CI and change fragility
  6. lower-value cleanup only after the above

When presenting the report, include:

  1. the current PR/CI blockers in one-line form
  2. the most important test theater patterns
  3. the highest-value missing-test gaps
  4. the top flaky-test risks
  5. the minimal remediation order required to get PR CI trustworthy and green

Final rules

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.