For AI agents: the complete documentation index is available at https://mfeflow.github.io/mfeflow/llms.txt, the full documentation bundle is available at https://mfeflow.github.io/mfeflow/llms-full.txt, and this page is available as Markdown at https://mfeflow.github.io/mfeflow/reference/feature-json.md.

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

FieldTypeRequiredMeaning
nametextYesanalytics-gtm, or @someone/feature for a registry feature
versiontextYesThe feature version
descriptiontextNoShown by mfeflow features
keywordslistNoWords the registry index lists for search
promptslistNoQuestions asked when the feature is added
requireslist of feature namesNoFeatures that must be installed first (E206)
conflictslist of feature namesNoFeatures that cannot be installed together (E205)
fileslistNoFiles to create
dependencieslistNonpm packages to add
scriptslistNopackage.json scripts to add
transformslistNoEdits to existing files
migrationslistNoFirst-party only. Not run for third parties

Targets

Many entries have a target that says where they apply.

ValueApplies to
rootThe project root
shellEvery shell
remotesEvery remote
an app name, or app:<name>One app

Conditions

An entry with when applies only if every condition holds. There are two kinds of key.

KeyMeaningExample
A plain nameOne of the feature's own options; it must equal the value{ "validator": "zod" }
feature:<name>Whether that feature is installed, or being added in the same command{ "feature:env-t3": true }

prompts

FieldTypeMeaning
nameidentifierThe option name, used as --option feature.name=value
typeboolean, string, selectThe kind of answer
messagetextThe question
defaulttext or booleanThe default answer
choiceslistRequired for select. The default must be one of them

files

FieldTypeMeaning
torelative pathDestination, relative to the target. Template values such as the app name are filled in per app
targettargetWhere to write
whenconditionWrite only if it holds
fromrelative pathSource file in the feature folder. Not allowed for third parties
contenttextInline content. The only source a third party may use
templatebooleanRender with templating
atRootbooleanResolve to from the project root. First-party only

Each file needs exactly one of from or content. Paths use forward slashes and no ...

dependencies

FieldMeaning
namenpm package name, or {{scope}}/<name> for a package of the project
rangeVersion range
devAdd to devDependencies
target, whenAs above

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.

opDoesMain fields
add-importAdds an importfrom, named, default, namespace, typeOnly
wrap-providerWraps the output of a component in a providercomponent, from, props, defaultImport, function
add-sharedAdds a package to the singleton listname, list
add-boot-stepAdds a call to the start-up sequencecall, from, args, await, before, after, function
add-env-keyAdds a typed env keykey, scope (server or runtime), schema, value, example, configFiles
add-routeAdds a route to a route arraypath, component, from, routes
add-workflow-stepAdds a step to a CI workflow jobjob, step, after

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:

feature.json
{
  "name": "@acme/hello",
  "version": "1.0.0",
  "description": "Adds a hello module to every remote.",
  "keywords": ["example"],
  "files": [
    { "to": "src/hello.ts", "target": "remotes", "content": "export const hello = 'hi';\n" }
  ],
  "dependencies": [{ "name": "nanoid", "range": "^5.0.0", "target": "remotes" }]
}

Errors

An invalid file is E202. A third-party feature that uses something it may not is E203. See Error codes.