Introduction

Welcome back to Applying What You've Learned! You have completed the first lesson, where we configured Claude Code for an existing project. Now, in this second lesson, we are taking the next step: adding a real feature while leveraging existing skills.

Here is something powerful about Claude Code: skills can be reused across multiple projects. Once a skill is available, Claude can automatically recognize when it is relevant and apply it to any project. In this lesson, we will add a new feature to our Todo API and watch as Claude automatically selects the api-endpoint-creator skill to guide the entire implementation process—from analyzing existing patterns to generating routes, controllers, and tests. This demonstrates how reusable skills save time and ensure consistency across all our projects.

Understanding Skill Reusability

Before we dive into adding the feature, let us establish an important concept: skills are portable and context-aware. Skills live in a personal skills directory at ~/.claude/skills/, making them available across all projects. This means once a skill exists, Claude can use it in any project where it is relevant.

The key to skill reusability lies in how Claude selects them. When we work with Claude Code, it analyzes the current task against all available skills. If the task description, file types, or context matches a skill's criteria, Claude automatically invokes that skill. We do not need to manually specify which skill to use; Claude makes this decision intelligently based on what we are trying to accomplish.

For this lesson, we will use the api-endpoint-creator skill, which was designed to analyze existing API patterns and create new endpoints with routes, controllers, and tests. Since we are about to add a new feature to an Express API, the conditions are perfect for automatic skill selection. Later in this course, you will learn how to create your own skills, but for now, we will focus on experiencing how existing skills enhance our development workflow.

The api-endpoint-creator Skill

Before we add our feature, let's review what the api-endpoint-creator skill does. It automates the process of adding new API endpoints by following this workflow:

  1. Analyze existing patterns: Read current routes, controllers, and models to understand project conventions
  2. Check test patterns: Examine existing test files to match testing style
  3. Generate implementation: Create new routes and controllers following discovered patterns
  4. Write tests: Generate comprehensive test coverage matching project conventions
  5. Verify functionality: Run tests to ensure everything works

The skill works across any Express-based API project, adapting to each project's specific conventions as documented in CLAUDE.md. In this lesson, we'll see all five steps of this workflow in action as we add the priority feature.

Requesting the Feature

Let us start by requesting a new feature for our Todo API. We want to add a priority field that categorizes todos as low, medium, or high priority. We will also want the ability to filter todos by priority. Here is how we phrase the request:

Notice how we provide clear requirements without specifying implementation details. We state what we want: the priority field, the allowed values, the default behavior, and the filtering capability. This gives Claude enough context to implement the feature correctly while following our CLAUDE.md conventions.

When Claude receives this request, it begins by understanding the current state of the codebase before making any changes.

How Skills Activate: Automatic vs Explicit

Here is where something remarkable happens. Before implementing the feature, Claude recognizes that this task involves modifying API endpoints. We see this message:

This is automatic skill selection in action. Claude recognized the context—modifying an Express API—and matched it to the api-endpoint-creator skill without us specifying anything.

However, skills can also be explicitly invoked when you want precise control:

When to use each approach:

  • Automatic (default): Let Claude choose based on context. Best for natural workflow.
  • Explicit (using /skill): When you want a specific skill's workflow, even if Claude might choose differently.

Both approaches are valid; automatic selection works most of the time, while explicit invocation gives you control when needed. In practices, you may be asked to use explicit invocation to ensure you experience a particular skill's workflow.

Exploring the Current Implementation

Following the skill's workflow, Claude starts by reading the existing data model to understand the current structure:

This exploration step is crucial because Claude needs to know what fields already exist before adding new ones. The current Todo model has five fields, and we are about to add a sixth: the priority field.

Next, Claude examines the route handlers to understand how todos are currently created and retrieved. This helps Claude identify where the new priority logic needs to be integrated, both for creating todos with a priority and for filtering them during retrieval.

Adding Priority to the Model

Now Claude edits the model to include the priority field with a default value:

The implementation is straightforward:

  • The constructor accepts a priority parameter with a default value of 'medium'
  • If no priority is provided, it defaults to 'medium'
  • The priority is stored as a simple string field

Note that we are not adding validation in the model here. In Express applications, input validation is typically handled by middleware, which keeps the model focused on data structure rather than business rules. We will explore validation patterns in later lessons.

Updating the API Endpoints

With the model updated, Claude now modifies the routes to handle priority in both the creation and retrieval of todos:

Notice how both endpoints follow our CLAUDE.md standards: async/await syntax, proper error handling, and the correct response formats with { data: ... } for success and { error: ... } for failures. The routes use relative paths ('/') because the router is already mounted at /api/todos in server.js, so these handlers respond to POST /api/todos and GET /api/todos respectively.

Generating Comprehensive Tests

Continuing to follow the skill's workflow, Claude now generates tests for the priority feature. The skill automatically creates comprehensive test coverage based on the patterns it observed in existing test files:

The skill generates tests that match our testing conventions, which we will examine in detail next.

Understanding the Generated Tests

Following the skill's workflow, Claude generates comprehensive tests matching our CLAUDE.md conventions. The skill creates three distinct test cases:

The skill generates three tests:

  1. Happy path: Creating a todo with an explicit priority value
  2. Edge case: Default priority when none is specified
  3. Filtering: Retrieving todos filtered by priority

All tests follow our Jest + supertest conventions from CLAUDE.md, including proper authentication setup and response validation.

Running the Tests

Now comes the moment of truth. Following its workflow, the skill automatically runs the generated tests:

All tests pass on the first run. This is not luck; it is the result of several factors working together:

  • Our CLAUDE.md documented clear coding standards
  • The model and routes were implemented following those standards
  • The api-endpoint-creator skill understood both the requirements and the conventions
  • The generated tests matched the actual implementation

This demonstrates the compound benefit of proper configuration and reusable skills.

Why This Works So Well

Skills are context-triggered: when Claude detects a task matching a skill's purpose, it activates automatically. We don't need to remember or manually specify skills—the system handles coordination transparently.

The combination of:

  • CLAUDE.md for project-specific standards
  • Skills for cross-project capabilities

...creates a powerful workflow where Claude understands both general practices and specific project requirements.

Conclusion and Next Steps

In this lesson, we added a priority feature to our Todo API and witnessed the automatic activation of the api-endpoint-creator skill we created previously. The skill recognized the context, analyzed existing patterns, guided the implementation, generated comprehensive tests, and verified that everything works correctly. This demonstrates one of the most powerful aspects of Claude Code: skills are truly reusable across projects.

The combination of CLAUDE.md for project-specific standards and skills for cross-project capabilities creates a robust development workflow. Our project configuration ensures consistency within a single codebase, while skills provide consistent approaches across all our codebases. Together, they transform Claude Code from a helpful assistant into a knowledgeable team member who understands both our general practices and specific project requirements.

Now it is your turn to experience this workflow firsthand! The upcoming practice exercises will give you hands-on experience adding features and watching skills activate automatically, reinforcing these powerful concepts through direct application.

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