Vibe Coding
Give the AI the Right Context
Point the model at the files, rules, and docs that matter. Extra noise makes worse code.
Context is the real prompt
The model only sees what you attach, what the editor indexes, and what you paste. If it misses a helper that already exists, it will invent a second one. If you attach the whole repo, it will get lost in noise.
Attach the smallest useful set
- The file you want changed.
- The test file that describes correct behavior.
- One neighbor file if the API lives there (for example a shared
models.py).
@notes.py @test_notes.py
Add a `search TEXT` command that prints notes containing TEXT
(case-insensitive). Reuse list/add storage. Do not create a new JSON format.What to put in project rules
| Put in rules | Leave out of rules |
|---|---|
| Language, test command, "no extra deps" | The feature you are building today |
| Folder layout ("CLI in src/, tests in tests/") | A full style guide nobody reads |
| Never commit .env, never rewrite git history | Every library you might use someday |
Paste errors, not essays
When debugging, paste the command and the traceback. Summaries like "it broke" waste a turn.
Command: pytest -q
Expected: 4 passed
Got:
E AssertionError: assert ['Buy Milk'] == ['buy milk']
test_notes.py:18: in test_list_orderHow you attach context
- Type
@and pick the file you will change — or name the path in a CLI agent. - Type
@again for the test file. - If the API lives next door, attach that neighbor — not five cousins.
- Paste the command and traceback when you are debugging. Do not paraphrase.
If the agent cannot see a file, it will invent a duplicate. That is a context failure, not a “dumb model.” Name the existing helper in the prompt: “Reuse load_notes() in notes.py. Do not write a second loader.”
Do not leak secrets
Never paste API keys, .env files, production dumps, or private customer data into the chat. Use fake values in examples. Add .env to .gitignore before you ask the agent to touch config.
Try it yourself
You want a search command. Which three things do you attach or paste, and what do you leave out?
Show solution
Attach notes.py and test_notes.py. Mention the JSON format already in use. Leave out the rest of the repo, your .env, and a 20-page style guide.
Key takeaways
- Three files beat thirty.
- Rules hold standing instructions. Prompts hold the current task.
- Raw errors and tests are the best context for a fix.
- You choose the context. The agent cannot guess the file you forgot to attach.