aws-cdk-development by zxkane/aws-skills
npx skills add https://github.com/zxkane/aws-skills --skill aws-cdk-development包含钩子
此技能使用 Claude 钩子,这些钩子可以自动执行代码以响应事件。安装前请仔细审查。
此技能为使用 Cloud Development Kit (CDK) 开发 AWS 基础设施提供全面指导,并集成了用于访问最新 AWS 知识和 CDK 实用工具的 MCP 服务器。
在回答之前,始终使用 MCP 工具(mcp__aws-mcp__* 或 mcp__*awsdocs*__*)验证 AWS 事实。aws-mcp-setup 依赖项会自动加载——如果 MCP 工具不可用,请引导用户完成该技能的设置流程。
此技能包含通过插件自动配置的 CDK MCP 服务器:
何时使用:用于 CDK 特定指导和实用工具
重要提示:利用此服务器获取 CDK 构造指导和高级 CDK 操作。
在以下情况下使用此技能:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
关键:当 CDK 构造中资源名称是可选时,请不要显式指定资源名称。
原因:CDK 生成的名称支持:
模式:让 CDK 使用 CloudFormation 的命名机制自动生成唯一名称。
// ❌ 错误 - 显式命名会阻碍可重用性和并行部署
new lambda.Function(this, 'MyFunction', {
functionName: 'my-lambda', // 避免这样做
// ...
});
// ✅ 正确 - 让 CDK 生成唯一名称
new lambda.Function(this, 'MyFunction', {
// 未指定 functionName - CDK 生成:StackName-MyFunctionXXXXXX
// ...
});
安全说明:对于不同的环境(开发、预发布、生产),请遵循 AWS 安全支柱最佳实践,使用单独的 AWS 账户,而不是依赖单个账户内的资源命名。账户级别的隔离提供了更强的安全边界。
根据运行时使用适当的 Lambda 构造:
TypeScript/JavaScript:使用 @aws-cdk/aws-lambda-nodejs
import { NodejsFunction } from 'aws-cdk-lib/aws-lambda-nodejs';
new NodejsFunction(this, 'MyFunction', {
entry: 'lambda/handler.ts',
handler: 'handler',
// 自动处理打包、依赖项和转译
});
Python:使用 @aws-cdk/aws-lambda-python
import { PythonFunction } from '@aws-cdk/aws-lambda-python-alpha';
new PythonFunction(this, 'MyFunction', {
entry: 'lambda',
index: 'handler.py',
handler: 'handler',
// 自动处理依赖项和打包
});
优势:
使用多层验证策略进行全面的 CDK 质量检查:
对于 TypeScript/JavaScript 项目:
安装 cdk-nag 以进行合成时验证:
npm install --save-dev cdk-nag
添加到您的 CDK 应用程序中:
import { Aspects } from 'aws-cdk-lib';
import { AwsSolutionsChecks } from 'cdk-nag';
const app = new App();
Aspects.of(app).add(new AwsSolutionsChecks());
可选 - VS Code 用户:安装 CDK NAG 验证器扩展,以便在文件保存时获得更快的反馈。
对于 Python/Java/C#/Go 项目:cdk-nag 在所有 CDK 语言中都可用,并提供相同的合成时验证。
使用 cdk-nag 合成:使用全面的规则验证堆栈
cdk synth # cdk-nag 通过 Aspects 自动运行
抑制合理的例外情况并记录原因:
import { NagSuppressions } from 'cdk-nag';
// 记录为什么需要此例外
NagSuppressions.addResourceSuppressions(resource, [
{
id: 'AwsSolutions-L1',
reason: 'Lambda@Edge 需要特定的运行时以实现 CloudFront 兼容性'
}
]);
构建:确保编译成功
npm run build # 或特定语言的构建命令
测试:运行单元测试和集成测试
npm test # 或 pytest, mvn test 等
验证脚本:元级别检查
./scripts/validate-stack.sh
验证脚本现在专注于:
在实施前始终验证:
示例场景:
利用其获取 CDK 特定指导:
示例场景:
有关详细的 CDK 模式、反模式和架构指导,请参阅综合参考:
文件:references/cdk-patterns.md
此参考包括:
scripts/validate-stack.sh - 部署前验证references/cdk-patterns.md - 详细模式库当存储库中存在 GitHub Actions 工作流文件时,在提交前确保 .github/workflows/ 中定义的所有检查都通过。这可以防止 CI/CD 失败并保持代码质量标准。
每周安装次数
417
代码仓库
GitHub 星标数
216
首次出现
2026年1月20日
安全审计
安装于
opencode336
codex324
gemini-cli322
github-copilot322
cursor285
amp269
Contains Hooks
This skill uses Claude hooks which can execute code automatically in response to events. Review carefully before installing.
This skill provides comprehensive guidance for developing AWS infrastructure using the Cloud Development Kit (CDK), with integrated MCP servers for accessing latest AWS knowledge and CDK utilities.
Always verify AWS facts using MCP tools (mcp__aws-mcp__* or mcp__*awsdocs*__*) before answering. The aws-mcp-setup dependency is auto-loaded — if MCP tools are unavailable, guide the user through that skill's setup flow.
This skill includes the CDK MCP server automatically configured with the plugin:
When to use : For CDK-specific guidance and utilities
Important : Leverage this server for CDK construct guidance and advanced CDK operations.
Use this skill when:
CRITICAL : Do NOT explicitly specify resource names when they are optional in CDK constructs.
Why : CDK-generated names enable:
Pattern : Let CDK generate unique names automatically using CloudFormation's naming mechanism.
// ❌ BAD - Explicit naming prevents reusability and parallel deployments
new lambda.Function(this, 'MyFunction', {
functionName: 'my-lambda', // Avoid this
// ...
});
// ✅ GOOD - Let CDK generate unique names
new lambda.Function(this, 'MyFunction', {
// No functionName specified - CDK generates: StackName-MyFunctionXXXXXX
// ...
});
Security Note : For different environments (dev, staging, prod), follow AWS Security Pillar best practices by using separate AWS accounts rather than relying on resource naming within a single account. Account-level isolation provides stronger security boundaries.
Use the appropriate Lambda construct based on runtime:
TypeScript/JavaScript : Use @aws-cdk/aws-lambda-nodejs
import { NodejsFunction } from 'aws-cdk-lib/aws-lambda-nodejs';
new NodejsFunction(this, 'MyFunction', {
entry: 'lambda/handler.ts',
handler: 'handler',
// Automatically handles bundling, dependencies, and transpilation
});
Python : Use @aws-cdk/aws-lambda-python
import { PythonFunction } from '@aws-cdk/aws-lambda-python-alpha';
new PythonFunction(this, 'MyFunction', {
entry: 'lambda',
index: 'handler.py',
handler: 'handler',
// Automatically handles dependencies and packaging
});
Benefits :
Use a multi-layer validation strategy for comprehensive CDK quality checks:
For TypeScript/JavaScript projects :
Install cdk-nag for synthesis-time validation:
npm install --save-dev cdk-nag
Add to your CDK app:
import { Aspects } from 'aws-cdk-lib';
import { AwsSolutionsChecks } from 'cdk-nag';
const app = new App();
Aspects.of(app).add(new AwsSolutionsChecks());
Optional - VS Code users : Install CDK NAG Validator extension for faster feedback on file save.
For Python/Java/C#/Go projects : cdk-nag is available in all CDK languages and provides the same synthesis-time validation.
Synthesis with cdk-nag : Validate stack with comprehensive rules
cdk synth # cdk-nag runs automatically via Aspects
Suppress legitimate exceptions with documented reasons:
import { NagSuppressions } from 'cdk-nag';
// Document WHY the exception is needed
NagSuppressions.addResourceSuppressions(resource, [
{
id: 'AwsSolutions-L1',
reason: 'Lambda@Edge requires specific runtime for CloudFront compatibility'
}
]);
Build : Ensure compilation succeeds
npm run build # or language-specific build command
Tests : Run unit and integration tests
npm test # or pytest, mvn test, etc.
Validation Script : Meta-level checks
./scripts/validate-stack.sh
The validation script now focuses on:
Always verify before implementing :
Example scenarios :
Leverage for CDK-specific guidance :
Example scenarios :
For detailed CDK patterns, anti-patterns, and architectural guidance, refer to the comprehensive reference:
File : references/cdk-patterns.md
This reference includes:
scripts/validate-stack.sh - Pre-deployment validationreferences/cdk-patterns.md - Detailed pattern libraryWhen GitHub Actions workflow files exist in the repository, ensure all checks defined in .github/workflows/ pass before committing. This prevents CI/CD failures and maintains code quality standards.
Weekly Installs
417
Repository
GitHub Stars
216
First Seen
Jan 20, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode336
codex324
gemini-cli322
github-copilot322
cursor285
amp269
Azure Data Explorer (Kusto) 查询技能:KQL数据分析、日志遥测与时间序列处理
100,500 周安装
Cloudflare MCP Server 教程:在Cloudflare Workers上构建远程模型上下文协议服务器
328 周安装
Cloudflare Images 图像托管与转换 API 使用指南 | 支持 AI 人脸裁剪与内容凭证
328 周安装
Swift iOS HomeKit Matter 开发指南:控制智能家居与设备配网
329 周安装
iOS WeatherKit 使用指南:获取天气数据、预报与警报的 Swift 实现
329 周安装
Microsoft Agent Framework 开发指南:统一Semantic Kernel与AutoGen的AI智能体框架
329 周安装
Spring缓存单元测试指南:@Cacheable、@CacheEvict、@CachePut测试方法与内存缓存管理器
329 周安装