Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use when modeling, validating, refactoring, or reviewing Rust service domain boundaries, especially when replacing primitive String fields with newtypes, parse-don't-validate constructors, private invariants, TryFrom/FromStr parsers, request DTO boundaries, or property tests.
.claude/skills/hashgraph-online-rust-domain-boundaries/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-22 | ✗→✓ | ▲ Improved | 55% | 0% |
| case-16 | ✓→✓ | = Same ✓ | 5% | 0% |
| case-03 | ✓→✓ | = Same ✓ | -2% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 66% | 0% |
| case-05 | ✓→✓ | = Same ✓ | 5% | 0% |
Use this skill to keep invalid states out of Rust service internals. Parse raw input once at the boundary, store validated values in narrow domain types, and make unchecked construction difficult.
files, environment variables, database rows, queues, and CLI flags.
serde deserialize incomingshapes, then convert DTO fields into validated domain values.
usernames, passwords, subscriber names, slugs, tenant IDs, idempotency keys, and money-like or duration-like values.
pub fields or impl From<String> for fallible conversions.
leaking internal details.
the final persistence or serialization edge.
lengths, normalization rules, and round trips.
TryFrom<String>, TryFrom<&str>, or FromStr for fallible parsing.AsRef<str> or a named accessor for read-only exposure.Display only when the formatted value is safe to show in logs,errors, and UI.
Debug for secret-bearing values unless the debug output isredacted.
canonicalization.
Deserialize into a request shape, then construct a command:
rust#[derive(serde::Deserialize)] pub struct SubscribeRequest { email: String, name: String, } pub struct SubscribeCommand { pub email: EmailAddress, pub name: SubscriberName, } impl TryFrom<SubscribeRequest> for SubscribeCommand { type Error = SubscribeValidationError; fn try_from(value: SubscribeRequest) -> Result<Self, Self::Error> { Ok(Self { email: EmailAddress::parse(value.email)?, name: SubscriberName::parse(value.name)?, }) } }
Handlers should reject invalid input before business logic or database code. If validation needs database state, keep pure parsing separate from uniqueness or authorization checks.
Read references/property-testing.md when invariants have many edge cases or when an AI agent is likely to miss invalid inputs with example-only tests.
Minimum tests for a new domain type:
serde or SQL mapping when that type crosses thoseboundaries.
references/newtype-patterns.md: constructor, trait, serde, and persistencepatterns for Rust newtypes.
references/property-testing.md: property-testing strategy for parsers anddomain constructors.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-16 | pass→pass | 12,039 | 7,913 | -34% | 1 | 1 | 0% | 2,238 | 2,356 | +5% | 0 | 0 | — |
case-01 | fail→fail | 15,798 | 15,319 | -3% | 1 | 1 | 0% | 3,995 | 4,556 | +14% | 0 | 0 | — |
case-02 | fail→fail | 22,096 | 16,822 | -24% | 1 | 1 | 0% | 5,432 | 4,809 | -11% | 0 | 0 | — |
case-03 | pass→pass | 11,835 | 6,827 | -42% | 1 | 1 | 0% | 2,294 | 2,242 | -2% | 0 | 0 | — |
case-04 | pass→pass | 11,847 | 14,082 | +19% | 1 | 1 | 0% | 2,113 | 3,510 | +66% | 0 | 0 | — |
case-05 | pass→pass | 14,480 | 8,948 | -38% | 1 | 1 | 0% | 2,373 | 2,492 | +5% | 0 | 0 | — |
case-17 | pass→pass | 15,162 | 10,521 | -31% | 1 | 1 | 0% | 2,532 | 2,433 | -4% | 0 | 0 | — |
case-06 | pass→pass | 10,640 | 8,030 | -25% | 1 | 1 | 0% | 2,208 | 2,369 | +7% | 0 | 0 | — |
case-07 | pass→pass | 15,211 | 12,170 | -20% | 1 | 1 | 0% | 2,764 | 3,015 | +9% | 0 | 0 | — |
case-08 | pass→pass | 10,985 | 8,224 | -25% | 1 | 1 | 0% | 2,018 | 2,370 | +17% | 0 | 0 | — |
case-09 | pass→pass | 11,902 | 7,600 | -36% | 1 | 1 | 0% | 2,374 | 2,235 | -6% | 0 | 0 | — |
case-10 | pass→pass | 14,053 | 12,663 | -10% | 1 | 1 | 0% | 2,363 | 2,871 | +21% | 0 | 0 | — |
case-11 | pass→pass | 17,429 | 9,022 | -48% | 1 | 1 | 0% | 2,285 | 1,875 | -18% | 0 | 0 | — |
case-12 | pass→pass | 24,425 | 18,773 | -23% | 1 | 1 | 0% | 1,962 | 2,168 | +10% | 0 | 0 | — |
case-13 | pass→pass | 23,069 | 19,246 | -17% | 1 | 1 | 0% | 3,612 | 3,674 | +2% | 0 | 0 | — |
case-14 | pass→pass | 16,983 | 16,604 | -2% | 1 | 1 | 0% | 3,011 | 3,954 | +31% | 0 | 0 | — |
case-15 | pass→pass | 10,058 | 6,772 | -33% | 1 | 1 | 0% | 1,838 | 1,897 | +3% | 0 | 0 | — |
case-18 | pass→pass | 16,346 | 15,879 | -3% | 1 | 1 | 0% | 3,210 | 4,099 | +28% | 0 | 0 | — |
case-19 | pass→pass | 12,642 | 5,082 | -60% | 1 | 1 | 0% | 2,226 | 1,620 | -27% | 0 | 0 | — |
case-20 | pass→pass | 13,820 | 11,455 | -17% | 1 | 1 | 0% | 2,484 | 3,022 | +22% | 0 | 0 | — |
case-21 | pass→pass | 12,726 | 10,366 | -19% | 1 | 1 | 0% | 2,346 | 2,513 | +7% | 0 | 0 | — |
case-22 | fail→pass | 13,700 | 16,506 | +20% | 1 | 1 | 0% | 2,625 | 4,059 | +55% | 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. 22 cases were attempted. The headline lift of +5 percentage points is the difference between those two pass rates over the 22 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.