-
Notifications
You must be signed in to change notification settings - Fork 0
Codeloom 4 bedrock #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
5844de6
1b21e0e
42f776c
d6d7012
b67b211
80fb709
769b171
ace61b6
7e3c317
7abaf2c
0b6f6d8
ae86206
67645df
ee43e76
493ecf9
3fcc83d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,128 @@ | ||
| inspector_Enable: | ||
| title: Enable &Inspector; scanning | ||
| title_abbrev: Enable scanning | ||
| synopsis: enable &Inspector; scanning for resource types. | ||
| category: Actions | ||
| languages: | ||
| Python: | ||
| versions: | ||
| - sdk_version: 3 | ||
| github: python/example_code/inspector | ||
| excerpts: | ||
| - description: Enable Inspector scanning for specified resource types. | ||
| snippet_tags: | ||
| - python.example_code.inspector.Enable | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Kiro version correctly put 3 snippets here: class, decl, and the action code. This one is missing the extra snippets. |
||
| services: | ||
| inspector: {Enable} | ||
| inspector_BatchGetAccountStatus: | ||
| title: Get &Inspector; account status | ||
| title_abbrev: Get account status | ||
| synopsis: get the &Inspector; status for AWS accounts. | ||
| category: Actions | ||
| languages: | ||
| Python: | ||
| versions: | ||
| - sdk_version: 3 | ||
| github: python/example_code/inspector | ||
| excerpts: | ||
| - description: Get Inspector account status information. | ||
| snippet_tags: | ||
| - python.example_code.inspector.BatchGetAccountStatus | ||
| services: | ||
| inspector: {BatchGetAccountStatus} | ||
| inspector_ListFindings: | ||
| title: List &Inspector; findings | ||
| title_abbrev: List findings | ||
| synopsis: list security findings from &Inspector;. | ||
| category: Actions | ||
| languages: | ||
| Python: | ||
| versions: | ||
| - sdk_version: 3 | ||
| github: python/example_code/inspector | ||
| excerpts: | ||
| - description: List Inspector security findings with filtering options. | ||
| snippet_tags: | ||
| - python.example_code.inspector.ListFindings | ||
| services: | ||
| inspector: {ListFindings} | ||
| inspector_BatchGetFindingDetails: | ||
| title: Get &Inspector; finding details | ||
| title_abbrev: Get finding details | ||
| synopsis: get detailed information for &Inspector; findings. | ||
| category: Actions | ||
| languages: | ||
| Python: | ||
| versions: | ||
| - sdk_version: 3 | ||
| github: python/example_code/inspector | ||
| excerpts: | ||
| - description: Get detailed information for specific Inspector findings. | ||
| snippet_tags: | ||
| - python.example_code.inspector.BatchGetFindingDetails | ||
| services: | ||
| inspector: {BatchGetFindingDetails} | ||
| inspector_ListCoverage: | ||
| title: List &Inspector; coverage | ||
| title_abbrev: List coverage | ||
| synopsis: list resource coverage information from &Inspector;. | ||
| category: Actions | ||
| languages: | ||
| Python: | ||
| versions: | ||
| - sdk_version: 3 | ||
| github: python/example_code/inspector | ||
| excerpts: | ||
| - description: List Inspector resource coverage statistics. | ||
| snippet_tags: | ||
| - python.example_code.inspector.ListCoverage | ||
| services: | ||
| inspector: {ListCoverage} | ||
| inspector_Disable: | ||
| title: Disable &Inspector; scanning | ||
| title_abbrev: Disable scanning | ||
| synopsis: disable &Inspector; scanning for resource types. | ||
| category: Actions | ||
| languages: | ||
| Python: | ||
| versions: | ||
| - sdk_version: 3 | ||
| github: python/example_code/inspector | ||
| excerpts: | ||
| - description: Disable Inspector scanning for specified resource types. | ||
| snippet_tags: | ||
| - python.example_code.inspector.Disable | ||
| services: | ||
| inspector: {Disable} | ||
| inspector_Hello: | ||
| title: Hello &Inspector; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, here is the hello example. It should have been at the top. |
||
| title_abbrev: Hello &Inspector; | ||
| synopsis: get started using &Inspector;. | ||
| category: Hello | ||
| languages: | ||
| Python: | ||
| versions: | ||
| - sdk_version: 3 | ||
| github: python/example_code/inspector | ||
| excerpts: | ||
| - description: Get started with Inspector by checking account status. | ||
| snippet_tags: | ||
| - python.example_code.inspector.Hello | ||
| services: | ||
| inspector: {BatchGetAccountStatus} | ||
| inspector_Scenario: | ||
| title: Learn &Inspector; basics | ||
| title_abbrev: Learn the basics | ||
| synopsis: learn to accomplish &Inspector; tasks. | ||
| category: Scenarios | ||
| languages: | ||
| Python: | ||
| versions: | ||
| - sdk_version: 3 | ||
| github: python/example_code/inspector | ||
| excerpts: | ||
| - description: Run an interactive scenario demonstrating Inspector features. | ||
| snippet_tags: | ||
| - python.example_code.inspector.Scenario | ||
| services: | ||
| inspector: {Enable, BatchGetAccountStatus, ListFindings, BatchGetFindingDetails, ListCoverage, Disable} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # CodeLoom-4-Bedrock | ||
|
|
||
| CodeLoom-4-Bedrock is configured to develop AWS SDK code examples across 12+ programming languages for AWS Documentation. | ||
|
|
||
| ## How It Works | ||
|
|
||
| This setup uses two key components to ensure consistent, high-quality code: | ||
|
|
||
| ### MCP Servers | ||
| - **Amazon Bedrock Knowledge Base**: Access to curated coding standards and premium implementation patterns | ||
| - **AWS Knowledge Server**: Direct access to AWS documentation and service information | ||
|
|
||
| ### Steering Rules | ||
| Automated guidance that enforces: | ||
| - **Knowledge Base First**: Always consult knowledge bases before writing code | ||
| - **Language-Specific Patterns**: Each language has specific naming, structure, and testing requirements | ||
|
|
||
| ## Quick Start | ||
|
|
||
| 1. **Check MCP Status**: Ensure servers are running in Kiro MCP Server view | ||
| 2. **Choose Language**: Each has specific patterns (see steering docs) | ||
| 3. **Research Service**: The tool will automatically query knowledge bases and AWS docs | ||
| 4. **Follow the Workflow**: KB consultation → Implementation → Testing → Documentation | ||
|
|
||
| ## Key Requirements | ||
|
|
||
| - **Knowledge Base Consultation**: Mandatory before any code creation | ||
| - **All Tests Must Pass**: Zero failures before work is complete | ||
| - **Hello Scenarios First**: Simple examples before complex ones | ||
| - **Real AWS Integration**: Tests use actual AWS services with proper cleanup | ||
|
|
||
| ## Configuration Files | ||
|
|
||
| - **MCP Setup**: `.kiro/settings/mcp.json` (requires `cex-ai-kb-access` AWS profile) | ||
| - **Detailed Rules**: `.kiro/steering/*.md` files contain comprehensive guidelines | ||
| - **Language Specifics**: See `tech.md`, `python-tech.md`, `java-tech.md`, etc. | ||
|
|
||
| ## Need Help? | ||
|
|
||
| - Review steering files in `.kiro/steering/` for detailed guidance | ||
| - Check MCP server status if knowledge base queries fail | ||
| - All language-specific patterns are documented in the steering rules |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| { | ||
| "mcpServers": { | ||
| "awslabs.bedrock-kb-retrieval-mcp-server": { | ||
| "command": "uvx", | ||
| "args": [ | ||
| "awslabs.bedrock-kb-retrieval-mcp-server@latest" | ||
| ], | ||
| "env": { | ||
| "AWS_PROFILE": "cex-ai-kb-access", | ||
| "AWS_REGION": "us-west-2", | ||
| "FASTMCP_LOG_LEVEL": "ERROR", | ||
| "BEDROCK_KB_RERANKING_ENABLED": "false" | ||
| }, | ||
| "disabled": false, | ||
| "autoApprove": [] | ||
| }, | ||
| "aws-knowledge-mcp-server": { | ||
| "command": "uvx", | ||
| "args": [ | ||
| "mcp-proxy", | ||
| "--transport", | ||
| "streamablehttp", | ||
| "https://knowledge-mcp.global.api.aws" | ||
| ], | ||
| "disabled": false | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,176 @@ | ||
| # .NET Technology Stack & Build System | ||
|
|
||
| ## .NET 3.5+ Development Environment | ||
|
|
||
| ### Build Tools & Dependencies | ||
| - **Build System**: dotnet CLI | ||
| - **Package Manager**: NuGet | ||
| - **Testing Framework**: xUnit | ||
| - **Code Formatting**: dotnet-format | ||
| - **SDK Version**: AWS SDK for .NET | ||
| - **.NET Version**: .NET 3.5+ (recommended .NET 6+) | ||
|
|
||
| ### Common Build Commands | ||
|
|
||
| ```bash | ||
| # Build and Package | ||
| dotnet build SOLUTION.sln # Build solution | ||
| dotnet build PROJECT.csproj # Build specific project | ||
| dotnet clean # Clean build artifacts | ||
|
|
||
| # Testing | ||
| dotnet test # Run all tests | ||
| dotnet test --filter Category=Integration # Run integration tests | ||
| dotnet test --logger trx # Run tests with detailed output | ||
|
|
||
| # Execution | ||
| dotnet run # Run project | ||
| dotnet run --project PROJECT.csproj # Run specific project | ||
|
|
||
| # Code Quality | ||
| dotnet format # Format code | ||
| ``` | ||
|
|
||
| ### .NET-Specific Pattern Requirements | ||
|
|
||
| #### File Naming Conventions | ||
| - Use PascalCase for class names and file names | ||
| - Service prefix pattern: `{Service}Actions.cs` (e.g., `S3Actions.cs`) | ||
| - Hello scenarios: `Hello{Service}.cs` (e.g., `HelloS3.cs`) | ||
| - Test files: `{Service}Tests.cs` | ||
|
|
||
| #### Hello Scenario Structure | ||
| - **Class naming**: `Hello{Service}.cs` class with main method | ||
| - **Method structure**: Static Main method as entry point | ||
| - **Documentation**: Include XML documentation explaining the hello example purpose | ||
|
|
||
| #### Code Structure Standards | ||
| - **Namespace naming**: Use reverse domain notation (e.g., `Amazon.DocSamples.S3`) | ||
| - **Class structure**: One public class per file matching filename | ||
| - **Method naming**: Use PascalCase for method names | ||
| - **Properties**: Use PascalCase for property names | ||
| - **Constants**: Use PascalCase for constants | ||
| - **Async methods**: Suffix with `Async` (e.g., `ListBucketsAsync`) | ||
|
|
||
| #### Error Handling Patterns | ||
| ```csharp | ||
| using Amazon.S3; | ||
| using Amazon.S3.Model; | ||
| using System; | ||
| using System.Threading.Tasks; | ||
|
|
||
| public class ExampleClass | ||
| { | ||
| public async Task ExampleMethodAsync() | ||
| { | ||
| var s3Client = new AmazonS3Client(); | ||
|
|
||
| try | ||
| { | ||
| var response = await s3Client.ListBucketsAsync(); | ||
| // Process response | ||
| Console.WriteLine($"Found {response.Buckets.Count} buckets"); | ||
| } | ||
| catch (AmazonS3Exception e) | ||
| { | ||
| // Handle S3-specific exceptions | ||
| Console.WriteLine($"S3 Error: {e.Message}"); | ||
| Console.WriteLine($"Error Code: {e.ErrorCode}"); | ||
| throw; | ||
| } | ||
| catch (Exception e) | ||
| { | ||
| // Handle general exceptions | ||
| Console.WriteLine($"Error: {e.Message}"); | ||
| throw; | ||
| } | ||
| finally | ||
| { | ||
| s3Client?.Dispose(); | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| #### Testing Standards | ||
| - **Test framework**: Use xUnit attributes (`[Fact]`, `[Theory]`) | ||
| - **Integration tests**: Mark with `[Trait("Category", "Integration")]` | ||
| - **Async testing**: Use `async Task` for async test methods | ||
| - **Resource management**: Use `using` statements for AWS clients | ||
| - **Test naming**: Use descriptive method names explaining test purpose | ||
|
|
||
| #### Project Structure | ||
| ``` | ||
| src/ | ||
| ├── {Service}Examples/ | ||
| │ ├── Hello{Service}.cs | ||
| │ ├── {Service}Actions.cs | ||
| │ ├── {Service}Scenarios.cs | ||
| │ └── {Service}Examples.csproj | ||
| └── {Service}Examples.Tests/ | ||
| ├── {Service}Tests.cs | ||
| └── {Service}Examples.Tests.csproj | ||
| ``` | ||
|
|
||
| #### Documentation Requirements | ||
| - **XML documentation**: Use `///` for class and method documentation | ||
| - **Parameter documentation**: Document all parameters with `<param>` | ||
| - **Return documentation**: Document return values with `<returns>` | ||
| - **Exception documentation**: Document exceptions with `<exception>` | ||
| - **README sections**: Include dotnet setup and execution instructions | ||
|
|
||
| ### AWS Credentials Handling | ||
|
|
||
| #### Critical Credential Testing Protocol | ||
| - **CRITICAL**: Before assuming AWS credential issues, always test credentials first with `aws sts get-caller-identity` | ||
| - **NEVER** assume credentials are incorrect without verification | ||
| - If credentials test passes but .NET SDK fails, investigate SDK-specific credential chain issues | ||
| - Common .NET SDK credential issues: EC2 instance metadata service conflicts, credential provider chain order | ||
|
|
||
| #### Credential Chain Configuration | ||
| ```csharp | ||
| // Explicit credential chain setup | ||
| var chain = new CredentialProfileStoreChain(); | ||
| if (chain.TryGetAWSCredentials("default", out var credentials)) | ||
| { | ||
| var config = new AmazonS3Config(); | ||
| var client = new AmazonS3Client(credentials, config); | ||
| } | ||
| ``` | ||
|
|
||
| ### Build Troubleshooting | ||
|
|
||
| #### DotNetV4 Build Troubleshooting | ||
| - **CRITICAL**: When you get a response that the project file does not exist, use `listDirectory` to find the correct project/solution file path before trying to build again | ||
| - **NEVER** repeatedly attempt the same build command without first locating the actual file structure | ||
| - Always verify file existence with directory listing before executing build commands | ||
|
|
||
| ### Language-Specific Pattern Errors to Avoid | ||
| - ❌ **NEVER create examples for dotnetv3 UNLESS explicitly instructed to by the user** | ||
| - ❌ **NEVER use camelCase for .NET class or method names** | ||
| - ❌ **NEVER forget to dispose AWS clients (use using statements)** | ||
| - ❌ **NEVER ignore proper exception handling for AWS operations** | ||
| - ❌ **NEVER skip NuGet package management** | ||
| - ❌ **NEVER assume credentials without testing first** | ||
|
|
||
| ### Best Practices | ||
| - ✅ **ALWAYS follow the established .NET project structure** | ||
| - ✅ **ALWAYS use PascalCase for .NET identifiers** | ||
| - ✅ **ALWAYS use using statements for AWS client management** | ||
| - ✅ **ALWAYS include proper exception handling for AWS service calls** | ||
| - ✅ **ALWAYS test AWS credentials before assuming credential issues** | ||
| - ✅ **ALWAYS include comprehensive XML documentation** | ||
| - ✅ **ALWAYS use async/await patterns for AWS operations** | ||
|
|
||
| ### Project Configuration Requirements | ||
| - **Target Framework**: Specify appropriate .NET version in .csproj | ||
| - **AWS SDK packages**: Include specific AWS service NuGet packages | ||
| - **Test packages**: Include xUnit and test runner packages | ||
| - **Configuration**: Support for appsettings.json and environment variables | ||
|
|
||
| ### Integration with Knowledge Base | ||
| Before creating .NET code examples: | ||
| 1. Query `coding-standards-KB` for "DotNet-code-example-standards" | ||
| 2. Query `DotNet-premium-KB` for "DotNet implementation patterns" | ||
| 3. Follow KB-documented patterns for project structure and class organization | ||
| 4. Validate against existing .NET examples only after KB consultation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same problem as previous versions, it is not using a valid entity name. Also, it appears to be missing the hello example.