Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Scaffold a new ECS component header under include/gz/sim/components/, wire its CMake listing, and (if needed) register it with ComponentFactory for serialization. Trigger when the user asks to add a new component or a per-entity data field.
.claude/skills/harunkurtdev-new-component/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -15% | 0% |
| case-13 | ✗→✓ | ▲ Improved | -34% | 0% |
| case-02 | ✗→✓ | ▲ Improved | -12% | 0% |
| case-03 | ✗→✓ | ▲ Improved | -23% | 0% |
| case-09 | ✗→✓ | ▲ Improved | -6% | 0% |
Components in gz-sim are header-only wrappers around the Component<> template. They live in include/gz/sim/components/<Name>.hh.
math::Vector3d, anstd::string, a msgs::*? Components don't have to be POD but they must be copyable.
the component or read it from SDF, you need to give it a Serializer<T> and register it with ComponentFactory.
physical state that physics writes, you probably also want <Name>Cmd.hh (user → physics) and <Name>Reset.hh (snapshot for Reset()).
cpp// include/gz/sim/components/Foo.hh #ifndef GZ_SIM_COMPONENTS_FOO_HH_ #define GZ_SIM_COMPONENTS_FOO_HH_ #include <gz/sim/components/Component.hh> #include <gz/sim/components/Factory.hh> #include <gz/sim/config.hh> namespace gz::sim { inline namespace GZ_SIM_VERSION_NAMESPACE { namespace components { /// \brief One-line description of what this component represents and /// which entities it gets attached to. using Foo = Component<double, class FooTag>; GZ_SIM_REGISTER_COMPONENT("gz_sim_components.Foo", Foo) } } } #endif
Key points:
class FooTag is what prevents two components with thesame data type from collapsing into one — never skip it.
GZ_SIM_REGISTER_COMPONENT(name, type) is required for any componentthat needs to round-trip through ComponentFactory.
cpp#ifndef GZ_SIM_COMPONENTS_BAR_HH_ #define GZ_SIM_COMPONENTS_BAR_HH_ #include <gz/msgs/double.pb.h> #include <gz/sim/components/Component.hh> #include <gz/sim/components/Factory.hh> #include <gz/sim/components/Serialization.hh> #include <gz/sim/config.hh> namespace gz::sim { inline namespace GZ_SIM_VERSION_NAMESPACE { namespace components { using BarSerializer = serializers::MsgsDoubleSerializer; using Bar = Component<msgs::Double, class BarTag, BarSerializer>; GZ_SIM_REGISTER_COMPONENT("gz_sim_components.Bar", Bar) } } } #endif
For brand-new data types, define Serializer<T> with static std::ostream &Serialize(...) and static std::istream &Deserialize(...) in include/gz/sim/components/Serialization.hh style and reference it from the component.
Add the new header to include/gz/sim/components/CMakeLists.txt so it gets installed:
cmakeset (component_headers Actor.hh ... Foo.hh # <-- new ... )
Headers are picked up automatically by the install logic — just keep the list alphabetical to match existing style.
Foo_TEST.cc next to the existing component tests undersrc/components/ if there's non-trivial behaviour (e.g. operator== or a custom serializer). Trivial typedef components don't need a dedicated test.
test/integration/log_system.cc patterns.
If the component is part of the public API, append a one-line entry to Migration.md under the next-release section so downstream users notice.
the same component.
GZ_SIM_REGISTER_COMPONENT macro for a serialized type.behaviour belongs in a system.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-08 | pass→pass | 13,876 | 5,884 | -58% | 1 | 1 | 0% | 2,286 | 2,062 | -10% | 0 | 0 | — |
case-01 | fail→pass | 17,247 | 9,262 | -46% | 1 | 1 | 0% | 3,215 | 2,748 | -15% | 0 | 0 | — |
case-13 | fail→pass | 17,420 | 4,568 | -74% | 1 | 1 | 0% | 2,791 | 1,832 | -34% | 0 | 0 | — |
case-02 | fail→pass | 16,797 | 7,097 | -58% | 1 | 1 | 0% | 2,965 | 2,603 | -12% | 0 | 0 | — |
case-03 | fail→pass | 16,489 | 7,576 | -54% | 1 | 1 | 0% | 3,217 | 2,466 | -23% | 0 | 0 | — |
case-04 | pass→pass | 16,990 | 14,334 | -16% | 1 | 1 | 0% | 3,110 | 3,894 | +25% | 0 | 0 | — |
case-05 | pass→pass | 16,931 | 12,649 | -25% | 1 | 1 | 0% | 3,177 | 3,551 | +12% | 0 | 0 | — |
case-06 | pass→pass | 13,932 | 11,637 | -16% | 1 | 1 | 0% | 2,434 | 3,103 | +27% | 0 | 0 | — |
case-07 | pass→pass | 10,104 | 4,575 | -55% | 1 | 1 | 0% | 1,771 | 1,821 | +3% | 0 | 0 | — |
case-09 | fail→pass | 7,993 | 1,752 | -78% | 1 | 1 | 0% | 1,405 | 1,319 | -6% | 0 | 0 | — |
case-10 | fail→pass | 8,557 | 5,291 | -38% | 1 | 1 | 0% | 1,450 | 1,951 | +35% | 0 | 0 | — |
case-11 | pass→pass | 11,706 | 3,874 | -67% | 1 | 1 | 0% | 1,836 | 1,690 | -8% | 0 | 0 | — |
case-12 | pass→pass | 12,938 | 5,268 | -59% | 1 | 1 | 0% | 2,513 | 2,003 | -20% | 0 | 0 | — |
case-14 | pass→pass | 8,911 | 5,021 | -44% | 1 | 1 | 0% | 1,642 | 2,060 | +25% | 0 | 0 | — |
case-15 | pass→pass | 2,735 | 2,028 | -26% | 1 | 1 | 0% | 499 | 1,376 | +176% | 0 | 0 | — |
case-16 | pass→pass | 13,659 | 8,980 | -34% | 1 | 1 | 0% | 2,303 | 2,576 | +12% | 0 | 0 | — |
case-17 | fail→pass | 12,489 | 3,855 | -69% | 1 | 1 | 0% | 2,226 | 1,614 | -27% | 0 | 0 | — |
case-18 | fail→pass | 12,602 | 1,816 | -86% | 1 | 1 | 0% | 2,095 | 1,335 | -36% | 0 | 0 | — |
case-19 | pass→pass | 8,789 | 3,064 | -65% | 1 | 1 | 0% | 1,574 | 1,562 | -1% | 0 | 0 | — |
case-20 | fail→pass | 18,068 | 5,584 | -69% | 1 | 1 | 0% | 3,378 | 2,197 | -35% | 0 | 0 | — |
case-21 | pass→pass | 13,179 | 10,005 | -24% | 1 | 1 | 0% | 1,968 | 2,464 | +25% | 0 | 0 | — |
case-22 | pass→pass | 6,937 | 4,377 | -37% | 1 | 1 | 0% | 1,105 | 1,781 | +61% | 0 | 0 | — |
case-23 | fail→pass | 14,431 | 7,345 | -49% | 1 | 1 | 0% | 2,293 | 2,215 | -3% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +43 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.