About

How to Prompt AI Coding Agents: Name the File and the Function

General

Not "fix it" but "in file X, function Y, change Z to W"

AI coding agents respond more accurately to clear instructions. Describing specific file names, function names, and desired behavior yields much better results than vague requests. Breaking large tasks into steps rather than requesting everything at once is also effective.

How to Use

1

Be specific: "Add email validation in UserController's create action"

2

Provide context: "Rails 8 project, using SQLite"

3

Specify desired output format: "Also write RSpec tests"

4

One at a time: Break large tasks into steps

Tags

#prompt #communication #best-practice

Source

Community Best Practice

← Project Context File Comparison How to Manage the Context Window in AI Coding Agents →