Skip to content

Commit 202d12d

Browse files
author
Tejas Ganesh Naik
committed
Made steering doc changes; added separate python directory
1 parent 4bb8450 commit 202d12d

File tree

12 files changed

+2520
-0
lines changed

12 files changed

+2520
-0
lines changed

steering_docs/dotnet-tech.md

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
# .NET Technology Stack & Build System
2+
3+
## .NET 3.5+ Development Environment
4+
5+
### Build Tools & Dependencies
6+
- **Build System**: dotnet CLI
7+
- **Package Manager**: NuGet
8+
- **Testing Framework**: xUnit
9+
- **Code Formatting**: dotnet-format
10+
- **SDK Version**: AWS SDK for .NET
11+
- **.NET Version**: .NET 3.5+ (recommended .NET 6+)
12+
13+
### Common Build Commands
14+
15+
```bash
16+
# Build and Package
17+
dotnet build SOLUTION.sln # Build solution
18+
dotnet build PROJECT.csproj # Build specific project
19+
dotnet clean # Clean build artifacts
20+
21+
# Testing
22+
dotnet test # Run all tests
23+
dotnet test --filter Category=Integration # Run integration tests
24+
dotnet test --logger trx # Run tests with detailed output
25+
26+
# Execution
27+
dotnet run # Run project
28+
dotnet run --project PROJECT.csproj # Run specific project
29+
30+
# Code Quality
31+
dotnet format # Format code
32+
```
33+
34+
### .NET-Specific Pattern Requirements
35+
36+
#### File Naming Conventions
37+
- Use PascalCase for class names and file names
38+
- Service prefix pattern: `{Service}Actions.cs` (e.g., `S3Actions.cs`)
39+
- Hello scenarios: `Hello{Service}.cs` (e.g., `HelloS3.cs`)
40+
- Test files: `{Service}Tests.cs`
41+
42+
#### Hello Scenario Structure
43+
- **Class naming**: `Hello{Service}.cs` class with main method
44+
- **Method structure**: Static Main method as entry point
45+
- **Documentation**: Include XML documentation explaining the hello example purpose
46+
47+
#### Code Structure Standards
48+
- **Namespace naming**: Use reverse domain notation (e.g., `Amazon.DocSamples.S3`)
49+
- **Class structure**: One public class per file matching filename
50+
- **Method naming**: Use PascalCase for method names
51+
- **Properties**: Use PascalCase for property names
52+
- **Constants**: Use PascalCase for constants
53+
- **Async methods**: Suffix with `Async` (e.g., `ListBucketsAsync`)
54+
55+
#### Error Handling Patterns
56+
```csharp
57+
using Amazon.S3;
58+
using Amazon.S3.Model;
59+
using System;
60+
using System.Threading.Tasks;
61+
62+
public class ExampleClass
63+
{
64+
public async Task ExampleMethodAsync()
65+
{
66+
var s3Client = new AmazonS3Client();
67+
68+
try
69+
{
70+
var response = await s3Client.ListBucketsAsync();
71+
// Process response
72+
Console.WriteLine($"Found {response.Buckets.Count} buckets");
73+
}
74+
catch (AmazonS3Exception e)
75+
{
76+
// Handle S3-specific exceptions
77+
Console.WriteLine($"S3 Error: {e.Message}");
78+
Console.WriteLine($"Error Code: {e.ErrorCode}");
79+
throw;
80+
}
81+
catch (Exception e)
82+
{
83+
// Handle general exceptions
84+
Console.WriteLine($"Error: {e.Message}");
85+
throw;
86+
}
87+
finally
88+
{
89+
s3Client?.Dispose();
90+
}
91+
}
92+
}
93+
```
94+
95+
#### Testing Standards
96+
- **Test framework**: Use xUnit attributes (`[Fact]`, `[Theory]`)
97+
- **Integration tests**: Mark with `[Trait("Category", "Integration")]`
98+
- **Async testing**: Use `async Task` for async test methods
99+
- **Resource management**: Use `using` statements for AWS clients
100+
- **Test naming**: Use descriptive method names explaining test purpose
101+
102+
#### Project Structure
103+
```
104+
src/
105+
├── {Service}Examples/
106+
│ ├── Hello{Service}.cs
107+
│ ├── {Service}Actions.cs
108+
│ ├── {Service}Scenarios.cs
109+
│ └── {Service}Examples.csproj
110+
└── {Service}Examples.Tests/
111+
├── {Service}Tests.cs
112+
└── {Service}Examples.Tests.csproj
113+
```
114+
115+
#### Documentation Requirements
116+
- **XML documentation**: Use `///` for class and method documentation
117+
- **Parameter documentation**: Document all parameters with `<param>`
118+
- **Return documentation**: Document return values with `<returns>`
119+
- **Exception documentation**: Document exceptions with `<exception>`
120+
- **README sections**: Include dotnet setup and execution instructions
121+
122+
### AWS Credentials Handling
123+
124+
#### Critical Credential Testing Protocol
125+
- **CRITICAL**: Before assuming AWS credential issues, always test credentials first with `aws sts get-caller-identity`
126+
- **NEVER** assume credentials are incorrect without verification
127+
- If credentials test passes but .NET SDK fails, investigate SDK-specific credential chain issues
128+
- Common .NET SDK credential issues: EC2 instance metadata service conflicts, credential provider chain order
129+
130+
#### Credential Chain Configuration
131+
```csharp
132+
// Explicit credential chain setup
133+
var chain = new CredentialProfileStoreChain();
134+
if (chain.TryGetAWSCredentials("default", out var credentials))
135+
{
136+
var config = new AmazonS3Config();
137+
var client = new AmazonS3Client(credentials, config);
138+
}
139+
```
140+
141+
### Build Troubleshooting
142+
143+
#### DotNetV4 Build Troubleshooting
144+
- **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
145+
- **NEVER** repeatedly attempt the same build command without first locating the actual file structure
146+
- Always verify file existence with directory listing before executing build commands
147+
148+
### Language-Specific Pattern Errors to Avoid
149+
-**NEVER create examples for dotnetv3 UNLESS explicitly instructed to by the user**
150+
-**NEVER use camelCase for .NET class or method names**
151+
-**NEVER forget to dispose AWS clients (use using statements)**
152+
-**NEVER ignore proper exception handling for AWS operations**
153+
-**NEVER skip NuGet package management**
154+
-**NEVER assume credentials without testing first**
155+
156+
### Best Practices
157+
-**ALWAYS follow the established .NET project structure**
158+
-**ALWAYS use PascalCase for .NET identifiers**
159+
-**ALWAYS use using statements for AWS client management**
160+
-**ALWAYS include proper exception handling for AWS service calls**
161+
-**ALWAYS test AWS credentials before assuming credential issues**
162+
-**ALWAYS include comprehensive XML documentation**
163+
-**ALWAYS use async/await patterns for AWS operations**
164+
165+
### Project Configuration Requirements
166+
- **Target Framework**: Specify appropriate .NET version in .csproj
167+
- **AWS SDK packages**: Include specific AWS service NuGet packages
168+
- **Test packages**: Include xUnit and test runner packages
169+
- **Configuration**: Support for appsettings.json and environment variables
170+
171+
### Integration with Knowledge Base
172+
Before creating .NET code examples:
173+
1. Query `coding-standards-KB` for "DotNet-code-example-standards"
174+
2. Query `DotNet-premium-KB` for "DotNet implementation patterns"
175+
3. Follow KB-documented patterns for project structure and class organization
176+
4. Validate against existing .NET examples only after KB consultation

steering_docs/java-tech.md

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# Java Technology Stack & Build System
2+
3+
## Java v2 Development Environment
4+
5+
### Build Tools & Dependencies
6+
- **Build System**: Apache Maven
7+
- **Testing Framework**: JUnit 5
8+
- **Build Plugin**: Apache Maven Shade Plugin
9+
- **SDK Version**: AWS SDK for Java v2
10+
- **Java Version**: JDK 17
11+
12+
### Common Build Commands
13+
14+
```bash
15+
# Build and Package
16+
mvn clean compile # Compile source code
17+
mvn package # Build with dependencies
18+
mvn clean package # Clean and build
19+
20+
# Testing
21+
mvn test # Run all tests
22+
mvn test -Dtest=ClassName # Run specific test class
23+
mvn test -Dtest=ClassName#methodName # Run specific test method
24+
25+
# Execution
26+
java -cp target/PROJECT-1.0-SNAPSHOT.jar com.example.Main
27+
mvn exec:java -Dexec.mainClass="com.example.Main"
28+
```
29+
30+
### Java-Specific Pattern Requirements
31+
32+
#### File Naming Conventions
33+
- Use PascalCase for class names
34+
- Service prefix pattern: `{Service}Action.java` (e.g., `S3ListBuckets.java`)
35+
- Hello scenarios: `Hello{Service}.java` (e.g., `HelloS3.java`)
36+
- Test files: `{Service}ActionTest.java`
37+
38+
#### Hello Scenario Structure
39+
- **Class naming**: `Hello{Service}.java` class with main method
40+
- **Method structure**: Static main method as entry point
41+
- **Documentation**: Include Javadoc explaining the hello example purpose
42+
43+
#### Code Structure Standards
44+
- **Package naming**: Use reverse domain notation (e.g., `com.example.s3`)
45+
- **Class structure**: One public class per file matching filename
46+
- **Method naming**: Use camelCase for method names
47+
- **Constants**: Use UPPER_SNAKE_CASE for static final variables
48+
- **Imports**: Group imports logically (Java standard, AWS SDK, other libraries)
49+
50+
#### Error Handling Patterns
51+
```java
52+
import software.amazon.awssdk.services.s3.S3Client;
53+
import software.amazon.awssdk.core.exception.SdkException;
54+
import software.amazon.awssdk.services.s3.model.S3Exception;
55+
56+
public class ExampleClass {
57+
public void exampleMethod() {
58+
try (S3Client s3Client = S3Client.builder().build()) { //For Hello examples, use Sync service clients. For Scenario examples or working with service client, use the Java Async client.
59+
// AWS service call
60+
var response = s3Client.operation();
61+
// Process response
62+
} catch (S3Exception e) {
63+
// Handle service-specific exceptions
64+
System.err.println("S3 Error: " + e.awsErrorDetails().errorMessage());
65+
throw e;
66+
} catch (SdkException e) {
67+
// Handle general SDK exceptions
68+
System.err.println("SDK Error: " + e.getMessage());
69+
throw e;
70+
}
71+
}
72+
}
73+
```
74+
75+
#### Testing Standards
76+
- **Test framework**: Use JUnit 5 annotations (`@Test`, `@BeforeEach`, `@AfterEach`)
77+
- **Integration tests**: Mark with `@Tag("IntegrationTest")` or similar
78+
- **Resource management**: Use Github standards for AWS clients
79+
- **Assertions**: Use JUnit 5 assertion methods
80+
- **Test naming**: Use descriptive method names explaining test purpose
81+
82+
#### Maven Project Structure
83+
```
84+
src/
85+
├── main/
86+
│ └── java/
87+
│ └── com/
88+
│ └── example/
89+
│ └── {service}/
90+
│ ├── Hello{Service}.java
91+
│ ├── {Service}Actions.java
92+
│ └── {Service}Scenario.java
93+
└── test/
94+
└── java/
95+
└── com/
96+
└── example/
97+
└── {service}/
98+
└── {Service}Test.java
99+
```
100+
101+
#### Documentation Requirements
102+
- **Class Javadoc**: Include purpose, usage examples, and prerequisites
103+
- **Method Javadoc**: Document parameters, return values, and exceptions
104+
- **Inline comments**: Explain complex AWS service interactions
105+
- **README sections**: Include Maven setup and execution instructions
106+
107+
### Language-Specific Pattern Errors to Avoid
108+
-**NEVER assume class naming without checking existing examples**
109+
-**NEVER use snake_case for Java class or method names**
110+
-**NEVER forget to close AWS clients (use try-with-resources)**
111+
-**NEVER ignore proper exception handling for AWS operations**
112+
-**NEVER skip Maven dependency management**
113+
114+
### Best Practices
115+
-**ALWAYS follow the established Maven project structure**
116+
-**ALWAYS use PascalCase for class names and camelCase for methods**
117+
-**ALWAYS use try-with-resources for AWS client management**
118+
-**ALWAYS include proper exception handling for AWS service calls**
119+
-**ALWAYS follow Java naming conventions and package structure**
120+
-**ALWAYS include comprehensive Javadoc documentation**
121+
122+
### Maven Configuration Requirements
123+
- **AWS SDK BOM**: Include AWS SDK Bill of Materials for version management
124+
- **Compiler plugin**: Configure for appropriate Java version
125+
- **Shade plugin**: For creating executable JARs with dependencies
126+
- **Surefire plugin**: For test execution configuration
127+
128+
### Integration with Knowledge Base
129+
Before creating Java code examples:
130+
1. Query `coding-standards-KB` for "Java-code-example-standards"
131+
2. Query `Java-premium-KB` for "Java implementation patterns"
132+
3. Follow KB-documented patterns for Maven structure and class organization
133+
4. Validate against existing Java examples only after KB consultation

0 commit comments

Comments
 (0)