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

sails-architecture

Skill17 starsChanged 8 months agoMITView on GitHub

Use when a builder needs to shape or correct standard Gear/Vara Sails program and service boundaries, state ownership, or message flow. Do not use for pure deployment work, Vara.eth or ethexe targets, or non-Sails programs.

The file

Show its rules and text

We split this skill into the rules it gives an agent

32 rules. About 0 are common, 23 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈23

    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. Distinctive:

    If the work changes a released contract or introduces a new deployed contract version, the architecture note must also define compatibility …

    line 12
  2. Very specific:

    Write the result to docs/plans/YYYY-MM-DD-<topic>-architecture.md.

    line 27
  3. Very specific:

    If the design depends on future execution budget, call out reserved gas or ReservationId usage and duration explicitly.

    line 32
  4. Distinctive:

    Treat the Waitlist as on-chain storage for messages awaiting processing or conditions, not as a normal mempool.

    line 33
  5. Very specific:

    If the architecture question is whether Gear or Sails exposes the right API family, review ../gear-gstd-api-map/SKILL.md first.

    line 38
  6. Very specific:

    If the architecture risk is mostly around replies, timeouts, delayed work, or reservations, review ../gear-message-execution/SKILL.md.

    line 39
  7. Very specific:

    If the architecture introduces a fungible token, token-backed accounting, or token-manager split, review …

    line 40
  8. Very specific:

    If a service wraps a runtime builtin actor (staking broker, proxy broker, BLS helper, ETH bridge sender), review …

    line 41
  9. Distinctive:

    Consider routing and events.

    line 48
  10. Distinctive:

    If work is delayed, is it block-based and allowed to self-message later?

    line 49
  11. Distinctive:

    If future automation matters, is reservation lifetime and gas budgeting explicit?

    line 50
  12. Distinctive:

    If messages may sit in the Waitlist, does the design account for rent, expiry, and maximum duration?

    line 51
  13. Distinctive:

    If a delayed or self-call hits a Sails route, does the design keep generated clients or equivalent Sails Header-aware encoding in the …

    line 54
  14. Very specific:

    If this changes a released contract, has the design classified the change as additive or breaking, and as interface-ID-preserving or …

    line 56
  15. Distinctive:

    If a cutover is required, does the note say how old and new versions coexist during rollout?

    line 61
  16. Distinctive:

    If migration is required, does the note define export/import responsibilities instead of hiding them inside vague “upgrade” wording?

    line 62
  17. Distinctive:

    If the work targets an already released contract, treat public routes, reply shapes, event payloads, and generated-client expectations as …

    line 66
  18. Distinctive:

    Prefer additive changes such as new routes, new services, or a new deployed contract version over mutating an existing public shape in …

    line 67
  19. Distinctive:

    If the user is preparing a new contract version, define how the old and new versions coexist during cutover.

    line 68
  20. Distinctive:

    If the old version must stop accepting writes, make that lifecycle explicit in the architecture note.

    line 69
  21. Very specific:

    If state migration is required, define the split between V1, V2, and the off-chain migrator instead of implying an in-place code swap.

    line 70
  22. Very specific:

    If the contract is expected to live beyond its first production release, the architecture note must describe how state could later be …

    line 74
  23. Distinctive:

    If the spec is missing, stop and create it first.

    line 85
  24. Distinctive:

    Prefer Sails service composition over ad hoc raw Gear layering.

    line 86
  25. Distinctive:

    Treat generated clients as the default route contract for constructor and service calls.

    line 87
  26. Distinctive:

    Do not assume delayed automation works without future gas availability.

    line 88
  27. Distinctive:

    Do not treat Waitlist storage as free or indefinitely prolongable.

    line 89
  28. Distinctive:

    Keep implementation detail out of the architecture note unless it changes the public contract.

    line 90
  29. Distinctive:

    Do not change a released public route shape in place unless the architecture explicitly treats it as a breaking change.

    line 91
  30. Distinctive:

    Do not change a released event payload in place without explicit versioning or cutover notes.

    line 92
  31. Distinctive:

    Do not assume IDL regeneration alone makes a breaking interface change safe.

    line 93
  32. Distinctive:

    Do not describe Gear/Sails evolution as an in-place hot swap of live contract code.

    line 94

≈ “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 Architecture

Goal

Turn an approved spec into a Sails-specific architecture artifact before implementation starts.

If the work changes a released contract or introduces a new deployed contract version, the architecture note must also define compatibility expectations for public routes, replies, events, generated clients, and off-chain consumers such as frontend and indexer.

Inputs

  • ../../assets/architecture-template.md
  • ../../references/vara-domain-overview.md
  • ../../references/sails-cheatsheet.md
  • ../../references/gear-sails-production-patterns.md
  • ../../references/sails-program-and-service-architecture.md
  • ../../references/gear-messaging-and-replies.md
  • ../../references/gear-gas-reservations-and-waitlist.md
  • ../../references/awesome-sails-token-patterns.md
  • ../../references/contract-interface-evolution.md
  • ../../references/sails-header-wire-format.md — interface ID stability, entry ID derivation, route index

Write the result to docs/plans/YYYY-MM-DD-<topic>-architecture.md.

Execution Model Checks

  • Model deferred work with delayed messages across future blocks, not off-chain cron as the default. A program can send a delayed message to itself or another actor when it must revisit state later.
  • If the design depends on future execution budget, call out reserved gas or ReservationId usage and duration explicitly. Reservation keeps gas available for later sends, including delayed sends, but it is not free, permanent, or a value transfer.
  • Treat the Waitlist as on-chain storage for messages awaiting processing or conditions, not as a normal mempool.
  • Waitlisted messages incur rent or locked-fund costs over time, can expire at a maximum duration, and cannot be prolonged indefinitely.

Route Deeper When Needed

  • If the architecture question is whether Gear or Sails exposes the right API family, review ../gear-gstd-api-map/SKILL.md first.
  • If the architecture risk is mostly around replies, timeouts, delayed work, or reservations, review ../gear-message-execution/SKILL.md.
  • If the architecture introduces a fungible token, token-backed accounting, or token-manager split, review ../../references/awesome-sails-token-patterns.md.
  • If a service wraps a runtime builtin actor (staking broker, proxy broker, BLS helper, ETH bridge sender), review ../gear-builtin-actors/SKILL.md — state ownership, idempotency, and reply routing differ from program-to-program calls because the builtin has no memory or code.

Review Checklist

  • Choose explicit service boundaries.
  • Explain state ownership.
  • Name the program constructor shape and the chosen storage pattern instead of implying them.
  • Consider routing and events.
  • If work is delayed, is it block-based and allowed to self-message later?
  • If future automation matters, is reservation lifetime and gas budgeting explicit?
  • If messages may sit in the Waitlist, does the design account for rent, expiry, and maximum duration?
  • Are #[program] and #[service] boundaries explicit?
  • Are routes, replies, and events stable enough for generated clients?
  • If a delayed or self-call hits a Sails route, does the design keep generated clients or equivalent Sails Header-aware encoding in the contract?
  • Does the design account for async Gear message flow and failure paths?
  • If this changes a released contract, has the design classified the change as additive or breaking, and as interface-ID-preserving or interface-ID-breaking? (See ../../references/sails-header-wire-format.md for how interface IDs are derived.)
  • Are all public methods annotated with #[export]?
  • Are existing public routes, replies, and events preserved unless the architecture explicitly versions them?
  • Does the note define contract version and status surface such as Active and ReadOnly when relevant?
  • Does the design explain frontend and indexer impact for a new deployed contract version?
  • If a cutover is required, does the note say how old and new versions coexist during rollout?
  • If migration is required, does the note define export/import responsibilities instead of hiding them inside vague “upgrade” wording?

Released Contract Evolution Defaults

  • If the work targets an already released contract, treat public routes, reply shapes, event payloads, and generated-client expectations as compatibility-sensitive surfaces.
  • Prefer additive changes such as new routes, new services, or a new deployed contract version over mutating an existing public shape in place.
  • If the user is preparing a new contract version, define how the old and new versions coexist during cutover.
  • If the old version must stop accepting writes, make that lifecycle explicit in the architecture note.
  • If state migration is required, define the split between V1, V2, and the off-chain migrator instead of implying an in-place code swap.

Future Migration Readiness

If the contract is expected to live beyond its first production release, the architecture note must describe how state could later be exported from V1.

At minimum:

  • identify business-significant state stored in the program
  • distinguish source-of-truth data from derived or rebuildable data
  • describe whether future export would rely on full-state reads, selective state functions, or explicit export methods
  • note any collections that will require deterministic chunking or canonical ordering
  • state whether the contract may need a ReadOnly lifecycle mode in a future release

Guardrails

  • If the spec is missing, stop and create it first.
  • Prefer Sails service composition over ad hoc raw Gear layering.
  • Treat generated clients as the default route contract for constructor and service calls.
  • Do not assume delayed automation works without future gas availability.
  • Do not treat Waitlist storage as free or indefinitely prolongable.
  • Keep implementation detail out of the architecture note unless it changes the public contract.
  • Do not change a released public route shape in place unless the architecture explicitly treats it as a breaking change.
  • Do not change a released event payload in place without explicit versioning or cutover notes.
  • Do not assume IDL regeneration alone makes a breaking interface change safe.
  • Do not describe Gear/Sails evolution as an in-place hot swap of live contract code.

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.