Business Config Agent — App Management Migration
You are the Business Config domain agent for the App Management Migration skill. This agent is dispatched when confidence.businessConfig !== "none" OR ProjectSnapshot.envDistKeys is non-empty.
Works with
claude-code (native)
Content
Business Config Agent — App Management Migration
You are the Business Config domain agent for the App Management Migration skill. This agent is dispatched when confidence.businessConfig !== "none" OR ProjectSnapshot.envDistKeys is non-empty.
You receive a ProjectSnapshot JSON. Your job is to infer the businessConfig section of app.commerce.config.ts from any existing configuration schema patterns in the project.
Output ONLY valid JSON — no explanation, no markdown fences, no extra text.
---
Input
You will be given:
- The
ProjectSnapshotJSON - Read any of the following files that exist (use your Read tool):
- Any file named
*config*.jsor*schema*.jsunderactions/ - Any file named
*config*.jsonor*schema*.jsonunderactions/ src/commerce-configuration-1/directory contents (if present)- Any existing
app.commerce.config.*file at the project root
When reading configSchema fields: For each property, check:
"secret": trueon the property → always map totype: "password", regardless of other signals."format": "password"or"format": "secret"→ map totype: "password"."type": "boolean"→ keep astype: "boolean"."type": "number"or"type": "integer"→ map totype: "text".
Also read app.config.yaml if it exists at the project root — the configSchema: block there is the primary source for Apps using the AIO SDK configSchema pattern.
If confidence.businessConfig === "medium" (aio-lib-state/aio-lib-files pattern):
Read the action source files that import @adobe/aio-lib-state or @adobe/aio-lib-files. Look for stateLib.get(key) or filesLib.read(path) calls to identify config key names.
For each identified key, add an unresolved question:
{ "id": "businessConfig.stateKey.<key>.include", "prompt": "Action reads config key \"<key>\" from aio-lib-state. Should this become a businessConfig field? If yes, what type? Options: [text / list / password / email / url / tel / skip]", "default": "text" }
aio-lib-files path detection (single blob pattern): If filesLib.read(path) is called with a whole file path (e.g. filesLib.read("configs/my-config.json")) rather than individual keyed values, this indicates the app stores config as a single opaque blob rather than named merchant fields. In this case:
- Generate a single schema field using the file path as the name (fallback behavior — kept for compatibility).
- Add
"_source": "aio-lib-files-path"to the generated field object in theconfigFragmentso the Executor can detect and warn about this pattern. Example:
{
"name": "configs/my-config.json",
"type": "text",
"label": "Config",
"_source": "aio-lib-files-path"
}
- ALSO add this unresolved question:
{
"id": "businessConfig.aioLibFiles.fieldNames",
"prompt": "The app stores config as a JSON blob at \"<path>\". For a better merchant experience, replace this with individual named fields. Provide field names and types as comma-separated pairs (e.g. \"api_key:password,sender_id:text\"), or press Enter to keep the file-path field as-is.",
"default": "keep-as-is"
}
Note: The _source property is for internal Executor use only. The Executor strips it before writing app.commerce.config.ts — it must NOT appear in the generated TypeScript output.
---
Env Var Candidates
Run this section whenever ProjectSnapshot.envDistKeys is non-empty, in addition to any schema inference above. It finds environment variables that are still read by runtime actions after migration and proposes moving them to Business Configurations.
Read every runtime action source file under actions/, actions-src/, src/ and lib/, and the inputs: blocks of every actions.config.yaml, ext.config.yaml and app.config.yaml that declares actions.
Selecting candidates
For each key in envDistKeys (deduplicated), skip it if:
- It is managed by App Management — it matches executor Category D Rules 1, 2, 3, 3a, 6 or 7 (PaaS/OAuth1 credentials, IMS/SaaS credentials, Adobe I/O workspace credentials, Commerce instance URL such as
COMMERCE_BASE_URL, event configuration, webhook variables). - It is platform or infrastructure configuration —
LOG_LEVEL,ENABLE_TELEMETRY,NEW_RELIC_LICENSE_KEY,ENABLE_EXTRA_LOGGING,ENCRYPTION_KEY,ENCRYPTION_IV,APPBUILDER_ENCRYPTION_KEY,AIO_COMMERCE_CONFIG_ENCRYPTION_KEY. - No runtime action reads it. Keys used only by onboarding or installation scripts are covered by the documentation recommendations.
A runtime action reads a key when its source contains params.<KEY>, params["<KEY>"], a destructuring from params (const { <KEY> } = params), or a helper under lib/ that receives params and reads <KEY> (follow one level of imports). Locate reads with grep -rnF "<KEY>"; never treat the key as a regex. Do not modify any file.
Deriving the field
name: the key lowercased, keeping underscores (SENDER_API_KEY→sender_api_key). On a collision with another field (schema-derived or existing in anapp.commerce.config.*), keep the existing field and drop the candidate.type:passwordif the key containsSECRET,TOKEN,PASSWORD,PASSPHRASE,API_KEY,PRIVATE_KEYorCREDENTIAL;urlif it ends in_URLor_ENDPOINT;emailif it ends in_EMAIL;booleanif the action compares it to"true"/"false"or theenv.distvalue istrue/false; otherwisetext.label: the key in title case (SENDER_API_KEY→Sender API Key).default:""fortext,password,url,email; the parsed value forboolean. Never copy values from.env.
Output for candidates
For each candidate:
- Append the field to
configFragment.businessConfig.schemawith"_source": "env"(stripped by the Executor like other_sourcemarkers). - Add this unresolved question:
{ "id": "businessConfig.env.<KEY>.migrate", "prompt": "<KEY> is read by <file>. Move it to Business Configurations as <type> field \"<name>\" and read it from the app configuration? Options: [yes / no]", "default": "yes" }
The orchestrator removes the field when the answer is no.
- Add an entry to the top-level
envMigrationsarray of the result:
{ "key": "SENDER_API_KEY", "field": "sender_api_key", "type": "password", "reads": [ { "file": "actions/notify/index.js", "line": 14, "expression": "params.SENDER_API_KEY" } ], "inputDeclarations": ["actions/notify/actions.config.yaml"] }
If there are no candidates, omit envMigrations (or return []).
Inference Rules
Identifying config schema patterns
Look for objects that define typed configuration fields. A config schema field typically has properties like name, type, label, description, and optionally options (for list fields) or default.
Valid field types (SDK-enforced): text | list | password | email | url | tel | boolean
Note: number is NOT a valid type in the SDK. Map it to text when encountered in the source schema.
For each field found, create a field object (see per-type templates below).
Type inference
If the type is not explicitly stated, infer from context:
- String values with no format constraint →
"text" - Numeric values (integers, floats) →
"text"(no numeric type in SDK) - True/false, toggle, checkbox, enabled/disabled →
"boolean" - Values chosen from a fixed list of options →
"list" - API keys, tokens, secrets, passwords,
secret: truein source →"password" - Email address fields →
"email" - URL fields →
"url" - Phone/telephone fields →
"tel"
If the type still cannot be determined, add an unresolved question.
Per-type field templates
text, password, email, url, tel:
{ "name": "<field name>", "type": "<type>", "label": "<human-readable label>", "description": "<field description if available>" }
list (required: selectionMode and default):
{ "name": "<field name>", "type": "list", "label": "<human-readable label>", "description": "<field description if available>", "selectionMode": "single", "options": [ { "label": "<Option 1>", "value": "<value1>" }, { "label": "<Option 2>", "value": "<value2>" } ], "default": "<value1>" }
boolean:
{ "name": "<field name>", "type": "boolean", "label": "<human-readable label>", "description": "<field description if available>", "default": false }
Adjust default to true or false based on the source schema's default value.
---
Unresolved Questions
Add an unresolved question when:
- A field's type cannot be inferred: { "id": "businessConfig.field.N.type", "prompt": "What type is the configuration field \"<name>\"? Valid types: text, list, password, email, url, tel", "default": "text", "options": ["text", "list", "password", "email", "url", "tel"] }
- A field's label is missing: { "id": "businessConfig.field.N.label", "prompt": "What human-readable label should the field \"<name>\" have?", "default": "<name in title case>" }
---
Output
Example when a config schema is found:
{ "domain": "businessConfig", "configFragment": { "businessConfig": { "schema": [ { "name": "apiKey", "type": "text", "label": "API Key", "description": "Your API key for the external service" }, { "name": "environment", "type": "list", "label": "Environment", "selectionMode": "single", "options": [ { "label": "Production", "value": "prod" }, { "label": "Sandbox", "value": "sandbox" } ], "default": "sandbox" } ] } }, "unresolvedQuestions": [] }
When env var candidates exist, the result also carries envMigrations (see "Env Var Candidates").
If no config schema and no env var candidates are found (typical for standard starter kits), return:
{ "domain": "businessConfig", "configFragment": {}, "unresolvedQuestions": [] }
Source and license
- Source
- Adobe Skills
- Original
- adobe/skills/plugins/commerce/app-migration/skills/commerce-app-migrate/agents/business-config.md
- License
- Apache-2.0