You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/docs/practical-techniques/lesson-11-agent-friendly-code.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ Both problems feed the same exponential curve. When you accept a random AI error
48
48
49
49
From [Lesson 5](/docs/methodology/lesson-5-grounding), agents discover your codebase through **agentic search**—Grep, Read, Glob. **Agents only see code they explicitly find.** When constraints scatter across files, search determines what the agent sees and what it misses.
50
50
51
-
**❌ Anti-pattern (scattered constraints):**
51
+
**Anti-pattern (scattered constraints):**
52
52
53
53
```typescript
54
54
// File: services/auth.ts
@@ -62,7 +62,7 @@ const MIN_PASSWORD_LENGTH = 12 // ← Agent never searches for this file
62
62
63
63
**What happens:** Agent searches `Grep("createUser")` → reads `services/auth.ts` → generates code accepting 3-character passwords because it never saw `MIN_PASSWORD_LENGTH`.
64
64
65
-
**✅ Production pattern (co-located constraints):**
0 commit comments