Hard-won lessons from building and shipping 60+ projects with AI coding agents (OpenCode, Claude Code, Codex, Copilot, Gemini, Vector) on a locked-down Windows work laptop, as one person who is an engineer, not a programmer.
Every line here cost at least one failed run. They were written down the moment something broke, by the agent that broke it, and are published so your agents don’t have to learn them again.
lessons.md: every lesson in one file, ready to paste into an agent’s context.chapters/: the same lessons sorted by topic.lessons.jsonl: machine-readable (chapter, text, date, kind).tools/build.py: turn your own lesson notes into the same format, with private terms stripped.Distilled from the patterns that kept coming back across all chapters.
?cb=<time>),
re-probe it after every deploy, and diff it against what you meant to ship. “Pushed” is not “done”.Get-Content/Set-Content. It reads UTF-8 as cp1252,
writes a BOM and turns every non-ASCII character into mojibake. Edit from Python with encoding="utf-8"
and LF. PowerShell > writes UTF-16.http.https://github.com/.proxy
overrides http.proxy and HTTPS_PROXY; on HTTP 407, retry the other route before giving up, and fall
back to the GitHub REST/Git Data API when git itself is blocked.PATH and fails silently.scrollWidth == viewport width on
every view. One wide table breaks the phone layout.| # | Chapter | Lessons | |—|—|—| | 1 | Working with AI agents | 120 | | 2 | Verification, tests and gates | 201 | | 3 | Git, GitHub and shipping | 123 | | 4 | Networks, proxies and TLS | 27 | | 5 | Windows, PowerShell and encodings | 21 | | 6 | UI, design and accessibility | 55 | | 7 | Apps, PWAs, mobile and 3D | 16 | | 8 | Data, numbers and honesty | 30 | | 9 | Python and scripting | 16 | | 10 | Product, launch and growth | 15 | | 11 | Notes, memory and second brain | 5 | | 12 | General engineering habits | 46 |
Whole handbook (large context models): add one line to your AGENTS.md, CLAUDE.md or
.github/copilot-instructions.md:
Before starting, read https://raw.githubusercontent.com/juw12/agent-lessons/main/lessons.md and follow it.
Just what you need (small context): paste the “15 that matter most” above plus the one or two chapters
for your stack (e.g. chapters/03-git.md and chapters/05-windows.md for a Windows repo).
Make your agent keep its own. The habit that produced this repo is simple: tell your agent
“after anything breaks, append one line to lessons.md: what happened, why, and the fix; read it before
every run”. After a month you have your own version of this file.
python tools/build.py \
--md path/to/your/lessons.md \
--md "path/to/README.md::^#+ (Lessons|Gotchas)" \
--corrections path/to/corrections.jsonl \
--rules path/OUTSIDE/the/repo/redact.json \
--out .
redact.json lists what must never be published (drop_if_contains), what to rewrite (replace, e.g.
internal hostnames to <internal-host>), and patterns that must not survive (forbidden_after_redaction).
The build refuses to write anything if a forbidden pattern is still present. Keep that file out of the
repo so the list of secrets is not itself published. tools/check.py runs a generic leak scan (emails,
IPs, tokens, user paths) and runs in CI on every push.
<corporate-proxy>, <internal-host> and <internal-ip> mark where a value was redacted.