agentleFS
equinorequinor/fusion-skills/skills/fusion-infra-cli/SKILL.md

fusion-infra-cli

Skill2 starsChanged 2 months agoMITView on GitHub

Provision and migrate Fusion databases using the fusion-infra-cli (finf). USE FOR: provision a database for a service, run SQL migrations, provision PR-specific ephemeral databases, check database state. DO NOT USE FOR: application code changes, service deployments, role management, or infrastructure other than databases.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use when a Fusion service database needs to be provisioned or migrated — locally during development or inside CI/CD pipelines.

    line 26
  2. Distinctive:

    After provisioning, apply SQL migrations:

    line 133
  3. Very specific:

    Always use --verbose in pipelines to get diagnostic output

    line 170
  4. Very specific:

    Always save output with -o response.json so pipeline steps can reference the result

    line 171
  5. Very specific:

    Never pass raw tokens in pipeline YAML — use secret variables and pass via -t

    line 173

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Fusion Infra CLI

When to use

Use when a Fusion service database needs to be provisioned or migrated — locally during development or inside CI/CD pipelines.

Typical triggers:

  • "Provision the database for the context service"
  • "Run migrations on the QA database"
  • "Set up a PR database for this pull request"
  • "What does the database provision config look like?"
  • "The pipeline is failing on the database provision step"
  • "Create a PR database that copies from CI"

When not to use

  • Application code or service changes — use the service repo
  • Role or permission management — use fusion-roles-cli
  • Infrastructure other than databases (networking, storage, etc.)
  • Kubernetes or container management

Prerequisites

Install finf as a .NET global tool:

dotnet tool install --global \
  --add-source "https://statoil-proview.pkgs.visualstudio.com/Fusion%20-%20Packages/_packaging/Fusion-Public/nuget/v3/index.json" \
  Fusion.Infra.Cli

Update to latest:

dotnet tool update --global \
  --add-source "https://statoil-proview.pkgs.visualstudio.com/Fusion%20-%20Packages/_packaging/Fusion-Public/nuget/v3/index.json" \
  Fusion.Infra.Cli

Auth uses DefaultAzureCredential automatically (picks up az login session). Pass -t <token> to override.

Core workflow — provision a database

1. Create the provisioning config file

The config file defines the database resource. Minimal example (db-config.json):

{
  "name": "my-service",
  "environment": "ci"
}

Full config with SQL permissions:

{
  "name": "my-service",
  "environment": "fqa",
  "sqlPermission": {
    "owners": [
      { "clientId": "<app-registration-client-id>" }
    ],
    "contributors": [
      { "clientId": "<app-registration-client-id>" }
    ]
  }
}

See references/db-config-schema.md for the full schema.

2. Run provisioning

CI / non-production:

finf database provision -f db-config.json -e ci \
  --sql-owner-client-id <client-id> \
  --sql-contributor-client-id <client-id> \
  -o response.json --verbose

QA:

finf database provision -f db-config.json -e fqa \
  --sql-owner-client-id <client-id> \
  --sql-contributor-client-id <client-id> \
  -o response.json --verbose

Production (add --production flag):

finf database provision -f db-config.json -e fprd \
  --production \
  --sql-owner-client-id <client-id> \
  --sql-contributor-client-id <client-id> \
  -o response.json --verbose

Pull Request (ephemeral database, copies from CI):

finf database provision -f db-config.json \
  -e pr -pr <pr-number> -ghr "equinor/my-repo" -c ci \
  --sql-owner-client-id <client-id> \
  --sql-contributor-client-id <client-id> \
  --timeout 500 -o response.json --verbose

3. Run migrations

After provisioning, apply SQL migrations:

# Non-production
finf database migrate -d sql-myservice-fqa -m migrations/ \
  -o migrations.json --verbose

# Production
finf database migrate -d sql-myservice-fprd -m migrations/ \
  --production -o migrations.json --verbose

The -m flag accepts a directory of .sql files or a single .sql file.

Environments

KeyPurpose
ciContinuous integration
fqaQA / pre-production
fprdProduction (requires --production flag)
prPull request ephemeral (requires -pr and -ghr)

Full reference

For complete flag reference, run:

finf database provision --help
finf database migrate --help

Or see the source documentation:

Safety

  • Always use --verbose in pipelines to get diagnostic output
  • Always save output with -o response.json so pipeline steps can reference the result
  • The --production flag is an explicit guard — never omit it for fprd provisioning
  • Never pass raw tokens in pipeline YAML — use secret variables and pass via -t
  • database delete is irreversible for non-PR databases — confirm with user before running

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.