Naming Conventions
Validation rules for Polycrate identifiers: the lowercase slug for workspace, organization, action and workflow names, block names, and the extended metadata name with valid and invalid examples.
Naming Conventions
Polycrate validates identifiers with different rules depending on the object type. The CLI implementation can be found in cmd/vars.go (constants ValidateSlugRegex, ValidateMetaDataNameRegex, ValidateBlockNameRegex). The Blocks page refers to this article for block directories and instances.
Slug (lowercase)
For name and organization in workspace.poly as well as for name of actions (block.poly) and workflows (workspace.poly) the same slug validation applies:
^[a-z][a-z0-9-]*$
In short:
- Starts with a lowercase letter (
a–z). - Followed only by lowercase letters, digits or single hyphens (
-). - No spaces, no slashes and no double hyphens (e.g.
my--appis invalid).
Valid: install, do-backup, v2-deploy, run-migrations
Invalid: _install, 123-test, My-App (uppercase letters), install--twice
→ Details and invocation with polycrate run: Actions
Block names (name in block.poly)
The block name is validated separately in the CLI with the block_name validator (including local names and registry paths with /). It is not identical to the slug for actions or workspaces.
Conventions and examples: Blocks – Naming convention
Extended metadata name
For Metadata.name (e.g. Hub/API metadata) the CLI can use metadata_name:
^[a-zA-Z]+([-/_]?[a-zA-Z0-9_]+)+$
In short:
- Starts with a letter (
a–z,A–Z). - Followed by at least one further segment: optionally a single separator (
-,/or_), followed by letters, digits or underscores.
Allowed and invalid examples (metadata name)
Allowed:
postgres-base
my-app
my_app
infra/postgres-base
team/apps/webapp
Not allowed:
_postgres # must start with a letter
123-app # must start with a letter
my app # space
Demo GmbH # disallowed special characters
my--app # double hyphen