Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .kiro/README.md
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
28 changes: 28 additions & 0 deletions .kiro/settings/mcp.json
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
}
}
}
176 changes: 176 additions & 0 deletions .kiro/steering/dotnet-tech.md
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
133 changes: 133 additions & 0 deletions .kiro/steering/java-tech.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Java Technology Stack & Build System

## Java v2 Development Environment

### Build Tools & Dependencies
- **Build System**: Apache Maven
- **Testing Framework**: JUnit 5
- **Build Plugin**: Apache Maven Shade Plugin
- **SDK Version**: AWS SDK for Java v2
- **Java Version**: Java 8+ (recommended Java 11+)

### Common Build Commands

```bash
# Build and Package
mvn clean compile # Compile source code
mvn package # Build with dependencies
mvn clean package # Clean and build

# Testing
mvn test # Run all tests
mvn test -Dtest=ClassName # Run specific test class
mvn test -Dtest=ClassName#methodName # Run specific test method

# Execution
java -cp target/PROJECT-1.0-SNAPSHOT.jar com.example.Main
mvn exec:java -Dexec.mainClass="com.example.Main"
```

### Java-Specific Pattern Requirements

#### File Naming Conventions
- Use PascalCase for class names
- Service prefix pattern: `{Service}Action.java` (e.g., `S3ListBuckets.java`)
- Hello scenarios: `Hello{Service}.java` (e.g., `HelloS3.java`)
- Test files: `{Service}ActionTest.java`

#### Hello Scenario Structure
- **Class naming**: `Hello{Service}.java` class with main method
- **Method structure**: Static main method as entry point
- **Documentation**: Include Javadoc explaining the hello example purpose

#### Code Structure Standards
- **Package naming**: Use reverse domain notation (e.g., `com.example.s3`)
- **Class structure**: One public class per file matching filename
- **Method naming**: Use camelCase for method names
- **Constants**: Use UPPER_SNAKE_CASE for static final variables
- **Imports**: Group imports logically (Java standard, AWS SDK, other libraries)

#### Error Handling Patterns
```java
import software.amazon.awssdk.services.s3.S3Client;
import software.amazon.awssdk.core.exception.SdkException;
import software.amazon.awssdk.services.s3.model.S3Exception;

public class ExampleClass {
public void exampleMethod() {
try (S3Client s3Client = S3Client.builder().build()) {
// AWS service call
var response = s3Client.operation();
// Process response
} catch (S3Exception e) {
// Handle service-specific exceptions
System.err.println("S3 Error: " + e.awsErrorDetails().errorMessage());
throw e;
} catch (SdkException e) {
// Handle general SDK exceptions
System.err.println("SDK Error: " + e.getMessage());
throw e;
}
}
}
```

#### Testing Standards
- **Test framework**: Use JUnit 5 annotations (`@Test`, `@BeforeEach`, `@AfterEach`)
- **Integration tests**: Mark with `@Tag("integration")` or similar
- **Resource management**: Use try-with-resources for AWS clients
- **Assertions**: Use JUnit 5 assertion methods
- **Test naming**: Use descriptive method names explaining test purpose

#### Maven Project Structure
```
src/
├── main/
│ └── java/
│ └── com/
│ └── example/
│ └── {service}/
│ ├── Hello{Service}.java
│ ├── {Service}Actions.java
│ └── {Service}Scenario.java
└── test/
└── java/
└── com/
└── example/
└── {service}/
└── {Service}Test.java
```

#### Documentation Requirements
- **Class Javadoc**: Include purpose, usage examples, and prerequisites
- **Method Javadoc**: Document parameters, return values, and exceptions
- **Inline comments**: Explain complex AWS service interactions
- **README sections**: Include Maven setup and execution instructions

### Language-Specific Pattern Errors to Avoid
- ❌ **NEVER assume class naming without checking existing examples**
- ❌ **NEVER use snake_case for Java class or method names**
- ❌ **NEVER forget to close AWS clients (use try-with-resources)**
- ❌ **NEVER ignore proper exception handling for AWS operations**
- ❌ **NEVER skip Maven dependency management**

### Best Practices
- ✅ **ALWAYS follow the established Maven project structure**
- ✅ **ALWAYS use PascalCase for class names and camelCase for methods**
- ✅ **ALWAYS use try-with-resources for AWS client management**
- ✅ **ALWAYS include proper exception handling for AWS service calls**
- ✅ **ALWAYS follow Java naming conventions and package structure**
- ✅ **ALWAYS include comprehensive Javadoc documentation**

### Maven Configuration Requirements
- **AWS SDK BOM**: Include AWS SDK Bill of Materials for version management
- **Compiler plugin**: Configure for appropriate Java version
- **Shade plugin**: For creating executable JARs with dependencies
- **Surefire plugin**: For test execution configuration

### Integration with Knowledge Base
Before creating Java code examples:
1. Query `coding-standards-KB` for "Java-code-example-standards"
2. Query `Java-premium-KB` for "Java implementation patterns"
3. Follow KB-documented patterns for Maven structure and class organization
4. Validate against existing Java examples only after KB consultation
Loading
Loading