sails-architecture
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.
What this skill does
# 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.
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.