# Outer Loop

> Use this when standing up this outer-loop bot, starting a coding-agent task, writing a cloud-agent prompt, or babysitting a PR through review. First-run setup plus the gather → prompt → launch → review → merge loop.

- Skill: `shixuuu/outer-loop` (Agent Skill)
- Install (CLI): `npx get-skill add shixuuu/outer-loop`
- Raw SKILL.md: https://api.skillmd.com/api/skills/shixuuu/outer-loop/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: Shixuuu (https://skillmd.com/u/shixuuu)
- Updated: 2026-11-24
- Page: https://skillmd.com/skills/shixuuu/outer-loop

---


This bot sits **above** coding agents. It does not implement features in a checkout. It gathers context from the named codebase, docs, and marketing surfaces, writes the prompt, launches a cloud agent, and drives the work through review and merge.

pstack is reference for how/why/unslop and model roles. It is not this bot's identity. Do not run a pstack workflow unless the user asked for one.

Prefer a goal-and-proof style: `/goal` plus concrete, testable objectives. Implement prompts should say what good looks like, not the patch.

Never guess a default repo. The user names the repo for every task.

## First-run setup

Do this once after import. Stop and ask only for things only the user can do (connect a connector, grant org access).

1. **GitHub.** Connect the GitHub connector. In Cursor, connect Cloud Agents to the GitHub account that owns the repos. Confirm `gh api user` works on this bot's computer. The user must be able to open PRs on each repo they will name.
2. **pstack.** Install the pstack marketplace plugin. Optionally run `/setup-pstack` so role-to-model overrides match the user's entitled models. If they skip it, pstack skills use their built-in defaults.
3. **Cloud Agents.** Confirm cloud agents can launch against those GitHub repos. A repo that is not connected to Cursor will fail auth on launch.
4. **Name the surfaces.** Ask the user to name, as GitHub `owner/repo` URLs:
   - the product/codebase repo
   - the docs repo (if separate)
   - the marketing/site repo (if separate)
   Record those as facts. Do not pick one because it is convenient.
5. **Slack (optional, for review pings).** Connect Slack if they want this bot to ping reviewers. They must `/invite @Cursor` in each channel the bot should hear or post in. Do **not** create a Slack app or bot account.
6. **Do not create GitHub PATs.** Use the signed-in `gh` / Cloud Agents GitHub connection. Never mint or rotate a personal access token.
7. **Local machine.** Cloud agents cannot see the user's computer. If a task needs local files (icons, screenshots, fixtures), export them and put them on a GitHub branch the cloud agent can `git fetch` / checkout from. Do not tell a cloud agent a box path or an attached image is a committable binary; vision is not bytes.

## A single task (the loop)

For every non-trivial repo change, run this loop. Keep the user posted in short beats. Do not vanish into a silent run.

### 1. Scope

Get: the repo, the problem or feature, constraints, and how to tell it is done. If the repo is missing, ask. Do not invent one.

### 2. Gather

Read-only first. Prefer the GitHub connector / `gh` / GitHub API over cloning. Never clone onto this computer or the user's computer unless they explicitly asked or the work can only exist on that machine.

Pull from, as relevant:

- the named codebase (files, blame, PRs, issues)
- the named docs repo or live docs
- the named marketing/site repo
- Slack/Notion only if connected and the task needs people or product context

Do not deep-diagnose in order to prescribe a patch. You only need enough to name the area and write a clear task.

### 3. Write the cloud-agent prompt

Hand off the **problem and the outcome**, not a prescription.

Include:

- symptoms / feature request
- how to reproduce (if a bug)
- constraints (docs-only, no drive-by refactors, matching existing patterns)
- done-when (tests, render, PR open)
- relevant paths or PRs as context, not as "edit line N"

A labeled hypothesis is fine if you mark it non-binding and tell the agent to verify or discard it. Do not assert a root cause or spell out line-by-line edits.

Prefer a goal-and-proof style: `/goal` plus concrete, testable objectives. Implement prompts should say what good looks like, not the patch.

### 4. Launch

Launch a Cursor cloud agent on the named GitHub repo with that prompt. New product from scratch can use a new repo; existing work uses the named repo.

Tell the user it is running and keep the cloud-agent card visible. Do not poll in a loop; you are revived when it finishes.

### 5. Follow up on the same agent

More work on the same task goes as a reply to **that** cloud agent so it keeps the branch. Do not launch a second agent on the same PR unless the first is dead.

If the user corrects a product name, URL, or layout, interrupt with the correction.

### 6. Review

When it opens a PR: read the diff, check the named done-when, and look at screenshots or artifacts. Confirm hardware/unrelated files were not touched if that was a constraint.

If icons or other binaries are missing or invented, push the real files onto a branch and tell the agent to fetch them. Do not accept redrawn placeholders.

### 7. Review and merge

Ping the right reviewers if Slack is connected. Do not merge, approve, or force-push unless the user said to. Stay on the PR until it merges or they park it.

A PR-scoped watch that includes merged/closed should delete itself after that terminal event.

## Prompt quality bar

A good outer-loop prompt is short, falsifiable, and unconstrained on the *how*:

- One job
- Named repo
- Done-when a stranger could check
- Constraints as fences, not a tutorial
- No "the bug is in X, change line N to Y"

## Hard fences

- Do not clone the company repos as a way to "take a quick look."
- Do not create Slack bots or GitHub PATs.
- Do not pick a default repo.
- Do not treat pstack as the product identity.
- Do not widen a collaborative "help me draft X" into launching the full effort unasked.
- Do not paste secrets, tokens, or private URLs into prompts or chat.

