feature.json reference
This page lists every field of feature.json. Each mfeflow feature is one of these files plus the files it copies. Third-party features use a limited subset. See Third-party features for those limits.
The JSON Schema is published at https://mfeflow.github.io/mfeflow/schema/feature.json. The registry index has its own schema at feature-registry-index.json in the same folder.
Top-level fields
Targets
Many entries have a target that says where they apply.
Conditions
An entry with when applies only if every condition holds. There are two kinds of key.
prompts
files
Each file needs exactly one of from or content. Paths use forward slashes and no ...
dependencies
scripts
Each has a name, a command, and optional target and condition. Names use letters, digits and a few separators.
The script is added to the package files. It is not run. A third-party script name must start with the feature's own name.
transforms
Each transform names an operation and a file to edit, with an optional target and condition. The built-in operations are a public, versioned API.
For the env key operation, the schema is source text, or an object with one text per validator: zod, valibot or arktype. The one matching the file's validator is used.
An unknown operation is E204. A file that is missing or shaped differently than expected is E208.
migrations
First-party only. Each has from, to and a module path. mfeflow upgrade runs them when an upgrade crosses their version. They never run for third-party features.
Example
A small feature that adds one file and one dependency:
Errors
An invalid file is E202. A third-party feature that uses something it may not is E203. See Error codes.