# Auto Skill Loop

> >-

- **Type:** Skill
- **Install:** `agentstack add skill-conn-castle-agent-layer-auto-skill-loop`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [conn-castle](https://agentstack.voostack.com/s/conn-castle)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [conn-castle](https://github.com/conn-castle)
- **Source:** https://github.com/conn-castle/agent-layer/tree/main/internal/templates/skills/auto-skill-loop
- **Website:** https://agent-layer.dev/

## Install

```sh
agentstack add skill-conn-castle-agent-layer-auto-skill-loop
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# auto-skill-loop

This is a parent orchestrator skill. Do not implement or ship code yourself.

## Required inputs

Fail before side effects unless all are present:
- `worker_skill`: exactly `fix-issues` or `improve-codebase`
- `implementer`: dispatch agent role
- `shipper`: dispatch agent role
- `review_agents`: one or more dispatch agent roles
- explicit standing authorization for this orchestrator to merge ready PRs

Dispatch agent roles may be terse (`codex xhigh`, `claude opus high`,
`antigravity`). Infer the agent only when unambiguous from the model; otherwise
fail. Before dispatching, follow `agent-dispatch`, inspect live options, and
fail if a requested override is unsupported.

Pass `review_agents` to any delegated skill that uses `multi-agent-plan-review`.

## References

Read the one selected worker skill contract. Do not read both.
- `fix-issues`: [references/fix-issues-loop.md](references/fix-issues-loop.md)
- `improve-codebase`: [references/improve-codebase-loop.md](references/improve-codebase-loop.md)

Read [references/blocker-classification.md](references/blocker-classification.md)
only when a worker returns a checkpoint or blocker candidate.

Read [references/merge-readiness.md](references/merge-readiness.md) only when a
PR exists and is ready for final review or merge.

## Ledger

Create `.agent-layer/tmp/auto-skill-loop..state.md`. Update it before
and after dispatches, branch switches, pushes, PR actions, blockers, and
merges.

Record current step, branches, PRs, dispatch agent roles, normalized dispatch
flags, review agent dispatch roles, merged PRs, blocked branches, blocked PRs,
recent touched paths, exhausted lenses, worker questions and answers,
user-only blockers, manual gates, PR-gate status, and verification evidence.
Record worker deferrals in this ledger or worker artifacts, not as deferral
notes in `ISSUES.md`.

## Loop

1. Start each fresh attempt from a clean primary branch checkout. Do not stash
   or discard work; if leaving an attempt, commit and push its branch first.
2. Create or reuse one batch branch for autonomous, non-blocked work.
3. Dispatch the implementer with the selected worker skill, the current ledger
   context, and the review agents to any delegated `multi-agent-plan-review` run.
4. Answer worker checkpoints as the human proxy when no user-only decision is
   required. If user input is required, commit and push the branch, leave any
   PR open, record the blocker, and checkout the primary branch. Then start a
   fresh attempt from #1.
5. If the PR gate has not been met, go back to #3 and continue on the same
   batch branch with the current uncommitted work or local commits. Once the PR
   gate has been met, continue to #6.
6. Use the shipper dispatch agent role for `/ship-pr` through its green,
   open-PR endpoint. Do not delegate merge execution.
7. Perform final readiness review yourself. If repository policy, PR automation,
   or any external gate requires explicit manual approval, leave the PR open,
   record the gate, and checkout the primary branch. Then continue back at #1
   with a fresh attempt.
8. Merge ready PRs under this skill's standing authorization.
9. Go back to #1 and continue. Stop only when interrupted or no autonomous work
   remains. When only a final small autonomous tail remains, ship it even if it
   misses the normal size gate.

## PR gate

Open or ship a PR when at least one is true:
- fixes at least 3 issues
- touches at least 5 meaningful files
- changes at least 500 meaningful lines
- fixes a high-severity security, data-loss, release-blocking, or correctness
  issue
- ships the final remaining autonomous work before exhaustion

Generated files, lockfile churn, and mechanical dependency noise do not count
unless they are the substance of the work.

## Guardrails

- Never close or delete a blocked PR or branch.
- Never weaken checks, tests, or skill definitions to keep the loop moving.
- Never treat low-value churn as progress.
- Keep the checkout clean between attempts.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [conn-castle](https://github.com/conn-castle)
- **Source:** [conn-castle/agent-layer](https://github.com/conn-castle/agent-layer)
- **License:** MIT
- **Homepage:** https://agent-layer.dev/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-conn-castle-agent-layer-auto-skill-loop
- Seller: https://agentstack.voostack.com/s/conn-castle
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
