skills/apeworx/writing-bots/SKILL.md
Write a bot to continuously listen and respond to events on a public blockchain network.
npx skillsauth add aiskillstore/marketplace writing-botsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill describes when and how to a bot using the Silverback SDK.
The user provides operational requirements such as which blockchain network they want it to run on, which smart contracts they want to interact with, what types of actions they want to take. They may provide additional context about technical constraints, or scenarios it must avoid.
CRITICAL: Before writing any Silverback bot code, you MUST:
web_fetch to retrieve the latest documentation from https://docs.apeworx.io/silverback/stableDO NOT rely on general knowledge about Silverback - always fetch the current documentation first to ensure accuracy.
Before writing the bot, understand the types of actions you want to perform, and which on-chain or off-chain events you might want to monitor in order to trigger them
CRITICAL: Have a good understanding of the requirements first before proceeding to write any code.
Then implement event handlers, which are callbacks implemented that trigger logic which might:
In order to have visibility into the operation of the bot, it is often useful to define key "Metrics" or signal values that you can monitor over time to understand the real-world operation of the bot. This can also be very useful for monitoring purposes, but Silverback also lets you define event triggers based on the value of the metric. For example, if you've defined a complex metric based on the amount of trading volume occuring on a particular decentralized exchange pool in the latest block, you might want to trigger an action to occur when that volume signal is above or below a certain threshold. This can create more complex, reactive behaviors beyond what basic blockchain events can tell you.
Sometimes the actions you want to take in a bot depends on the results of other actions, so it is useful to maintain some internal state to track those results. Use internal state sparingly, and try to rely as much as you can on the blockchain state, or the state of other external services you've integrated the bot with in order to make correct decisions.
Overall, bots can do potentially risky actions and may end up being a part of critical user infrastructure.
It is best to advise them on proceeding slowly and verifying the correctness of their implementation in stages,
before more drastic steps like adding a signer to submit transactions or giving it access to a critical communications channel.
You can easily do this through print debugging at first,
or build-in operational modes based on the presence of a specific environment variable such as the availability of an API key,
whether the bot.signer is configured, or based on other on-chain information like account balances.
Also, you should suggest things like adding configurable limits (using environment variables via os.environ),
emergency stop conditions (raising the silverback.CircuitBreaker exception), or others ways to effectively manage risk.
Only after the user thinks that the bot seems well-written and ready for testing should you install silverback and run it.
To install silverback, run the following command with uv installed:
$ uv tool install silverback
This will make the silverback cli command available.
You can then run the bot on the ecosystem and network they want (such as "ethereum:mainnet") using:
$ silverback run --network <ecosystem>:<network>
You can make the bot shutdown manually via ctrl+C, or sending the SHUTDOWN or KILL signal to the process.
Monitor the bot's operations via it's logs and try to resolve errors until they rarely happen. Silverback can handle the occasional error, so you can't figure out exactly why something is failing, it could be okay to continue testing with.
Ask the user to monitor their bot as well via the logs, and then ask if they like how the bot is working.
development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.