agentleFS
gear-foundationgear-foundation/vara-skills/skills/sails-ethexe-implementer/SKILL.md

sails-ethexe-implementer

Skill17 starsChanged 8 months agoMITView on GitHub

Use when approved tasks require Rust code changes in a Sails ethexe workspace with the ethexe feature enabled. Do not use for standard Gear/Vara Sails apps without ethexe, or when the spec or architecture is still unsettled.

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 1 is distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If the task does NOT need the ethexe feature, use ../sails-rust-implementer/SKILL.md instead.

    line 12
  2. Very specific:

    Use #[sails_type] for all custom types.

    line 30
  3. Very specific:

    Use emit_eth_event() for Ethereum-style events, emit_event() for standard Gear events.

    line 36
  4. Very specific:

    Use Syscall::* for runtime accessors.

    line 38
  5. Very specific:

    Do not use signal_from(), signal_code(), or system_reserve_gas() — they are gated out under ethexe.

    line 90
  6. Very specific:

    Do not use raw gcore::*, msg::*, or exec::* calls — use Syscall::*.

    line 91
  7. Very specific:

    Do not mark more than 3 fields as #[indexed] per event variant.

    line 92
  8. Distinctive:

    Do not use reserved event variant names.

    line 93
  9. Very specific:

    Do not assume payable works with scale-only transport — it requires ethabi.

    line 94
  10. Very specific:

    Use Syscall::message_source() == Syscall::program_id() for self-message guards.

    line 97

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Sails Ethexe Implementer

Overview

Implement approved tasks in Sails ethexe workspaces where the ethexe feature is enabled and methods may be exported via ethabi transport, accept value (payable), or emit Ethereum-style events.

If the task does NOT need the ethexe feature, use ../sails-rust-implementer/SKILL.md instead.

Inputs

  • ../../references/sails-ethexe-patterns.md — ethexe diff table, type requirements, transport rules, event patterns
  • ../../references/sails-syscall-mapping.md — Syscall::* API (note gated syscalls)
  • ../../references/sails-cheatsheet.md — core Sails patterns
  • ../../references/sails-rs-imports.md — import paths
  • ../../references/sails-idl-v2-syntax.md — IDL v2 annotations
  • ../../references/sails-header-wire-format.md — Sails Header routing

Consume the approved spec, architecture, and tasks artifacts before changing code.

Workflow

  1. Confirm the task is specified and architecture-approved.
  2. Confirm the crate has sails-rs with features = ["ethexe"] in Cargo.toml.
  3. Identify the smallest code change that satisfies the task.
  4. Use #[sails_type] for all custom types. Types used in ethabi-exported methods must also be ABI-encodable as Solidity tuples (SolValue).
  5. Choose the correct transport per method:
    • #[export] — both scale + ethabi (default with ethexe)
    • #[export(scale)] — scale only, no ethabi
    • #[export(ethabi)] — ethabi only
    • #[export(ethabi, payable)] — ethabi with value acceptance
  6. Use emit_eth_event() for Ethereum-style events, emit_event() for standard Gear events. Do not mix them on the same event type without explicit architecture guidance.
  7. Mark #[indexed] on up to 3 event fields per variant for Ethereum topic indexing.
  8. Use Syscall::* for runtime accessors. Three syscalls are unavailable: signal_from, signal_code, system_reserve_gas.
  9. Hand verification to the gtest loop before claiming done.

Transport Decision Guide

ScenarioAttribute
Standard method, both transports#[export]
Method only callable from Gear programs (no EVM)#[export(scale)]
Method only callable from EVM#[export(ethabi)]
Method that accepts value from EVM#[export(ethabi, payable)] or #[export(scale, ethabi, payable)]
Query (read-only)#[export] (transport flags orthogonal to query semantics)

Payable Methods

Non-payable methods panic at runtime if msg::value() > 0. To accept value:

#[export(payable)]
pub fn deposit(&mut self) -> u64 {
    let value = Syscall::message_value();
    // handle deposit...
    value as u64
}

Constructors can also be payable: #[export(payable)] pub fn create() -> Self { ... }

Eth Events

#[event]
pub enum MyEvent {
    Transfer {
        #[indexed]
        from: ActorId,
        #[indexed]
        to: ActorId,
        value: u64,
    },
    Paused,
}

// In service method:
self.emit_eth_event(MyEvent::Transfer { from, to, value });
  • Max 3 #[indexed] fields per variant
  • Forbidden variant names: ExecutableBalanceTopUpRequested, Message, MessageQueueingRequested, Reply, ReplyQueueingRequested, StateChanged, ValueClaimed, ValueClaimingRequested

Guardrails

  • Do not use signal_from(), signal_code(), or system_reserve_gas() — they are gated out under ethexe.
  • Do not use raw gcore::*, msg::*, or exec::* calls — use Syscall::*.
  • Do not mark more than 3 fields as #[indexed] per event variant.
  • Do not use reserved event variant names.
  • Do not assume payable works with scale-only transport — it requires ethabi.
  • Service names must be PascalCase and must not collide with Solidity reserved keywords.
  • Preserve released routes, reply shapes, and events unless the task explicitly changes them.
  • Use Syscall::message_source() == Syscall::program_id() for self-message guards.
  • Hand verification to the gtest loop before claiming done.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.