Building Complete Features

Introduction

Welcome to this course! In previous courses, you learned how to make individual changes to existing projects - one file at a time or through structural reorganizations. You focused on writing clear prompts for each change.

Now, you will learn how to build complete features that require coordination across multiple files working together. This is how production-ready features are built.

Suppose you want to add a createdAt timestamp to your Task API in an Express app. This lesson demonstrates how to use Codex to build a complete, production-ready feature by giving clear, practical prompts. The focus is on communicating with Codex to coordinate changes across multiple files and steps. While Express is used as an example, these techniques apply to any multi-file project or framework.

Let Codex Plan the Workflow

When adding a new feature, start by asking Codex to outline the necessary changes. This helps you see the big picture and ensures you do not miss any steps.

plaintext
What files need to be changed to add a createdAt timestamp feature to tasks?

Codex responds with a plan, listing which files and components will be affected (for example: TypeScript interfaces, controllers, routes, database migrations). Review Codex's plan and adjust it if needed before proceeding. This step uses Codex as your project navigator.

Use Precise, File-Specific Prompts

Codex works best with clear, targeted instructions. Instead of vague requests, specify the file, the location, and the exact change you want.

plaintext
In src/types/task.ts, add a createdAt field of type Date to the Task interface

If you're not sure about the file or location, ask Codex to help you find it first:

plaintext
Which file defines the Task interface in this project?

Codex generates the code and often explains its reasoning. This approach works for any language or framework - always tell Codex exactly where and what to change.

Ask for Next Steps and Explanations

After making a change, prompt Codex for what to do next or ask it to explain the impact of a change. This keeps your workflow moving and helps you understand the process.

plaintext
What commands do I need to run after adding the createdAt field?

Codex responds with the necessary commands or steps (like running database migrations, restarting the development server, or rebuilding TypeScript), and can explain why each step is needed.

Guide Codex Through Multi-File Features

For features that touch multiple files, keep prompting Codex for each part. For example, after updating a type definition, move to the controller, the route, and then the tests. Each time, be explicit:

plaintext
In src/controllers/taskController.ts, update the createTask function to set createdAt to the current date when creating a new task
plaintext
In src/routes/tasks.ts, ensure the GET /tasks endpoint returns tasks ordered by createdAt descending

You can also ask Codex to generate or update tests as part of the workflow:

plaintext
In src/tests/task.test.ts, add a test to verify that createdAt is set when a Task is created

Codex will generate the code for each file and explain any framework-specific details (like middleware configuration or database query syntax).

Use Codex for Testing and Troubleshooting

Codex can help you verify your changes and debug issues. Ask it how to test a new feature or what to do if you encounter an error.

plaintext
How can I test that the createdAt timestamp is working for new and existing tasks?

If you encounter a problem, describe it directly:

plaintext
I got a TypeScript error about createdAt being possibly undefined. What should I do?

Codex will suggest solutions, explain error messages, or walk you through fixes.

Prompting Strategies for Complete Features

  • Be specific: Always mention file names, function names, and the exact change.
  • Work step by step: Use Codex to plan, then implement, and then test.
  • Ask for explanations: If you are unsure, have Codex explain its reasoning or the impact of a change.
  • Iterate: If Codex's answer is not quite right, clarify your prompt or ask for a revision.
  • Summarize progress: Occasionally ask Codex to recap what has been changed so far to keep track.

Summary and What's Next

In this lesson, you learned how to use Codex to build complete features by coordinating changes across multiple files. You discovered how to plan features by asking Codex to outline necessary changes, use precise file-specific prompts for each component, ask for next steps and explanations to keep the workflow moving, guide Codex through multi-file features step by step, and use Codex for testing and troubleshooting. You also learned effective prompting strategies for complete features: being specific, working step by step, asking for explanations, iterating, and summarizing progress.

Next, you will get hands-on practice building complete features with the Express task tracker project. You will add a createdAt timestamp feature that requires changes across TypeScript types, controllers, routes, and the database layer - all working together to create a complete, working feature.

Move on to the practice exercises to start applying these techniques to real features!

Sign up

Join the 1M+ learners on CodeSignal

Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal