Deploy prototype

From aaronjmars/miroshark-aeon · View interactive version

Deploy prototype is an AI agent skill from the GitHub repository aaronjmars/miroshark-aeon. Generate a small app or tool and deploy it live to Vercel via API

How to use this skill

Skill file

<!-- autoresearch: variation B — sharper output via prototype quality bar + self-check + signal-anchored record -->

${var} — What to build and deploy.

- Empty → auto-select from recent signals (articles, logs, memory topics).

- Plain text (e.g. market heatmap) → interpret as a build brief.

- Typed form type:slug description (e.g. tool:market-heatmap volume heatmap of top-20 tokens, viz:tx-graph, api:summarize, landing:startup-idea) → use type to bias shape and slug as the deployment name.

Today is ${today}. Your task is to ship a small, self-contained prototype that someone could actually use in the browser today.

Steps

  1. Read context. Read memory/MEMORY.md and the most recent entries in memory/logs/ for active topics.

If running as part of a chain, scan injected upstream outputs for a concrete artifact worth making interactive.

  1. Pick what to build (if ${var} is empty or vague).

Scan these sources, in order, for prototype-worthy signals:

Score each candidate 1-5 on:

Pick the highest-total candidate. If no candidate reaches 9/15, skip building and exit as DEPLOY_PROTOTYPE_EMPTY (step 9).

Record the chosen signal — its source file(s) and one-line rationale — you'll use it in steps 6 and 7.

  1. Commit to a shape before writing code. Before touching .pending-deploy/, write out (in your reasoning, not a file):
  1. Write the files. Clear stale state from prior runs, then create the dir, each as its own Bash call (see Shell shape in the Network note; rm is not an allowed command, so the clear goes through node):

```bash

node -e "require('fs').rmSync('.pending-deploy',{recursive:true,force:true})"

```

```bash

mkdir -p .pending-deploy/files

```

Write all project files into .pending-deploy/files/. This directory is the repo root — everything here is pushed to GitHub and deployed to Vercel.

Quality bar — every prototype must meet these:

For API endpoints: place handlers in api/ (e.g. api/index.js exporting export default function handler(req, res) { ... }).

For Next.js: keep it one page — package.json + pages/index.js. Only if the idea genuinely needs SSR.

  1. Write deploy metadata. Create .pending-deploy/meta.json:

```json

{

"name": "aeon-prototype-<slug-from-step-3>",

"description": "One-sentence description, matches the OG description on the page",

"framework": null,

"tagline": "≤90 chars — matches <title> on the page",

"signal_source": "path or URL of the article/log/topic that triggered this prototype",

"primary_action": "what the visitor does in the first 10 seconds"

}

```

  1. Build the Vercel deploy payload. Write .pending-deploy/payload.json:

```json

{

"name": "aeon-prototype-<slug>",

"files": [

{ "file": "index.html", "data": "<!DOCTYPE html>...", "encoding": "utf-8" }

],

"projectSettings": {

"framework": null,

"buildCommand": null,

"outputDirectory": null

},

"target": "production"

}

```

Use "encoding": "base64" for any binary file.

Pre-flight checks (run before writing the notify):

  1. Save the prototype record. Write to output/articles/prototype-${today}.md. If a file with that name already exists (second run in the same day), append -02, -03, etc.

```markdown

# Prototype: <Name>

Built: ${today}

Tagline: <tagline from meta.json>

Status: Pending deploy

Live URL: _(filled in-run in step 8 once the Vercel deploy returns its URL)_

## Signal

What triggered this: one paragraph. Link the source article/log/topic (signal_source from meta.json).

## What it does

One paragraph, plain language. Include the primary action a visitor takes.

## How it works

Brief technical notes - stack, data source, anything non-obvious. No code dumps.

## Files

## Extend

Three bullets on what would make this a real product (not placeholder - concrete next steps).

```

Append a one-line row to memory/topics/prototypes.md (create the file with a header row if missing):

```

| date | slug | tagline | signal_source | live_url |

|------|------|---------|---------------|----------|

| 2026-04-20 | aeon-prototype-foo | ... | output/articles/... | _pending_ |

```

  1. Deploy live (in-run). The deploy is the skill's irreversible action, so it runs in-run as the final step — behind the step-6 pre-flight — not deferred to any post-run script.

If VERCEL_TOKEN is unset → skip the deploy, leave .pending-deploy/ in place, and exit DEPLOY_PROTOTYPE_NO_TOKEN (step 10). The build still succeeded; the operator just needs to add the token and re-run.

Otherwise POST the inline deployment built in step 6. Write the key as the literal {VERCEL_TOKEN} placeholder so ./secretcurl substitutes it internally — a bare $VERCEL_TOKEN on the command line is refused by the Bash permission layer, and plain curl must not carry the token:

One call; it prints http=<code> bytes=<n>:

```bash

./secretcurl -sS -o .pending-deploy/deploy-resp.json -w 'http=%{http_code} bytes=%{size_download}\n' \

-X POST "https://api.vercel.com/v13/deployments" \

-H "Authorization: Bearer {VERCEL_TOKEN}" \

-H "Content-Type: application/json" \

--data @.pending-deploy/payload.json

```

Optional source mirror (best-effort, non-fatal). If GH_GLOBAL is set, also publish the source to GitHub. gh already authenticates as GH_GLOBAL in-run (it's the ambient GH_TOKEN), so no secret goes on the command line. Check whether it is set: read the "Keys set for this run" line in your run notes, never a shell test (those are refused and cost a turn). If GH_GLOBAL is not on that line, skip the mirror. Otherwise run these in order, each as its own call:

```bash

git -C .pending-deploy/files init -q

```

```bash

git -C .pending-deploy/files add -A

```

```bash

git -C .pending-deploy/files -c user.name=aeon -c user.email=aeon@users.noreply.github.com commit -qm "prototype: <slug>"

```

```bash

gh repo create <slug> --public --source=.pending-deploy/files --push

```

If any of them fails, stop the mirror there and run echo "::notice::source mirror skipped (non-fatal)". A mirror failure never fails the run - the live Vercel URL is the deliverable.

  1. Notify. Send via ./notify (one of these, depending on outcome):
  1. Exit modes. End the run with one of these, logged in memory/logs/${today}.md under ### deploy-prototype:
  1. Log. Append to memory/logs/${today}.md:

```

### deploy-prototype

```

Environment Variables

Both are declared optional (?) so the skill degrades gracefully: no VERCEL_TOKEN → build-only; no GH_GLOBAL → deploy without the source mirror. Never read the token values directly and never embed them in any deployed file (step 6 greps for them).

Guidelines

Network note

Steps 1–7 are local — file writes and notify only. Step 8's deploy is the one outbound side-effect and it runs in-run: the Vercel deployment via ./secretcurl with the {VERCEL_TOKEN} placeholder (a bare $VERCEL_TOKEN on the command line is refused by the Bash permission layer, so never use plain curl for it), and the optional GitHub mirror via gh (authenticated ambiently as GH_GLOBAL). There is no deferred/postprocess step — the deploy is the skill's final, fail-closed action: on any non-2xx it exits DEPLOY_PROTOTYPE_DEPLOY_FAILED and keeps .pending-deploy/ for a retry.

Shell shape. Each Bash call is one allowed command (pipes are fine). The run refuses a call that sets a variable (HTTP=$(./secretcurl ...)), uses if / for / while or [ ... ] tests, or joins commands with ;, && or ||, and each refusal costs a model turn; rm is not an allowed command and a cd in a subshell is refused too. So the deploy is one ./secretcurl call whose -w prints http=<code> bytes=<n> itself, the GH_GLOBAL check reads the run notes' "Keys set for this run" line instead of a shell test, and the mirror is one git -C .pending-deploy/files ... or gh call per step.

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.