agentleFS
sriramvrinda-osssriramvrinda-oss/oci-db-management-mcp-server/skills/oci-dbm-provision/SKILL.md

oci-dbm-provision

Skill3 starsChanged 7 months agoMITView on GitHub

Provisions a new Autonomous Database (ADB) with private endpoint and TLS-only access. Skipped automatically by oci-dbm-commission if the ADB already exists. Trigger when a user says "create an ADB for DBM", "provision a new autonomous database", or when oci-dbm-commission directs here for fresh provisioning.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 3 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Call DatabaseClient.list_autonomous_databases(compartment_id=compartment_ocid, display_name=display_name) and filter for results with …

    line 35
  2. Very specific:

    If a matching ADB is found: print its OCID and lifecycle state, confirm with the user, and skip creation.

    line 37
  3. Distinctive:

    If not found, proceed to Step 2.

    line 38
  4. Very specific:

    Call DatabaseClient.create_autonomous_database() with CreateAutonomousDatabaseDetails containing:

    line 42
  5. Very specific:

    Do NOT pass vault_id, secret_id, or any secret-related fields to CreateAutonomousDatabaseDetails — those fields are not used for the admin …

    line 58
  6. Very specific:

    Fail fast: if lifecycle_state is TERMINATED or FAILED — print the error and stop.

    line 65
  7. Distinctive:

    Before handing off, verify:

    line 97
  8. Distinctive:

    Do not proceed if either check fails.

    line 101

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

oci-dbm-provision

This skill is a worker in the oci-dbm-commission chain. It does NOT generate scripts. It uses the OCI Python SDK directly to provision a new Autonomous Database configured for private endpoint access and TLS-only connectivity.

This skill is skipped automatically by oci-dbm-commission when the target ADB already exists. If the ADB is found, this skill confirms its OCID and outputs it without creating anything.


Inputs

These values are passed by oci-dbm-commission (or supplied directly by the user):

InputDescriptionDefault
compartment_ocidOCID of the compartment to create the ADB inrequired
db_nameShort alphanumeric database name (no spaces, max 14 chars)required
display_nameHuman-readable display name for the ADBrequired
admin_passwordPassword for the ADMIN user — used directly at creation timerequired
subnet_ocidOCID of the private subnet for the ADB private endpointrequired
compute_countNumber of ECPUs2
storage_tbsStorage in terabytes1
workloadWorkload type: OLTP, DW, AJD, or APEXOLTP

What This Skill Executes

Step 1 — Check Whether ADB Already Exists

Call DatabaseClient.list_autonomous_databases(compartment_id=compartment_ocid, display_name=display_name) and filter for results with lifecycle_state not in ['TERMINATED', 'TERMINATING'].

  • If a matching ADB is found: print its OCID and lifecycle state, confirm with the user, and skip creation. Output the existing adb_ocid and proceed to Step 4 to collect connection details.
  • If not found, proceed to Step 2.

Step 2 — Create the ADB

Call DatabaseClient.create_autonomous_database() with CreateAutonomousDatabaseDetails containing:

FieldValueReason
compartment_idcompartment_ocidtarget compartment
db_namedb_nameshort name
display_namedisplay_namehuman label
admin_passwordadmin_passwordset at creation — NOT via vault
subnet_idsubnet_ocidplaces ADB in VCN via private endpoint
compute_model'ECPU'required — OCPU is deprecated
compute_countcompute_count (min 2)ECPU count
data_storage_size_in_tbsstorage_tbsstorage allocation
db_workloadworkloade.g. 'OLTP'
is_mtls_connection_requiredFalseTLS-only; recommended with PE
license_model'LICENSE_INCLUDED'standard licensing

Do NOT pass vault_id, secret_id, or any secret-related fields to CreateAutonomousDatabaseDetails — those fields are not used for the admin password and will cause errors.

Step 3 — Poll Until Available

Poll DatabaseClient.get_autonomous_database(adb_id=adb_ocid) every 2.5 minutes (150 seconds).

  • Continue until lifecycle_state == 'AVAILABLE'.
  • Fail fast if lifecycle_state is TERMINATED or FAILED — print the error and stop.
  • Print status on each poll: [HH:MM:SS] lifecycle_state = PROVISIONING ...

Step 4 — Print and Output Connection Details

Once the ADB is AVAILABLE (or was pre-existing), retrieve:

  • adb.id — the ADB OCID
  • adb.private_endpoint_ip — private IP within the VCN
  • adb.private_endpoint — private hostname
  • adb.connection_strings.medium — the full qualified service name for DBM enablement

Print all four values clearly.

The connection_strings.medium value has the format:

<prefix>_<dbname>_medium.adb.oraclecloud.com

Example: ep8c8t82piuc9mv_dbmdemo_medium.adb.oraclecloud.com

Output the following values for the next skill:

adb_ocid: <ocid>
full_service_name: <connection_strings.medium value>
compartment_ocid: <ocid>
provision_complete: true

Confirmation Before Finishing

Before handing off, verify:

  • DatabaseClient.get_autonomous_database() returns lifecycle_state = AVAILABLE
  • connection_strings.medium is non-empty and contains the expected <dbname> substring

Do not proceed if either check fails.


What This Skill Hands Back

Outputs passed to oci-dbm-commission (and subsequently to oci-dbm-enable):

  • adb_ocid — OCID of the available ADB
  • full_service_name — the full qualified service name from connection_strings.medium
  • compartment_ocid — unchanged, forwarded for downstream skills
  • provision_complete: true — signal that this step completed successfully

Gotchas

Gotcha 1 — Always use ECPU, never OCPU.

compute_model='OCPU' is deprecated for new ADB creation. Use compute_model='ECPU' with compute_count set to a minimum of 2. Passing OCPU may succeed today but will be rejected in future API versions without warning.

Gotcha 2 — Do NOT pass vault/secret fields for the admin password.

CreateAutonomousDatabaseDetails does have vault-related fields, but they are for a different feature (customer-managed encryption keys), not for the ADMIN password. Pass admin_password directly as a plain string. Mixing these up produces cryptic 400 or 412 errors.

Gotcha 3 — Save connection_strings.medium — you will need it in oci-dbm-enable.

The DBM enablement API requires the full qualified service name, not the short db_name. This value is only reliably obtained from adb.connection_strings.medium after the ADB is provisioned. If it is lost, you must call get_autonomous_database() again to retrieve it before running oci-dbm-enable.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.