Agent skill

Author Hook Policy

by LunCoSim in LunCoSim/lunco-sim

Declare, bind, inspect, and test a LunCoSim function-shaped Rhai hook policy through the owner macro and authored policy manifest.

Apache-2.0Auto-check passed

Install Author Hook Policy

skills CLI
$ npx skills add LunCoSim/lunco-sim --skill author-hook-policy -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install LunCoSim/lunco-sim author-hook-policy --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/LunCoSim/lunco-sim.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/author-hook-policy .claude/skills/author-hook-policy && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
author-hook-policy
GitHub stars
107
Token cost
~3k tokens
SKILL.md length
1,470 words
Files
1
Skills in repo
40
Repo updated
First seen
Licence
Apache-2.0

At a glance

Declare, bind, inspect, and test a LunCoSim function-shaped Rhai hook policy through the owner macro and authored policy manifest.

  • SKILL.md covers Read first, Declare the seam at its owner, Author and select the policy and Inspect and test, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Author Hook Policy is an agent skill from LunCoSim/lunco-sim. Declare, bind, inspect, and test a LunCoSim function-shaped Rhai hook policy through the owner macro and authored policy manifest.

Its SKILL.md is about 3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It works with Rust. The repository describes itself as: Collaborative Multiphysics Cosimulator For Space Missions 🌎🚀🌚. The licence is Apache-2.0.

Example prompts

  • “/author-hook-policy”

What it can do on your machine

Read from SKILL.md and the folder at commit 43f1301. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are rust and toml).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Author Hook Policy loads about 3k tokens when it runs. Until then it costs about 37 tokens; SKILL.md has 1,470 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~37
When it runs · the whole SKILL.md, loaded when a task matches
~3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from LunCoSim/lunco-sim at commit 43f1301, republished under its Apache-2.0 licence (© LunCoSim). 1,470 words, ~2,956 tokens.

Download SKILL.mdSave it as .claude/skills/author-hook-policy/SKILL.md (or your agent's skills folder).
name
author-hook-policy
description
Declare, bind, inspect, and test a LunCoSim function-shaped Rhai hook policy through the owner macro and authored policy manifest.

Author a hook policy

Use this skill when a decision should be changeable without recompiling the engine. A hook is a function-shaped seam: Rust publishes a small typed fact boundary and Rhai supplies the policy implementation.

Treat hook candidacy as a mandatory design step. Prefer a hook for changeable lifecycle, routing/selection, presentation, permission, deployment, or Twin-specific behavior. A hook may expose substantial behavior with nested maps/arrays and return a typed decision or action plan. Its owner must validate and consume that result through a generic mechanism; use Unit for a pure notification and never leave a decision result unread. Keep continuous math, kinematics, dynamics, invariants, and hot paths in Rust or Modelica. Before adding a Rust branch, identify the owner, fact inputs, result consumer, installation scope, lifecycle, failure/required semantics, and the production Rhai test.

Read first

Declare the seam at its owner

Place one lunco_hooks::declare_hook! invocation beside the owner’s hook id and decision function. It is collected automatically; do not edit a central list. Declare the function-shaped ABI with named parameters and a HookValueType for each parameter and the result:

rust
lunco_hooks::declare_hook! {
    id: MY_HOOK,
    owner: "my-owner",
    description: "Choose a generic engine action from authored facts.",
    signature: [ctx: Map],
    output: String,
    deterministic: false,
    required: false,
    installable: true,
}

Keep the map contents as owner facts, not a second ad-hoc registry. Use a deterministic contract only when identical inputs must produce the same result on every peer. Set required only when the generic mechanism cannot operate safely without a policy.

For scheduled or async owner work, consume the runtime_context supplied by the hook owner and reject calls from the wrong cycle or phase. The owner must capture the context before dispatch, preserve it through worker completion, and reject stale results before publication. Test the scheduled path and an intentional off-cycle call in production authored Rhai.

Author and select the policy

Put the implementation in assets/scripting/policy/<name>.rhai and add one entry to assets/scripting/policy/index.toml:

toml
kind = "lunco.policy.v1"
scope = "application" # use "twin" for a Twin-owned manifest

[[policies]]
hook = "my.hook"
source = "my_policy.rhai"
entry = "decide"
deterministic = false
required = false

The required scope separates application policy discovery from the mounted Twin's twin policy layer. The manifest's single [startup] entry names the Rhai function that receives and installs all resolved policy records. The application manifest is loaded at simulation startup. A Twin may provide its own uniquely marked scope = "twin" policy manifest; its matching entries replace application records before its own startup function runs when that Twin becomes active. The Twin startup function receives the Twin-owned records; application policies remain active for seams the Twin does not replace. A Twin manifest that contains policy records must declare its own [startup] source and entry; an empty Twin policy directory may omit it. Do not add a Rust-side policy list or a second bootstrap path. Twin policy manifests are selected from the mounted Twin's indexed file inventory, so keep them inside that Twin root; activation does not rescan the directory tree. When skip_when_hook_unavailable = true, the runtime omits the policy only when that hook owner is not linked into the selected build and reports its id in policy_status().unavailable. Source, compile, and activation failures remain visible, and required policies cannot use this flag. The source path is resolved by the asset/storage layer. Do not read policy files through std::fs in a runtime/domain crate.

Inline bind_policy(id, entry, source) is useful for a local non-deterministic experiment. It must not claim a deterministic contract. Use unbind_policy to remove exactly that implementation; reloading the authored manifest is the explicit operation that installs the authored policy again.

For a trusted native implementation, add an explicit [[native_plugins]] entry to the Twin manifest. Use a portable Twin-relative path without a root, volume, parent traversal, or alternate data stream. The loader checks canonical containment before admitting a library, including symlinks and Windows junctions. The provider must implement an existing reflected installable hook and return the declared typed result through the native ABI; it does not declare a second hook list or mutate the owner's ECS/USD state. Use a native provider for expensive or platform-specific computation, not for changeable product policy. An eventual terrain provider belongs at the consumed lunco-terrain-bake boundary.

Show full SKILL.md (784 more words)Show less

Inspect and test

Use list_hooks() to inspect the reflected declaration. It reports parameters: [{name, type}], output, ownership, policy binding, determinism, requirement, and installation state. Use policy_status() for startup/Twin load diagnostics and the last typed Twin lifecycle result. The owner must consume every non-Unit result; the lifecycle dispatcher retains its returned map and exact invocation context in that status surface. Twin lifecycle calls use a Twin/Lifecycle route whose generation is the mounted Twin's nonzero TwinId; startup/reload, asset events, and teardown use Start, Event, and Stop phases with no elapsed clock. The assets_mounted lifecycle event receives the parsed Twin manifest, indexed relative paths, exact twin:// authority, and active-Twin fact. Its ordered {command, params} actions go through the generic typed command bridge; Rhai chooses loaders and order, while each domain owner validates paths and performs asynchronous work. A malformed plan faults and queues no commands; a rejected command is reported while later actions continue. invoke_hook(id, [args]) distinguishes unavailable hooks from installed functions that fault.

Scheduled owner calls supply an immutable runtime_context map with their route, cycle, phase, clock, and logical sequence. If a policy is valid only in one cycle, reject other contexts and verify the real scheduled owner path in an authored production test. For example, readiness.action runs under Core/Simulation/Behavior with fixed-clock time and the latest SimTick; its policy rejects direct calls from other cycles. Physics initialization is a discrete lifecycle decision: use the required physics.initialization(facts) seam, a generation-qualified Twin/Lifecycle/Preparation route, and no clock sample. Its stable facts include the selector, validation status, pose, assembly size, and measured penetration when present. accept admits the authored pose unchanged, pause disables the validated penetrating assembly and removes it from scene readiness, and reject keeps it held. The shipped Application policy pauses measured terrain penetrations and remains installed across Twin reloads; a mounted Twin may replace it. Keep authored selector names in facts.policy; do not construct dynamic hook ids or expose process-local ECS entity ids as deterministic policy facts.

The application twin.lifecycle policy selects the active Twin's default USD scene, tool libraries, timeline data, SysML/KerML sources, and Modelica roots from its typed manifest and indexed file inventory. Loader commands keep only generic ownership, safe-path, asset-read, and domain-registration mechanics.

For application UI contributions, reuse the optional application.asset.lifecycle(event, ctx) hook. The shared asset layer emits JSON-scope loading/changed events after asynchronous reads, including the canonical asset_root_uri; the Rhai policy can parse each record with parse_json(text) and return a generic menus tree. Scene completion is also delivered with the canonical loaded path and root_prim; return selected declared dataset ids in dataset_text_artifacts when the scene needs their text. The Rust host validates the complete action map, while DatasetArtifactPlugin resolves each registry id to its canonical asset URI and reads through the shared TextAsset loader. Missing or unreadable requested datasets are reported; unrequested datasets remain quiet. SceneTransitionStarted retires pending reads. Keep asset selection and menu policy in Rhai; Rust owns typed lifecycle facts, safe asset delivery, action-shape validation, rendering, and provider cleanup.

Put policy and observable runtime assertions in an authored Rhai production scene test. Cover the declared signature, successful binding/invocation, missing-policy status, rejected deterministic inline binding, and exact unbinding. Keep Rust coverage to the low-level HookValue conversion and registry mechanics; do not embed long USD or load Twin assets in Rust tests.

The primary USD scene lifecycle also owns required deterministic usd.scene_composition(facts: Map) -> Map for incomplete composition closures. Its facts contain the scene address and ordered unresolved arcs. The shipped application policy returns #{action: "allow_partial"} to preserve the existing partial-load behavior; a Twin may replace it with reject_scene. The owner invokes it after structural projection but before releasing the simulation hold. Rejection tears down the partial primary scene, and missing, faulting, or malformed policy results fail admission visibly. Keep the loader's missing-arc warning and the policy's admission decision as separate owner responsibilities.

Handoff

Report the owner-side declaration, manifest/source files, reflected signature, failure semantics, focused checks, and the production Rhai test evidence.

Scene avatar availability

lunco-camera-core declares camera.scene_avatar(ctx: Map) -> Map independently of camera selection. The windowed camera owner calls it in Application/Presentation/Preparation on scene/projection/policy changes. The application policy returns create: bool and, for creation, bindings containing [intent, port, f64 factor] rows. Rust validates the shared control vocabulary, installs the scene-owned transient rig, and reports invalid results through the camera contract. The rig has no USD prim identity and does not enter saved layers. Keep director/operator selection independent of avatar availability; reuse an authored avatar and retire transient rigs at scene teardown.

Verify both avatar-free and authored-avatar cases with scene_avatar_presence.rhai in an owned windowed production session, supplying its exact doc_id and authored_avatar_path (unit for a transient avatar). The scenario saves an ignored artifact and compares all document layers. The production test_hook_policies.rhai covers declaration and off-cycle rejection.

© LunCoSim, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/author-hook-policy of LunCoSim/lunco-sim.

Open the folder on GitHubat commit 43f1301

Compare with similar skills

Author Hook Policy next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Author Hook Policy compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Author Hook Policy this skillLunCoSim/lunco-sim107—~3kAutomated safety check: PassApache-2.0
Update V8 Versionopeninterpreter/openinterpreter69k2 repos~845Automated safety check: PassApache-2.0
Firecrawl Page Scrape Integrationfirecrawl/firecrawl190k1 repos~944Automated safety check: PassISC
Migrate Core Code to Submodulestinyhumansai/openhuman42k—~2.6kAutomated safety check: PassGPL-3.0
Rust TDD Workflowrtk-ai/rtk83k—~753Automated safety check: NotesApache-2.0
OpenLogi macOS Permissions TriageAprilNEA/OpenLogi23k—~2.5kAutomated safety check: NotesApache-2.0

Similar skills

  • Update V8 Version

    openinterpreter/openinterpreter

    Bumps the pinned v8 and rusty_v8 versions in Codex, validates the release-candidate path with the v8-canary check, and traces failures to upstream build changes.

    69k GitHub starsUsed in 2 repos~845 tokens
    DevOps & CloudAuto-check passed
  • Adds Firecrawl's /scrape endpoint to application code to pull markdown, HTML, links, screenshots or structured data from a single known URL.

    190k GitHub starsUsed in 1 repo~944 tokens
    Data & AnalyticsAuto-check passed
  • Migrate Core Code to Submodules

    tinyhumansai/openhuman

    Plans and carries out moving non-host-specific code and its tests from the OpenHuman core into vendored tiny submodule libraries, then releases the submodule and re-pins the host.

    42k GitHub stars~2.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Enforces red-green-refactor for Rust work, with idiomatic test patterns, a naming convention and a pre-commit gate of cargo fmt, clippy and test.

    83k GitHub stars~753 tokensUpdated yesterday
    Testing & QAAuto-check: notes
  • Decides whether an OpenLogi device problem on macOS is a privacy-permission (TCC) problem, using agent log lines, and says which identity needs which grant.

    23k GitHub stars~2.5k tokensUpdated yesterday
    DevelopmentAuto-check: notes
  • Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook.

    5.6k GitHub starsUsed in 3 repos~1.1k tokens
    DevelopmentAuto-check passed

More from LunCoSim/lunco-sim

All 40 skills in this repo
  • Nightly Changelog

    LunCoSim/lunco-sim

    Generate concise LunCoSim nightly GitHub release notes with platform downloads, installation guidance, an AI-agent mission prompt, and a changelog link.

    107 GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Build or repair a reusable scene component through a live LunCoSim Editor session.

    107 GitHub stars~4.4k tokensUpdated today
    Auto-check passed
  • Assembly Quality

    LunCoSim/lunco-sim

    Build or review a componentized LunCoSim USD assembly with a realistic, dimensionally checkable presentation.

    107 GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Author Rhai Tests

    LunCoSim/lunco-sim

    Author and review LunCoSim behavioral, asset-backed, component, mission, visual, and requirements-verification tests.

    107 GitHub stars~3.5k tokensUpdated today
    Auto-check passed
  • Author Rhai Tool

    LunCoSim/lunco-sim

    Create, extend, register, or debug a reusable LunCoSim Rhai tool library for live USD authoring, component linting, inspection, or test support.

    107 GitHub stars~5.2k tokensUpdated today
    Auto-check passed
  • Author Tutorial

    LunCoSim/lunco-sim

    Author an interactive tutorial, guided lesson, onboarding flow, coach-mark tour, or objectives checklist in LunCoSim.

    107 GitHub stars~1.4k tokensUpdated today
    Auto-check passed

Works with

Questions about Author Hook Policy

What does Author Hook Policy do?

Declare, bind, inspect, and test a LunCoSim function-shaped Rhai hook policy through the owner macro and authored policy manifest. Author Hook Policy is an agent skill from LunCoSim/lunco-sim. Declare, bind, inspect, and test a LunCoSim function-shaped Rhai hook policy through the owner macro and authored policy manifest.

How do I install Author Hook Policy in Claude Code?

Run `npx skills add LunCoSim/lunco-sim --skill author-hook-policy -a claude-code`. Or copy the skill folder (skills/author-hook-policy in LunCoSim/lunco-sim) into .claude/skills/author-hook-policy in your project. Claude Code loads it when a task matches its description.

How do I install Author Hook Policy in Codex?

Run `npx skills add LunCoSim/lunco-sim --skill author-hook-policy -a codex`. Or copy the skill folder (skills/author-hook-policy in LunCoSim/lunco-sim) into .agents/skills/author-hook-policy in your project. Codex loads it when a task matches its description.

Can I use Author Hook Policy in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add LunCoSim/lunco-sim --skill author-hook-policy -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/author-hook-policy, .gemini/skills/author-hook-policy, .github/skills/author-hook-policy and .opencode/skills/author-hook-policy in your project.

What does Author Hook Policy need to run?

SKILL.md names no scripts, command-line tools or credentials: Author Hook Policy is instructions for the agent only.

Does Author Hook Policy access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Author Hook Policy safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Author Hook Policy use?

Author Hook Policy is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Author Hook Policy use?

About 3k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Author Hook Policy?

Skills that share tags, products or a category with Author Hook Policy: Update V8 Version (openinterpreter/openinterpreter, 69k stars), Firecrawl Page Scrape Integration (firecrawl/firecrawl, 190k stars), Migrate Core Code to Submodules (tinyhumansai/openhuman, 42k stars) and Rust TDD Workflow (rtk-ai/rtk, 83k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Author Hook Policy?

LunCoSim (a GitHub organization) maintains it in LunCoSim/lunco-sim, which has 107 GitHub stars. The repository holds 40 skills in this directory. The repository was last updated on October 10, 2026.

Source: LunCoSim/lunco-sim on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.