| name | goal-loop |
| description | Use after plan-and-spec to build a planned change to completion. Scales to size: a small single-issue change is built directly (one story, verify, one PR); a new/large epic is walked one child story at a time (build via design, verify in a browser, open one PR per story), then reports. Triggered by plan-and-spec ONLY after the user has confirmed the FILED GitHub issue is correct; or use directly when a spec (/docs/plan) and a filed, user-approved issue already exist. Execution only โ it does not plan or file issues. |
| metadata | {"author":"dev@potenlab.dev","version":"0.1.0","date":"2026-06-17T00:00:00.000Z","status":"v1","reuses":"plan-and-spec, design, supabase-integration, higgsfield-assets, verify-in-browser, commit-commands:commit-push-pr, qa-check, higgsfield"} |
goal-loop โ drive a planned goal to done, one story per turn
The goal is an epic (from plan-and-spec) plus its acceptance criteria. The loop walks the
epic's child-story issues one at a time and builds each to a verified, reviewable PR. You keep
going autonomously until every story is green, then report once at the end.
Think as an engineer, speak as a designer/PM. You build like a full-stack engineer; you report
per story in plain language ("Submit-a-brief is built and running โ here's the walkthrough and a PR").
This skill is execution only. It does not clarify, spec, or file issues โ plan-and-spec did
that. It assumes the spec (/docs/plan/<slug>.md) and the epic + child issues already exist.
0. Gate before you loop
0a. Higgsfield hard-gate (REQUIRED โ building needs it)
goal-loop builds real apps with real assets, so the workflow's Higgsfield hard-gate applies here.
Before the first story, verify the Higgsfield MCP is connected and the user is signed in by calling
a read-only Higgsfield tool โ balance (preferred) or list_workspaces.
-
Returns a balance/workspaces โ proceed.
-
Missing, or auth/unauthorized/connection error โ STOP. Don't build. Tell the user, plainly:
"Before I start building I need Higgsfield connected โ it makes all the images and icons. Just sign
in: run /mcp, pick higgsfield โ Authenticate, and log in in the browser. Tell me once it shows
connected and I'll pick up the build."
0b. Inputs exist AND the issue is user-approved
Confirm there is something to build and that the user already blessed the filed issue (that gate
lives in plan-and-spec ยงโฃ โ don't re-ask, but don't build an issue that was never confirmed):
- The spec at
/docs/plan/<slug>.md.
- Either a single
change issue (small change) OR an epic + open story children
(gh issue list --label "story,change" / read the epic's checklist).
- If there's no spec/issue at all, you were invoked too early โ defer to
plan-and-spec first.
Scale to the work: if it's a single small-change issue, treat it as one short story โ build it
directly, verify, open one PR, done. Only walk a multi-story loop when there's an epic with children.
0c. Read the project config
Read .designer-workflow/config.md for the sandbox location and the off-limits / production
boundary. Every story is built inside the sandbox; the boundary is hard (see ยง3).
1. The loop
for each open child story, in the spec's build order:
โ pick the next open story (respect dependencies: schema โ auth โ UI โ per-user filtering)
โก build invoke `design` to build just that story (backend / UI / assets / wire), in the sandbox
โข verify invoke `verify-in-browser` โ core flow, access rule, console + network, mobile + desktop
โฃ land one PR for this story (commit-push-pr) that CLOSES its issue; check the epic's box
โค next move to the next story
โ repeat until every child story is shipped
โ REPORT once: goal met, list every PR + walkthrough
โ Pick the next story
Take the next open child issue following the build order in the spec (ยง10) โ dependencies
first (schema before the UI that reads it; auth before "only my team" filtering). One story per turn.
โก Build it โ delegate to design
Invoke the design skill to build just this one story, scoped to its Story โ implementation
map section of the spec. design assembles the backend (supabase-integration), UI
(frontend-design / impeccable), and assets (higgsfield-assets), and wires it โ all inside the
sandbox branch/app. Build only what this story needs; don't pull future stories forward.
โข Verify it โ verify-in-browser (every story, no exceptions)
Invoke verify-in-browser. A story is not done until you've watched it run: the core flow
completes, the access rule holds (positive AND negative case), console + network are clean, and you've
captured a mobile + desktop walkthrough. If it fails, fix it in the sandbox and re-verify โ
never land a broken story.
โฃ Land one PR per story
Open one PR for this story via commit-commands:commit-push-pr (or qa-check for the
branch/commit/PR mechanics). The PR:
- Lands on a sandbox branch โ never commits to
main.
- Closes its issue โ put
Closes #NN in the PR body.
- Carries the mobile + desktop walkthrough + a short "for the developer" note (the only place
engineer detail is allowed โ stack touched, the Supabase project/branch, what to review).
Then check that story's box in the epic checklist (gh issue edit / let the close auto-tick it) and
tell the user, in one plain line, that this piece is built and open for review.
โค Next / done
Move to the next open story. When none remain, report once.
2. Autonomy โ run to done, report at the end
After the go-ahead (the user's "the plan is correct" in plan-and-spec, or a direct invocation), run
autonomously through all stories โ do not pause for approval between stories. Give a short
plain-language line as each story lands so the user can follow along, but don't wait.
Stop early and ask only when:
- Sandbox boundary hit โ a story needs out-of-sandbox / production access (see ยง3). Stop, write the
dev-handoff note, keep going on the stories that don't need it, and surface the handoff at the end.
- Verify won't pass โ a story can't be made to work after a genuine fix attempt. Stop on that
story, report what's blocking in plain language, and don't fake a green walkthrough.
- Genuine ambiguity the spec doesn't answer and you can't safely assume. Ask one plain question.
Otherwise: keep building. Don't invent extra confirmation gates โ the single human gate was the plan
approval in plan-and-spec.
3. The sandbox boundary still holds (autonomy does NOT override it)
Running unattended makes isolation more important, not less. Every story is built inside the new
app's own workspace/branch and its own Supabase project/branch.
- โ
Allowed: the new app's data model, its own Supabase project/branch, its UI, assets, config/env.
- ๐ซ Hard refuse: other apps/repos; production DBs, migrations, or data; shared secrets / any
.env*;
auth/billing of an existing system; .understand-anything*/ KG files.
If a story requires an out-of-sandbox change, do not reach out. Write a dev-handoff note
(../design/references/dev-handoff-template.md), skip just that story, continue the rest, and surface
the handoff in the final report. Handing off is success, not failure.
4. Final report (designer/PM language)
When the goal is met (or as far as the sandbox allows), report once, plainly:
"All done. I built and tested every piece on phone and desktop:
โข Submit a brief โ built, running, PR open.
โข See the board โ built, running, PR open.
โข Move a brief โ built, running, PR open.
โข Only-my-team โ built, running, PR open (checked one account can't see another's).
Each piece has its own review link. One piece needs a developer because it touches
our real data โ I've written up exactly what's needed."
List the PRs/walkthroughs. Keep raw logs and engineer detail in the PRs, never in chat.
5. Acceptance โ a goal-loop run is "done" when it
- Verified Higgsfield access before building (hard-gated).
- Built every open child story, one per turn, in the spec's build order.
- Verified each story in a browser (mobile + desktop) before landing it.
- Opened one PR per story that closes its issue โ never committed to
main.
- Stayed inside the sandbox โ wrote a dev-handoff note instead of any boundary breach.
- Ran autonomously after the go-ahead and reported once at the end with all PRs + walkthroughs.
6. Building blocks (all installed โ you assemble, you don't build)
| Need | Reuse |
|---|
| The plan/spec + epic/child issues (input) | plan-and-spec (runs before this) |
| Build one story full-stack | design skill (โ supabase-integration, frontend-design, impeccable) |
| Brand-locked assets per story | higgsfield-assets skill + higgsfield MCP |
| Verify each story (mobile+desktop, console+network) | verify-in-browser skill |
| One PR per story | commit-commands:commit-push-pr, qa-check |
| Out-of-sandbox โ handoff, not breach | ../design/references/dev-handoff-template.md |