with one click
invowk-schema
// Schema guidelines for invowkfile.cue and samples/invowkmods/*.invowkmod, cross-platform runtime patterns, command implementations, capability checks, environment variables.
// Schema guidelines for invowkfile.cue and samples/invowkmods/*.invowkmod, cross-platform runtime patterns, command implementations, capability checks, environment variables.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | invowk-schema |
| description | Schema guidelines for invowkfile.cue and samples/invowkmods/*.invowkmod, cross-platform runtime patterns, command implementations, capability checks, environment variables. |
| disable-model-invocation | false |
Use this skill when:
invowkfile.cue root example filesamples/invowkmods/invowkfile.cue at project root)enable_host_ssh).depends_on (container only — validated inside the container environment, not on host).invowkmod.cue for modules.depends_on Pattern (Container Only)depends_on can be placed inside a container runtime block to validate against the container's own environment (not the host). This is distinct from root/command/implementation-level depends_on, which always validates against the host system. Runtime-level depends_on is only available for the container runtime — native and virtual runtimes do not support it (CUE schema rejects it at parse time).
runtimes: [{
name: "container"
image: "debian:stable-slim"
// Validated INSIDE the container
depends_on: {
tools: [{alternatives: ["python3"]}]
}
}]
// Validated on the HOST
depends_on: {
tools: [{alternatives: ["docker"]}]
}
Commands with positional arguments (args) cannot have subcommands. This is enforced during command discovery and module validation.
Why: CLI parsers interpret positional arguments after a command name as potential subcommand names. If deploy has both args: [{name: "env"}] and a subcommand deploy staging, running invowk cmd deploy prod is ambiguous—is prod an argument or a subcommand name?
Valid:
// Leaf command with args (no subcommands)
cmds: [
{name: "deploy", args: [{name: "env"}], ...}
]
// Parent command with subcommands (no args on parent)
cmds: [
{name: "deploy"}, // No args here
{name: "deploy staging"}, // Subcommand
{name: "deploy prod"}, // Subcommand
]
Invalid:
cmds: [
{name: "deploy", args: [{name: "env"}], ...}, // Has args
{name: "deploy staging", ...} // Is a subcommand of deploy
]
// Error: command 'deploy' has both args and subcommands
This validation runs:
invowk cmd execution (command discovery)invowk validate <module-path>Bash scripts with native+virtual runtimes must use platform-specific implementations.
The problem: The native runtime on Windows uses PowerShell (or cmd), which cannot parse bash syntax. When a command declares runtimes: [{name: "native"}, {name: "virtual"}], the first runtime (native) becomes the default. This causes bash scripts to fail on Windows with PowerShell parser errors.
The solution: Split implementations by platform:
runtimes: [{name: "native"}, {name: "virtual"}] with platforms: [{name: "linux"}, {name: "macos"}]runtimes: [{name: "virtual"}] with platforms: [{name: "windows"}] (virtual runtime uses mvdan/sh, a cross-platform POSIX shell)Valid (platform-specific implementations):
implementations: [
{
script: """
echo "Hello from bash"
if [ -f /etc/os-release ]; then
cat /etc/os-release
fi
"""
runtimes: [{name: "native"}, {name: "virtual"}]
platforms: [{name: "linux"}, {name: "macos"}]
},
{
script: """
echo "Hello from bash"
if [ -f /etc/os-release ]; then
cat /etc/os-release
fi
"""
runtimes: [{name: "virtual"}]
platforms: [{name: "windows"}]
},
]
Invalid (bash script without platform restriction):
implementations: [
{
script: """
echo "Hello from bash"
if [ -f /etc/os-release ]; then
cat /etc/os-release
fi
"""
runtimes: [{name: "native"}, {name: "virtual"}]
// Missing platforms restriction - will fail on Windows!
},
]
When to apply this pattern:
Exceptions (no split needed):
runtimes: [{name: "virtual"}] only (already cross-platform)runtimes: [{name: "native"}] only and platforms: [{name: "linux"}, {name: "macos"}] (Linux/macOS only)Native-only platform-split pattern (for testing):
When writing native runtime mirror tests (native_*.txtar), use native-only implementations without a virtual fallback:
implementations: [
{
script: """
echo "Hello from native shell"
echo "VAR=$MY_VAR"
"""
runtimes: [{name: "native"}]
platforms: [{name: "linux"}, {name: "macos"}]
},
{
script: """
Write-Output "Hello from native shell"
Write-Output "VAR=$($env:MY_VAR)"
"""
runtimes: [{name: "native"}]
platforms: [{name: "windows"}]
},
]
When to use native-only vs native+virtual:
runtimes: [{name: "native"}]): For test files that specifically validate native shell behavior on each platform. Used in native_*.txtar mirror tests.runtimes: [{name: "native"}, {name: "virtual"}]): For production commands that prefer native shell but fall back to virtual shell. Requires the standard platform-split pattern (see above) to avoid PowerShell parsing bash syntax on Windows.samples/invowkmods/ directory)The samples/invowkmods/ directory contains sample modules that serve as reference implementations, validation tests, and audit fixtures.
.invowkmod directory containing invowkmod.cue (metadata) and invowkfile.cue (commands).pkg/invowkmod/invowkmod_schema.cue and the invowkfile schema in pkg/invowkfile/invowkfile_schema.cue.go run . validate samples/invowkmods/io.invowk.sample.invowkmod.samples/invowkmods/com.example.audit.*.invowkmod should be verified with invowk audit, not normal validation.io.invowk.sample.invowkmod - Minimal cross-platform module with a simple greeting command.com.example.audit.deterministic.invowkmod - Intentionally unsafe fixture covering deterministic audit checkers.com.example.audit.llm.subtle.invowkmod - Semantic fixture for LLM-backed audit checks.When modifying module-related code, verify:
samples/invowkmods/ pass validation: go run . validate samples/invowkmods/io.invowk.sample.invowkmod.invowkmod.cue is required and parsed; invowkfile.cue contains only commands.pkg/invowkmod/ tests pass: go test -v ./pkg/invowkmod/....| Pitfall | Symptom | Fix |
|---|---|---|
| Stale sample modules | Validation fails after schema changes | Update safe samples in samples/invowkmods/ after module-related changes |
| Missing platform restrictions | Bash scripts fail on Windows | Add platform-specific implementations for native+virtual runtimes |
| Args with subcommands | Discovery validation error | Commands with positional args cannot have subcommands |
Treating Unix /... paths as universally absolute in config tests | Windows short CI fails on include path validation | For includes fixtures, use t.TempDir() + filepath.Join(...) and keep relative negatives explicit |
For path handling in implementations, see .agents/rules/windows.md.