trove-lambda

trove-lambda is a cursor rule for Cursor from bravew/trove. It costs 885 tokens per session, scanned A, original, MIT.

Coding rules for AWS Lambda, a service that runs small pieces of code without managing servers, and AWS CDK, a way to define cloud infrastructure in code.

In plain words
What is it for?
Use it when writing or reviewing Lambda handlers and CDK files, especially code that receives queued or published messages.
Why use it?
It keeps Lambda handlers, message parsing, logging, and their cloud setup consistent, reducing mistakes when processing SQS or SNS messages.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it when writing or reviewing Lambda handlers and CDK files, especially code that receives queued or published messages.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/bravew/trove/trove-lambda
View source ↗ bravew/trove
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/bravew/trove

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for trove-lambda

README.md
[![agentmods](https://agentmods.dev/badge/rules/bravew/trove/trove-lambda/github.svg)](https://agentmods.dev/rules/bravew/trove/trove-lambda)
Your own site
<a href="https://agentmods.dev/rules/bravew/trove/trove-lambda"><img src="https://agentmods.dev/badge/rules/bravew/trove/trove-lambda/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for trove-lambda

Your own site · 80×15
<a href="https://agentmods.dev/rules/bravew/trove/trove-lambda"><img src="https://agentmods.dev/badge/rules/bravew/trove/trove-lambda.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 885 This file is loaded in full into every session.
When invoked 885 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00885 $0.00885
Opus 5.5 $0.00354 $0.00354
Sonnet 5.5 $0.00177 $0.00177
Haiku 4.5 $0.00089 $0.00089

Measured 20d ago against content hash 5de9546217aa, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

trove-lambda scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 20d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/trove-dev/rules/trove-lambda.mdc · 108 lines

How it starts

The opening of the file, as written. The whole thing — 108 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Session Init

This skill ships Trove conventions. Prefer existing project patterns over generic best practices when they conflict.

AWS Lambda Conventions

Handler Structure

from aws_lambda_powertools import Logger
from aws_lambda_powertools.utilities.typing import LambdaContext

logger = Logger()

@logger.inject_lambda_context(log_event=True)
def handler(event: dict, context: LambdaContext) -> dict:
    records = parse_event(event)
    for record in records:
        process_record(record)
    return {"statusCode": 200}

SQS/SNS Event Parsing

def parse_sqs_event(event: dict) -> list[dict]:
    return [json.loads(record["body"]) for record in event["Records"]]

def parse_sns_via_sqs(event: dict) -> list[dict]:
    messages = []
    for record in event["Records"]:
        body = json.loads(record["body"])
        message = json.loads(body["Message"])
        messages.append(message)
    return messages

def parse_sns_direct(event: dict) -> list[dict]:
    # A Lambda subscribed to the topic directly gets no `body`.
    return [json.loads(record["Sns"]["Message"]) for record in event["Records"]]

Check which shape the trigger delivers before parsing. SNS through SQS puts the SNS envelope in body. A direct subscription puts it under Sns.

Logging

Follow the same logging rules as trove-python, plus:

  • Use @logger.inject_lambda_context(log_event=True) on handlers
  • Use logger.append_keys() for request-scoped context
  • Use logger.exception() in error handlers (captures stack trace for Sentry)
  • Keep messages static and put values in extra: logger.warning("IPC token rejected", extra={"source": source})

IPC Pattern (Backend Communication)

Inbound: an event that claims to come from the backend is untrusted until its token matches BACKEND_IPC_TOKEN. Check it before parsing the payload or doing any work, compare in constant time, and never log the token itself.

Read the full file on GitHub · 108 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 20d ago Changed · +27 lines · +272 tokens per session 5de9546217aa
  2. 2mo ago Changed · -2 lines · -12 tokens per session 608e7a6cc2c9
  3. 3mo ago First seen · 83 lines · 625 tokens per session scan A 28bb6b715acd

Subscribe to this mod's changes

trove-lambda is a cursor rule published in the GitHub repository bravew/trove (11 stars, last pushed today), licensed MIT. It adds 885 tokens to every session, about $0.0035 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

trove-lambda compared with cursor rules from other repositories

trove-lambda next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
trove-lambdabravew/troveCursor rule11todayMITA885Cursor
cloudflare-email-telegram-cursorrules-prompt-filePatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A720Cursor
service-bindingslouisbrulenaudet/monorepo-templateCursor rule19yesterdayApache-2.0A775Cursor
implement-graceful-shutdown-for-your-applicationPaulJPhilp/EffectPatternsCursor rule8075mo agoMITA702Cursor
hatch3r-scalabilityhatch3r/hatch3rCursor rule262mo agoMITA0Cursor
cloudflare-workers-hono-angular-saas-cursorrules-prompt-fileXD3an/awesome-ai-coding-all-in-oneCursor rule144d agononeA1,335Cursor
knative-istio-typesense-gpu-cursorrules-prompt-filXD3an/awesome-ai-coding-all-in-oneCursor rule144d agononeA613Cursor