Token导航 LogoToken导航TokenDH.com
开发操作浏览器github未标认证来源可访问许可证需确认审计通过

aws-optimization-sstAWS optimization SST 部署

Agent Skill

用于辅助云资源、部署、容器、基础设施和运维自动化任务。它适合让 Agent 检查配置、整理部署步骤、分析资源状态、生成排障思路或辅助云服务接入。使用时需要明确目标环境、账号权限、区域和资源组,区分本地测试与生产操作;涉及删除资源、重启服务、修改网络或权限配置时,应先确认影响范围。

总安装

245

周安装

10

GitHub Stars

公开资料未说明

下载量

79
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:aws-optimization-sst(AWS optimization SST 部署)
来源仓库:https://github.com/tejovanthn/rasikalife
仓库路径:skills/aws-optimization-sst
安装命令:
npx skills add https://github.com/tejovanthn/rasikalife --skill aws-optimization-sst
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/tejovanthn/rasikalife --skill aws-optimization-sst

简介

用于优化基于 SST 框架的 AWS 资源使用效率,涵盖性能提升与成本节约策略。

  • 它适合让 Agent 提供 Lambda 函数配置建议、缓存机制设计与冷启动优化方案。
  • 使用时需要遵循右-sizing 原则,合理设置内存与超时参数,并利用 SST 默认优化配置。
  • 安装需通过 npx skills add 命令从 tejovanthn/rasikalife 仓库添加 aws-optimization-sst 技能。
  • 涉及生产环境调整时应结合 CloudWatch 数据持续迭代优化,避免过度配置造成资源浪费。

SKILL.md

AWS Optimization with SST

This skill covers best practices for optimizing AWS resources using SST, focusing on performance, cost, and developer experience.

Core Principles

  • Right-size resources: Don't over-provision
  • Use SST's defaults: They're already optimized
  • Leverage caching: Reduce redundant work
  • Optimize cold starts: Minimize Lambda initialization time
  • Monitor and iterate: Use data to guide optimization

Lambda Function Optimization

Pattern 1: Function Configuration

// sst.config.ts
new sst.aws.Function("Api", {
  handler: "src/api.handler",
  memory: "512 MB",      // Start here, adjust based on metrics
  timeout: "30 seconds", // Don't use default 3 seconds
  architecture: "arm64", // 20% cheaper and often faster
  nodejs: {
    esbuild: {
      minify: true,       // Smaller bundle
      external: [         // Don't bundle AWS SDK v3
        "@aws-sdk/*"
      ]
    }
  }
});

Memory considerations:

  • Start with 512 MB
  • Monitor execution time vs cost
  • More memory = more CPU = faster execution
  • Sometimes higher memory is cheaper (finishes faster)

Architecture:

  • Use arm64 (Graviton2) for 20% cost savings
  • Same or better performance
  • Works for most workloads

Pattern 2: Bundle Size Optimization

// Optimize imports - tree-shaking friendly
✅ import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
❌ import * as AWS from "aws-sdk";

// Use specific SDK clients
✅ import { GetCommand } from "@aws-sdk/lib-dynamodb";
❌ import { DocumentClient } from "aws-sdk/clients/dynamodb";

Bundle size tips:

  • Use AWS SDK v3 (modular)
  • Import only what you need
  • Mark heavy deps as external
  • Use dynamic imports for large libraries
// Dynamic import for rarely-used code
export async function generatePDF(data: Data) {
  const puppeteer = await import("puppeteer");
  // Only loads when actually called
}

Pattern 3: Connection Reuse

// ✅ Initialize outside handler (reused across invocations)
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";

const client = new DynamoDBClient({
  maxAttempts: 3,
  requestHandler: {
    connectionTimeout: 3000,
    socketTimeout: 3000
  }
});

export async function handler(event) {
  // Use client here
}

// ❌ Don't initialize inside handler
export async function handler(event) {
  const client = new DynamoDBClient({});
  // Creates new connection every time
}

Pattern 4: Provisioned Concurrency

For consistently high traffic:

new sst.aws.Function("HighTraffic", {
  handler: "src/api.handler",
  transform: {
    function: {
      reservedConcurrentExecutions: 10,
      // Provisioned concurrency keeps instances warm
    }
  }
});

When to use:

  • Consistent traffic patterns
  • Latency-sensitive applications
  • Cost justified by reduced cold starts

DynamoDB Optimization

Pattern 1: Table Configuration

const table = new sst.aws.Dynamo("Database", {
  fields: {
    pk: "string",
    sk: "string"
  },
  primaryIndex: { hashKey: "pk", rangeKey: "sk" },

  // Use on-demand for variable traffic
  // Use provisioned for predictable traffic
  stream: "new-and-old-images", // Only if needed for triggers

  transform: {
    table: {
      // Enable point-in-time recovery for production
      pointInTimeRecovery: $app.stage === "production"
        ? { enabled: true }
        : undefined,

      // TTL for automatic data expiration
      timeToLiveAttribute: "expiresAt"
    }
  }
});

Pattern 2: Query Optimization

// ✅ Use Query with specific partition key
await client.send(new QueryCommand({
  TableName: Resource.Database.name,
  KeyConditionExpression: "pk = :pk",
  ExpressionAttributeValues: { ":pk": "USER#123" }
}));

// ❌ Don't use Scan unless absolutely necessary
await client.send(new ScanCommand({
  TableName: Resource.Database.name
}));
// Scans entire table - expensive and slow!

Pattern 3: Batch Operations

// Write multiple items efficiently
import { BatchWriteCommand } from "@aws-sdk/lib-dynamodb";

// Batch up to 25 items per request
const batches = chunk(items, 25);

for (const batch of batches) {
  await client.send(new BatchWriteCommand({
    RequestItems: {
      [Resource.Database.name]: batch.map(item => ({
        PutRequest: { Item: item }
      }))
    }
  }));
}

Pattern 4: Projection Expressions

// Only fetch fields you need
await client.send(new GetCommand({
  TableName: Resource.Database.name,
  Key: { pk: "USER#123", sk: "PROFILE" },
  ProjectionExpression: "name, email" // Don't fetch everything
}));

Pattern 5: GSI Design

// Sparse indexes save cost
const table = new sst.aws.Dynamo("Database", {
  fields: {
    pk: "string",
    sk: "string",
    gsi1pk: "string", // Only set on items that need indexing
    gsi1sk: "string"
  },
  primaryIndex: { hashKey: "pk", rangeKey: "sk" },
  globalIndexes: {
    gsi1: {
      hashKey: "gsi1pk",
      rangeKey: "gsi1sk",
      projection: "keys_only" // Cheapest option
    }
  }
});

// Only active users have gsi1pk
{
  pk: "USER#123",
  sk: "PROFILE",
  status: "active",
  gsi1pk: "ACTIVE#USER", // Only active users
  gsi1sk: "USER#123"
}

S3 Optimization

Pattern 1: Bucket Configuration

const bucket = new sst.aws.Bucket("Uploads", {
  transform: {
    bucket: {
      // Lifecycle rules for cost savings
      lifecycleConfiguration: {
        rules: [
          {
            id: "archive-old-files",
            status: "Enabled",
            transitions: [
              {
                days: 30,
                storageClass: "INTELLIGENT_TIERING"
              },
              {
                days: 90,
                storageClass: "GLACIER"
              }
            ]
          },
          {
            id: "delete-temp-files",
            status: "Enabled",
            expiration: { days: 7 },
            filter: {
              prefix: "temp/"
            }
          }
        ]
      }
    }
  }
});

Pattern 2: Intelligent Tiering

// Automatically moves objects between access tiers
{
  storageClass: "INTELLIGENT_TIERING"
}

// Tiers:
// - Frequent Access (default)
// - Infrequent Access (30 days)
// - Archive Instant Access (90 days)
// - Archive Access (90+ days)
// - Deep Archive Access (180+ days)

Pattern 3: CloudFront for Static Assets

const cdn = new sst.aws.Router("CDN", {
  routes: {
    "/*": {
      bucket: bucket
    }
  },
  transform: {
    distribution: {
      defaultCacheBehavior: {
        compress: true, // Enable compression
        viewerProtocolPolicy: "redirect-to-https",
        cachePolicyId: "658327ea-f89d-4fab-a63d-7e88639e58f6" // CachingOptimized
      }
    }
  }
});

Pattern 4: Presigned URLs

import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
import { GetObjectCommand } from "@aws-sdk/client-s3";

// Generate time-limited URL
const url = await getSignedUrl(
  s3Client,
  new GetObjectCommand({
    Bucket: Resource.Uploads.name,
    Key: fileKey
  }),
  { expiresIn: 3600 } // 1 hour
);

// No Lambda invocation needed for downloads

API Gateway Optimization

Pattern 1: HTTP API vs REST API

// Use HTTP API (cheaper, faster)
new sst.aws.ApiGatewayV2("Api", {
  routes: {
    "GET /posts": "src/posts.list",
    "POST /posts": "src/posts.create"
  }
});

// HTTP API is 71% cheaper than REST API
// Same features for most use cases

Pattern 2: Response Caching

new sst.aws.ApiGatewayV2("Api", {
  routes: {
    "GET /posts": {
      function: "src/posts.list",
      // Cache at API Gateway level
      cache: {
        ttl: "5 minutes"
      }
    }
  }
});

Pattern 3: Request Validation

// Reject invalid requests early (before Lambda invocation)
new sst.aws.ApiGatewayV2("Api", {
  routes: {
    "POST /posts": {
      function: "src/posts.create",
      authorizer: "iam",
      // Validate request before invoking Lambda
    }
  }
});

Remix Optimization with SST

Pattern 1: Server Bundle Optimization

// remix.config.js
export default {
  serverBuildPath: "build/server/index.mjs",
  serverMinify: true,
  serverModuleFormat: "esm",
  // Don't bundle Node.js built-ins
  serverDependenciesToBundle: [
    /^(?!node:)/, // Bundle everything except node: imports
  ]
};

Pattern 2: Asset Optimization

const remix = new sst.aws.Remix("Web", {
  environment: {
    ASSET_URL: cdn.url // Serve assets from CloudFront
  },
  transform: {
    server: {
      // Optimize Lambda
      memory: "512 MB",
      architecture: "arm64"
    }
  }
});

Pattern 3: Edge Caching

// Use CloudFront for edge caching
export const headers = () => ({
  "Cache-Control": "public, max-age=3600, s-maxage=86400"
});

// Cache at edge for 24 hours
// Browser cache for 1 hour

Cost Monitoring

Pattern 1: Resource Tagging

new sst.aws.Function("Api", {
  handler: "src/api.handler",
  transform: {
    function: {
      tags: {
        Environment: $app.stage,
        Service: "api",
        CostCenter: "engineering"
      }
    }
  }
});

Pattern 2: Budget Alerts

// Use AWS Budgets to track costs
// Set up alerts when approaching limits
// Review CloudWatch metrics regularly

Pattern 3: Cost Allocation

// Tag all resources consistently
const tags = {
  Project: "my-app",
  Environment: $app.stage,
  Team: "engineering"
};

// Apply to all resources
new sst.aws.Function("Api", {
  transform: {
    function: { tags }
  }
});

Performance Monitoring

Pattern 1: X-Ray Tracing

new sst.aws.Function("Api", {
  handler: "src/api.handler",
  transform: {
    function: {
      tracingConfig: {
        mode: "Active" // Enable X-Ray tracing
      }
    }
  }
});

// In code
import { captureAWS } from "aws-xray-sdk-core";
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";

const client = captureAWS(new DynamoDBClient({}));

Pattern 2: CloudWatch Metrics

import { CloudWatchClient, PutMetricDataCommand } from "@aws-sdk/client-cloudwatch";

const cloudwatch = new CloudWatchClient({});

await cloudwatch.send(new PutMetricDataCommand({
  Namespace: "MyApp",
  MetricData: [{
    MetricName: "ProcessingTime",
    Value: duration,
    Unit: "Milliseconds"
  }]
}));

Environment-Specific Optimization

Pattern 1: Development Environment

if ($app.stage === "dev") {
  // Smaller, cheaper resources for dev
  new sst.aws.Function("Api", {
    memory: "256 MB",
    timeout: "10 seconds"
  });
}

Pattern 2: Production Environment

if ($app.stage === "production") {
  new sst.aws.Function("Api", {
    memory: "1024 MB",    // More resources
    timeout: "30 seconds",
    transform: {
      function: {
        reservedConcurrentExecutions: 10,
        pointInTimeRecovery: { enabled: true }
      }
    }
  });
}

Best Practices Checklist

Lambda Functions

  • Use ARM64 architecture
  • Minimize bundle size
  • Reuse connections
  • Set appropriate memory
  • Set appropriate timeout
  • Use environment variables for config

DynamoDB

  • Use single table design
  • Query instead of Scan
  • Use batch operations
  • Design GSIs carefully
  • Enable TTL for expiring data
  • Use projection expressions

S3

  • Set lifecycle policies
  • Use Intelligent Tiering
  • Enable CloudFront for static assets
  • Use presigned URLs
  • Compress files before upload

API Gateway

  • Use HTTP API over REST API
  • Enable response caching
  • Validate requests early
  • Use custom domains

Monitoring

  • Tag all resources
  • Set up CloudWatch alarms
  • Enable X-Ray tracing
  • Review Cost Explorer monthly
  • Set budget alerts

Cost Optimization Strategies

1. Right-Size Resources

Monitor and adjust:

# Check Lambda memory usage
# If max memory used < 60% of allocated, reduce

2. Use Reserved Capacity

For predictable workloads:

  • DynamoDB Reserved Capacity
  • Lambda Provisioned Concurrency
  • Savings Plans

3. Cleanup Unused Resources

# Regular audit
sst remove --stage old-feature

4. Optimize Data Transfer

  • Use CloudFront for global distribution
  • Keep data in same region
  • Use VPC endpoints for AWS services

Common Anti-Patterns

Don't:

  • Over-provision memory "just in case"
  • Use Scan on large tables
  • Keep all data forever
  • Ignore CloudWatch metrics
  • Deploy to multiple regions unnecessarily
  • Use REST API when HTTP API works

Do:

  • Start small, scale based on metrics
  • Use Query with partition keys
  • Set up lifecycle policies
  • Monitor and optimize regularly
  • Deploy to one region initially
  • Use HTTP API by default

Further Reading

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.43%
按下载量换算30

Claude

27.73%
按下载量换算22

Cursor

20.43%
按下载量换算16

Gemini CLI

8.93%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills