بنقرة واحدة
build-agent-image
Export capabilities and build a custom agent Docker image for one or more connectors
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Export capabilities and build a custom agent Docker image for one or more connectors
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Research the vendor API, implement fetch_metadata and fetch_run_details, and verify with ETL tests
Scaffold a new connector directory with base template, manifest, credentials.json, and requirements.txt
Implement all template methods in a connector's connector.py — the main agent workflow
Research the database driver, implement connection methods, stub credentials.json, and verify with connection tests
| name | build-agent-image |
| description | Export capabilities and build a custom agent Docker image for one or more connectors |
| argument-hint | <connector-name> [<connector-name>...] [--mode MODE] |
| disable-model-invocation | false |
$ARGUMENTS contains:
postgres, coalesce, postgres coalesce--mode MODE (optional): full, hybrid, or auto. Default: auto (DW only; ignored for ETL)Parse any flags from $ARGUMENTS. Anything not prefixed with -- is a connector name.
If no connector name is provided: List the available connectors under both connectors/
and etl_connectors/ (excluding _base) and ask the user which one(s) to build. Do not proceed
until they respond.
For each connector name, auto-detect whether it is a DW or ETL connector by checking which directory it exists in:
connectors/<name>/ → DW connectoretl_connectors/<name>/ → ETL connectorIf found in neither directory: Stop and tell the user the connector was not found. Suggest
running /create-connector <name> (DW) or /create-connector <name> --etl (ETL).
If found in both directories: Ask the user which one they mean and wait for a response.
For each DW connector, check that these files exist:
connectors/<name>/connector.pyconnectors/<name>/manifest.jsonconnectors/<name>/requirements.txtIf any are missing, stop and tell the user to run /create-connector <name> first.
Note: If connectors/<name>/Dockerfile.extra exists with system dependency instructions, those are automatically included in the agent image build — no extra steps needed.
For each ETL connector, check that these files exist:
etl_connectors/<name>/connector.pyetl_connectors/<name>/manifest.jsonIf any are missing, stop and tell the user to run /create-connector <name> --etl first.
ETL connectors do not require an export step — the manifest.json in etl_connectors/<name>/ is the single source of truth (status mappings are authored there directly). Skip Steps 2–4 and go directly to Step 5.
Check if output/<name>/manifest.json already exists:
ls output/<name>/manifest.json 2>/dev/null
If it exists: Ask the user whether to re-export or use the existing export. If they want to re-export, continue to Step 3. If they want to use existing, skip to Step 4.
If it doesn't exist: Continue to Step 3.
Run the full test suite with --export:
CONNECTOR=<name> docker compose run --rm test --export
This generates output/<name>/manifest.json and output/<name>/templates/. If tests fail, report the failures and stop — the connector needs fixing before an image can be built.
The agent image can bundle multiple connectors. Before building, check if there are other connectors in the repo that already have exports.
Scan for other exported connectors:
ls -d output/*/manifest.json 2>/dev/null
Any directory under output/ with a manifest.json is a connector that has been
previously exported and can be included.
If other exported connectors exist besides the one from $ARGUMENTS:
Present the user with the full list and ask which ones to include. Format the prompt like this:
The following connectors have been exported and can be included in the agent image:
oracle_db_11← the connector you just builtcockroachdb— previously exportedmicrosoft_fabric— previously exportedWhich connectors should be included? Options:
- all — include everything (default)
- only
oracle_db_11— just the one you're working on- Or list specific names, e.g.
oracle_db_11, cockroachdb
Wait for the user to respond before proceeding.
If no other exported connectors exist: Skip this step — the image will contain
only the connector from $ARGUMENTS.
Build the command from the detected types (Step 1) and the user's selection in Step 4.
All connector names (DW and ETL) are passed as positional arguments. The script auto-detects each connector's type from its directory.
echo y | python scripts/generate_agent_image.py \
<name1> <name2> <name3> \
--mode <mode>
Where:
<mode> is from arguments or defaults to auto (applies to DW connectors only)If the build succeeds, report:
custom-agent:latest-generic)docker run --rm --entrypoint ls <tag> /opt/custom-connectors/docker run --rm --entrypoint ls <tag> /opt/custom-etl-connectors/docker tag <tag> <your-registry>/<tag>
docker push <your-registry>/<tag>
connectors/<name>/credentials.json or etl_connectors/<name>/credentials.json) are already in the format needed for self-hosted credentials — just swap in production values: https://docs.getmontecarlo.com/docs/self-hosted-credentialsIf the build fails, read the Docker build output and diagnose:
docker pull the agent base imagerequirements.txt for correct package names