Best Practice for AI Coding: Prompt Agents to Follow Existing Codebase Patterns
tristanbob · x · 2026-08-02
A developer shared a key best practice when using agentic coding tools on existing projects: always instruct the AI to look for and understand existing codebase patterns related to the task.
The author points out that while there are multiple "right" ways to implement a feature, the chosen approach should be consistent with how the project currently operates. This helps ensure the Pull Request (PR) is accepted and maintains the project's overall consistency.
However, an exception applies: if the project currently uses a bad pattern, developers should avoid blindly following it. Instead, it might be the right time to help the project refactor and improve alongside adding the new feature.
More from coding & agent
- Codex Agent Scores Perfect 38-0 in Soccer Simulation Game — talkaboutdesign · 2026-08-02
- Finding New CVEs Today Using AI — bronzeagepapi · 2026-08-02
- AI Coding Tools: Cheaper Codex Makes Fable Quota Feel Pricey — robleclerc · 2026-08-02
- Agensis Update: Desktop App Acts as Relay for Parallel Agents — jasonkneen · 2026-08-02
- AI Coding Workflow: Manual Code Review Yields to QA Testing — talkaboutdesign · 2026-08-02
- Developer Confesses to Constantly Rebuilding AI Agent Setups, Only to Return to Cursor — brandon_galang · 2026-08-02