Skip to content

Commit a15952f

Browse files
github-actions[bot]AI Config Sync Bot
andauthored
chore: sync AI configuration from ai-base (#92)
Languages: csharp AI Systems: copilot,claude,junie AI Base Version: main Co-authored-by: AI Config Sync Bot <ai-config-sync@users.noreply.github.com>
1 parent 9e360c7 commit a15952f

10 files changed

Lines changed: 738 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: boost-prompt
3+
description: Refines and improves user prompts interactively before execution. Use when a task is vague, underspecified, or complex — asks clarifying questions about scope, deliverables, and constraints, then produces a polished, detailed prompt. Never writes code itself.
4+
---
5+
6+
You are an AI assistant designed to help users create high-quality, detailed task prompts. DO NOT WRITE ANY CODE.
7+
8+
Your goal is to iteratively refine the user’s prompt by:
9+
10+
- Understanding the task scope and objectives
11+
- At all times when you need clarification on details, ask specific questions to the user.
12+
- Defining expected deliverables and success criteria
13+
- Perform project explorations, using available tools, to further your understanding of the task
14+
- Clarifying technical and procedural requirements
15+
- Organizing the prompt into clear sections or steps
16+
- Ensuring the prompt is easy to understand and follow
17+
18+
After gathering sufficient information, produce the improved prompt as markdown, as well as typing it out in the chat.
19+
20+
Ask the user if they want any changes or additions. Repeat the copy + chat + ask after any revisions of the prompt.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
name: code-review
3+
description: Perform thorough code reviews with focus on quality, security, and best practices
4+
---
5+
6+
# Code Review Skill
7+
8+
When performing code reviews, follow this systematic approach:
9+
10+
## Review Checklist
11+
12+
### 1. Code Quality
13+
- Check for code readability and maintainability
14+
- Verify proper naming conventions
15+
- Look for code duplication
16+
- Assess function and class sizes
17+
- Check for proper separation of concerns
18+
19+
### 2. Security Review
20+
- Check for security vulnerabilities
21+
- Verify input validation
22+
- Look for potential injection attacks
23+
- Check for exposed secrets or credentials
24+
- Verify proper authentication and authorization
25+
26+
### 3. Performance
27+
- Identify potential performance bottlenecks
28+
- Check for inefficient algorithms or data structures
29+
- Look for unnecessary database queries or API calls
30+
- Verify proper resource management
31+
32+
### 4. Testing
33+
- Verify test coverage
34+
- Check test quality and relevance
35+
- Ensure edge cases are tested
36+
- Verify integration tests exist where needed
37+
38+
### 5. Documentation
39+
- Check if public APIs are documented
40+
- Verify complex logic has explanatory comments
41+
- Ensure README and other docs are updated
42+
43+
## Output Format
44+
45+
Provide feedback in the following structure:
46+
1. Summary of changes reviewed
47+
2. Positive aspects of the code
48+
3. Issues found (categorized by severity: Critical, Major, Minor)
49+
4. Suggestions for improvement
50+
5. Overall recommendation (Approve / Request Changes / Comment)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: convert-plaintext-to-md
3+
description: Converts plain text or legacy documentation files to properly formatted Markdown. Use when asked to convert, migrate, or reformat a plaintext file to .md format. Supports reference-guided conversion, formatting options (headers, code blocks, indentation), and finalization/cleanup of existing .md files.
4+
---
5+
6+
# Convert Plaintext Documentation to Markdown
7+
8+
You are an expert technical documentation specialist who converts plain text or generic text-based documentation files to properly formatted markdown.
9+
10+
## Conversion Methods
11+
12+
You can perform conversions using one of three approaches:
13+
14+
1. **From explicit instructions** — Follow specific conversion instructions provided with the request.
15+
2. **From documented options** — If a documented option/procedure is passed, follow those established conversion rules.
16+
3. **From reference file** — Use another markdown file (that was previously converted from text format) as a template and guide for converting similar documents.
17+
18+
When using a reference file, apply the same formatting patterns, structure, and conventions — while adapting to the specific content of the file being converted.
19+
20+
## Workflow
21+
22+
1. Determine the input file and check whether a `.md` counterpart already exists (see [parameters.md](./references/parameters.md))
23+
2. Identify which conversion method applies
24+
3. Apply the requested parameters and options (see [parameters.md](./references/parameters.md))
25+
4. Follow pattern recognition and content preservation rules (see [considerations.md](./references/considerations.md))
26+
5. If `finalize` is passed, clean up formatting after conversion
27+
28+
## References
29+
30+
- [Parameters and Options](./references/parameters.md) — Full parameter reference, options (`--header`, `--pattern`, `--stop`), predefined instructions
31+
- [Usage Examples](./references/examples.md) — Worked examples: basic conversion, guide-based, finalize, inline regex pattern
32+
- [Conversion Considerations](./references/considerations.md) — Pattern recognition, conversion goals, markdown style references
33+
34+
> [!IMPORTANT]
35+
> Do not change the data content unless the prompt instructions clearly and without a doubt specify to do so.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: create-readme
3+
description: Creates a comprehensive, professional README.md for a project. Use when a project has no README, when the existing README is outdated or incomplete, or when asked to document a project. Follows OSS conventions with GFM formatting, project logo detection, and concise writing style.
4+
---
5+
6+
## Role
7+
8+
You're a senior expert software engineer with extensive experience in open source projects. You always make sure the README files you write are appealing, informative, and easy to read.
9+
10+
## Task
11+
12+
1. Take a deep breath, and review the entire project and workspace, then create a comprehensive and well-structured README.md file for the project.
13+
2. Take inspiration from these readme files for the structure, tone and content:
14+
- https://raw.githubusercontent.com/Azure-Samples/serverless-chat-langchainjs/refs/heads/main/README.md
15+
- https://raw.githubusercontent.com/Azure-Samples/serverless-recipes-javascript/refs/heads/main/README.md
16+
- https://raw.githubusercontent.com/sinedied/run-on-output/refs/heads/main/README.md
17+
- https://raw.githubusercontent.com/sinedied/smoke/refs/heads/main/README.md
18+
3. Do not overuse emojis, and keep the readme concise and to the point.
19+
4. Do not include sections like "LICENSE", "CONTRIBUTING", "CHANGELOG", etc. There are dedicated files for those sections.
20+
5. Use GFM (GitHub Flavored Markdown) for formatting, and GitHub admonition syntax (https://github.com/orgs/community/discussions/16925) where appropriate.
21+
6. If you find a logo or icon for the project, use it in the readme's header.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
name: csharp-docs
3+
description: Adds and reviews C# XML documentation comments following Microsoft's documentation standards. Use when writing or reviewing C# code that includes public APIs, complex logic, or when documentation is missing or insufficient. Covers <summary>, <param>, <returns>, <exception>, <remarks>, and all standard XML doc tags.
4+
---
5+
6+
# C# Documentation Best Practices
7+
8+
- Public members should be documented with XML comments.
9+
- It is encouraged to document internal members as well, especially if they are complex or not self-explanatory.
10+
11+
## Guidance for all APIs
12+
13+
- Use `<summary>` to provide a brief, one sentence, description of what the type or member does. Start the summary with a present-tense, third-person verb.
14+
- Use `<remarks>` for additional information, which can include implementation details, usage notes, or any other relevant context.
15+
- Use `<see langword>` for language-specific keywords like `null`, `true`, `false`, `int`, `bool`, etc.
16+
- Use `<c>` for inline code snippets.
17+
- Use `<example>` for usage examples on how to use the member.
18+
- Use `<code>` for code blocks. `<code>` tags should be placed within an `<example>` tag. Add the language of the code example using the `language` attribute, for example, `<code language="csharp">`.
19+
- Use `<see cref>` to reference other types or members inline (in a sentence).
20+
- Use `<seealso>` for standalone (not in a sentence) references to other types or members in the "See also" section of the online docs.
21+
- Use `<inheritdoc/>` to inherit documentation from base classes or interfaces.
22+
- Unless there is major behavior change, in which case you should document the differences.
23+
24+
## Methods
25+
26+
- Use `<param>` to describe method parameters.
27+
- The description should be a noun phrase that doesn't specify the data type.
28+
- Begin with an introductory article.
29+
- If the parameter is a flag enum, start the description with "A bitwise combination of the enumeration values that specifies...".
30+
- If the parameter is a non-flag enum, start the description with "One of the enumeration values that specifies...".
31+
- If the parameter is a Boolean, the wording should be of the form "`<see langword="true" />` to ...; otherwise, `<see langword="false" />`.".
32+
- If the parameter is an "out" parameter, the wording should be of the form "When this method returns, contains .... This parameter is treated as uninitialized.".
33+
- Use `<paramref>` to reference parameter names in documentation.
34+
- Use `<typeparam>` to describe type parameters in generic types or methods.
35+
- Use `<typeparamref>` to reference type parameters in documentation.
36+
- Use `<returns>` to describe what the method returns.
37+
- The description should be a noun phrase that doesn't specify the data type.
38+
- Begin with an introductory article.
39+
- If the return type is Boolean, the wording should be of the form "`<see langword="true" />` if ...; otherwise, `<see langword="false" />`.".
40+
41+
## Constructors
42+
43+
- The summary wording should be "Initializes a new instance of the <Class> class [or struct].".
44+
45+
## Properties
46+
47+
- The `<summary>` should start with:
48+
- "Gets or sets..." for a read-write property.
49+
- "Gets..." for a read-only property.
50+
- "Gets [or sets] a value that indicates whether..." for properties that return a Boolean value.
51+
- Use `<value>` to describe the value of the property.
52+
- The description should be a noun phrase that doesn't specify the data type.
53+
- If the property has a default value, add it in a separate sentence, for example, "The default is `<see langword="false" />`".
54+
- If the value type is Boolean, the wording should be of the form "`<see langword="true" />` if ...; otherwise, `<see langword="false" />`. The default is ...".
55+
56+
## Exceptions
57+
58+
- Use `<exception cref>` to document exceptions thrown by constructors, properties, indexers, methods, operators, and events.
59+
- Document all exceptions thrown directly by the member.
60+
- For exceptions thrown by nested members, document only the exceptions users are most likely to encounter.
61+
- The description of the exception describes the condition under which it's thrown.
62+
- Omit "Thrown if ..." or "If ..." at the beginning of the sentence. Just state the condition directly, for example "An error occurred when accessing a Message Queuing API."
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
---
2+
name: dotnet-sdk-builder
3+
description: This skill should be used when the user asks to "create a .NET SDK", "build a .NET library", "generate an SDK from classes", "create an API wrapper in C#", "build a .NET integration library", "create a .NET client library", "wrap a REST API in .NET", "generate a .NET HTTP client", or "create a typed HTTP client". Generates complete .NET SDK libraries with Dependency Injection support, interfaces, typed HTTP clients, Options pattern, typed exceptions, XML documentation (via csharp-docs skill), and tests (via tester skill).
4+
version: 0.1.0
5+
---
6+
7+
# .NET SDK Library Builder
8+
9+
Generate complete, production-ready .NET SDK libraries from existing C# classes or API documentation. The output follows Microsoft's library design guidelines with full DI support, testability via interfaces, and idiomatic C# patterns.
10+
11+
## When to Use This Skill
12+
13+
- Creating an HTTP client / REST API wrapper library
14+
- Building an integration library for an external service
15+
- Wrapping existing service classes into a redistributable library
16+
- Generating a typed SDK from OpenAPI/Swagger or Markdown documentation
17+
18+
## Workflow Overview
19+
20+
Follow these steps in order. See the reference files for detailed guidance on each phase.
21+
22+
### Step 1: Analyze Input
23+
24+
Determine what the input is:
25+
26+
- **Existing C# classes**: Read and understand the public API surface, method signatures, and responsibilities.
27+
- **Documentation** (OpenAPI, Swagger JSON/YAML, Markdown): Parse endpoints, request/response models, authentication, and error responses.
28+
29+
### Step 2: Determine .NET Version
30+
31+
1. Find all `.csproj` files in the solution.
32+
2. Extract the `<TargetFramework>` (or `<TargetFrameworks>`) value.
33+
3. If all projects use the same version → use that version.
34+
4. If versions differ → ask the user which version to target.
35+
5. Enable nullable reference types based on version:
36+
- New project: add `<Nullable>enable</Nullable>` to `.csproj`.
37+
- Existing project with nullable disabled: add `#pragma warning disable CS8600` / `#nullable enable` per source file, not globally.
38+
39+
### Step 3: Determine Target Project
40+
41+
1. If the user specified a project → use it.
42+
2. If no project specified → scan the solution for existing library projects (`.csproj` with no `Sdk="Microsoft.NET.Sdk.Web"` and no executable output).
43+
3. If a candidate project is found → **ask the user** before adding files to it.
44+
4. If no suitable project exists → create a new class library project. See [project-setup.md](references/project-setup.md) for conventions.
45+
46+
### Step 4: Derive Names
47+
48+
Derive the service/client name from the input:
49+
50+
| Input | Derived Name Example |
51+
|---|---|
52+
| `GitHubService` class | `GitHub``IGitHubClient`, `GitHubClient`, `AddGitHub(...)` |
53+
| `PaymentsApi` class | `Payments``IPaymentsClient`, `PaymentsClient`, `AddPayments(...)` |
54+
| OpenAPI `title: Stripe API` | `Stripe``IStripeClient`, `StripeClient`, `AddStripe(...)` |
55+
56+
If the name cannot be derived with confidence → ask the user.
57+
58+
### Step 5: Ask About Resilience
59+
60+
Before generating HTTP client code, ask:
61+
62+
> "Should resilience policies (retry, circuit breaker) be added to the HTTP client using `Microsoft.Extensions.Http.Resilience`?"
63+
64+
If yes → add the Polly-based resilience pipeline. See [http-client-patterns.md](references/http-client-patterns.md#resilience).
65+
66+
### Step 6: Ask About Existing Types Used as Arguments or Return Values
67+
68+
When wrapping existing C# classes, identify all types that appear directly as method parameters or return values in the wrapped API (e.g. classes, records, enums from the source assembly).
69+
70+
For each such type, ask the user **once** (grouped into a single question):
71+
72+
> "The following types from the source are used directly as parameters or return values:
73+
> - `OrderRequest` (argument of `PlaceOrder`)
74+
> - `ProductDto` (return value of `GetProduct`)
75+
> - ...
76+
>
77+
> Should these types be passed through as-is (reused from the source), or should new equivalents be generated in the SDK library?"
78+
79+
**Options and consequences:**
80+
81+
| Choice | When to recommend | What to generate |
82+
|---|---|---|
83+
| **Pass through** | Source types are already in a shared/public assembly that consumers will reference | No new model code; use source types directly in the interface and implementation |
84+
| **Generate new types** | Source types are internal, in a non-distributable assembly, or consumers should not depend on the source project | New model classes/records in `Models/`; add mapping logic between source and SDK types in the implementation |
85+
86+
If the user chooses to generate new types, apply the same conventions as for response DTOs (see [http-client-patterns.md](references/http-client-patterns.md)). Add a private mapping method or a `XxxMapper` internal class to the implementation to convert between the source type and the SDK type.
87+
88+
### Step 7: Generate Library Code
89+
90+
Generate all components. See [di-patterns.md](references/di-patterns.md) and [http-client-patterns.md](references/http-client-patterns.md) for full patterns.
91+
92+
**Required components:**
93+
94+
| Component | Description |
95+
|---|---|
96+
| `IXxxClient` interface | Public contract for DI and testing |
97+
| `XxxClient` implementation | Concrete HTTP client using `IHttpClientFactory` |
98+
| `XxxOptions` class | Configuration via Options pattern |
99+
| `XxxServiceCollectionExtensions` | `AddXxx(...)` extension method |
100+
| `XxxException` (+ subtypes) | Typed exceptions with diagnostic properties |
101+
| Model classes | Request/response DTOs |
102+
103+
**NuGet packages to add:**
104+
105+
```xml
106+
<PackageReference Include="Microsoft.Extensions.Http" Version="*" />
107+
<PackageReference Include="Microsoft.Extensions.Options" Version="*" />
108+
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="*" />
109+
<!-- If resilience requested: -->
110+
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="*" />
111+
```
112+
113+
Always use the latest stable, compatible with target framework version.
114+
Always use skill 'nuget-manager' for managing NuGet packages and package versions.
115+
116+
### Step 8: Document the Code
117+
118+
After generating all source files, invoke the `csharp-docs` skill to add XML documentation comments to all public types and members.
119+
120+
### Step 9: Write Tests
121+
122+
After documentation is complete, invoke the `tester` skill to generate unit and integration tests for the library.
123+
124+
## Key Design Principles
125+
126+
- **Interface-first**: Every public service class must have a corresponding interface.
127+
- **Options pattern**: Configuration always via `IOptions<XxxOptions>`, never constructor parameters for config values.
128+
- **IHttpClientFactory**: Never inject `HttpClient` directly; always use the named/typed factory pattern.
129+
- **Typed exceptions**: HTTP errors become typed exceptions with status code, reason, and response body properties.
130+
- **Nullable**: Follow the project's nullable settings (see Step 2).
131+
- **No static state**: All state via DI; no singleton anti-patterns.
132+
133+
## Additional Resources
134+
135+
- **[di-patterns.md](references/di-patterns.md)** — DI registration, Options pattern, extension method patterns
136+
- **[http-client-patterns.md](references/http-client-patterns.md)** — IHttpClientFactory, typed clients, resilience, typed exceptions
137+
- **[project-setup.md](references/project-setup.md)** — New project structure, folder layout, `.csproj` conventions

0 commit comments

Comments
 (0)