Moosync/Moosync / .agents/skills/instrumentation
instrumentation
UnverifiedHermetic tracing instrumentation rules and validation. Covers the requirement for
Instrumentation Skill
Description
The Instrumentation skill enforces logging best practices in the Moosync repository. To preserve stack traces and keep execution flows observable, every function definition in Rust source files must be decorated with the #[tracing::instrument] attribute.
Requirements
- Instrumentation on All Functions: Every function definition (with a body) must have a
#[tracing::instrument]attribute, unless it is:- A test function or inside a test module (e.g.,
mod tests). - A trait declaration signature (without a body).
- A common built-in trait method:
main,default,from,into,try_from,fmt,clone,drop.
- A test function or inside a test module (e.g.,
- Skip All Parameters (
skip_all): To prevent compilation errors caused by non-Debugtypes (such as JNIEnv, callbacks, closures, platform context objects, ordyntrait objects), always skip all function parameters usingskip_all.
Preferred Pattern:
#[tracing::instrument(level = "debug", skip_all)]
pub fn my_function(param1: NonDebugClosure, param2: JniContext) -> Result<(), MyError> {
// ...
}
Commands
| Command | Description | Example |
|---|---|---|
| Verify Instrumentation | Runs recursive checks on all .rs files to find missing instrumentation. | bazel run //tools:check_instrument |
| Fix Skips/Instrumentation | Programmatically updates all tracing::instrument attributes to standardized skip_all. | python3 tools/fix_instrumentation_skips.py |
Git Pre-Commit Hook Integration
The instrumentation check is integrated into the Git pre-commit hook:
- When you stage any
.rsor.slintfiles and rungit commit, the pre-commit hook (located in.git/hooks/pre-commit) runsbazel run //tools:check_instrument. - If any function is missing the instrumentation attribute, the pre-commit hook fails with exit code 1 and blocks the commit, reporting the exact files and line numbers needing attention.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 192k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 192k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 192k | Updated | Claude CodeCodex | Verified | Install |