Strategies

Strategies are reusable “finalization steps” that run after an AIKP produces outputs. They exist to keep the workflow consistent across AIKPs while still allowing AIKP-specific overrides.

Why strategies exist

Most AIKP workflows need the same three post-processing steps:

  1. makegeojson

    • Produces the UI/DB-facing metadata document.

    • This metadata connects the output artifact(s) to the UI by describing where files live (COS keys/URLs), how they should be displayed, and what the document bounding geometry is.

  2. upload

    • Uploads the produced artifacts (and the generated metadata) to Cloud Object Storage (COS).

  3. publish

    • Registers (posts) the metadata document into the documents database so it becomes visible/available in the UI.

The strategy layer exists so:

  • AIKPs can share the same default implementation of these steps.

  • AIKPs can override only the parts they need, without re-implementing the whole CLI workflow.

What strategies exist

Vector strategies

Vector strategies are reusable implementations specifically for AIKPs that produce vector outputs.

Default (core) strategies

Default strategies are the core implementations used when an AIKP does not override behavior.

How to use strategies (CLI)

The standard “finalization pipeline” is:

  1. Create metadata:

ai makegeojson
# optional examples
ai makegeojson --friendly-name "My Layer"
ai makegeojson --cos-key "+v2"
  1. Upload artifacts + metadata to COS:

ai upload
# or
ai upload --dry-run
  1. Publish the metadata document to the docs DB:

publish post
# or
publish post --dry-run

Notes:

  • --cos-key and --friendly-name are commonly used to override identity without changing recipe defaults.

  • If --friendly-name or --cos-key starts with +, it is treated as a suffix.

How to create custom strategies

AIKPs can override strategies in a supported way (recommended), or via a legacy module mapping approach.