Practice workspaceY
Better task judgment
PRACTICAL CODEX LESSON

Choose the right existing pattern

Find a relevant precedent, verify that its constraints match, and reuse conventions without preserving a known flaw.

01 / PREDICT

Three existing files solve something similar. Does the newest file, the shortest file or the most relevant behavior make the best reference?

Write a brief prediction before opening the explanation.

02 / EXPLAIN
Read the lesson

A precedent is evidence, not an order

An existing implementation can reveal how a project handles loading states, errors, validation and ownership. Find an example with the same responsibilities and constraints as the task. A polished component for a public search box may be a poor precedent for a private account lookup. Inspect its callers and tests before recommending reuse. File age, popularity or a familiar library alone does not establish fitness.

Name what should be reused

Give Codex the relevant path and explain the specific pattern that matters: the shared request client, error shape, accessibility behavior or layout. Also state the behavior that differs in the new task. This gives the agent evidence for consistency without forcing a blind copy. Repository instructions and actual usage may disagree; report the conflict and investigate instead of silently choosing the example that is easiest to imitate.

Keep the exception visible

Reuse does not justify copying a documented security defect, deprecated API or inaccessible interaction. If the closest example is unsuitable, explain the mismatch and propose the smallest alternative. Avoid turning a small feature into a project-wide cleanup unless that work is authorized. Verify the new behavior and the conventions it was meant to preserve; fewer changed lines are useful only when the result is correct.

Common mistake

Treating every existing pattern as desirable, or adding a new library because one old example is inconvenient.

03 / DEMONSTRATE

Make the request actionable

A weak starting brief: Add an account selector using whichever component is easiest.

Inspect the existing selectors, their callers and relevant tests. Identify the closest example for authenticated account lookup and explain which conventions to reuse. Preserve keyboard access and the shared request client. Flag obsolete or unsafe behavior rather than copying it. Implement only the requested selector and verify its selection, loading and failure states.

This example is an adaptable request, not evidence that a runtime action has executed.

04 / PRACTICE

A private account picker

src/PublicSearch.tsx: public endpoint, mouse-only interactions.
src/MemberPicker.tsx: authenticated shared client, keyboard navigation, tested loading/error states.
legacy/AccountDropdown.tsx: matching visual design, deprecated request client and a documented missing ownership check.
Task: add a private account picker; no new dependency is needed.

Simulated scenario · No repository access or command execution

Which reference should guide the new implementation?

Loading your saved lesson progress…