From chat to agent|INEMA.CLUB-PRO

Lesson 2 · 12 min

Step 1: from chat to the terminal (OSWork)

The terminal is just another window. With six commands, you can move through your folders; with an AGENTS.md, the agent knows who you are and what it can do; with Git, you can undo any mistake.

Start lesson

In this lesson, you will

  1. 1Move through folders in the terminal
  2. 2Write the agent manual (AGENTS.md)
  3. 3Undo any change with Git
  4. 4Keep keys out of the text

Objective: set up the agent’s work folder with rules, a safety net, and secrets kept out of the text.

01How the pieces fit together

You give the task, the agent works inside the folder, and you review it.

Scroll down: each step below lights up its part of the diagram.

  1. 1/5

    You

    You’re still the one who decides: you ask, review the result, and accept or undo it. Giving the task, reviewing, and deciding is management.

  2. 2/5

    Terminal

    This is how you get to the folder and call the agent. On Windows, use cmd; on Mac and Linux, use the Terminal.

  3. 3/5

    Project folder

    Everything the agent needs to know goes here: the rules in AGENTS.md, the work in the files, the keys in .env (which Git ignores), and the history in .git.

  4. 4/5

    Agent

    The agent reads AGENTS.md before starting, works on the files in the folder, and, if the rules require it, says what changed and how you can review it.

  5. 5/5

    The full cycle

    You ask, the agent works inside the folder following AGENTS.md, and says what changed. You review it. If you like it, commit; if not, use git restore.

The same files work for Claude Code and Codex: both read AGENTS.md.

02The work cycle with the agent

Click each step.

1. Ask

Inside the folder, run claude or codex and ask for one thing, with the result you expect.

Start by asking it to read AGENTS.md so it follows your rules.

RequestRead AGENTS.md. Create an index.html with a simple page about me, using the information there.

03The files and commands in this sequence

Copy and use them. Replace the text between the < > signs with your own.

Terminal · first folder
mkdir projetos
cd projetos
mkdir meu-primeiro-agente
cd meu-primeiro-agente
dir      # Windows (on Mac and Linux: ls)
AGENTS.md
# Who I am
<your name, your profession, who you work for>

# Rules for this project
- Write in Portuguese, using short sentences.
- Don’t delete files without asking.
- Before finishing, say what changed and how I can check it.
- Never write keys or passwords in a text file; they belong in .env.

# What’s here
- index.html: my page
Terminal · Git and keeping secrets out of text
git init
echo .env> .gitignore
git add .
git commit -m "primeira versão"

# undo an agent's change:
git restore index.html

# .env must NOT appear here:
git status
Repository example
  1. You can reach the folder using only the terminal and say which folder you’re in.
  2. AGENTS.md has at least three rules you wrote.
  3. The page opens in your browser, and you asked for at least one correction.
  4. git status does not show .env.

04Practice: the 6 exercises in sequence 1

Do them in order. Move on only when the "done when" condition is true.

E1 · First folder using the terminal

10 min

Create projetos/meu-primeiro-agente, go into it, and list its contents. Open the same folder in File Explorer (or Finder) and compare.

Done when: you can reach the folder using only the terminal, without the mouse, and say which folder you’re in.

E2 · The employee handbook

15 min

Create AGENTS.md with who you are, the project rules, and what’s in the folder.

Done when: the file exists and has at least three rules that you wrote yourself.

E3 · The first task

15 min

Call the agent and ask it to create index.html based on AGENTS.md. Open it in your browser and ask for a change.

Done when: the page opens, and you asked the agent for at least one correction.

E4 · The safety net

20 min

Run git init, add, and commit. Ask for a big change, and if you don’t like it, revert it with git restore.

Done when: you undid an agent’s change with one command, no panic.

E5 · Keep secrets out of the text

10 min

Create a .env file with a fake key and a .gitignore file with the line .env. Add the rule to AGENTS.md.

Done when: git status does not show .env.

E6 · The agent reads your files

20 min

Put three of your own texts in the folder and ask for a resumo.md with 5 decisions and 5 open items, citing the source of each one.

Done when: you found at least two of the quoted sentences in the original.

Complete exercises, including the extra challenge (repeat with the other agent): jornada-agentes/exercicios/01-oswork.md.

05Sequence 1 in video

Six commands, one AGENTS.md, and the first task.

From chat to the terminal · 1 min 52 secVideo page with script →

06Test what you learned

The explanation appears after your answer.

Question 1 of 3

Where does an API key go in a project?competency

Go deeper on step 1

Previous lessonNext lesson