agent-instructions
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
Use when building serverless systems on AWS. Covers Lambda design, cold starts, event-driven patterns with EventBridge and SQS, idempotency, step functions, and the limits that shape the architecture.
$ npx -y skills add nimadorostkar/Claude-Skills-collection --skill aws-serverless --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/aws-serverlessContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when building serverless systems on AWS. Covers Lambda design, cold starts, event-driven patterns with EventBridge and SQS, idempotency, step functions, and the limits that shape the architecture.
name: aws-serverless description: Use when building serverless systems on AWS. Covers Lambda design, cold starts, event-driven patterns with EventBridge and SQS, idempotency, step functions, and the limits that shape the architecture. metadata: category: devops version: 1.0.0 tags: [serverless, lambda, eventbridge, sqs, step-functions]
Build serverless systems that handle retries and partial failure correctly. The platform will retry your function; whether that is harmless is entirely your design decision.
1. **Assume the function will run twice** — SQS is at-least-once. EventBridge is at-least-once. Asynchronous Lambda invocations retry twice by default. Idempotency is not optional. 2. **Report partial batch failures** — With SQS batches, a single failed message re-delivers the *entire* batch unless you return `batchItemFailures`. That is how one poison message causes ten thousand duplicate side effects. 3. **Keep the handler thin** — Parse the event, call a plain function, map the result. The business logic should be testable without a Lambda context. 4. **Initialize outside the handler** — Database clients, SDK clients, and config are reused across warm invocations. Creating them per invocation is a per-request cost you pay forever. 5. **Tune memory by measurement** — Memory determines CPU. A function at 1024 MB often finishes in a third of the time of one at 256 MB, for the same or lower total cost. 6. **Set the DLQ and the alarm** — An asynchronous function without a DLQ silently discards events after its retries. You will not know.
**SQS handler: partial batch failure plus idempotency:**
export const handler = async (event: SQSEvent): Promise<SQSBatchResponse> => {
const batchItemFailures: SQSBatchItemFailure[] = [];
for (const record of event.Records) {
try {
const order = JSON.parse(record.body) as OrderPlaced;
// Conditional write: the second delivery of the same event is a no-op.
await ddb.send(new PutItemCommand({
TableName: PROCESSED_TABLE,
Item: { pk: { S: `event#${order.eventId}` }, ttl: { N: String(ttl(14)) } },
ConditionExpression: "attribute_not_exists(pk)",
}));
await fulfil(order);
} catch (err) {
if (err instanceof ConditionalCheckFailedException) {
continue; // already processed: succeed silently
}
// Fail only this message. The rest of the batch is acknowledged.
batchItemFailures.push({ itemIdentifier: record.messageId });
console.error("processing failed", { messageId: record.messageId, err });
}
}
return { batchItemFailures };
};**Retries and DLQ declared, not assumed:**
Resources:
OrdersQueue:
Type: AWS::SQS::Queue
Properties:
VisibilityTimeout: 180 # >= 6x the function timeout
RedrivePolicy:
deadLetterTargetArn: !GetAtt OrdersDlq.Arn
maxReceiveCount: 5 # then it stops retrying and lands in the DLQA curated library of 137 production-grade skills for Claude and other AI coding agents. Every skill follows one structure, speaks with one voice, and earns its place by changing what the agent does.
Repo: nimadorostkar/Claude-Skills-collection
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
Use when an agent needs state that survives a session or a context compaction. Covers what to persist, file-based memory, structuring notes for retrieval, and…
Use when automating agent behavior with lifecycle hooks. Covers hook events, deterministic enforcement of rules the model should not be trusted to remember,…
Use when packaging skills, commands, hooks, and MCP servers into a distributable plugin. Covers manifest structure, bundling, versioning, testing, and…
Use when writing a new skill for an AI agent. Covers scoping, description writing for reliable triggering, progressive disclosure, and the difference between a…
Use when reviewing or improving an existing agent skill. Covers triggering accuracy, content quality, redundancy with the base model, and measuring whether the…