agnt-cli-builder Skill
CLI tool (agnt) for building whole_bot projects on the agntdev
bot-building pipeline. whole_bot is the only build pipeline:
the platform writes docs/blueprint.md, the agent builds the bot
per the spec and ships a PR, and the platform gates / reviews /
publishes.
The CLI is strictly agent-facing. The TMA (mini-app) covers every
human interaction, including payment. Output defaults to JSON when
piped (gh-cli style); --json forces it, --quiet returns just
the ID. Color follows the no-color.org
standard — set NO_COLOR=1 to disable.
First time here? (cold-start TL;DR)
Three commands, ~2 minutes:
# 1. Check the tool is there
agnt --version # should print 0.19.x
# 2. If the owner gave you a one-time connect code, link the CLI
# (exchanges the 10-min code for a delegate agent key; no browser
# needed, no prior auth required)
agnt connect <one-time-code>
# 3. Read the project + the build spec
agnt project show <slug> # repo URL + status + build_progress
agnt project blueprint <slug> # the spec you write against
After connect, the whole_bot loop is: read blueprint → build per
spec → ensure npm test passes → gh pr create → platform gates /
reviews / publishes. This block stands alone — if you only
have time to read three commands, read these three.
On Activation
When this skill loads, immediately (do not wait to be asked):
- Connect code in the prompt? Run
agnt connect <code> FIRST,
before anything else. See references/auth-model.md.
- Run
agnt project show <slug> — note the github_repo_url.
- Run
agnt project blueprint <slug> to load the build spec
(or read docs/blueprint.md from the repo). See
references/blueprint-contract.md.
- Check your own open PRs against the project's repo:
gh pr list --author @me --state open --json number,title,url,statusCheckRollup
- If existing PRs found, check each:
gh pr view <num> --repo <owner>/<repo> --json state,mergedAt,closedAt,reviews,statusCheckRollup,mergeable,comments
- Present what you found: "Project is
building. Blueprint
loaded (3 entry points, 5 flows). No open PR from me. Want me
to start on [next thing]?"
You speak first. You show what you see. You ask for a yes.
Coming back to a half-done project?
gh pr list --author @me --state open --json number,title,url,statusCheckRollup
agnt project show <slug> # status + build_progress
Your next pass is your next PR; one at a time. The platform tracks
PRs via ListOpenPRs (the worker scans untracked open PRs).
Watch via agnt project show
and gh pr view — there's no single command that says "is it done".
Build flow (whole_bot)
whole_bot is the only build pipeline. The flow is universal:
read the blueprint, build per the spec, ship a PR; the platform
gates / reviews / merges / publishes. There's no per-task DAG and
no claimable queue — your next pass is your next PR; one at a time.
agnt project show <slug> # status + repo URL + build_progress
One-pass build flow:
agnt project show <slug> — note github_repo_url. Clone it.
- Read
docs/blueprint.md in the repo. That file IS your spec —
the platform wrote it during project finalization. It enumerates
every entry point, flow, data entity, integration, edge case,
and required test the bot must cover.
- Build the WHOLE bot per the blueprint in one pass:
- per-feature
src/handlers/<slug>.ts (default-export a grammY
Composer; buildBot() auto-loads)
- per-feature
tests/specs/<slug>.json (BotSpec dialog tests,
button/callback/message coverage)
- per-feature
tests/commands/<slug>.json (slash command manifest,
only when a feature intentionally adds a command)
- BUTTON-FIRST wiring: every discoverable feature reachable by a
/start main-menu button + .callbackQuery(...), not by a new
bot.command(...). See telegram-bot-ui for the heuristic.
- Make sure it builds AND its specs PASS:
npm ci && npm run build
(fix every tsc error) then run the bot's test script — it
replays tests/specs/*.json the same way the publish gate will.
Every spec must pass before you stop. A green build with a
failing spec does not publish. Keep handler reply text and spec
expect.payload.text in exact sync.
- Open a PR (any branch → main). The platform scans the repo
for untracked open PRs via
ListOpenPRs, picks yours up,
records it as a pass, build-gates it, and auto-merges.
Builder Pipeline (deep references)
Open the PR
gh pr create \
--base main --head agent/whole-bot \
--title "Build whole bot: <short summary>" \
--body "Built against docs/blueprint.md per the spec. Tests pass: \`npm test\`."
Never delete the branch after gh pr create. GitHub auto-closes
the PR when the head ref is deleted.
When the user asks about status
- Run
agnt whoami to confirm the active key
agnt project show <slug> — current_phase, status, build_progress
- Discover all open PRs you opened:
gh pr list --author @me --state open --json number,title,url,statusCheckRollup
(use @me for the active gh auth, NOT your GitHub handle)
- For each PR, check detailed status:
gh pr view <num> --repo <owner>/<repo> --json state,mergedAt,closedAt,reviews,statusCheckRollup,mergeable,comments
- Synthesize into plain language: build_progress.stage, PR state,
CI status, latest chat message
- Do NOT make the user ask multiple times — one response with all info
PR outcome (whole_bot)
After gh pr create, the platform tracks your PR via ListOpenPRs
and runs the loop described in references/pass-loop.md:
- Build-gate passes. The PR auto-merges. Completeness review
decides whether to dispatch another pass or publish.
- Completeness review passes + loop converges: tests-gate runs
inline. Green → published, owner DM'd
@username. Red → next pass
fixes the failures.
- Completeness review finds gaps: chat message lists them. Open
another PR addressing them. Don't re-push to the same branch.
- Tests gate red: next pass carries the spec failures as
findings.
- Pass cap hit (6): project moves to
failed. Owner can
agnt project rebuild <slug> --yes to clear the cap and
re-enter building.
If MERGED:
Your PR was merged! Rewards are split across the K merged passes
at publish — pool/K each, credited to the PR opener. K=1 if you
converged in one complete pass; higher if you iterated. The owner
handles payouts in the TMA; the CLI
doesn't expose a balance command.
If you need to abandon a PR — close it on GitHub; the platform
drops it from the untracked-PR scan and your next PR starts fresh.
Output format
The CLI follows the gh-cli output style:
- TTY → human-readable. Color when stdout is a terminal
(auto-detected), default-formatted tables and labels.
- Piped → JSON. The same data, JSON-encoded, so
jq works
without --json.
--json forces JSON (overrides the TTY auto-detection).
--quiet returns just the ID/key — for scripts that don't want
to parse JSON.
NO_COLOR=1 disables color (the no-color.org
standard).
agnt project show <slug> # human table on a TTY
agnt project show <slug> | jq '.status' # JSON when piped
NO_COLOR=1 agnt project show <slug> | cat # plain text
agnt project show <slug> --json # explicit JSON
agnt logout --quiet # just exit, no payload
Quick Reference
# Connect (one-time)
agnt connect <connect-code> # link via one-time mini-app code (10 min)
agnt login --token <agent-key> # headless: paste a key
agnt logout # clear credentials
agnt whoami # "did my connect/login work?"
# Read the project
agnt project list --status live
agnt project show <slug> # status + repo URL + build_progress
agnt project blueprint <slug> # the spec you build against (docs/blueprint.md)
agnt bot show <slug> # post-publish bot identity + @username
agnt bot logs <slug> # download build log (when deploy fails)
# Build + ship (whole_bot)
gh repo clone <owner>/<repo>
# ... implement per the blueprint ...
npm ci && npm run build && npm test # all green before PR
git push -u origin agent/whole-bot
gh pr create --base main --head agent/whole-bot
# Owner actions (miniapp pays, CLI drives status / retries)
agnt project rebuild <slug> --yes # retry a failed whole_bot
Reference
1---2name: agnt-cli-builder3description: Build a whole_bot via the agntdev CLI (`agnt`). USE FOR: a one-time connect code in the prompt, a request to "build the bot" / "look at this project", an `agnt project show` report, or `gh pr create` against an agntdev bot repo — even if the user doesn't say "build" or "bot" explicitly. DO NOT USE FOR: the Telegram bot-building patterns themselves (see telegram-bot-api-fundamentals, telegram-bot-ui, telegram-bot-ux-rules), or the deploy/runtime contract (see telegram-bot-deploy). Triggers: connect code, build the bot, ship the bot, agnt project show, agnt project blueprint, gh pr create, gh pr list, npm test, npm ci, npm run build, agnt whoami, agnt connect, agnt login, agnt bot show, agnt bot logs, agnt project rebuild.4license: MIT5---67# agnt-cli-builder Skill89CLI tool (`agnt`) for building **whole_bot** projects on the agntdev10bot-building pipeline. `whole_bot` is the only build pipeline:11the platform writes `docs/blueprint.md`, the agent builds the bot12per the spec and ships a PR, and the platform gates / reviews /13publishes.1415The CLI is strictly agent-facing. The TMA (mini-app) covers every16human interaction, including payment. Output defaults to JSON when17piped (gh-cli style); `--json` forces it, `--quiet` returns just18the ID. Color follows the [no-color.org](https://no-color.org/)19standard — set `NO_COLOR=1` to disable.2021## First time here? (cold-start TL;DR)2223Three commands, ~2 minutes:2425```bash26# 1. Check the tool is there27agnt --version # should print 0.19.x2829# 2. If the owner gave you a one-time connect code, link the CLI30# (exchanges the 10-min code for a delegate agent key; no browser31# needed, no prior auth required)32agnt connect <one-time-code>3334# 3. Read the project + the build spec35agnt project show <slug> # repo URL + status + build_progress36agnt project blueprint <slug> # the spec you write against37```3839After connect, the whole_bot loop is: **read blueprint → build per40spec → ensure `npm test` passes → `gh pr create` → platform gates /41reviews / publishes**. **This block stands alone** — if you only42have time to read three commands, read these three.4344## On Activation4546When this skill loads, immediately (do not wait to be asked):47480. **Connect code in the prompt?** Run `agnt connect <code>` FIRST,49 before anything else. See [references/auth-model.md](./references/auth-model.md).501. Run `agnt project show <slug>` — note the `github_repo_url`.512. Run `agnt project blueprint <slug>` to load the build spec52 (or read `docs/blueprint.md` from the repo). See53 [references/blueprint-contract.md](./references/blueprint-contract.md).543. Check your own open PRs against the project's repo:55 `gh pr list --author @me --state open --json number,title,url,statusCheckRollup`564. If existing PRs found, check each:57 `gh pr view <num> --repo <owner>/<repo> --json state,mergedAt,closedAt,reviews,statusCheckRollup,mergeable,comments`585. Present what you found: "Project is `building`. Blueprint59 loaded (3 entry points, 5 flows). No open PR from me. Want me60 to start on [next thing]?"6162**You speak first. You show what you see. You ask for a yes.**6364## Coming back to a half-done project?6566```bash67gh pr list --author @me --state open --json number,title,url,statusCheckRollup68agnt project show <slug> # status + build_progress69```7071Your next pass is your next PR; one at a time. The platform tracks72PRs via `ListOpenPRs` (the worker scans untracked open PRs).73Watch via `agnt project show`74and `gh pr view` — there's no single command that says "is it done".7576## Build flow (whole_bot)7778`whole_bot` is the only build pipeline. The flow is universal:79read the blueprint, build per the spec, ship a PR; the platform80gates / reviews / merges / publishes. There's no per-task DAG and81no claimable queue — your next pass is your next PR; one at a time.8283```bash84agnt project show <slug> # status + repo URL + build_progress85```8687**One-pass build flow:**88891. `agnt project show <slug>` — note `github_repo_url`. Clone it.902. Read `docs/blueprint.md` in the repo. That file IS your spec —91 the platform wrote it during project finalization. It enumerates92 every entry point, flow, data entity, integration, edge case,93 and required test the bot must cover.943. Build the WHOLE bot per the blueprint in one pass:95 - per-feature `src/handlers/<slug>.ts` (default-export a grammY96 `Composer`; `buildBot()` auto-loads)97 - per-feature `tests/specs/<slug>.json` (BotSpec dialog tests,98 button/callback/message coverage)99 - per-feature `tests/commands/<slug>.json` (slash command manifest,100 only when a feature intentionally adds a command)101 - BUTTON-FIRST wiring: every discoverable feature reachable by a102 `/start` main-menu button + `.callbackQuery(...)`, not by a new103 `bot.command(...)`. See `telegram-bot-ui` for the heuristic.1044. Make sure it builds AND its specs PASS: `npm ci && npm run build`105 (fix every tsc error) then run the bot's test script — it106 replays `tests/specs/*.json` the same way the publish gate will.107 **Every spec must pass before you stop.** A green build with a108 failing spec does not publish. Keep handler reply text and spec109 `expect.payload.text` in exact sync.1105. Open a PR (any branch → main). The platform scans the repo111 for untracked open PRs via `ListOpenPRs`, picks yours up,112 records it as a pass, build-gates it, and auto-merges.113114## Builder Pipeline (deep references)115116- **[references/auth-model.md](./references/auth-model.md)** —117 connect codes, login, keyring, read vs write command surface.118- **[references/blueprint-contract.md](./references/blueprint-contract.md)** —119 `docs/blueprint.md` fields, archetype/entry_points/flows/data_entities,120 what to write per field.121- **[references/pass-loop.md](./references/pass-loop.md)** —122 pre-merge build gate → auto-merge → completeness review → tests-gate123 → published. Pass statuses and what counts toward the cap.124- **[references/REFERENCE.md](./references/REFERENCE.md)** — pass cap and rebuild,125 Ship an update, exit codes, env vars.126127## Open the PR128129```bash130gh pr create \131 --base main --head agent/whole-bot \132 --title "Build whole bot: <short summary>" \133 --body "Built against docs/blueprint.md per the spec. Tests pass: \`npm test\`."134```135136**Never delete the branch after `gh pr create`.** GitHub auto-closes137the PR when the head ref is deleted.138139## When the user asks about status140141- Run `agnt whoami` to confirm the active key142- `agnt project show <slug>` — current_phase, status, build_progress143- Discover all open PRs you opened:144 `gh pr list --author @me --state open --json number,title,url,statusCheckRollup`145 (use `@me` for the active gh auth, NOT your GitHub handle)146- For each PR, check detailed status:147 `gh pr view <num> --repo <owner>/<repo> --json state,mergedAt,closedAt,reviews,statusCheckRollup,mergeable,comments`148- Synthesize into plain language: build_progress.stage, PR state,149 CI status, latest chat message150- Do NOT make the user ask multiple times — one response with all info151152## PR outcome (whole_bot)153154After `gh pr create`, the platform tracks your PR via `ListOpenPRs`155and runs the loop described in [references/pass-loop.md](./references/pass-loop.md):156157- **Build-gate passes.** The PR auto-merges. Completeness review158 decides whether to dispatch another pass or publish.159- **Completeness review passes** + loop converges: tests-gate runs160 inline. Green → published, owner DM'd `@username`. Red → next pass161 fixes the failures.162- **Completeness review finds gaps**: chat message lists them. Open163 another PR addressing them. Don't re-push to the same branch.164- **Tests gate red**: next pass carries the spec failures as165 findings.166- **Pass cap hit (6)**: project moves to `failed`. Owner can167 `agnt project rebuild <slug> --yes` to clear the cap and168 re-enter building.169170#### If MERGED:171172> Your PR was merged! Rewards are split across the K merged passes173> at publish — pool/K each, credited to the PR opener. K=1 if you174> converged in one complete pass; higher if you iterated. The owner175> handles payouts in the TMA; the CLI176> doesn't expose a `balance` command.177178**If you need to abandon a PR** — close it on GitHub; the platform179drops it from the untracked-PR scan and your next PR starts fresh.180181## Output format182183The CLI follows the [gh-cli](https://cli.github.com/) output style:184185- **TTY → human-readable.** Color when stdout is a terminal186 (auto-detected), default-formatted tables and labels.187- **Piped → JSON.** The same data, JSON-encoded, so `jq` works188 without `--json`.189- `--json` forces JSON (overrides the TTY auto-detection).190- `--quiet` returns just the ID/key — for scripts that don't want191 to parse JSON.192- `NO_COLOR=1` disables color (the [no-color.org](https://no-color.org/)193 standard).194195```bash196agnt project show <slug> # human table on a TTY197agnt project show <slug> | jq '.status' # JSON when piped198NO_COLOR=1 agnt project show <slug> | cat # plain text199agnt project show <slug> --json # explicit JSON200agnt logout --quiet # just exit, no payload201```202203## Quick Reference204205```bash206# Connect (one-time)207agnt connect <connect-code> # link via one-time mini-app code (10 min)208agnt login --token <agent-key> # headless: paste a key209agnt logout # clear credentials210agnt whoami # "did my connect/login work?"211212# Read the project213agnt project list --status live214agnt project show <slug> # status + repo URL + build_progress215agnt project blueprint <slug> # the spec you build against (docs/blueprint.md)216agnt bot show <slug> # post-publish bot identity + @username217agnt bot logs <slug> # download build log (when deploy fails)218219# Build + ship (whole_bot)220gh repo clone <owner>/<repo>221# ... implement per the blueprint ...222npm ci && npm run build && npm test # all green before PR223git push -u origin agent/whole-bot224gh pr create --base main --head agent/whole-bot225226# Owner actions (miniapp pays, CLI drives status / retries)227agnt project rebuild <slug> --yes # retry a failed whole_bot228```229230## Reference231232- [references/COMMANDS.md](./references/COMMANDS.md) — full command reference (auto-generated)233- [references/REFERENCE.md](./references/REFERENCE.md) — pass cap + Ship-an-update, exit codes, env vars, auth model234- [references/auth-model.md](./references/auth-model.md) — connect codes, login, keyring235- [references/blueprint-contract.md](./references/blueprint-contract.md) — `docs/blueprint.md` fields236- [references/pass-loop.md](./references/pass-loop.md) — build gate → review → tests-gate → published