Agent Skill · cubic

cubic-loop

Iteratively improves code by running cubic AI reviews, fixing issues, and re-reviewing until clean or a maximum number of iterations is reached. Use when the user wants to polish their changes, says "loop until clean", "keep reviewing", or wants to fully optimize code quality before merging.

Provider: cubic Path in repo: cubic-loop/SKILL.md

Skill body

Cubic Loop

Iteratively review and fix code until cubic finds no more issues: review -> fix -> re-review -> repeat.

When To Activate

Inputs

Instructions

1. Determine review mode

Check whether to use local CLI or PR-based review:

For local mode, verify the CLI is installed:

which cubic

If not found, show install instructions and stop:

curl -fsSL https://cubic.dev/install | bash

For PR mode, verify GitHub CLI access:

gh auth status

If gh is missing or unauthenticated, stop and tell the user they need GitHub CLI access for PR mode.

Then identify the PR:

gh pr view --json number,headRefName -q '{number: .number, branch: .headRefName}'

2. Loop (max 5 iterations)

Repeat the following cycle.

A. Run review

Local mode:

git status --porcelain
# If uncommitted changes: cubic review -j
# If clean working tree: cubic review -b -j

If local review output is queued/running (or no final issues array is available yet), poll until complete:

PR mode:

git push

Then wait for GitHub/PR review results to settle before fetching issues:

After completion, use gh api graphql against repository.pullRequest.reviewThreads.

Prefer unresolved, non-outdated review threads. If the author identity is available, focus on comments authored by cubic’s bot/app; otherwise, use the PR’s review comments and note that the source could not be narrowed to cubic with certainty.

B. Check exit conditions

Stop the loop if ANY of these are true:

C. Fix issues

For each issue, prioritized P0 first then P1, P2:

  1. Read the file and surrounding context
  2. Validate the issue is real -> skip false positives
  3. Fix in the simplest way possible without refactoring unrelated code
  4. Track what was fixed for the summary

When there are multiple independent issues, use sub-agents where available to verify and fix them in parallel.

Skip P3 issues unless the user explicitly requested “fix everything”.

D. Commit and continue

git add -A
git commit -m "fix: address cubic review feedback (iteration N)"

Go back to step A.

3. Report

After exiting the loop, present a summary.

Output Format

Clean exit:

## Cubic Loop Complete

Iterations:   2
Issues fixed: 5
Remaining:    0

Changes:
- Iteration 1: Fixed SQL injection (P0), added null checks (P1 x2)
- Iteration 2: Fixed error handling (P2), added input validation (P2)

All commits pushed. Ready to merge.

Max iterations reached:

## Cubic Loop — Stopped after 5 iterations

Iterations:   5
Issues fixed: 11
Remaining:    2

Remaining issues:
- src/legacy.ts:234 — P2: "Consider extracting this into a utility function"
- src/config.ts:12 — P3: "Magic number could be a named constant"

These may be intentional trade-offs. Review manually or run again.

Skill frontmatter

allowed-tools: Bash

Work with this as data

Every skill here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for agent skills

4 MCP tools reach this
  • find_skillsBrowse and filter every skill in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This skill
curl "https://apis.io/api/v1/skills/cubic-loop"
All agent skills
curl "https://apis.io/api/v1/skills?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.