Build a feature with Claude Code

In Tutorial 3 you built a feature by hand. Here you build the same kind of feature, a list of bookmarks owned by the user, by describing it. The Claude Code plugin scaffolds it, writes the code and tests, wires it into the SPL and the product, migrates and verifies.

Table of contents

Prerequisites

  • The Claude Code plugin installed. See Installation.
  • my_first_app as Tutorial 3 or Tutorial 7 leaves it, with splent_feature_notes installed and the CLI container running.
  • A feature name that is still free. The product already has splent_feature_notes, so this tutorial builds bookmarks.

Step 1. Describe what you want

Start Claude Code on your machine, not in the container, from your splent_workspace folder.

cd splent_workspace
claude

The plugin runs splent through the CLI container on its own, so leave the container running. Then say what the feature is.

add a bookmarks feature with a title and a URL, owned by the user

Claude runs the feature skill. It infers a name (splent_feature_bookmarks), an archetype (full, since it has a model), and that “owned by the user” means a foreign key to auth’s user table, so it depends on auth. It states that plan in a couple of lines before it starts.

Step 2. What Claude does

The skill drives the CLI from start to end and writes the code at each step.

# scaffold the package at the workspace root (spl:* below needs the product deselected)
splent product:deselect
splent feature:create splent-io/splent_feature_bookmarks --type full

# write idiomatic code (Claude does this, following the conventions):
#   models.py        Bookmarks(id, title, url, user_id → user.id, created_at)
#   repositories.py  custom queries on BaseRepository
#   services.py      business logic on BaseService
#   routes.py        @login_required /bookmarks/ (resolved via service_proxy)
#   forms.py, templates/bookmarks/index.html, hooks.py (sidebar), seeders.py
#   tests/unit, tests/integration, tests/functional

# add to the SPL (spl:* runs detached; dependencies are auto-detected)
splent spl:add-feature sample_splent_spl splent_feature_bookmarks   # → bookmarks => auth

# install into the product
splent product:select my_first_app
splent feature:add splent-io/splent_feature_bookmarks

# infer and write the contract (needs a selected product)
splent feature:contract splent_feature_bookmarks --write

# migrate
splent db:migrate splent_feature_bookmarks
splent db:upgrade

It is the flow of Tutorial 3, with two things explicit. --type full names the archetype Tutorial 3 got by default, and feature:contract --write writes the contract before migrating, where Tutorial 3 refreshed it later through the feature:xray prompt.

The CLI owns the mechanics, so Claude never hand-edits the feature lists in pyproject.toml, the .uvl model or the migration tables. The logic (models, services, routes, templates, tests) is the code it writes for you to review.

Step 3. Verify

splent feature:test splent_feature_bookmarks   # unit, integration, functional
splent feature:xray --validate                 # hooks/extension wiring OK
splent product:validate                        # UVL satisfiable, contracts compatible, imports OK
splent product:routes | grep bookmarks

Run these in the CLI container’s shell. product:routes prints one line per route and method. Claude picks the exact paths, so yours may differ a little from this.

  /bookmarks/                                GET     splent_feature_bookmarks   bookmarks.index
  /bookmarks/<int:bookmark_id>/delete        POST    splent_feature_bookmarks   bookmarks.delete
  /bookmarks/<subfolder>/<filename>          GET     splent_feature_bookmarks   bookmarks.assets
  /bookmarks/create                          GET     splent_feature_bookmarks   bookmarks.create
  /bookmarks/create                          POST    splent_feature_bookmarks   bookmarks.create

The assets route comes from the scaffold’s assets/ folder, whose JavaScript and CSS the feature serves under its prefix.

Open http://localhost:5591/login, log in and go to the new page (/bookmarks/, or the route Claude reported). The sidebar has a Bookmarks link next to Notes, and the page lists the user’s bookmarks and lets them add and delete their own. Claude writes the code afresh each time, so names and details can differ. The summary it prints at the end says what it built.

When the app won’t boot

If product:derive or the app fails, paste the error to Claude.

/splent:doctor product:derive fails with <the error>

The doctor skill reads the product, the SPL and the logs, fixes the cause and derives again.

What you end up with

A tested feature, splent_feature_bookmarks, in the SPL with a bookmarks => auth constraint, installed and migrated into your product, serving a login-protected page. The result of Tutorial 3, reached by describing the feature instead of writing every file.

Tips

  • Describe intent, and the right skill (feature, product, doctor) triggers on its own. See the Skills reference.
  • Review the diff like any change. It is your feature.

Back to top

splent. Distributed by an LGPL license v3. Contact us: drorganvidez@us.es