Breaking Down Task Comments

From Plan to Action

In previous lessons, we learned how to create a high-level technical plan. Now we're ready to move from planning to building. Our goal is to add a "Comments" feature to a task management system.

Important Note About Practice Environment:

The practices in this unit use a simplified implementation to focus on the decomposition methodology rather than production deployment. You'll work with:

  • Basic Python classes instead of full FastAPI routers
  • SQLite with integer IDs instead of Postgres with UUIDs
  • Mocked external services instead of real cloud storage

The skills you're learning (breaking down features, identifying dependencies, managing task scope) apply regardless of the specific tech stack. In professional work, you'd adapt these same principles to your production environment.

In the CodeSignal IDE, basic libraries like SQLAlchemy and Pytest are installed, allowing you to focus on the logic of feature decomposition.

Decomposing the "Comments" Feature

To build a feature successfully, we group our work into logical phases. We call these "atomic tasks." A task is atomic if it focuses on one thing, affects only a few files, and can be finished in one sitting (usually under 2 hours).

For our Comments feature, we split the work like this:

PhaseTask IDFocusDependencies
FoundationT001, T002Database Model and RepositoryNone
Business LogicT003, T004Services and Validation SchemasT001, T002
API LayerT005, T006Endpoints and AuthorizationT003, T004
IntegrationT007Final End-to-End TestsAll previous

By following this order, we ensure that we never build a "roof" (the API) before we have a "foundation" (the database).

Defining Task Requirements (The Template)

Every task needs a clear set of instructions so Claude knows exactly what "done" looks like. We use a standard template for this. Let's look at the requirements for our first task, T001.

Task Template: [T001] Create Comment Model

  • Files Modified: src/models/comment.py, tests/unit/test_comment_model.py
  • Acceptance Criteria:
    • Model extends Base from src.database.
    • Fields: id (Integer, primary key), task_id (Integer, Foreign Key), user_id (Integer, Foreign Key), content (String), created_at (DateTime with default).
    • Relationships: task (to Task model), author (to User model).
    • All foreign keys explicitly marked nullable=False.
    • Unit tests verify fields, relationships, and default timestamp behavior.
  • Dependencies: None
  • Estimated Time: 45 minutes

Notice the checkboxes. These are called Acceptance Criteria. They act as a checklist for both you and Claude. If every box isn't checked, the task isn't finished.

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