[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M72W9Q6J2NERGRQDHKY2P51Z":3,"skill-same:01M72W9Q6J2NERGRQDHKY2P51Z":45},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M72W9Q6J2NERGRQDHKY2P51Z","hook-authoring",null,"Write and verify pycro-manager acquisition hooks and saved analysis adapters.","Micro-Claw\u002Fmicroclaw","Micro-Claw","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F320137264?v=4","01M72W9AP162N8788QFVMKTN9H","MicroClaw","01M72W9APY8G657Y1VN8K9S04G",10,"BSD-3-Clause","https:\u002F\u002Fgithub.com\u002FMicro-Claw\u002Fmicroclaw\u002Fblob\u002Fmain\u002Fmicroclaw\u002Fskills\u002Fhook-authoring\u002FSKILL.md",[],[],"2026-11-10 22:39:42",false,"---\nname: hook-authoring\ndescription: Write and verify pycro-manager acquisition hooks and saved analysis adapters.\n---\n\n# pycro-manager hook API reference\n\nReturned by `load_skill(name=\"hook-authoring\")`.\n\n## Integrating the user's own analysis\n\nExternal analysis packages are integrated by writing an adapter hook, not by\nadding a microclaw tool for each package. The adapter translates pycro-manager's\nimage\u002Fevent contract into the package's existing interface and translates its\nresult into logging, filtering, acquisition branching, or guarded follow-up\nevents.\n\n### What to ask the user\n\nStart in biological\u002Fworkflow language. Usually ask only these three questions,\none at a time if that is easier:\n\n1. **What existing workflow do you use, and can you point me to it?** A package\n   name or web page is enough; even better is the app, notebook, script, project,\n   model, environment, or repository they currently run. Ask them to describe\n   how they start it today (for example, “open this project and press Run”).\n2. **Can you show me one example that works?** Ask for a representative input\n   and its result. The user may explain the result biologically (“these outlined\n   cells are the ones I want”); do not require them to name arrays, dtypes,\n   coordinate systems, APIs, or command-line arguments.\n3. **What should the microscope do with the result?** Examples: record a score,\n   make a map, keep images containing the target, revisit detected objects for a\n   z-stack, analyze several tiles together, or stop after enough targets are found.\n   Ask for a threshold or acquisition budget only if their desired action needs one.\n\nIf they cannot provide a working example, ask for the smallest available substitute:\na screenshot of the expected result, a tutorial dataset, or permission to run the\nworkflow on a copy of one image. Ask follow-up questions only when investigation\ncannot resolve an ambiguity that changes the biological meaning or hardware action.\n\n### What microclaw must investigate\n\nThe following is an agent verification checklist, NOT a questionnaire for the\nuser. Derive it by inspecting supplied local files and environments, reading the\npackage's official documentation and source code (search the web when needed),\nrunning `--help` or a documented example, and observing a safe dry run:\n\n- entry point, installed version\u002Fenvironment, and model\u002Fproject\u002Fconfig artifacts;\n- processing unit (frame, tile group, time window, or completed dataset), latency,\n  startup cost, and CPU\u002FGPU needs;\n- image axes\u002Forder, shape, dtype\u002Frange, channel mapping, pixel size, and preprocessing;\n- exact raw output, coordinate convention and units, origin, and score semantics;\n- the hook method\u002Fstate\u002Ftwo-pass design needed for the requested microscope action;\n- cleanup, thread safety, determinism, bounded failure behavior, and event limits;\n- all files, processes, network behavior, and hardware boundaries;\n- analyzer\u002Fmodel\u002Fproject\u002Fversion and parameters to record as provenance.\n\nPrefer primary sources: the installed code and version, the package's official\ndocumentation, and its upstream repository. Record where every inferred contract\nfact came from. Never silently infer coordinates, channels, or confidence semantics\nfrom a package name. To branch acquisition on a group of images, use microclaw's\n`run_adaptive_survey` candidates-queue runner (below), NOT pycro-manager's native\n`AcquisitionFuture.await_image_saved(...)` pattern: microclaw deliberately does not\nhand hooks the `Acquisition` object, and detection stays inside the hash-pinned,\nlogged `analyze_frame` rather than a runner-thread wait loop, so branching stays\ninside reviewed analysis. For per-image work after persistence, inspect the\ninstalled callback contract before choosing `image_saved_fn`.\n\nFor completed data, use `run_analysis_on_saved_dataset` with a reviewed,\nhash-pinned adapter from the saved manifest. Implement\n`analyze_completed_dataset(dataset_view, selection, context)` for whole-selection\nwork, or `analyze_saved_frame(image, metadata, context)` for per-frame work.\nSave either offline shape with `generate_and_save_hook(runner_contract=\"fixed\")`\nafter source review and confirmation; `adaptive` requires a live `analyze_frame`.\nSaving it does not make it attachable to an acquisition: `list_hooks` reports it\nas resolvable, and its `route` says `run_analysis_on_saved_dataset`. Passing an\noffline adapter as `hook_strategy` is refused by name.\n\nThe return contract is different from live `analyze_frame`: **do not return\n`HookResult` from either offline verb**. `analyze_saved_frame` returns one\nmeasurement dictionary or `None` per call. `analyze_completed_dataset` returns\nan iterable of dictionaries\u002F`None` entries, or `None` (not a single dictionary).\nA bare measurement dictionary has no `result` key; the runner wraps it as the\nresult with status `unverified`. Even a key called `status` in that bare mapping\nis just a measurement. A normalized envelope has a `result` key and may also\ncontain `status`, `analyzer`, `analyzer_version`, `parameters`, and\n`artifact_sha256`; any other envelope key is an error. Its omitted status defaults\nto `unverified`.\n\nAlternatively, call `context.emit_observation(result, status=\"unverified\", ...)`\nwith the same optional provenance fields, and return `None` to avoid reporting\nthe same observation twice. Saved adapters may claim only `unverified` or\n`provisional`, through either channel. `observed` is reserved for reviewed\npackage adapters: a saved adapter claiming it raises `ValueError`, and the\nrunner records a failed analysis and the reason in its manifest. Invalid return\ntypes and unknown envelope keys likewise fail the analysis.\n\nThe runner opens the `ndstorage.Dataset`; the whole-selection adapter receives a\nread-only `DatasetView` restricted to the requested axis selection, with\n`coordinates`, `read_image`, `read_metadata`, and bounded `as_array` access.\nThe context provides observations, cancellation and `context.artifacts`, an\n`ArtifactDirectory` with `emit(filename, payload)`. It exposes no output path or\nlive hardware capabilities. With an array payload and a `.tif`\u002F`.tiff` filename,\n`emit` writes through `tifffile`, including multi-page TIFF movies; bytes are\nwritten as supplied. Choose all intended time points, preserve frame order, and\nverify the written movie before calling a retrospective annotation delivered.\nCaller-settable `artifact_limits` default to:\n\n```json\n{\"max_artifact_bytes\": 67108864, \"max_count\": 64, \"max_total_bytes\": 268435456}\n```\n\nThat is 64 artifacts, at most 64 MiB each and 256 MiB total, measured on the\nencoded artifacts. Filenames must be bare names and must not collide.\n\nThis skill explains how to compose tools; it does not maintain a competing\ncapability declaration. Check the installed tool schema and the tool's own\nrefusal for availability and restrictions. Inconclusive discovery means “not\nverified”, not “unimplemented”. An unwritten adapter is different from an\nunavailable execution path; a missing dependency blocks the adapter that needs it.\nStateful streaming remains available when those boundaries do not fit.\n`analyze_frame` itself does not receive a batch. The trusted adapter's\npre-hardware callback is not exposed to saved source.\n\nNo network call may occur while images are acquired. A local subprocess is allowed\nonly after its lint warning and full source are explicitly reviewed; derived XY\u002FZ\nevents must pass the guard.\n\nOnce the technical contract is complete, summarize it in plain language and call\nout only unresolved assumptions that affect scientific meaning or safety. Choose\nthe hook method below, write a plain saved-hook class, and test it without hardware\nagainst the example. If the output cannot yet be verified, make the first version\nobservation-only: return raw output as measurements and do not drive acquisition. Show the full source\nand lint warnings, and save it only after explicit confirmation. Package setup\nbelongs in the hook's documented local environment, not in a package-specific\nmicroclaw analysis tool.\n\nFor a live observation-only version, normalize the verified part of the raw\noutput to JSON values in `HookResult.measurements`. Record the analyzer name\nand installed version, parameters affecting the result, and the sha256 of any\nmodel\u002Fproject\u002Fconfig artifact. Use `status=\"unverified\"` when axes, units, score\nsemantics, or coordinates remain unresolved. Do not turn an unverified record into\nfiltering, stage movement, early stopping, or follow-up acquisition.\n\n## Acquisition callback availability\n\nPycro-manager's native `Acquisition(...)` constructor accepts all of these callback\nkwargs, but Microclaw does not currently expose all of them through its runners.\n\nCurrently wired by Microclaw's acquisition runner for reviewed built-ins:\n\n  image_process_fn       callable(image, metadata, event_queue) -> tuple | None\n  pre_hardware_hook_fn   callable(event_or_events) -> same shape (trusted adapter only)\n  post_hardware_hook_fn  callable(event_or_events) -> same shape (ALWAYS return it)\n\nPycro-manager supplies either one event dict or, when hardware sequencing is\nactive, a list of event dicts. A callback must return the same shape it received;\na one-element list is ordinary and must be handled. Per-frame planned hardware\nactions cannot run between exposures in a multi-event hardware-sequenced burst,\nso Microclaw refuses the fixed plan when any consecutive\n``int(k * interval_s * 1000.0)`` deadlines match across its frame count.\nChoose an interval whose truncated millisecond deadlines remain distinct.\n\n``run_multiposition_acquisition`` accepts one hook name or an ordered list.\nPost-hardware callbacks run in declared order and each receives the event\nreturned by its predecessor; returning ``None`` is a defect and aborts loudly.\nImage observers receive independent pixel copies of the same original frame,\nso mutations never flow between analyses, and a discard from any observer wins\n(for storage only, never dose). The one-artifact-per-frame rule applies across\nthe composition: after the first accepted artifact, later proposals for that\nframe are refused and audited. Artifact limits and the hook log are per run,\nand composed log entries identify their ``hook_strategy``. Saved hooks are\nstill resolved independently, hash-checked, stripped of forbidden parameters,\nand ``UntrustedHookAdapter``-wrapped; composition grants no controller, guard,\npath, or event-queue capability.\n\nGenerated and user-saved hooks instead implement\n`analyze_frame(image, metadata) -> HookResult | None`. They never receive ctrl,\nguard, credentials, paths\u002Fdirectories, runner queues, or the pycro-manager event queue. Legacy saved\n`image_process_fn` classes still load, but receive a raising event-queue stub and no\nother capability. Only classes shipped in PRECODED_HOOK_REGISTRY are trusted built-ins.\n\nNative pycro-manager callbacks not currently wired by Microclaw:\n\n  event_generation_hook_fn callable(event) -> list[dict] | None\n  image_saved_fn            callable(axes, dataset[, event_queue]) -> None\n\nDo not implement or promise an unwired callback in a generated Microclaw hook. Adding\none requires runner plumbing and fixture\u002Fintegration tests first. For wired callbacks,\nonly the methods actually implemented by the hook are passed to `Acquisition(...)`.\n\n## Hook function signatures and return-value contracts\n\n### analyze_frame(image: np.ndarray, metadata: dict) -> HookResult | None\n\nThe saved-hook contract. `HookResult` contains JSON-safe measurements and a list\nor tuple of typed action proposals: MoveStage, MoveNamedStage, SetDeviceProperty, AcquireAt, SetExposure,\nContinueAcquisition, StopAcquisition, RequestAutofocus, SetIlluminationPower, EmitArtifact,\nor DiscardFrame.\nRunner support for control-flow proposals is:\n\n  runner                              ContinueAcquisition   StopAcquisition \u002F AcquireAt\n  adaptive time series:               dispatch next frame   StopAcquisition supported;\n    run_timelapse(n_frames=None,                              AcquireAt refused\n      max_frames=..., hook_strategy=...)\n  spatial survey:                     dispatch next tile    supported\n    run_adaptive_survey\n  fixed-plan hooked acquisitions      accepted noop         refused\n\nA fixed-plan runner already continues through every committed event, so\nContinueAcquisition changes nothing and is recorded as an accepted noop. Proposals\nthat would change behaviour but are unavailable remain refused. The adaptive\nrunner guard-checks and reservation-checks every proposal and writes every\naccept\u002Frefuse decision to the log.\n\nFor an adaptive time series, the saved hook's pinned registry source must\nreference `ContinueAcquisition` or `StopAcquisition`; otherwise hook resolution\nrefuses before acquisition. That source check cheaply rejects the legacy shape\nbut does not prove the hook will return a decision. At runtime every image must\nproduce exactly one routing decision. A missing, duplicate, malformed, late, or\nover-budget decision fails closed at that image; a missing decision on the first\nimage does not idle until `max_idle_s`.\n\nSaved hooks cannot access hardware directly. For predetermined\n``run_timelapse`` and ``run_zstack`` acquisitions, every named-stage action\ncomes from the acquisition call's ``hook_action_plan`` and is bounded by its\n``named_stage_envelope`` before the run. Each generated event has one explicit\nindexed action list, including empty lists. Events are dispatched before the\nfirst image is analyzed, so ``MoveNamedStage`` returned by ``analyze_frame`` is\nrefused as unsupported; the hook scores frames and the plan moves hardware.\nThe action carries only ``position_um``. The envelope names the device, interval,\nattempted-write budget, and explicit restoration policy, and the trusted parent\nchecks, moves, waits, reads back, and audits requested and achieved positions.\n\n``SetDeviceProperty(value)`` is likewise available in predetermined\n``run_timelapse`` and ``run_zstack`` plans. The acquisition call supplies one\nexact ``property_envelope`` (device\u002Fproperty, categorical values or numeric\nbounds, attempted-write budget, and restoration policy); the action supplies\nonly the string value. The live authorization map and property bounds still\napply, and multiposition and tile runs accept no such envelope.\n\nAdaptive ``run_adaptive_survey`` hooks may propose ``MoveNamedStage`` or\n``SetDeviceProperty`` beside the one action selecting the next event. The\ntrusted parent registers that ordered set by the selected event's axes and\napplies it from ``pre_hardware_hook_fn`` within the approved envelope. The seed\nhas an explicit empty action set. ``hook_action_plan`` is rejected because later\nevents are selected at runtime.\n\nAcquireAt(position) normally requests an immediate guarded revisit of that planned\ntile. When run_adaptive_survey has acquire_on_hit, it instead records the planned\ntile and the focus device's current Z once for a deferred acquire phase, bounded by\nmax_hits. Use AcquireAt beside RequestAutofocus when the later acquisition should\nuse the autofocus-converged plane.\n\nOptional analyzer, analyzer_version, parameters, and artifact_sha256 fields retain\nthe `microclaw.analysis-observation\u002Fv1` envelope used by HookBase.log_analysis.\nSaved hooks default to status `unverified` and may claim only `unverified` or\n`provisional`; `observed` is not self-assertable by untrusted source. The parent\nwrites the envelope and the action audit.\n\nThere is deliberately no interactive confirmation from the acquisition callback\nthread: pyjavaz serializes bridge calls behind one lock, so prompting there can\ndeadlock acquisition. A proposal outside the already committed reservation is\nrefused and logged, never escalated to a prompt.\n\nSetIlluminationPower is power modulation only. The caller must authorize a device,\npower property, ceiling, and accepted-write budget before the run; the parent reads\nthe initial value once, confirms the whole unattended per-frame run once, and checks\neach proposal against that envelope and SafetyGuard. A hook cannot express a shutter\nenable or turn light on. A fixed open-loop ramp that reads no image content could be\na reviewed PRECODED_HOOK_REGISTRY built-in; a UV level computed per frame from blink\ndensity is feedback and must use the proposed-action union. This block does not add\nsuch an open-loop built-in.\n\n`max_power_step_factor` bounds the ratio between consecutive parent writes, so it\nlimits how fast power climbs rather than how high it can reach. From zero there is\nno ratio constraint and the envelope ceiling is the only bound. The ratchet is a\nbackstop against a runaway, not the mechanism that makes a ramp gradual: a hook that\nwants a gradual ramp implements it itself, as `uv_activation` does with\n`step_percent`.\n\nEnd-of-run power policy belongs to the hook and its user: a hook may leave the last\naccepted value, restore a chosen value, or ramp down to zero. Microclaw does not add\nan automatic final write. A non-increasing write within the authorized envelope is\nalways permitted even after the increasing-write budget is exhausted, and does not\nconsume that budget. An aborted or failed run may never reach the hook's intended\nfinal frame, so hardware can remain at whatever value the last accepted write set.\n\nEmitArtifact is constructed as ``EmitArtifact(filename, payload)`` (prefer the\nunambiguous keyword form ``EmitArtifact(filename=\"result.tiff\", payload=image)``).\nThe filename is bare, never a path; payload is bytes or an ndarray. Trusted\nparent code confines and exclusively creates the file in the run artifact directory,\nenforces per-file and per-run limits, hashes it, and records the path and sha256.\nA HookResult may propose at most one artifact per frame; this keeps the observation's\nsingle artifact_sha256 provenance field unambiguous.\nHook measurements are unverified claims and may describe an action that the parent\nrefused; the corresponding `hook_action` records are authoritative.\n\nDiscardFrame returns None from the parent image processor after recording the\nobservation. The position is still moved to and still exposed: discard saves storage,\nnot dose: filtering happens after exposure, so it cannot reduce dose.\n\n``RequestAutofocus`` is honored only by ``run_adaptive_survey`` for a saved or\ngenerated hook when the caller supplies ``autofocus_budget``. The budget counts\ncamera exposures (sweep planes plus the refocused-tile re-exposure), and each\ntile may be refocused once. A converged tile is shown to ``analyze_frame`` again\nwith ``metadata[\"microclaw_refocused\"] is True``; the first look has False. The\ntrusted parent carries this flag rather than assuming Micro-Manager copies a\ncustom event key into image metadata. A failed sweep is logged and carried past\nwithout widening or retrying it.\n\nThe second look is still an adaptive survey decision point: it must return\n``ContinueAcquisition`` or ``StopAcquisition`` (or another supported routing action).\nWithout a hardware proposal, a routing action beside ``RequestAutofocus`` keeps\nthe survey alive if autofocus refuses or does not converge. If autofocus queues\na focused re-exposure, later actions are refused until those pixels are judged.\nNamed-stage\u002Fproperty actions paired with ``RequestAutofocus`` are always refused\nwith ``not dispatched until the refocused tile is judged``, regardless of order.\n\n**A hook must never rely on ``RequestAutofocus`` to keep the survey moving.** It\nis the only action that can be *granted* and still queue nothing: it is refused\nwhen no budget was authorized, when the exposure budget is exhausted, when the\ntile was already refocused, when the guard or the focus lock rejects the sweep —\nand when the sweep is accepted but does not converge, which is a normal outcome\nthis capability is built around. In every one of those cases nothing is\ndispatched, and a hook that returned ``RequestAutofocus`` alone has ended the\nsurvey by omission: it idles out ``max_idle_s`` and reports a stall. On M5,\n2026-08-11, a budget sized below a single sweep did exactly that and cost a\nthree-tile run after two tiles.\n\nAsk for refocus and also provide the fallback route. If refocus is granted, the\nfallback is deferred and the hook chooses again on the focused frame; if it is\nrefused, the fallback advances the scan::\n\n    return HookResult(stats, actions=(RequestAutofocus(), ContinueAcquisition()))\n\nOn convergence the survey deliberately adopts the new focus plane. Timelapse\nsurvey events carry no Z, so the refocused exposure and later tiles remain at\nthat Z; a non-converging sweep restores the entry Z. Both first and second looks\nremain in the dataset: the re-exposure carries a ``refocus=1`` axis because\nNDTiff otherwise indexes identical axes as one readable frame.\n\nThe live runner refuses a proposal while Micro-Manager's focus lock is engaged.\nA standalone exported script has no generic focus-lock query, so it cannot make\nthat check: disengage the lock before running the script. It retains the same\nrecorded Z guard, exposure budget, one-refocus-per-tile rule, and focus sweep.\nPrecoded hooks use the direct runner contract and do not route typed actions\nthrough the saved-hook adapter, so ``RequestAutofocus`` is not available to them.\n\n### image_process_fn(image: np.ndarray, metadata: dict, event_queue) -> tuple | None\n\nCalled after every image arrives from the camera, before it is saved.\n\n  - Return (image, metadata) to keep the image (you may modify either).\n  - Returning None discards the image and NOTHING else: it keeps the frame out\n    of the dataset. No event is dropped — every remaining event for that\n    position still moves the stage, opens the shutter, and exposes the sample;\n    only the pixels are thrown away afterward; submitted events still execute.\n    This is a dataset filter, never a way to stop a position from being exposed.\n  - NEVER call event_queue.put(...) — see the event_queue section below. Every\n    microclaw runner silently discards anything a hook puts there: it adds no\n    event, and event_queue.put(None) does NOT end the acquisition early.\n\nFor a saved `analyze_frame` hook, return measurements in `HookResult`; the\ntrusted parent writes the log and stamps position\u002Fx_um\u002Fy_um\u002Fz_um from the image\nmetadata, so every entry is self-describing. `HookBase.log` is only for trusted\npre-coded registry hooks and must not be used as a saved-hook pattern.\n\nIf you read the metadata yourself: a multi-position acquisition carries\n\"PositionName\", \"XPosition_um_Intended\" and \"YPosition_um_Intended\"; a Z-stack\ncarries \"ZPosition_um_Intended\". An acquisition without a given axis does not\ncarry its keys, so read every one with .get() and fall back to\n`metadata[\"Axes\"][\"position\"]` for identity. (metadata[\"Axes\"] holds e.g.\n{\"position\": \"tile_r0_c1\", \"time\": 0, \"z\": 3}.)\n\n### post_hardware_hook_fn(event_or_events: dict | list[dict]) -> same shape\n\nCalled after the hardware has moved to the event's position (XY, Z, channel)\nbut before the camera fires.\n\n  - Return the (optionally modified) event dict or event list in the same shape,\n    ALWAYS. NEVER return None:\n    over the ZMQ bridge there is no way to cancel an event from a hook's\n    return value — None becomes an empty event that STILL FIRES THE CAMERA,\n    unlabeled, at the skipped event's OWN position (the hardware phase has\n    already run: the ghost exposure lands exactly where you tried not to\n    expose). See \"Skipping and stopping\" below for what actually works.\n  - Use this for autofocus: the stage is already at the nominal XY, so you can\n    do a Z sweep here and update the focus device before the shutter opens.\n\n### pre_hardware_hook_fn(event_or_events: dict | list[dict]) -> same shape\n\nCalled before hardware moves. Microclaw wires this only through its trusted\nadapter: from a declarative ``hook_action_plan`` for predetermined runs, or from\nthe action set registered with an adaptively selected event. Generated hook\nsource does not implement or receive this callback.\n\n  - Return the (optionally modified) event dict or event list in the same shape,\n    ALWAYS. NEVER return None:\n    as with post_hardware_hook_fn there is no cancel over the bridge — None\n    becomes an empty event that still fires the camera, unlabeled, wherever\n    the stage last was. See \"Skipping and stopping\" below.\n  - You may change event[\"z\"], event[\"x\"], event[\"y\"] to redirect hardware.\n\n### event_generation_hook_fn(event: dict) -> list[dict] | None\n\nCalled to dynamically generate or replace the events for an acquisition. NOT\ncurrently wired by Microclaw's runner (see \"Acquisition callback availability\");\ndo not implement or promise it in a generated hook until that plumbing and its\ntests land.\n\n  - Return a list of replacement event dicts to use instead of the original.\n  - Return None to leave the original event unchanged.\n  - Use this when you need to compute event parameters at acquisition time\n    rather than ahead of time.\n\n### image_saved_fn(axes: dict, dataset[, event_queue]) -> None\n\nPycro-manager calls this after each image has been saved. Read the new pixels with\n`dataset.read_image(**axes)` and metadata with `dataset.read_metadata(**axes)`.\nThis is a per-image callback, not a signal that the dataset or an image group is\ncomplete. The optional third argument is pycro-manager's older adaptive form: the\ncallback may put follow-up events directly on that queue. It does not receive or return\nan `AcquisitionFuture`. The separate future API is returned by `acq.acquire()` and lets\nthe acquisition owner await saved images. Microclaw uses neither mechanism here;\nadaptive branching goes through the `run_adaptive_survey` candidates-queue runner, so\na hook is never handed an `Acquisition` or its future; the runner owns dispatch.\n\nMicroclaw's current acquisition runner does not yet wire this constructor argument.\nDo not claim a generated hook can implement it until that native `image_saved_fn`\nplumbing is added and tested.\n\n## Skipping and stopping — discarding pixels versus preventing exposures\n\n\"Skip this event\" via a return value DOES NOT EXIST over the ZMQ bridge, on\nany hook, under any microclaw runner. pyjavaz sends a hook's None return as an\nempty JSON object; the Java side deserializes that into a real event that\nstill fires the camera — one unlabeled ghost exposure per \"skipped\" event, and\nthe run completes looking successful. There is no return value that cancels an\nevent; no wrapper can fix this on our side of the bridge.\n\nThe levers that DO work:\n\n  - Stop everything, loudly: RAISE from the hook. pycro-manager's hook thread\n    catches the exception and calls acquisition.abort(e) — the whole\n    acquisition aborts and the error surfaces to the caller. \"Skip the rest\"\n    from inside a hook is not available; \"stop everything, loudly\" is.\n    (The abort can race at most one final ghost exposure out the door —\n    promptness, not correctness.)\n  - Keep a frame out of the dataset: return None from image_process_fn. That\n    discards the pixels and nothing else — the hardware activity it came from\n    already happened, and future events are unaffected.\n  - Decide per frame whether the next exposure happens at all: use an adaptive\n    runner. For one field over time, call `run_timelapse` with `n_frames=None`,\n    `max_frames=\u003Cdose cap>`, and a saved `hook_strategy`; only time 0 is seeded,\n    and each `ContinueAcquisition` publishes one successor. For a planned\n    position list, use `run_adaptive_survey`; only its first tile is seeded.\n    An event that was never submitted needs no skip mechanism — nothing crosses\n    the bridge, so stopping is simply NOT SUBMITTING. For time series,\n    `adaptive_handoff` makes analysis and guarded actions gate each successor;\n    `hooked_fixed_plan` observers\n    keep the submitted events; their results do not gate the next exposure.\n\n## Event dict structure\n\n```python\n{\n    \"axes\": {\n        \"z\":        0,    # zero-based index within the Z axis\n        \"time\":     0,    # zero-based time-point index\n        \"position\": 0,    # zero-based position index\n        \"channel\":  0,    # zero-based channel index\n    },\n    \"z\":        10.5,             # absolute Z position in µm  (if Z axis used)\n    \"x\":       100.0,             # absolute X in µm           (if set explicitly)\n    \"y\":       200.0,             # absolute Y in µm           (if set explicitly)\n    \"channel\": {\"group\": \"Channel\", \"config\": \"DAPI\"},  # (if channel axis used)\n    \"exposure\": 100,              # exposure in ms             (if set explicitly)\n    \"min_start_time\": 0.0,        # earliest start time in seconds from acq start\n}\n```\n\nOnly keys relevant to the current axis configuration are present. The \"axes\"\nindices are sequence numbers (0, 1, 2, …), not physical values.\n\n## event_queue — unavailable to saved hooks\n\nNEVER call event_queue.put(). Saved hooks receive no hardware event queue; legacy\nsaved callbacks receive a stub that raises instead.\n\nReviewed built-in image_process_fn callbacks receive pycro-manager's real event\nqueue, but a put() on it is a SILENT NO-OP under every microclaw runner:\nby the time any image is processed, the acquisition's terminator is already\nqueued ahead of (or the event source has already consumed) anything the hook\nadds, so the hook's event is orphaned and never executed. Nothing raises and\nnothing warns — the run completes looking successful while the added event\nwas silently dropped behind the terminator.\n\n  - Never push new events:  event_queue.put({...}) is silently discarded.\n  - Never push None:        event_queue.put(None) does NOT end the acquisition\n    early — the terminator it would duplicate is already queued, and the\n    hook's None is discarded the same way.\n\nA reviewed built-in that needs to ADD work may run under the survey-with-detector runner,\nwhich hands the hook a `candidates` queue and a `progress` counter as\nattributes: self.candidates and self.progress (None under every batched\nrunner — check them and RAISE if missing). There the supported pattern is:\n\n  1. Never analyze a frame whose position label is not in the survey set —\n     otherwise the hook re-detects its own follow-up frames, forever.\n  2. Check every derived event with guard.check_xy \u002F guard.check_z BEFORE\n     enqueueing it — derived events bypass the normal per-move guards, and\n     enforce a max_events cap, logged when it is hit.\n  3. candidates.put(event) BEFORE progress.image_done(), always — reversed, a\n     hit on the last survey tile can be silently lost.\n\nThe adaptive variant of the same runner is the one-event-at-a-time mode (see\n\"Skipping and stopping\"), reachable through the run_adaptive_survey tool: the\nrunner additionally sets hook.survey_events (the full built tile list, seed\nincluded) and pre-dispatches only survey_events[0]; every later tile exists\nonly if the hook submits it. The ordering contract extends naturally: decide\nfrom the frame that just arrived; then candidates.put() the next tile OR call\nprogress.done_early(); then progress.image_done(). Positions run in the order\nthe tool was given — hand run_adaptive_survey a reversed list for a reverse\nscan.\n\nA reviewed built-in that needs to add work and finds self.candidates is None must FAIL\nLOUDLY (raise), not quietly log a success — it is running under a batched\nrunner that can never honor its decisions.\n\n## Generated saved-hook pattern\n\nSaved hooks must not inherit HookBase or take a `log_path` constructor argument.\nThe trusted parent owns the log so hook\nsource cannot forge or omit its action decision record.\n\n```python\nfrom microclaw.hook_decisions import ContinueAcquisition, HookResult\nimport numpy as np\n\nclass MyHook:\n    def analyze_frame(self, image: np.ndarray, metadata: dict):\n        # ... your logic ...\n        return HookResult({\"key\": \"value\"}, (ContinueAcquisition(),))\n```\n\nSaved source still executes in the hardware-control process. Source review and\nhash pinning remain the containment story until Block 13 adds worker isolation;\nthere is no hard deadline, memory cap, network isolation, or native-crash recovery.\n\n## Choosing the right hook type\n\n  Task                                   Hook to implement\n  -------------------------------------  --------------------------------\n  Record measurements \u002F propose action   analyze_frame → HookResult\n  Adjust exposure or settings per frame  SetExposure proposal (currently refused\n                                           by run_adaptive_survey)\n  Refocus a promising survey tile       RequestAutofocus from a saved hook +\n                                           run_adaptive_survey autofocus_budget\n  Redirect stage before hardware moves   pre_hardware_hook_fn (native pycro-manager;\n                                           not yet wired by Microclaw)\n  Stop a single-field time series        run_timelapse(n_frames=None,\n    based on each image                     max_frames=...) + adaptive hook\n                                            (stop = don't submit; NEVER return None)\n  Stop\u002Frefine a spatial survey           run_adaptive_survey + adaptive hook\n    based on each tile                      (stop = don't submit; NEVER return None)\n  Abort everything on a safety limit     raise from any hook (loud, surfaces)\n  Generate events dynamically at runtime event_generation_hook_fn (native;\n                                           not yet wired by Microclaw)\n  React after each image is persisted    image_saved_fn (native pycro-manager;\n                                           not yet wired by Microclaw)\n  Branch acquisition on a group of       run_adaptive_survey + adaptive hook\n    images before deciding                 (runner owns dispatch; no AcquisitionFuture)\n  Analyze a completed saved dataset      run_analysis_on_saved_dataset + reviewed\n                                           saved adapter: analyze_completed_dataset\n                                           or analyze_saved_frame; selection-limited\n                                           reads and bounded artifact emission above\n\n## Observation-only SNR hook\n\n`snr_observer` is the pre-coded observation-only reference for fixed surveys. It\ncalls the shared `compute_stats` implementation and writes one\n`microclaw.analysis-observation\u002Fv1` record per image, including SNR, focus metric\nand validity, intensity statistics, saturation, analysis time, and acquisition\ncoordinates. It always returns the original image and metadata. It has no score\nthreshold, filtering, queue submission, early-stop, or hardware behavior.\n\n  hook_params:\n    min_snr       validity gate for the reported focus metric (default 3.0);\n                  this does not filter or select images\n\nUse it with a fixed one-frame-per-tile acquisition and a log path. Rank the\ncompleted log offline; a streaming hook cannot know final top-k. Its SNR is a\nwhole-field measurement, so any revisit targets the recorded tile coordinate,\nnot an invented object centroid.\n\n## Micro-Manager plugin hooks\n\nTwo pre-coded strategies delegate hook logic to an installed Micro-Manager\nplugin. Reuse requires matching algorithm, data, stop and export contracts;\ninstalled does not mean compatible. Call\nlist_mm_plugins() for classpaths; it does not prove a controllable running instance. These require a Micro-Manager build with\nthe unified plugin classloader (PR #2401); on older builds the plugin classes\nare not resolvable over the ZMQ bridge and the hook fails loudly at startup.\n\nMM plugins are arbitrary Java: they bypass SafetyGuard (which only gates\nmicroclaw's own hardware calls) and the Python AST scanner (which only sees\nPython source). ALWAYS confirm the classpath + method with the user before\nenabling a plugin hook.\n\n### mm_plugin_analyzer  (analyzer — read-only, allowed by default)\n\nTreats the plugin as an ANALYZER: microclaw computes a scalar feature from the\nimage (np.mean) in Python, passes only that scalar to the plugin, and uses the\nplugin's returned score for a guarded, Python-side keep\u002Fskip decision. The full\nimage never crosses the bridge, and the plugin must NOT move hardware here.\n\n  hook_params:\n    classpath      fully-qualified plugin class (e.g. \"org.lab.QualityScorePlugin\")\n    method         plugin method to call with the scalar feature (default \"analyze\")\n    reject_below   optional float; discard the image if score \u003C this value\n\n  Safety gate: SafetyGuard.check_plugin — allowed unless the classpath is listed\n  in safety_config.yaml plugins.blocked. Fails open: if the plugin call raises,\n  the image is kept and the error is logged (data is never lost to a plugin bug).\n\n### autofocus_mm_plugin  (hardware motion — explicit confirmation required)\n\nDrop-in alternative to autofocus_per_position: runs the lab's validated MM\nautofocus plugin (via the autofocus manager) in the post_hardware slot before\neach capture. The PLUGIN owns the Z motion.\n\n  hook_params:\n    plugin_name    optional MM autofocus plugin name; omit to use the active one\n\n  Safety gate: hardware-moving plugin hooks are permitted by default and require\n  explicit user confirmation before enabling (the blocklist still applies).\n  An explicit plugins.allow_hardware_motion: false disables them. The plugin's\n  arbitrary Java motion cannot be enumerated or intercepted. PASSIVE guard on\n  the result: after the plugin focuses, microclaw\n  reads the new Z and calls check_z; if it is out of bounds the hook logs\n  autofocus=\"unsafe_abort\" and RAISES SafetyViolation — the whole acquisition\n  aborts loudly, naming the Z and the limit (\"skip this capture\" does not\n  exist over the bridge; see \"Skipping and stopping\"). microclaw does NOT\n  re-drive Z — an active correction would fight the plugin's own safety\n  controller.\n\n### The composition rule (one image-processing side per hook)\n\nPer hook, keep the heavy full-image work on ONE side (Python or Java) and let\nonly scalars\u002Fmetadata cross the bridge. If microclaw itself issues the hardware\nmove from a plugin's non-image output, SafetyGuard applies normally (guard the\nmove as usual) — that differs from autofocus_mm_plugin, where the plugin drives\nthe stage and microclaw can only guard passively. Full-image Java processing\nshould be an MM processor pipeline, not a hook.\n","# pycro-manager hook API reference\n\nReturned by `load_skill(name=\"hook-authoring\")`.\n\n## Integrating the user's own analysis\n\nExternal analysis packages are integrated by writing an adapter hook, not by\nadding a microclaw tool for each package. The adapter translates pycro-manager's\nimage\u002Fevent contract into the package's existing interface and translates its\nresult into logging, filtering, acquisition branching, or guarded follow-up\nevents.\n\n### What to ask the user\n\nStart in biological\u002Fworkflow language. Usually ask only these three questions,\none at a time if that is easier:\n\n1. **What existing workflow do you use, and can you point me to it?** A package\n   name or web page is enough; even better is the app, notebook, script, project,\n   model, environment, or repository they currently run. Ask them to describe\n   how they start it today (for example, “open this project and press Run”).\n2. **Can you show me one example that works?** Ask for a representative input\n   and its result. The user may explain the result biologically (“these outlined\n   cells are the ones I want”); do not require them to name arrays, dtypes,\n   coordinate systems, APIs, or command-line arguments.\n3. **What should the microscope do with the result?** Examples: record a score,\n   make a map, keep images containing the target, revisit detected objects for a\n   z-stack, analyze several tiles together, or stop after enough targets are found.\n   Ask for a threshold or acquisition budget only if their desired action needs one.\n\nIf they cannot provide a working example, ask for the smallest available substitute:\na screenshot of the expected result, a tutorial dataset, or permission to run the\nworkflow on a copy of one image. Ask follow-up questions only when investigation\ncannot resolve an ambiguity that changes the biological meaning or hardware action.\n\n### What microclaw must investigate\n\nThe following is an agent verification checklist, NOT a questionnaire for the\nuser. Derive it by inspecting supplied local files and environments, reading the\npackage's official documentation and source code (search the web when needed),\nrunning `--help` or a documented example, and observing a safe dry run:\n\n- entry point, installed version\u002Fenvironment, and model\u002Fproject\u002Fconfig artifacts;\n- processing unit (frame, tile group, time window, or completed dataset), latency,\n  startup cost, and CPU\u002FGPU needs;\n- image axes\u002Forder, shape, dtype\u002Frange, channel mapping, pixel size, and preprocessing;\n- exact raw output, coordinate convention and units, origin, and score semantics;\n- the hook method\u002Fstate\u002Ftwo-pass design needed for the requested microscope action;\n- cleanup, thread safety, determinism, bounded failure behavior, and event limits;\n- all files, processes, network behavior, and hardware boundaries;\n- analyzer\u002Fmodel\u002Fproject\u002Fversion and parameters to record as provenance.\n\nPrefer primary sources: the installed code and version, the package's official\ndocumentation, and its upstream repository. Record where every inferred contract\nfact came from. Never silently infer coordinates, channels, or confidence semantics\nfrom a package name. To branch acquisition on a group of images, use microclaw's\n`run_adaptive_survey` candidates-queue runner (below), NOT pycro-manager's native\n`AcquisitionFuture.await_image_saved(...)` pattern: microclaw deliberately does not\nhand hooks the `Acquisition` object, and detection stays inside the hash-pinned,\nlogged `analyze_frame` rather than a runner-thread wait loop, so branching stays\ninside reviewed analysis. For per-image work after persistence, inspect the\ninstalled callback contract before choosing `image_saved_fn`.\n\nFor completed data, use `run_analysis_on_saved_dataset` with a reviewed,\nhash-pinned adapter from the saved manifest. Implement\n`analyze_completed_dataset(dataset_view, selection, context)` for whole-selection\nwork, or `analyze_saved_frame(image, metadata, context)` for per-frame work.\nSave either offline shape with `generate_and_save_hook(runner_contract=\"fixed\")`\nafter source review and confirmation; `adaptive` requires a live `analyze_frame`.\nSaving it does not make it attachable to an acquisition: `list_hooks` reports it\nas resolvable, and its `route` says `run_analysis_on_saved_dataset`. Passing an\noffline adapter as `hook_strategy` is refused by name.\n\nThe return contract is different from live `analyze_frame`: **do not return\n`HookResult` from either offline verb**. `analyze_saved_frame` returns one\nmeasurement dictionary or `None` per call. `analyze_completed_dataset` returns\nan iterable of dictionaries\u002F`None` entries, or `None` (not a single dictionary).\nA bare measurement dictionary has no `result` key; the runner wraps it as the\nresult with status `unverified`. Even a key called `status` in that bare mapping\nis just a measurement. A normalized envelope has a `result` key and may also\ncontain `status`, `analyzer`, `analyzer_version`, `parameters`, and\n`artifact_sha256`; any other envelope key is an error. Its omitted status defaults\nto `unverified`.\n\nAlternatively, call `context.emit_observation(result, status=\"unverified\", ...)`\nwith the same optional provenance fields, and return `None` to avoid reporting\nthe same observation twice. Saved adapters may claim only `unverified` or\n`provisional`, through either channel. `observed` is reserved for reviewed\npackage adapters: a saved adapter claiming it raises `ValueError`, and the\nrunner records a failed analysis and the reason in its manifest. Invalid return\ntypes and unknown envelope keys likewise fail the analysis.\n\nThe runner opens the `ndstorage.Dataset`; the whole-selection adapter receives a\nread-only `DatasetView` restricted to the requested axis selection, with\n`coordinates`, `read_image`, `read_metadata`, and bounded `as_array` access.\nThe context provides observations, cancellation and `context.artifacts`, an\n`ArtifactDirectory` with `emit(filename, payload)`. It exposes no output path or\nlive hardware capabilities. With an array payload and a `.tif`\u002F`.tiff` filename,\n`emit` writes through `tifffile`, including multi-page TIFF movies; bytes are\nwritten as supplied. Choose all intended time points, preserve frame order, and\nverify the written movie before calling a retrospective annotation delivered.\nCaller-settable `artifact_limits` default to:\n\n```json\n{\"max_artifact_bytes\": 67108864, \"max_count\": 64, \"max_total_bytes\": 268435456}\n```\n\nThat is 64 artifacts, at most 64 MiB each and 256 MiB total, measured on the\nencoded artifacts. Filenames must be bare names and must not collide.\n\nThis skill explains how to compose tools; it does not maintain a competing\ncapability declaration. Check the installed tool schema and the tool's own\nrefusal for availability and restrictions. Inconclusive discovery means “not\nverified”, not “unimplemented”. An unwritten adapter is different from an\nunavailable execution path; a missing dependency blocks the adapter that needs it.\nStateful streaming remains available when those boundaries do not fit.\n`analyze_frame` itself does not receive a batch. The trusted adapter's\npre-hardware callback is not exposed to saved source.\n\nNo network call may occur while images are acquired. A local subprocess is allowed\nonly after its lint warning and full source are explicitly reviewed; derived XY\u002FZ\nevents must pass the guard.\n\nOnce the technical contract is complete, summarize it in plain language and call\nout only unresolved assumptions that affect scientific meaning or safety. Choose\nthe hook method below, write a plain saved-hook class, and test it without hardware\nagainst the example. If the output cannot yet be verified, make the first version\nobservation-only: return raw output as measurements and do not drive acquisition. Show the full source\nand lint warnings, and save it only after explicit confirmation. Package setup\nbelongs in the hook's documented local environment, not in a package-specific\nmicroclaw analysis tool.\n\nFor a live observation-only version, normalize the verified part of the raw\noutput to JSON values in `HookResult.measurements`. Record the analyzer name\nand installed version, parameters affecting the result, and the sha256 of any\nmodel\u002Fproject\u002Fconfig artifact. Use `status=\"unverified\"` when axes, units, score\nsemantics, or coordinates remain unresolved. Do not turn an unverified record into\nfiltering, stage movement, early stopping, or follow-up acquisition.\n\n## Acquisition callback availability\n\nPycro-manager's native `Acquisition(...)` constructor accepts all of these callback\nkwargs, but Microclaw does not currently expose all of them through its runners.\n\nCurrently wired by Microclaw's acquisition runner for reviewed built-ins:\n\n  image_process_fn       callable(image, metadata, event_queue) -> tuple | None\n  pre_hardware_hook_fn   callable(event_or_events) -> same shape (trusted adapter only)\n  post_hardware_hook_fn  callable(event_or_events) -> same shape (ALWAYS return it)\n\nPycro-manager supplies either one event dict or, when hardware sequencing is\nactive, a list of event dicts. A callback must return the same shape it received;\na one-element list is ordinary and must be handled. Per-frame planned hardware\nactions cannot run between exposures in a multi-event hardware-sequenced burst,\nso Microclaw refuses the fixed plan when any consecutive\n``int(k * interval_s * 1000.0)`` deadlines match across its frame count.\nChoose an interval whose truncated millisecond deadlines remain distinct.\n\n``run_multiposition_acquisition`` accepts one hook name or an ordered list.\nPost-hardware callbacks run in declared order and each receives the event\nreturned by its predecessor; returning ``None`` is a defect and aborts loudly.\nImage observers receive independent pixel copies of the same original frame,\nso mutations never flow between analyses, and a discard from any observer wins\n(for storage only, never dose). The one-artifact-per-frame rule applies across\nthe composition: after the first accepted artifact, later proposals for that\nframe are refused and audited. Artifact limits and the hook log are per run,\nand composed log entries identify their ``hook_strategy``. Saved hooks are\nstill resolved independently, hash-checked, stripped of forbidden parameters,\nand ``UntrustedHookAdapter``-wrapped; composition grants no controller, guard,\npath, or event-queue capability.\n\nGenerated and user-saved hooks instead implement\n`analyze_frame(image, metadata) -> HookResult | None`. They never receive ctrl,\nguard, credentials, paths\u002Fdirectories, runner queues, or the pycro-manager event queue. Legacy saved\n`image_process_fn` classes still load, but receive a raising event-queue stub and no\nother capability. Only classes shipped in PRECODED_HOOK_REGISTRY are trusted built-ins.\n\nNative pycro-manager callbacks not currently wired by Microclaw:\n\n  event_generation_hook_fn callable(event) -> list[dict] | None\n  image_saved_fn            callable(axes, dataset[, event_queue]) -> None\n\nDo not implement or promise an unwired callback in a generated Microclaw hook. Adding\none requires runner plumbing and fixture\u002Fintegration tests first. For wired callbacks,\nonly the methods actually implemented by the hook are passed to `Acquisition(...)`.\n\n## Hook function signatures and return-value contracts\n\n### analyze_frame(image: np.ndarray, metadata: dict) -> HookResult | None\n\nThe saved-hook contract. `HookResult` contains JSON-safe measurements and a list\nor tuple of typed action proposals: MoveStage, MoveNamedStage, SetDeviceProperty, AcquireAt, SetExposure,\nContinueAcquisition, StopAcquisition, RequestAutofocus, SetIlluminationPower, EmitArtifact,\nor DiscardFrame.\nRunner support for control-flow proposals is:\n\n  runner                              ContinueAcquisition   StopAcquisition \u002F AcquireAt\n  adaptive time series:               dispatch next frame   StopAcquisition supported;\n    run_timelapse(n_frames=None,                              AcquireAt refused\n      max_frames=..., hook_strategy=...)\n  spatial survey:                     dispatch next tile    supported\n    run_adaptive_survey\n  fixed-plan hooked acquisitions      accepted noop         refused\n\nA fixed-plan runner already continues through every committed event, so\nContinueAcquisition changes nothing and is recorded as an accepted noop. Proposals\nthat would change behaviour but are unavailable remain refused. The adaptive\nrunner guard-checks and reservation-checks every proposal and writes every\naccept\u002Frefuse decision to the log.\n\nFor an adaptive time series, the saved hook's pinned registry source must\nreference `ContinueAcquisition` or `StopAcquisition`; otherwise hook resolution\nrefuses before acquisition. That source check cheaply rejects the legacy shape\nbut does not prove the hook will return a decision. At runtime every image must\nproduce exactly one routing decision. A missing, duplicate, malformed, late, or\nover-budget decision fails closed at that image; a missing decision on the first\nimage does not idle until `max_idle_s`.\n\nSaved hooks cannot access hardware directly. For predetermined\n``run_timelapse`` and ``run_zstack`` acquisitions, every named-stage action\ncomes from the acquisition call's ``hook_action_plan`` and is bounded by its\n``named_stage_envelope`` before the run. Each generated event has one explicit\nindexed action list, including empty lists. Events are dispatched before the\nfirst image is analyzed, so ``MoveNamedStage`` returned by ``analyze_frame`` is\nrefused as unsupported; the hook scores frames and the plan moves hardware.\nThe action carries only ``position_um``. The envelope names the device, interval,\nattempted-write budget, and explicit restoration policy, and the trusted parent\nchecks, moves, waits, reads back, and audits requested and achieved positions.\n\n``SetDeviceProperty(value)`` is likewise available in predetermined\n``run_timelapse`` and ``run_zstack`` plans. The acquisition call supplies one\nexact ``property_envelope`` (device\u002Fproperty, categorical values or numeric\nbounds, attempted-write budget, and restoration policy); the action supplies\nonly the string value. The live authorization map and property bounds still\napply, and multiposition and tile runs accept no such envelope.\n\nAdaptive ``run_adaptive_survey`` hooks may propose ``MoveNamedStage`` or\n``SetDeviceProperty`` beside the one action selecting the next event. The\ntrusted parent registers that ordered set by the selected event's axes and\napplies it from ``pre_hardware_hook_fn`` within the approved envelope. The seed\nhas an explicit empty action set. ``hook_action_plan`` is rejected because later\nevents are selected at runtime.\n\nAcquireAt(position) normally requests an immediate guarded revisit of that planned\ntile. When run_adaptive_survey has acquire_on_hit, it instead records the planned\ntile and the focus device's current Z once for a deferred acquire phase, bounded by\nmax_hits. Use AcquireAt beside RequestAutofocus when the later acquisition should\nuse the autofocus-converged plane.\n\nOptional analyzer, analyzer_version, parameters, and artifact_sha256 fields retain\nthe `microclaw.analysis-observation\u002Fv1` envelope used by HookBase.log_analysis.\nSaved hooks default to status `unverified` and may claim only `unverified` or\n`provisional`; `observed` is not self-assertable by untrusted source. The parent\nwrites the envelope and the action audit.\n\nThere is deliberately no interactive confirmation from the acquisition callback\nthread: pyjavaz serializes bridge calls behind one lock, so prompting there can\ndeadlock acquisition. A proposal outside the already committed reservation is\nrefused and logged, never escalated to a prompt.\n\nSetIlluminationPower is power modulation only. The caller must authorize a device,\npower property, ceiling, and accepted-write budget before the run; the parent reads\nthe initial value once, confirms the whole unattended per-frame run once, and checks\neach proposal against that envelope and SafetyGuard. A hook cannot express a shutter\nenable or turn light on. A fixed open-loop ramp that reads no image content could be\na reviewed PRECODED_HOOK_REGISTRY built-in; a UV level computed per frame from blink\ndensity is feedback and must use the proposed-action union. This block does not add\nsuch an open-loop built-in.\n\n`max_power_step_factor` bounds the ratio between consecutive parent writes, so it\nlimits how fast power climbs rather than how high it can reach. From zero there is\nno ratio constraint and the envelope ceiling is the only bound. The ratchet is a\nbackstop against a runaway, not the mechanism that makes a ramp gradual: a hook that\nwants a gradual ramp implements it itself, as `uv_activation` does with\n`step_percent`.\n\nEnd-of-run power policy belongs to the hook and its user: a hook may leave the last\naccepted value, restore a chosen value, or ramp down to zero. Microclaw does not add\nan automatic final write. A non-increasing write within the authorized envelope is\nalways permitted even after the increasing-write budget is exhausted, and does not\nconsume that budget. An aborted or failed run may never reach the hook's intended\nfinal frame, so hardware can remain at whatever value the last accepted write set.\n\nEmitArtifact is constructed as ``EmitArtifact(filename, payload)`` (prefer the\nunambiguous keyword form ``EmitArtifact(filename=\"result.tiff\", payload=image)``).\nThe filename is bare, never a path; payload is bytes or an ndarray. Trusted\nparent code confines and exclusively creates the file in the run artifact directory,\nenforces per-file and per-run limits, hashes it, and records the path and sha256.\nA HookResult may propose at most one artifact per frame; this keeps the observation's\nsingle artifact_sha256 provenance field unambiguous.\nHook measurements are unverified claims and may describe an action that the parent\nrefused; the corresponding `hook_action` records are authoritative.\n\nDiscardFrame returns None from the parent image processor after recording the\nobservation. The position is still moved to and still exposed: discard saves storage,\nnot dose: filtering happens after exposure, so it cannot reduce dose.\n\n``RequestAutofocus`` is honored only by ``run_adaptive_survey`` for a saved or\ngenerated hook when the caller supplies ``autofocus_budget``. The budget counts\ncamera exposures (sweep planes plus the refocused-tile re-exposure), and each\ntile may be refocused once. A converged tile is shown to ``analyze_frame`` again\nwith ``metadata[\"microclaw_refocused\"] is True``; the first look has False. The\ntrusted parent carries this flag rather than assuming Micro-Manager copies a\ncustom event key into image metadata. A failed sweep is logged and carried past\nwithout widening or retrying it.\n\nThe second look is still an adaptive survey decision point: it must return\n``ContinueAcquisition`` or ``StopAcquisition`` (or another supported routing action).\nWithout a hardware proposal, a routing action beside ``RequestAutofocus`` keeps\nthe survey alive if autofocus refuses or does not converge. If autofocus queues\na focused re-exposure, later actions are refused until those pixels are judged.\nNamed-stage\u002Fproperty actions paired with ``RequestAutofocus`` are always refused\nwith ``not dispatched until the refocused tile is judged``, regardless of order.\n\n**A hook must never rely on ``RequestAutofocus`` to keep the survey moving.** It\nis the only action that can be *granted* and still queue nothing: it is refused\nwhen no budget was authorized, when the exposure budget is exhausted, when the\ntile was already refocused, when the guard or the focus lock rejects the sweep —\nand when the sweep is accepted but does not converge, which is a normal outcome\nthis capability is built around. In every one of those cases nothing is\ndispatched, and a hook that returned ``RequestAutofocus`` alone has ended the\nsurvey by omission: it idles out ``max_idle_s`` and reports a stall. On M5,\n2026-08-11, a budget sized below a single sweep did exactly that and cost a\nthree-tile run after two tiles.\n\nAsk for refocus and also provide the fallback route. If refocus is granted, the\nfallback is deferred and the hook chooses again on the focused frame; if it is\nrefused, the fallback advances the scan::\n\n    return HookResult(stats, actions=(RequestAutofocus(), ContinueAcquisition()))\n\nOn convergence the survey deliberately adopts the new focus plane. Timelapse\nsurvey events carry no Z, so the refocused exposure and later tiles remain at\nthat Z; a non-converging sweep restores the entry Z. Both first and second looks\nremain in the dataset: the re-exposure carries a ``refocus=1`` axis because\nNDTiff otherwise indexes identical axes as one readable frame.\n\nThe live runner refuses a proposal while Micro-Manager's focus lock is engaged.\nA standalone exported script has no generic focus-lock query, so it cannot make\nthat check: disengage the lock before running the script. It retains the same\nrecorded Z guard, exposure budget, one-refocus-per-tile rule, and focus sweep.\nPrecoded hooks use the direct runner contract and do not route typed actions\nthrough the saved-hook adapter, so ``RequestAutofocus`` is not available to them.\n\n### image_process_fn(image: np.ndarray, metadata: dict, event_queue) -> tuple | None\n\nCalled after every image arrives from the camera, before it is saved.\n\n  - Return (image, metadata) to keep the image (you may modify either).\n  - Returning None discards the image and NOTHING else: it keeps the frame out\n    of the dataset. No event is dropped — every remaining event for that\n    position still moves the stage, opens the shutter, and exposes the sample;\n    only the pixels are thrown away afterward; submitted events still execute.\n    This is a dataset filter, never a way to stop a position from being exposed.\n  - NEVER call event_queue.put(...) — see the event_queue section below. Every\n    microclaw runner silently discards anything a hook puts there: it adds no\n    event, and event_queue.put(None) does NOT end the acquisition early.\n\nFor a saved `analyze_frame` hook, return measurements in `HookResult`; the\ntrusted parent writes the log and stamps position\u002Fx_um\u002Fy_um\u002Fz_um from the image\nmetadata, so every entry is self-describing. `HookBase.log` is only for trusted\npre-coded registry hooks and must not be used as a saved-hook pattern.\n\nIf you read the metadata yourself: a multi-position acquisition carries\n\"PositionName\", \"XPosition_um_Intended\" and \"YPosition_um_Intended\"; a Z-stack\ncarries \"ZPosition_um_Intended\". An acquisition without a given axis does not\ncarry its keys, so read every one with .get() and fall back to\n`metadata[\"Axes\"][\"position\"]` for identity. (metadata[\"Axes\"] holds e.g.\n{\"position\": \"tile_r0_c1\", \"time\": 0, \"z\": 3}.)\n\n### post_hardware_hook_fn(event_or_events: dict | list[dict]) -> same shape\n\nCalled after the hardware has moved to the event's position (XY, Z, channel)\nbut before the camera fires.\n\n  - Return the (optionally modified) event dict or event list in the same shape,\n    ALWAYS. NEVER return None:\n    over the ZMQ bridge there is no way to cancel an event from a hook's\n    return value — None becomes an empty event that STILL FIRES THE CAMERA,\n    unlabeled, at the skipped event's OWN position (the hardware phase has\n    already run: the ghost exposure lands exactly where you tried not to\n    expose). See \"Skipping and stopping\" below for what actually works.\n  - Use this for autofocus: the stage is already at the nominal XY, so you can\n    do a Z sweep here and update the focus device before the shutter opens.\n\n### pre_hardware_hook_fn(event_or_events: dict | list[dict]) -> same shape\n\nCalled before hardware moves. Microclaw wires this only through its trusted\nadapter: from a declarative ``hook_action_plan`` for predetermined runs, or from\nthe action set registered with an adaptively selected event. Generated hook\nsource does not implement or receive this callback.\n\n  - Return the (optionally modified) event dict or event list in the same shape,\n    ALWAYS. NEVER return None:\n    as with post_hardware_hook_fn there is no cancel over the bridge — None\n    becomes an empty event that still fires the camera, unlabeled, wherever\n    the stage last was. See \"Skipping and stopping\" below.\n  - You may change event[\"z\"], event[\"x\"], event[\"y\"] to redirect hardware.\n\n### event_generation_hook_fn(event: dict) -> list[dict] | None\n\nCalled to dynamically generate or replace the events for an acquisition. NOT\ncurrently wired by Microclaw's runner (see \"Acquisition callback availability\");\ndo not implement or promise it in a generated hook until that plumbing and its\ntests land.\n\n  - Return a list of replacement event dicts to use instead of the original.\n  - Return None to leave the original event unchanged.\n  - Use this when you need to compute event parameters at acquisition time\n    rather than ahead of time.\n\n### image_saved_fn(axes: dict, dataset[, event_queue]) -> None\n\nPycro-manager calls this after each image has been saved. Read the new pixels with\n`dataset.read_image(**axes)` and metadata with `dataset.read_metadata(**axes)`.\nThis is a per-image callback, not a signal that the dataset or an image group is\ncomplete. The optional third argument is pycro-manager's older adaptive form: the\ncallback may put follow-up events directly on that queue. It does not receive or return\nan `AcquisitionFuture`. The separate future API is returned by `acq.acquire()` and lets\nthe acquisition owner await saved images. Microclaw uses neither mechanism here;\nadaptive branching goes through the `run_adaptive_survey` candidates-queue runner, so\na hook is never handed an `Acquisition` or its future; the runner owns dispatch.\n\nMicroclaw's current acquisition runner does not yet wire this constructor argument.\nDo not claim a generated hook can implement it until that native `image_saved_fn`\nplumbing is added and tested.\n\n## Skipping and stopping — discarding pixels versus preventing exposures\n\n\"Skip this event\" via a return value DOES NOT EXIST over the ZMQ bridge, on\nany hook, under any microclaw runner. pyjavaz sends a hook's None return as an\nempty JSON object; the Java side deserializes that into a real event that\nstill fires the camera — one unlabeled ghost exposure per \"skipped\" event, and\nthe run completes looking successful. There is no return value that cancels an\nevent; no wrapper can fix this on our side of the bridge.\n\nThe levers that DO work:\n\n  - Stop everything, loudly: RAISE from the hook. pycro-manager's hook thread\n    catches the exception and calls acquisition.abort(e) — the whole\n    acquisition aborts and the error surfaces to the caller. \"Skip the rest\"\n    from inside a hook is not available; \"stop everything, loudly\" is.\n    (The abort can race at most one final ghost exposure out the door —\n    promptness, not correctness.)\n  - Keep a frame out of the dataset: return None from image_process_fn. That\n    discards the pixels and nothing else — the hardware activity it came from\n    already happened, and future events are unaffected.\n  - Decide per frame whether the next exposure happens at all: use an adaptive\n    runner. For one field over time, call `run_timelapse` with `n_frames=None`,\n    `max_frames=\u003Cdose cap>`, and a saved `hook_strategy`; only time 0 is seeded,\n    and each `ContinueAcquisition` publishes one successor. For a planned\n    position list, use `run_adaptive_survey`; only its first tile is seeded.\n    An event that was never submitted needs no skip mechanism — nothing crosses\n    the bridge, so stopping is simply NOT SUBMITTING. For time series,\n    `adaptive_handoff` makes analysis and guarded actions gate each successor;\n    `hooked_fixed_plan` observers\n    keep the submitted events; their results do not gate the next exposure.\n\n## Event dict structure\n\n```python\n{\n    \"axes\": {\n        \"z\":        0,    # zero-based index within the Z axis\n        \"time\":     0,    # zero-based time-point index\n        \"position\": 0,    # zero-based position index\n        \"channel\":  0,    # zero-based channel index\n    },\n    \"z\":        10.5,             # absolute Z position in µm  (if Z axis used)\n    \"x\":       100.0,             # absolute X in µm           (if set explicitly)\n    \"y\":       200.0,             # absolute Y in µm           (if set explicitly)\n    \"channel\": {\"group\": \"Channel\", \"config\": \"DAPI\"},  # (if channel axis used)\n    \"exposure\": 100,              # exposure in ms             (if set explicitly)\n    \"min_start_time\": 0.0,        # earliest start time in seconds from acq start\n}\n```\n\nOnly keys relevant to the current axis configuration are present. The \"axes\"\nindices are sequence numbers (0, 1, 2, …), not physical values.\n\n## event_queue — unavailable to saved hooks\n\nNEVER call event_queue.put(). Saved hooks receive no hardware event queue; legacy\nsaved callbacks receive a stub that raises instead.\n\nReviewed built-in image_process_fn callbacks receive pycro-manager's real event\nqueue, but a put() on it is a SILENT NO-OP under every microclaw runner:\nby the time any image is processed, the acquisition's terminator is already\nqueued ahead of (or the event source has already consumed) anything the hook\nadds, so the hook's event is orphaned and never executed. Nothing raises and\nnothing warns — the run completes looking successful while the added event\nwas silently dropped behind the terminator.\n\n  - Never push new events:  event_queue.put({...}) is silently discarded.\n  - Never push None:        event_queue.put(None) does NOT end the acquisition\n    early — the terminator it would duplicate is already queued, and the\n    hook's None is discarded the same way.\n\nA reviewed built-in that needs to ADD work may run under the survey-with-detector runner,\nwhich hands the hook a `candidates` queue and a `progress` counter as\nattributes: self.candidates and self.progress (None under every batched\nrunner — check them and RAISE if missing). There the supported pattern is:\n\n  1. Never analyze a frame whose position label is not in the survey set —\n     otherwise the hook re-detects its own follow-up frames, forever.\n  2. Check every derived event with guard.check_xy \u002F guard.check_z BEFORE\n     enqueueing it — derived events bypass the normal per-move guards, and\n     enforce a max_events cap, logged when it is hit.\n  3. candidates.put(event) BEFORE progress.image_done(), always — reversed, a\n     hit on the last survey tile can be silently lost.\n\nThe adaptive variant of the same runner is the one-event-at-a-time mode (see\n\"Skipping and stopping\"), reachable through the run_adaptive_survey tool: the\nrunner additionally sets hook.survey_events (the full built tile list, seed\nincluded) and pre-dispatches only survey_events[0]; every later tile exists\nonly if the hook submits it. The ordering contract extends naturally: decide\nfrom the frame that just arrived; then candidates.put() the next tile OR call\nprogress.done_early(); then progress.image_done(). Positions run in the order\nthe tool was given — hand run_adaptive_survey a reversed list for a reverse\nscan.\n\nA reviewed built-in that needs to add work and finds self.candidates is None must FAIL\nLOUDLY (raise), not quietly log a success — it is running under a batched\nrunner that can never honor its decisions.\n\n## Generated saved-hook pattern\n\nSaved hooks must not inherit HookBase or take a `log_path` constructor argument.\nThe trusted parent owns the log so hook\nsource cannot forge or omit its action decision record.\n\n```python\nfrom microclaw.hook_decisions import ContinueAcquisition, HookResult\nimport numpy as np\n\nclass MyHook:\n    def analyze_frame(self, image: np.ndarray, metadata: dict):\n        # ... your logic ...\n        return HookResult({\"key\": \"value\"}, (ContinueAcquisition(),))\n```\n\nSaved source still executes in the hardware-control process. Source review and\nhash pinning remain the containment story until Block 13 adds worker isolation;\nthere is no hard deadline, memory cap, network isolation, or native-crash recovery.\n\n## Choosing the right hook type\n\n  Task                                   Hook to implement\n  -------------------------------------  --------------------------------\n  Record measurements \u002F propose action   analyze_frame → HookResult\n  Adjust exposure or settings per frame  SetExposure proposal (currently refused\n                                           by run_adaptive_survey)\n  Refocus a promising survey tile       RequestAutofocus from a saved hook +\n                                           run_adaptive_survey autofocus_budget\n  Redirect stage before hardware moves   pre_hardware_hook_fn (native pycro-manager;\n                                           not yet wired by Microclaw)\n  Stop a single-field time series        run_timelapse(n_frames=None,\n    based on each image                     max_frames=...) + adaptive hook\n                                            (stop = don't submit; NEVER return None)\n  Stop\u002Frefine a spatial survey           run_adaptive_survey + adaptive hook\n    based on each tile                      (stop = don't submit; NEVER return None)\n  Abort everything on a safety limit     raise from any hook (loud, surfaces)\n  Generate events dynamically at runtime event_generation_hook_fn (native;\n                                           not yet wired by Microclaw)\n  React after each image is persisted    image_saved_fn (native pycro-manager;\n                                           not yet wired by Microclaw)\n  Branch acquisition on a group of       run_adaptive_survey + adaptive hook\n    images before deciding                 (runner owns dispatch; no AcquisitionFuture)\n  Analyze a completed saved dataset      run_analysis_on_saved_dataset + reviewed\n                                           saved adapter: analyze_completed_dataset\n                                           or analyze_saved_frame; selection-limited\n                                           reads and bounded artifact emission above\n\n## Observation-only SNR hook\n\n`snr_observer` is the pre-coded observation-only reference for fixed surveys. It\ncalls the shared `compute_stats` implementation and writes one\n`microclaw.analysis-observation\u002Fv1` record per image, including SNR, focus metric\nand validity, intensity statistics, saturation, analysis time, and acquisition\ncoordinates. It always returns the original image and metadata. It has no score\nthreshold, filtering, queue submission, early-stop, or hardware behavior.\n\n  hook_params:\n    min_snr       validity gate for the reported focus metric (default 3.0);\n                  this does not filter or select images\n\nUse it with a fixed one-frame-per-tile acquisition and a log path. Rank the\ncompleted log offline; a streaming hook cannot know final top-k. Its SNR is a\nwhole-field measurement, so any revisit targets the recorded tile coordinate,\nnot an invented object centroid.\n\n## Micro-Manager plugin hooks\n\nTwo pre-coded strategies delegate hook logic to an installed Micro-Manager\nplugin. Reuse requires matching algorithm, data, stop and export contracts;\ninstalled does not mean compatible. Call\nlist_mm_plugins() for classpaths; it does not prove a controllable running instance. These require a Micro-Manager build with\nthe unified plugin classloader (PR #2401); on older builds the plugin classes\nare not resolvable over the ZMQ bridge and the hook fails loudly at startup.\n\nMM plugins are arbitrary Java: they bypass SafetyGuard (which only gates\nmicroclaw's own hardware calls) and the Python AST scanner (which only sees\nPython source). ALWAYS confirm the classpath + method with the user before\nenabling a plugin hook.\n\n### mm_plugin_analyzer  (analyzer — read-only, allowed by default)\n\nTreats the plugin as an ANALYZER: microclaw computes a scalar feature from the\nimage (np.mean) in Python, passes only that scalar to the plugin, and uses the\nplugin's returned score for a guarded, Python-side keep\u002Fskip decision. The full\nimage never crosses the bridge, and the plugin must NOT move hardware here.\n\n  hook_params:\n    classpath      fully-qualified plugin class (e.g. \"org.lab.QualityScorePlugin\")\n    method         plugin method to call with the scalar feature (default \"analyze\")\n    reject_below   optional float; discard the image if score \u003C this value\n\n  Safety gate: SafetyGuard.check_plugin — allowed unless the classpath is listed\n  in safety_config.yaml plugins.blocked. Fails open: if the plugin call raises,\n  the image is kept and the error is logged (data is never lost to a plugin bug).\n\n### autofocus_mm_plugin  (hardware motion — explicit confirmation required)\n\nDrop-in alternative to autofocus_per_position: runs the lab's validated MM\nautofocus plugin (via the autofocus manager) in the post_hardware slot before\neach capture. The PLUGIN owns the Z motion.\n\n  hook_params:\n    plugin_name    optional MM autofocus plugin name; omit to use the active one\n\n  Safety gate: hardware-moving plugin hooks are permitted by default and require\n  explicit user confirmation before enabling (the blocklist still applies).\n  An explicit plugins.allow_hardware_motion: false disables them. The plugin's\n  arbitrary Java motion cannot be enumerated or intercepted. PASSIVE guard on\n  the result: after the plugin focuses, microclaw\n  reads the new Z and calls check_z; if it is out of bounds the hook logs\n  autofocus=\"unsafe_abort\" and RAISES SafetyViolation — the whole acquisition\n  aborts loudly, naming the Z and the limit (\"skip this capture\" does not\n  exist over the bridge; see \"Skipping and stopping\"). microclaw does NOT\n  re-drive Z — an active correction would fight the plugin's own safety\n  controller.\n\n### The composition rule (one image-processing side per hook)\n\nPer hook, keep the heavy full-image work on ONE side (Python or Java) and let\nonly scalars\u002Fmetadata cross the bridge. If microclaw itself issues the hardware\nmove from a plugin's non-image output, SafetyGuard applies normally (guard the\nmove as usual) — that differs from autofocus_mm_plugin, where the plugin drives\nthe stage and microclaw can only guard passively. Full-image Java processing\nshould be an MM processor pipeline, not a hook.\n",{"name":5,"description":7},"main","bb3e123c0e5ce6b52cb0e1a27d5e52bce5f3b045","microclaw\u002Fskills\u002Fhook-authoring",1,"https:\u002F\u002Fgithub.com\u002FMicro-Claw\u002Fmicroclaw","https:\u002F\u002Fgithub.com\u002FMicro-Claw","2026-10-20 00:35:52",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add Micro-Claw\u002Fmicroclaw --skill hook-authoring",{"tool":37,"command":38},"bunx","bunx skills add Micro-Claw\u002Fmicroclaw --skill hook-authoring",{"tool":40,"command":41},"pnpm","pnpm dlx skills add Micro-Claw\u002Fmicroclaw --skill hook-authoring","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMicro-Claw\u002Fmicroclaw\u002Fblob\u002Fmain\u002Fmicroclaw\u002Fskills\u002Fhook-authoring\u002FSKILL.md",true,[],[46,53,59,65,71,77],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":19},"01M72WAR49VE6T3ENRRZ523X76","extension-example","Exercise extension-dependent skill loading.","https:\u002F\u002Fgithub.com\u002FMicro-Claw\u002Fmicroclaw\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Fextension-example\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M72WAPVCEKCRHRP3TNBCFNGF","weather","https:\u002F\u002Fgithub.com\u002FMicro-Claw\u002Fmicroclaw\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskill_packages\u002Fweather\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M72WANVZ372X54DH6P9AVXR4","metrics","https:\u002F\u002Fgithub.com\u002FMicro-Claw\u002Fmicroclaw\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskill_packages\u002Fmetrics\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M72WAM0BVCPRGQJ3QYZZYX7X","markdown","https:\u002F\u002Fgithub.com\u002FMicro-Claw\u002Fmicroclaw\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskill_packages\u002Fmarkdown\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M72WAJZAX9VVQA61FVPN5XVC","executable","https:\u002F\u002Fgithub.com\u002FMicro-Claw\u002Fmicroclaw\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskill_packages\u002Fexecutable\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M72WAH1XNYBSZFESQH6BTCJ2","conformance","https:\u002F\u002Fgithub.com\u002FMicro-Claw\u002Fmicroclaw\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskill_packages\u002Fconformance\u002FSKILL.md",[],[]]