
- Vague prompts cause the assistant to infer project type, frameworks, file structure, and other assumptions.
- Explicit prompts provide the context and constraints the assistant needs to produce focused, actionable results.
- The result: less back-and-forth, fewer surprises, and a predictable file scaffold.
- Prompt: “Make a login screen”
- Context: establishes Express.js, PostgreSQL, and the endpoint path.
- Action: clearly states “Create POST /api/auth/login”.
- Details: validation rules, hashing, token requirements, and error mappings.
- Examples: explicit success response format and expected status codes.
- Initialize Node.js project (
package.json) - Install dependencies:
express,express-validator,bcrypt,jsonwebtoken,pg,dotenv, andnodemon(dev) - Create a basic Express app (
server.js) - Create DB connection (
config/database.js) - Implement
POST /api/auth/logininroutes/auth.js - Add
.envandschema.sql - Add error handling and validation
Example
.env template
package.json snippet
Minimal example of routes/auth.js (concise pattern)
This implementation demonstrates express-validator, bcrypt comparison, JWT generation, and consistent error handling.
config/database.js correctly exports a pg Pool instance configured via process.env values.
Database schema example
A simple schema.sql to create the users table used above:
- It specified the stack (Express.js), the exact route to implement, validation constraints, the database, hashing algorithm, token behavior, response formats, and expected status codes.
- With those constraints, the assistant generated a predictable file structure,
.envtemplate, and an implementation plan.
- Context: What exists already (project type, folder structure, relevant files)
- Action: Exactly what you want (add endpoint, create files, run tests)
- Details: Constraints, libraries, edge cases, and formats
- Examples: Example request/response or code snippets to clarify expected outputs
- Clear: Avoid ambiguity; name frameworks and endpoints.
- Complete: Include required validations, status codes, and response shapes.
- Contextual: Provide repository context or file layout if it matters.
Tip: Spending a minute writing a clear, complete prompt can save many minutes of revisions. Aim for the Goldilocks zone — neither too vague nor overly verbose.
- Vagueness that leads the assistant to assume stack or file layout.
- Conflicting constraints that leave the model unsure which rule to follow.
- Omitting expected response formats (e.g., not specifying JSON structure).
- Express: https://expressjs.com/
- express-validator: https://express-validator.github.io/docs/
- bcrypt: https://www.npmjs.com/package/bcrypt
- jsonwebtoken: https://www.npmjs.com/package/jsonwebtoken
- pg (node-postgres): https://node-postgres.com/
- PostgreSQL docs: https://www.postgresql.org/docs/
- Vague prompts cause LLMs to infer and explore; explicit prompts produce focused, actionable output.
- Use the Context → Action → Details → Examples pattern and the three Cs (clear, complete, contextual) to get consistent, useful results.
- When uncertain, include an example response or code pattern — examples guide the model to your intended shape of output.