Features
A feature is a versioned Python package that adds one capability to your product. It brings its routes, models, migrations, templates, assets, tests and, when it needs one, its own service such as Redis or Nginx. Products of a line share the same released features.
What it holds
| Part | Files |
|---|---|
| Contract | pyproject.toml, what the feature provides, requires and lets others extend |
| Code | models.py, services.py, routes.py, hooks.py and the rest |
| Interface | templates/, assets/, translations/ |
| Data | migrations/, seeders.py |
| Server | docker/, optional, the feature’s own containers |
A feature is editable while you work on it (a checkout at the workspace root) and pinned in a product that uses a release (a read-only snapshot in the cache). Production only takes pinned features.
How it relates to the other layers
- Product line. The model names the feature and decides what it needs.
- Other features. A feature extends another only through what that one declares, with template hooks, services, signals or a refiner. The contracts say what is allowed, and they are checked before the app starts.
- Product. A product declares the feature in its
pyproject.toml, editable or at a version. - Framework. At boot it imports the feature and registers everything it brings.
Commands
| Command | What it does |
|---|---|
feature:create |
Scaffolds a new feature |
feature:add, feature:attach |
Add it to the product, editable or pinned |
feature:refine |
Makes it extend another feature |
feature:test |
Runs its tests in the product |
feature:release |
Publishes a version |