feature:create

Scaffold a new feature at the workspace root.


Table of contents

  1. Usage
  2. Feature types
  3. Examples
  4. Generated structure
    1. full (default)
    2. light
    3. config
    4. service
  5. What happens next
  6. Requirements
  7. See also

Usage

splent feature:create <namespace>/<feature_name> [--type TYPE]

Feature types

Not every feature needs models, migrations, and a full UI. Use --type to scaffold only what you need:

Type When to use What you get
full (default) Domain features with CRUD, UI, and database Everything: models, routes, services, repositories, hooks, signals, seeders, commands, templates, assets, migrations, full test suite
light UI features without their own database tables Routes, hooks, templates, and functional tests — no models, migrations, or seeders
config Infrastructure (Redis, session backends, mail providers) Only config.py with inject_config() and unit tests — no routes, services, or UI
service Backend services without UI (queues, integrations, APIs) Services, config, commands, signals, and unit tests — no routes or templates

Examples

# Full domain feature (default)
splent feature:create splent-io/splent_feature_billing

# Infrastructure — just config and maybe docker-compose
splent feature:create splent-io/splent_feature_redis --type config

# Lightweight UI — no models or migrations
splent feature:create splent-io/splent_feature_sidebar --type light

# Backend service — no UI, has commands and signals
splent feature:create splent-io/splent_feature_email_queue --type service

Generated structure

full (default)

splent_feature_billing/
├── pyproject.toml
├── MANIFEST.in
├── .gitignore
├── src/<namespace>/splent_feature_billing/
│   ├── __init__.py          ← Blueprint + register_service
│   ├── models.py            ← SQLAlchemy model
│   ├── repositories.py      ← Data access layer
│   ├── services.py          ← Business logic
│   ├── routes.py            ← Flask routes
│   ├── forms.py             ← WTForms
│   ├── hooks.py             ← Template hook registration
│   ├── signals.py           ← Signal definitions
│   ├── commands.py          ← CLI commands (feature:billing ...)
│   ├── config.py            ← Environment variable injection
│   ├── seeders.py           ← Dev/test data
│   ├── templates/billing/
│   │   └── index.html
│   ├── assets/js/
│   │   ├── scripts.js
│   │   └── webpack.config.js
│   ├── migrations/
│   │   ├── env.py
│   │   ├── alembic.ini
│   │   ├── script.py.mako
│   │   └── versions/
│   ├── translations/
│   └── tests/
│       ├── conftest.py
│       ├── unit/test_services.py
│       ├── integration/test_repositories.py
│       ├── functional/test_routes.py
│       ├── e2e/test_browser.py
│       └── load/locustfile.py

light

splent_feature_sidebar/
├── pyproject.toml
├── MANIFEST.in
├── .gitignore
├── src/<namespace>/splent_feature_sidebar/
│   ├── __init__.py          ← Blueprint only
│   ├── routes.py
│   ├── hooks.py
│   ├── templates/sidebar/
│   │   └── index.html
│   └── tests/
│       ├── conftest.py
│       ├── unit/test_services.py
│       └── functional/test_routes.py

config

splent_feature_redis/
├── pyproject.toml
├── MANIFEST.in
├── .gitignore
├── src/<namespace>/splent_feature_redis/
│   ├── __init__.py          ← inject_config on init
│   ├── config.py            ← inject_config(app)
│   └── tests/
│       ├── conftest.py
│       └── unit/test_services.py

service

splent_feature_email_queue/
├── pyproject.toml
├── MANIFEST.in
├── .gitignore
├── src/<namespace>/splent_feature_email_queue/
│   ├── __init__.py          ← register_service
│   ├── services.py          ← Business logic
│   ├── config.py            ← Environment variables
│   ├── signals.py           ← Signal definitions
│   ├── commands.py          ← CLI commands
│   └── tests/
│       ├── conftest.py
│       └── unit/test_services.py

What happens next

The feature is created locally and is not automatically added to any product. Typical next steps:

splent feature:add splent-io/splent_feature_billing    # Link to product
splent product:resolve                                     # Create symlinks
splent product:restart                                  # Load the feature

Requirements

  • The <namespace>/<feature_name> format is mandatory.
  • The feature must not already exist at the workspace root.

See also


Back to top

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