Automated summary
Captures the non-obvious conventions and traps of the crazyflow drone simulator, covering the array API, JAX usage, dynamics model registration, and how tests are run with pixi.
Strengths
- Spells out the array API rules: take the namespace from inputs with array_namespace, coerce parameters with to_xp, and never import numpy on a computation path
- Gives a reliable procedure for adding a dynamics model or drone, including every registration site and the grep trap caused by build_control_fns
- Flags concrete testing pitfalls: render tests deselected by addopts, the visualization test skipped silently when headless, and executable docstrings whose output is never compared
- Details out-of-Sim usage subtleties: import order versus scipy, the three distinct load_params, the shared partial returned by parametrize, and batch/feature axis conventions
Limitations
- Heavily tied to the crazyflow repository, so it is not a general guide to JAX or drone simulation
- The document cuts off mid-sentence about symbolic_dynamics, leaving that section incomplete
- Assumes familiarity with pixi, jax.jit/grad/vmap and the project's test setup
Load it whenever a task touches the crazyflow codebase: adding a drone or dynamics model, reusing controllers outside Sim, or debugging tests and executable examples.
When learning JAX or the standard array API, when doing generic drone simulation, or when working in a simulator other than crazyflow.
Security analysis
SafeThe skill is a codebase-specific guide with no dangerous instructions, credential handling, network exfiltration, obfuscated payloads, or destructive commands. It suggests deleting a shared JAX cache to resolve confusing failures, which is mildly operational but not a meaningful security risk.
No concerns found
How this analysis is madeExamples
Add a new quadrotor platform called 'x500' to crazyflow: register it in the available drones, add the matching section to every crazyflow/dynamics/*/params.toml, and make sure the ~40 parametrized registration tests pass.Write a batched MPC-style loop that calls crazyflow's dynamics and Mellinger controller outside Sim, with array_namespace handling, zeros-initialized integral state under jit, and a ctrl_freq that matches my real 100 Hz loop.My crazyflow tests pass in CI but a docstring example prints the wrong value — convert the output check to a pycon fence with >>> prompts and tell me why the markdown runner never caught it.name: crazyflow description: Non-obvious traps and conventions in the crazyflow drone simulator. Use when working in the crazyflow codebase, adding a dynamics model or drone platform, reusing the dynamics or controllers outside Sim for estimation or MPC, or writing code under jax.jit, grad or vmap.
Crazyflow
Settings are in pyproject.toml, layout in the tree, API reference in docs/.
Conventions
- Ruff settings live in
pyproject.tomland must pass before committing. - Dynamics and controllers follow the array API standard. Take the namespace from the inputs with
array_namespace(...), do all math through it, coerce bound parameters withto_xp, and never importnumpyinto a computation path. crazyflow/control/mellinger/params.tomldeliberately holds values that differ from the true physical constants incrazyflow/drones/params.toml, reproducing the real firmware. Do not unify them.
Testing
pixi run -e tests tests # what CI runs
pixi run -e tests test-docs # every example in docstrings and docs
Use pixi, not uv. pixi run <cmd> resolves task names only, so arbitrary commands need -e tests.
addopts = "-m 'not render'"deselects every render test, andtests/unit/test_visualizations.pyis@skip_if_headlesswithout the marker, so it is skipped silently withoutDISPLAY. Rendering regressions pass CI green. Run-m renderlocally with a display.- Docs and docstrings are executable. The markdown runner catches exceptions but never compares
output, so a
printwith the result in a trailing comment proves nothing. Output that must be checked goes in apyconfence with>>>prompts, which doctest picks up. tests/integration/test_examples.pyruns every script underexamples/, so a new example is a new test.tests/conftest.pyforces JAX's persistent cache on at/tmp/jax_cache, shared across branches. Delete it when failures make no sense.- Request the
devicefixture rather than a GPU marker. It falls back to CPU silently, sogpu-testsasserts nothing about placement on a machine without CUDA.
Adding a dynamics model or drone
Grepping the name of an existing model or drone finds every registration site, except when matching
against all models in the simulation's build_control_fns.
Define the function in dynamics.py and never in the package __init__.py, because load_params
derives the model name from fn.__module__.split(".")[-2]. parametrize binds exactly the
keyword-only parameters after the bare *, so anything before it is never bound. Every drone in
available_drones needs a section in every crazyflow/dynamics/*/params.toml, even an empty one.
Registration alone produces roughly 40 parametrized tests. These do not include derivatives tests.
Using dynamics and controllers outside Sim
Pure, batched, array-API functions with no dependency on Sim.
- Import crazyflow before scipy.
crazyflow/__init__.pysetsSCIPY_ARRAY_API=1and imports scipy immediately, and scipy cannot be reconfigured once loaded. Transitive imports through acados or sklearn trigger this too. - Three different
load_paramsexist. The two in.corefilter to the target signature and silently drop the rest, so hardware constants likethrust_maxneedcrazyflow.drones.load_params. parametrizereturns afunctools.partialwhosekeywordsdict is shared by every reference to it. Callparametrizeagain for an independent copy.- Leading batch dimensions, trailing feature axis.
quatis scalar-last xyzw,forceis(..., 1)rather than a scalar,ang_velis body frame. ctrl_freqscales only the integral and derivative terms, so it must match your real loop rate. Under jit, initialize integral states to zeros rather thanNone, since the pytree structure change forces a recompile.symbolic_dynamicsmonkey-patches module-global symbols while building, so it is not reentrant. Do not build two concurrently.
The functional API and jit
Sim rebinds sim.data as a Python side effect that JAX cannot trace, so anything inside jit,
grad, vmap or scan must use crazyflow.sim.functional with Sim only as the builder. See
functional-api.md.
- After editing a pipeline, call
build_step_fn()orbuild_reset_fn()again. The builders snapshot the stages, so a later edit is silently ignored and the stage never runs. n_stepsis static, so each distinct value compiles separately. Build once and reuse.states.forceandstates.torqueare inputs, not outputs, and nothing clears them, so writing them applies a persistent disturbance.- Mutating state does not invalidate
core.mjx_synced, socontacts()can query stale geometry. Set the flag false yourself. - Gradients vanish at
clip_floor_pos(jnp.whereon floor contact) and at any saturation bound.
Splats
attach_splats performs no calibration. Both .ply files must already sit in the simulator's
frames, the scene in the MuJoCo world frame at metric scale and the drone in its body frame. An
uncalibrated splat looks correct alone but does not match the simulated geometry. See
splats.md.
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/crazyflow-conventions-msshyweq/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/crazyflow-conventions-msshyweq' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/crazyflow-conventions-msshyweq/download' --output '.skill-downloads/crazyflow-conventions-msshyweq/SKILL.md.part' && mv '.skill-downloads/crazyflow-conventions-msshyweq/SKILL.md.part' '.skill-downloads/crazyflow-conventions-msshyweq/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/crazyflow-conventions-msshyweq/SKILL.md' && test -s '.skill-downloads/crazyflow-conventions-msshyweq/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/crazyflow' && cp -R '.skill-downloads/crazyflow-conventions-msshyweq' '.claude/skills/crazyflow'Cursor
test -f '.skill-downloads/crazyflow-conventions-msshyweq/SKILL.md' && test -s '.skill-downloads/crazyflow-conventions-msshyweq/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/crazyflow' && cp -R '.skill-downloads/crazyflow-conventions-msshyweq' '.cursor/skills/crazyflow'Codex
test -f '.skill-downloads/crazyflow-conventions-msshyweq/SKILL.md' && test -s '.skill-downloads/crazyflow-conventions-msshyweq/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/crazyflow' && cp -R '.skill-downloads/crazyflow-conventions-msshyweq' '.agents/skills/crazyflow'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/crazyflow-conventions-msshyweq'openskills read 'crazyflow-conventions-msshyweq'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/crazyflow-conventions-msshyweq/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
React Hook Form Best Practices
Development
Master React Hook Form: avoid anti-patterns, manage subscriptions, and handle reset, dirty state, and controlled inputs correctly.
Emotion to Mantine Migration
Development
Migrate Emotion styled-components to Mantine components with style props and CSS modules. Use when converting .styled.tsx files or removing @emotion imports.
Scope Creep Detector
Development
Analyzes git diffs against a stated intent to detect scope creep, unrelated files, broad PRs, and oversized changes, then suggests keep, split, or justify actions.