Blueprint for Claude Code
This repo doesn't ship the application. It ships the instructions for Claude Code to build it on your machine, one file per phase, with pinned versions and the literal output you have to see at each step.
What gets built is an agent that handles every incoming chat with a setter-and-closer profile: it qualifies, answers the playbook objection, offers times that actually exist, books, and leaves written in the CRM where things stand.
==Every line comes from a command. The commands are in verification.
01
The problem
The one underneath is about installation. pip install doesn't give the same
result on two computers, and it doesn't warn you. The case that justifies the whole
kit is in PINES.md:
fastapi 0.141.1 declares starlette>=0.46.0 ← no ceiling
starlette 1.3.1 2026-06-12 the latest that existed
1.4.0 2026-08-05 ┐
1.4.1 2026-08-05 │ all AFTER
1.5.0 2026-08-08 │ fastapi 0.141.1 was
1.5.1 2026-08-08 │ frozen
1.6.0 2026-08-08 ┘
It doesn't fail at install time. It fails later, strangely, and the error names neither of the two. — PINES.md
That's why nothing here is pinned with >=. The 30 dependencies, the model,
and the base image live in a single file, and the gate rejects anything generated
that doesn't respect them.
The one on top is about selling. People ask for a WhatsApp agent that sells, not a menu bot: one that qualifies, answers objections, books. Today replies are written by hand. Whoever writes at three in the morning goes with whoever answered first.
Every step of the blueprint comes in the same shape. Objective, what ends up true. Do this, the command, copyable. You have to see, the literal output, not "it should work". If it fails, every failure mode with its fix.
The fourth exists because computers are different. A step without "If it fails" leaves you facing a screen that says no and no way out. — blueprint/00-mapa.md
02
What kind of repo this is
In the clone there is no agente/ folder. Your run writes it. That's the
difference that explains the numbers above: the gate passes with eleven skipped checks
and the suite leaves 203 tests asleep, because they are waiting for a build that
doesn't exist yet.
What does come is 16 blueprint files, one per phase, and 11 commands in
.claude/skills/ that open them in order. The rule the map repeats: read
one file per phase, not all sixteen. Loading them all spends the context the build
needs at the end.
| Command | What it does |
|---|---|
/start | from a freshly downloaded clone to a working closer: it sizes up the ground, says what it costs and how long it takes, interviews, builds, and deploys locally or on Railway |
/armar-cerrador | builds the whole closer, phase by phase. /start walks the same files, with the start and the finish around them |
/seguir | resumes a half-finished build, without overwriting anything silently |
/configurar | catalog, price range, availability, escalation, internal channel |
/playbook | the objections with their answers, the tone, and how to address people |
/conectar | the credentials, which the installer writes |
/probar | chat simulator |
/revisar | runs the gate |
/publicar | deploys and registers the webhook |
/bandeja | approves the drafts one by one |
/soltar | moves step 3 to automatic, if the numbers add up |
If the build is cut short, the state stays in .wca-estado.json with the phase
and the sha256 of each written file. It's local and doesn't go to git. A file that
changed isn't rewritten silently: what changed is stated and confirmation is awaited,
file by file.
03
The six steps
The output always carries all six elements, even if five are skipped. That's what lets you see where the cycle broke off.
Receive the message and bring in the context.
webhook · history · contact card · transcribed audio
Detect the intent and qualify.
budget · urgency · fit · score 0 to 100
Reply in the brand tone and offer times that exist.
writes to a person
Book and confirm.
writes to the calendar
Write the stage, the summary, and the next step in the CRM.
writes to the database
Hand the chat to a human when appropriate.
anger · price out of range · escalation word
Steps 3, 4, and 5 write outside. The default mode is borrador:
they draft, show, and wait for explicit confirmation. Moving to automatico
is decided by the installer, and done with /soltar.
No blueprint file can break them, and each one has its check in the gate.
hmac.compare_digest. Re-serializing the JSON to sign it passes all the
tests and fails all real deliveries.enviar(): 24-hour window,
ban check, and never writing first to someone who hasn't written.timeout=.PINES.md and nowhere else.04
What gets built
| Piece | How it ends up |
|---|---|
| Provider | meta, zernio, or demo, against a single interface. demo asks for no credentials and is not a fake transport: it replays recorded deliveries, with the same raw bytes, the same signature header, and the same deduplication path. |
| Audio | is transcribed with the Whisper API (OPENAI_API_KEY). Without that key, step 1 stops with the reason written out, not with an invented transcription. |
| Image | is read by the Anthropic model that is already configured. There is no vision key to get. |
| Calendar | Google Calendar: the event, and the reminder 24 hours before. |
| CRM | the leads table, with step 5 writing to it. |
| Panel and API | agente/servidor.py: ten routes and eleven methods — the GET and POST of /webhook/{proveedor} share a path —, the API behind PANEL_TOKEN, and a view that opens in the browser. |
| Deployment | the laptop, a Mac Mini, or Railway. Railway is the blueprint's default, but the installer makes the choice. |
| Inbox | drafts are resolved one by one. Approving doesn't send: it re-runs the step with confirmado set to true, and sends the single enviar(). |
The credentials are 18 variables, and env.example carries the names and where
each value comes from. Never a value. The only one always needed is Anthropic's:
demo mode saves you the WhatsApp credentials, not the model that drafts.
05
How it is verified
This is what an unbuilt tree gave, that is, without the agente/ folder. Don't
copy it from here: run the two commands and compare.
$ .venv/bin/python scripts/auditar.py
auditar · whatsapp-closer-agentkit · without agente/: not built yet
[ok ] 01 blueprint-existe 16 file(s) cited by 28, all with content
[ok ] 02 manifiesto 7 templates up to date with the manifest.
[ok ] 05 pines 30 pins in 1 file(s), MODELO=claude-opus-5, imagen python:3.12-slim, verif
[salteado] 06 deps-imports agente/ doesn't exist: this runs after /armar-cerrador
[ok ] 08 secretos 104 files reviewed, 7 patterns
[ok ] 17 contrato-control 6/6 mutations rejected
[ok ] 19 pruebas 50 passed, 203 skipped in 0.25s · 203 skipped: 0 live-only, 203 waiting
[salteado] 23 censo-de-campos the census didn't run in this tree: no EVIDENCIA/censo.json. Run it with `.v
auditar: PASS · 0 errors · 1 warning · 11 skipped
a skipped check is not a passed check: read the reason for each one.
Excerpt: 8 of the 23 lines, verbatim. The block slides to the right. The cuts at the end of a line are from the tool. The seconds change on every run.
$ .venv/bin/python -m pytest -q
50 passed, 203 skipped in 0.25s
The 11 skipped and the 203 asleep are the correct state of a tree with no build: they
are waiting for agente/. The gate says so with a warning and not an error,
for that very reason. That is the only warning in this run. As soon as the build exists,
they stop being skipped and need another look. A second warning appears if git doesn't
yet have the core files in the index, so on a half-committed copy it may give you
something different.
23 checks. The first twenty-two look at the tree: that the blueprint is whole, that the
templates haven't drifted from the manifest, that the versions are the ones in
PINES.md, that no secret is written in a file, that there is a single HTTP
client and a single enviar(), that the output schema doesn't accept a
mutation it should reject.
The gate doesn't open a socket or read a secret, and that's on purpose: a check that goes out to the network sits waiting on a timeout with a bad connection, and then there's no report.
The twenty-third measures one floor up. It goes field by field through the output contract, mutates it, and re-runs the suite: if no node turns red, that field is declared by the contract and asserted by no one.
In a clone it can't run, because there's no output to mutate:
$ .venv/bin/python scripts/auditar.py --censo
census: couldn't be measured. the census needs the build: agente/ciclo.py
doesn't exist, so there's no output to mutate and the 43
declared fields go unmeasured. The static half — the
`SIN_ASERCION` list against the schema — does run in check 23 without a build
It has already run once over a build. Of the 43 fields:
31 asserted,
3 that the schema fixes and have no possible mutant, and
9 with no assertion. That number is published, with the
nine names, in PENDIENTES.md.
Six independent runs built the agent from this blueprint. The last three closed at 217, 231, and 253 passed, with the gate at PASS · 0 errors · 0 warnings · 0 skipped.
Those numbers don't come from this clone and can't: there's no agente/ here.
What a freshly downloaded clone gives is what's above, and that you can reproduce on
your machine in two commands.
06
The limits
Outside the 24-hour window from the contact's last message, WhatsApp only lets you send approved templates. The step 4 reminder almost always falls outside that window, so it needs a template registered by Meta, and approval takes time.
It means the kit is well put together. What gets closed by hand, once, with your
credentials, is in PENDIENTES.md, each one with what it looks like when it fails:
leads table and the write permission on your key.The census found them and they're published by name, not hidden:
calificacion/intencion crm/resumen
calificacion/urgencia crm/proximo_paso
respuesta/objecion_detectada crm/proximo_paso_fecha
respuesta/objecion_en_playbook pregunta
supuestos
The worst of the nine is objecion_en_playbook: what it decides is whether
the playbook was looked up or not, which is the only thing separating this agent from
a menu bot.
For Google Calendar, authorized_user goes all the way.
service_account is stopped: the token asks for a JWT signed with RS256 and
no library that does it is in PINES.md. It's declared, not improvised.
© 2026 Oswaldo Bentti. All rights reserved.
All courses · Ozbit News · quantbite.io · www.linkedin.com/in/ozbit