PTENES
MODULE 5.8 · LAST IN THE LEARNING PATH

🔒 Publishing rules

You already know how to build with the agent, test on localhost, and publish for real (module 5.7). One piece is missing, and it’s the most serious one in the course: who clicks “it’s live”—and when. This module wraps up Track 5 with the discipline that separates a useful agent from a dangerous one.

6
Topics
30
Minutes
Intermediate
Level
Governance
Type
0 of 60%
1

🧑‍💼 The intern and the send button

New here? Publish (also called deploy, “put it online”) means making a version of your work visible and accessible to other people on the internet—instead of only running on your computer. It’s the difference between a draft on your desk and a letter that’s been mailed.

Imagine an excellent, fast intern working alone on a draft report for a client. They research, write, and review the formatting — they do all of that on their own, without needing approval for every sentence. But there’s one line they never cross on their own: clicking “send” on the email that goes to the client. That’s always the manager’s decision — even if the intern is sure it’s ready.

The coding agent is exactly this intern. It can build, test, adjust the design (modules 5.1 through 5.6), and even run the publishing command on its own if you let it — it has the technical ability. The question in this module isn't "can it publish on its own?" (it can). It's "should it?" And the answer, by default, is no — until you explicitly say yes.

💡 Main Concept

Autonomy to build and test ≠ autonomy to publish. Those are two different permissions, and the second is always more restricted.

  • •Without this safeguard, an agent can publish too early, with an error, or at the wrong time—and no one noticed before it went live.
  • •The safeguard isn’t about distrusting the agent. It’s the same safeguard you’d use with a new human employee.
Build
Autonomous
Test locally
Autonomous
Publish
ONLY with an order
You
Pulls the trigger
2

📜 The golden rule in CLAUDE.md

New here? O CLAUDE.md is a plain text file that you keep inside your project folder (covered in depth in module 0.4) with standing instructions for the agent — it reads this file automatically every time it opens the project. It's the right place to record a rule that must always apply, in every session, even with a new agent or after several months.

This module’s golden rule is short and should be written word for word near the top of that file: The agent never publishes or deploys on its own — only when a human gives an explicit order for that specific publication. “It published before, so it can do it again” doesn’t count. Each publication is a new decision.

Agent builds and test on localhost — freely, without asking permission — GATE 🔒 only opens with explicit order "you can publish" git add / commit git push — the agent gets this far — Vercel / GitHub Pages publishes automatically — outside your direct control —

Caption: the agent has full freedom to build and test locally (green on the left) — but before anything crosses the yellow gate with a lock toward `git push`, it needs your explicit instruction. After the push, the external tool (dashed yellow on the right) publishes on its own — automatically and outside your direct control.

🔍 Inside

  • Where to write: logo at the top of CLAUDE.md, in a clear section like "Publishing Rules" — not hidden in the middle of the text.
  • Why it works: the agent reads this file before acting. An explicit rule there carries more weight than "thinking" it's already allowed to publish.
3

⚙️ The git → automatic deploy pipeline

New here? One repository (or “repo”) is a project folder stored with a complete version history, usually hosted on a service like GitHub. Commit is the command that records a "snapshot" of the changes you made, with a message explaining what changed. Push it’s the command that sends those saved commits from your computer to the cloud repository.

Here’s the point that confuses many people who are just starting out: in most projects in this course, “publish” isn’t a special publishing button. It’s just this: commit + push to the repository. An external tool — Vercel, GitHub Pages, and others like them — keeps an eye on that repository and, as soon as it detects a new change, publishes it automatically, without any further action from you.

This divides the work into two clearly separated parts: the part you (or the agent, following your instructions) control directly—building, testing, and sending the push — and the automated part, which runs on its own afterward and is outside your direct control. There’s no point checking the tool’s dashboard every minute: once the push is out, the rest happens between the repository and the publishing tool.

🕐 The timeline of a publication

1

Build and test on localhost

The agent works freely in this phase (recapping module 5.7)—without asking for approval for every adjustment.

2

You actually look at the local version

Open it in a browser, click around, and check that it works as expected. Don’t skip this step.

3

You give the explicit go-ahead—“you can publish”

This is the gateway to topic 2. Without this sentence, nothing that follows should happen.

4

The agent runs commit + push

Human/agent work ends right here—when the code is sent to the repository.

5

The external tool publishes on its own

Vercel/GitHub Pages detects the change and publishes it automatically—you’re no longer in direct control from this point on.

💡 Practical Tip

If the publishing tool blocks or fails after the push, that’s not a problem you need to fix right away—it’s an issue with the tool’s account, and you (the human) can resolve it when it makes sense. For the agent, “done” means the push reached the repository, not that the site is live yet.

4

⚖️ Good rules × risky rules

Not every rule written in CLAUDE.md truly protects you. Some seem safe but leave a gap; others are explicit enough to keep the agent on track even on a day when it “is sure” everything is ready. Compare:

✓ Rules that really hold up

  • ✓"Never run git push or any deploy command unless I explicitly ask, even if the local tests have passed."
  • ✓Rule written near the top of the file, prominently — not buried among 40 other lines.
  • ✓Each publication requires a new approval — "published before" doesn’t become permanent permission.
  • ✓Rule clearly separates “test locally” (free) from “publish” (with an instruction).

✗ Rules that create a false sense of security

  • ✗"Be careful when publishing" — too vague; the agent decides what “careful” means.
  • ✗No written rule — relying only on the agent’s “common sense” in that session.
  • ✗"You can publish whenever the tests pass" — automated tests don't catch everything a person can see by actually looking.
  • ✗A rule given only verbally, in an old conversation, and never written in CLAUDE.md — disappears when the session ends.

📝 What to put in CLAUDE.md in practice

  • 1. The golden rule (topic 2) — word for word, with no room for interpretation.
  • 2. What counts as "publishing" in this specific project — it's not always just git push; sometimes it includes running a deploy command manually.
  • 3. Where to test first — which localhost address to check and what to look at (reviews module 5.7).
  • 4. What to do if publishing fails — usually: notify the human, don't try to fix it by triggering the deploy again.
5

🛠️ Writing and authorizing in practice

Three steps to make this work in your project: write the rule, test it on localhost before publishing anything, and only then authorize the push with an explicit phrase. Let’s get straight to what to paste.

1

Paste the rule into your project’s CLAUDE.md

Objective: make the restriction written and permanent, not a verbal agreement that disappears when the session closes.

## Publishing rules

- **Never publish/deploy without an explicit instruction.** This includes `git push`,
  any manual deploy command, or reactivating a stuck deploy.
- Building and testing at `<your localhost address>` are allowed — they don't
  need approval at every step.
- Publish only after I say something like "you can publish" or "put it online"
  — explicit wording that refers to THIS specific change.
- If publishing fails after the push, let me know. Don't try to fix it
  by triggering the deploy again on your own.

How to verify: open CLAUDE.md and confirm that the section is near the top and visible, without having to scroll through the entire page to find it.

2

Always check localhost before approving

Recapping module 5.7: ask the agent to run the local server and open the address in a real browser. Click the links and test on a phone if it’s responsive. Never authorize publishing based on “trust,” only on a description of what was done.

3

Authorize it with a clear sentence, and let the agent run the push

Objective: turn verbal authorization into an actual publishing command, without the agent having to guess the syntax.

git add <arquivos que mudaram, ou . se for tudo>
git commit -m "<mensagem curta explicando o que mudou>"
git push

How to verify: run git log -1 and check that the commit appears with the right message; then check the repository dashboard (GitHub) to see if the push went through. "Done" ends here — you don't need to keep checking whether the site has updated.

⚠️ Attention

"You can continue" or "that's fine" are NOT publishing instructions — they're just approval of a work step. The publishing instruction needs to be unambiguous: "you can publish," "put it live," "deployment authorized." If there's any doubt about whether the person's words counted as authorization, the agent should ask before running the push, not assume.

6

🎯 The 40% that completes the learning path

Since module 5.1, this track has repeated a figure: the agent quickly delivers about 60% of any interface—generic, functional, but without soul—and the final 40% (the brand, the polish, the fine-tuning) depend on you bringing in references, taste, and review. This module shows that the same principle applies to publishing: the final 40% aren't just about looks; they're about governance — when e if anything going live is always your decision, never delegated by default.

This isn't bureaucracy or a lack of trust in the agent. It's the same discipline any serious team applies to any new person: complete freedom to produce, with a final approval that is never automatic. Separating "I built and tested it locally" from "I authorized publishing" in two different sentences is what ensures that an error in one step never becomes a live problem without anyone reviewing it.

🧵 The guiding thread of Track 5

  • •5.1–5.4: why the default looks generic and how to close the loop by actually looking (screenshot).
  • •5.5–5.6: how to bring in visual references and your own brand — the part the agent can’t come up with on its own.
  • •5.7–5.8: build, test locally, and publish only with explicit authorization — the final decision is always human.

✓ Final track checklist

  • ✓The project’s CLAUDE.md has the publishing rule written near the top.
  • ✓You know which localhost address to open to test each project.
  • ✓You have a clear authorization phrase and always use it before the push.
  • ✓You know where the agent's work ends (push) and the automation begins (deploy).

✗ Common mistakes to avoid

  • ✗Accidentally give the agent deployment autonomy — by configuring an MCP or overly broad permissions without considering that consequence.
  • ✗Forget to test on localhost and approve based only on the description of what was done.
  • ✗Treat "you can continue" as if it meant "you can publish."
  • ✗Poking at the deployment tool after the push, trying to "fix" something that's not directly your responsibility.

✏️ Exercise

Open the CLAUDE.md for one of your actual projects (or create one if you don’t have one yet) and write your own version of the publishing rule—use the block in topic 5 as a starting point, but adapt it to your situation: what the localhost address is, what counts as “publishing” in this project, and what phrase you’ll use to authorize it. Then, the next time you publish something with the agent, check that it followed the rule before running the push.

Quick check (optional): what separates “testing on localhost” from “publishing,” according to this module’s golden rule?

✅ Module Summary — and Track 5

✓
The intern and the send button: building is flexible; publishing always requires approval.
✓
Golden rule in CLAUDE.md: "never publish without an explicit order," written and permanent.
✓
Git → deploy pipeline: commit + push finish the human/agent's work; everything else is automatic.
✓
The final 40%: when and whether to publish is a human decision—governance, not bureaucracy.

Next learning path:

Track 6 — Time: scheduling and loops. The agent starts acting when you aren’t watching — which makes authorization rules even more important.