Compile durable constraints into OpenViking Rules with rules/compile. Use when the user asks to add rules or import a policy. Do not use for preferences, facts, or rule search.
83%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Low
Low-risk findings worth noting
Use POST /api/v1/rules/compile to compile user-authorized durable constraints into
OpenViking Rules, then verify the task result and saved Rules.
Identify the user's rule text or policy sources and the intended OpenViking connection. Use the same instance and identity for upload, compilation, task polling, and verification.
Choose exactly one invocation mode for the entire workflow:
Build a request with top-level instruction and sources; at least one must be non-empty.
Preserve the source's obligations, applicability conditions, exceptions, thresholds,
and identifiers without inventing policy.
Continue only with the selected mode and use its exact parameter shape:
Python SDK mode
options supports sources. Each source may be a local file or directory path, a
remote URL, a Resource URI, or an advanced source dictionary. The SDK uploads local
paths automatically.
task = client.rule_compile(
instruction="Compile the supplied policy into durable Rules.",
options={
"sources": [
"/local/path/policy.md",
"https://example.org/policy.md",
"viking://resources/team-policy",
]
},
)
task_id = task["task_id"]Poll with client.get_task(task_id) and read saved content with
client.read_raw(uri).
HTTP mode
HTTP has no options wrapper. Put instruction and sources directly in the JSON
body. Use resource_uri for an existing Resource, path for a remote text source,
or temp_file_id returned by POST /api/v1/resources/temp_upload for local content.
{
"instruction": "Compile the supplied policy into durable Rules.",
"sources": [
{"resource_uri": "viking://resources/team-policy"},
{"path": "https://example.org/policy.md"},
{"temp_file_id": "tmp_xxx", "source_name": "policy.md"}
]
}Submit this body to POST /api/v1/rules/compile. Never send a client-local path to
that endpoint. Poll GET /api/v1/tasks/{task_id} and read saved content through
GET /api/v1/content/read?uri=...&raw=true.
Save the returned task_id; acceptance does not mean compilation has completed.
Poll using the selected mode until the task is completed, failed, or cancelled. Query the existing task rather than resubmitting the request.
Inspect result.operations, written_uris, and write_result. Distinguish saved
Rules from NOOP, UNCERTAIN, and REJECT results; completed does not guarantee new Rules.
Read representative saved Rules and their Scenarios using the selected mode. Check the
policy text and evidence, and verify rules/<scenario_id>/abstract.md holds Scenario
metadata while Rule files sit directly beside it as <atomic_id>.md.
Report the task ID, actual changes, representative URIs, and unresolved decisions.
applies_when conditions supported by the source.
Empty applies_when means applicable in every situation except exception, not unknown.volcengine/OpenViking
a17f974
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.