Free, open-source Windows optimization tool for performance, privacy, and simplicity.
C# csharpdebloatdotnetgamingopen-sourceoptimizationoptimizeroptimizerduckperformanceprivacytweakertweakswindowswinui
chore(agents): consolidate guidelines and tooling files
fatDuckd30169a606c4
diff --git a/.agent/skills/csharp-async b/.agent/skills/csharp-asyncnew file mode 120000index 0000000..8e8dad5--- /dev/null+++ b/.agent/skills/csharp-async@@ -0,0 +1 @@+../../.agents/skills/csharp-async\ No newline at end of filediff --git a/.agent/skills/csharp-docs b/.agent/skills/csharp-docsnew file mode 120000index 0000000..0fd4bd6--- /dev/null+++ b/.agent/skills/csharp-docs@@ -0,0 +1 @@+../../.agents/skills/csharp-docs\ No newline at end of filediff --git a/.agent/skills/csharp-xunit b/.agent/skills/csharp-xunitnew file mode 120000index 0000000..14503f3--- /dev/null+++ b/.agent/skills/csharp-xunit@@ -0,0 +1 @@+../../.agents/skills/csharp-xunit\ No newline at end of filediff --git a/.agent/skills/dotnet-best-practices b/.agent/skills/dotnet-best-practicesnew file mode 120000index 0000000..dc9ca38--- /dev/null+++ b/.agent/skills/dotnet-best-practices@@ -0,0 +1 @@+../../.agents/skills/dotnet-best-practices\ No newline at end of filediff --git a/.agent/skills/microsoft-docs b/.agent/skills/microsoft-docsnew file mode 120000index 0000000..0f3da12--- /dev/null+++ b/.agent/skills/microsoft-docs@@ -0,0 +1 @@+../../.agents/skills/microsoft-docs\ No newline at end of filediff --git a/.agent/skills/powershell-windows b/.agent/skills/powershell-windowsnew file mode 120000index 0000000..dd1b9ae--- /dev/null+++ b/.agent/skills/powershell-windows@@ -0,0 +1 @@+../../.agents/skills/powershell-windows\ No newline at end of filediff --git a/.agent/skills/windows-app-developer b/.agent/skills/windows-app-developernew file mode 120000index 0000000..ca6ba65--- /dev/null+++ b/.agent/skills/windows-app-developer@@ -0,0 +1 @@+../../.agents/skills/windows-app-developer\ No newline at end of filediff --git a/.agents/rules/repository-guidelines.md b/.agents/rules/repository-guidelines.mddeleted file mode 100644index 96c2b53..0000000--- a/.agents/rules/repository-guidelines.md+++ /dev/null@@ -1,54 +0,0 @@-----trigger: always_on------# Repository Guidelines--Welcome to the `optimizerDuck` repository! This document provides guidelines for contributing to the project, ensuring consistency and maintainability across the codebase.--## Project Structure & Module Organization--The repository is organized into two primary projects:--- **`optimizerDuck/`**: The core C# Windows application source.- - `UI/`: Contains XAML views, pages, and components.- - `Services/`: Houses business logic and system operations (e.g., `DiskCleanupService.cs`, `OptimizationService.cs`).- - `Common/`: Shared utilities, helpers, and data converters.- - `Resources/`: Application assets and multi-language `.resx` translation files.-- **`optimizerDuck.Test/`**: The xUnit test suite for validating application logic.--*To build the application, execute the `build.bat` script in the root directory or run `dotnet build optimizerDuck.slnx`.*--## Coding Style & Naming Conventions--This project targets modern .NET (C#) and uses XAML for the frontend presentation.--- **Classes & Methods**: Use `PascalCase` (e.g., `OptimizationService`, `GetSettings()`).-- **Variables & Parameters**: Use `camelCase` (e.g., `availableSpace`, `configData`).-- **Localization**: Avoid hardcoding UI text. Update the `.resx` files located in the `optimizerDuck/Resources/` directory for any new user-facing strings.-- **Linting & Formatting**: Follow standard C# conventions. The project's `.editorconfig` silently suppresses `CA1416` (Platform compatibility) warnings.--## Testing Guidelines--We utilize **xUnit** as our testing framework and `coverlet` for test coverage.--- **Test Placement**: Align test project paths with the main project layout (e.g., tests for `Services/` go into `optimizerDuck.Test/Services/`).-- **Naming Convention**: Suffix your test classes with `Tests` (e.g., `DiskCleanupServiceTests.cs`). Describe the behavior being tested clearly formatted in your test method names.-- **Running Tests**: You can execute the test suite via the .NET CLI:- ```bash- dotnet test optimizerDuck.Test/optimizerDuck.Test.csproj- ```--## Commit & Pull Request Guidelines--We follow the **Conventional Commits** format for our Git workflow. Structure your commit messages using the following prefixes:--- `feat:` for new capabilities (e.g., `feat: add disk cleanup page and its features`).-- `fix:` for bug resolutions (e.g., `fix: use proper color`).-- `refactor:` for restructurings or enhancements (e.g., `refactor: move converters to common`).--**When submitting a Pull Request:**-- Prepend the PR title with the appropriate conventional commit type.-- Ensure all recent changes compile successfully and all tests pass.-- Provide a brief description of the applied modifications. Link any relevant GitHub issues.-- Include a visual screenshot or GIF if your pull request modifies or creates UI elements.diff --git a/.agents/skills/csharp-async/SKILL.md b/.agents/skills/csharp-async/SKILL.mdnew file mode 100644index 0000000..4dbe78b--- /dev/null+++ b/.agents/skills/csharp-async/SKILL.md@@ -0,0 +1,49 @@+---+name: csharp-async+description: 'Get best practices for C# async programming'+---++# C# Async Programming Best Practices++Your goal is to help me follow best practices for asynchronous programming in C#.++## Naming Conventions++- Use the 'Async' suffix for all async methods+- Match method names with their synchronous counterparts when applicable (e.g., `GetDataAsync()` for `GetData()`)++## Return Types++- Return `Task<T>` when the method returns a value+- Return `Task` when the method doesn't return a value+- Consider `ValueTask<T>` for high-performance scenarios to reduce allocations+- Avoid returning `void` for async methods except for event handlers++## Exception Handling++- Use try/catch blocks around await expressions+- Avoid swallowing exceptions in async methods+- Use `ConfigureAwait(false)` when appropriate to prevent deadlocks in library code+- Propagate exceptions with `Task.FromException()` instead of throwing in async Task returning methods++## Performance++- Use `Task.WhenAll()` for parallel execution of multiple tasks+- Use `Task.WhenAny()` for implementing timeouts or taking the first completed task+- Avoid unnecessary async/await when simply passing through task results+- Consider cancellation tokens for long-running operations++## Common Pitfalls++- Never use `.Wait()`, `.Result`, or `.GetAwaiter().GetResult()` in async code+- Avoid mixing blocking and async code+- Don't create async void methods (except for event handlers)+- Always await Task-returning methods++## Implementation Patterns++- Implement the async command pattern for long-running operations+- Use async streams (IAsyncEnumerable<T>) for processing sequences asynchronously+- Consider the task-based asynchronous pattern (TAP) for public APIs++When reviewing my C# code, identify these issues and suggest improvements that follow these best practices.diff --git a/.agents/skills/csharp-docs/SKILL.md b/.agents/skills/csharp-docs/SKILL.mdnew file mode 100644index 0000000..6c67306--- /dev/null+++ b/.agents/skills/csharp-docs/SKILL.md@@ -0,0 +1,62 @@+---+name: csharp-docs+description: 'Ensure that C# types are documented with XML comments and follow best practices for documentation.'+---++# C# Documentation Best Practices++- Public members should be documented with XML comments.+- It is encouraged to document internal members as well, especially if they are complex or not self-explanatory.++## Guidance for all APIs++- 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.+- Use `<remarks>` for additional information, which can include implementation details, usage notes, or any other relevant context.+- Use `<see langword>` for language-specific keywords like `null`, `true`, `false`, `int`, `bool`, etc.+- Use `<c>` for inline code snippets.+- Use `<example>` for usage examples on how to use the member.+ - 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">`.+- Use `<see cref>` to reference other types or members inline (in a sentence).+- Use `<seealso>` for standalone (not in a sentence) references to other types or members in the "See also" section of the online docs.+- Use `<inheritdoc/>` to inherit documentation from base classes or interfaces.+ - Unless there is major behavior change, in which case you should document the differences.++## Methods++- Use `<param>` to describe method parameters.+ - The description should be a noun phrase that doesn't specify the data type.+ - Begin with an introductory article.+ - If the parameter is a flag enum, start the description with "A bitwise combination of the enumeration values that specifies...".+ - If the parameter is a non-flag enum, start the description with "One of the enumeration values that specifies...".+ - If the parameter is a Boolean, the wording should be of the form "`<see langword="true" />` to ...; otherwise, `<see langword="false" />`.".+ - 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.".+- Use `<paramref>` to reference parameter names in documentation.+- Use `<typeparam>` to describe type parameters in generic types or methods.+- Use `<typeparamref>` to reference type parameters in documentation.+- Use `<returns>` to describe what the method returns.+ - The description should be a noun phrase that doesn't specify the data type.+ - Begin with an introductory article.+ - If the return type is Boolean, the wording should be of the form "`<see langword="true" />` if ...; otherwise, `<see langword="false" />`.".++## Constructors++- The summary wording should be "Initializes a new instance of the <Class> class [or struct].".++## Properties++- The `<summary>` should start with:+ - "Gets or sets..." for a read-write property.+ - "Gets..." for a read-only property.+ - "Gets [or sets] a value that indicates whether..." for properties that return a Boolean value.+- Use `<value>` to describe the value of the property.+ - The description should be a noun phrase that doesn't specify the data type.+ - If the property has a default value, add it in a separate sentence, for example, "The default is `<see langword="false" />`".+ - If the value type is Boolean, the wording should be of the form "`<see langword="true" />` if ...; otherwise, `<see langword="false" />`. The default is ...".++## Exceptions++- Use `<exception cref>` to document exceptions thrown by constructors, properties, indexers, methods, operators, and events.+- Document all exceptions thrown directly by the member.+- For exceptions thrown by nested members, document only the exceptions users are most likely to encounter.+- The description of the exception describes the condition under which it's thrown.+ - 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."diff --git a/.agents/skills/csharp-xunit/SKILL.md b/.agents/skills/csharp-xunit/SKILL.mdnew file mode 100644index 0000000..4347c5a--- /dev/null+++ b/.agents/skills/csharp-xunit/SKILL.md@@ -0,0 +1,68 @@+---+name: csharp-xunit+description: 'Get best practices for XUnit unit testing, including data-driven tests'+---++# XUnit Best Practices++Your goal is to help me write effective unit tests with XUnit, covering both standard and data-driven testing approaches.++## Project Setup++- Use a separate test project with naming convention `[ProjectName].Tests`+- Reference Microsoft.NET.Test.Sdk, xunit, and xunit.runner.visualstudio packages+- Create test classes that match the classes being tested (e.g., `CalculatorTests` for `Calculator`)+- Use .NET SDK test commands: `dotnet test` for running tests++## Test Structure++- No test class attributes required (unlike MSTest/NUnit)+- Use fact-based tests with `[Fact]` attribute for simple tests+- Follow the Arrange-Act-Assert (AAA) pattern+- Name tests using the pattern `MethodName_Scenario_ExpectedBehavior`+- Use constructor for setup and `IDisposable.Dispose()` for teardown+- Use `IClassFixture<T>` for shared context between tests in a class+- Use `ICollectionFixture<T>` for shared context between multiple test classes++## Standard Tests++- Keep tests focused on a single behavior+- Avoid testing multiple behaviors in one test method+- Use clear assertions that express intent+- Include only the assertions needed to verify the test case+- Make tests independent and idempotent (can run in any order)+- Avoid test interdependencies++## Data-Driven Tests++- Use `[Theory]` combined with data source attributes+- Use `[InlineData]` for inline test data+- Use `[MemberData]` for method-based test data+- Use `[ClassData]` for class-based test data+- Create custom data attributes by implementing `DataAttribute`+- Use meaningful parameter names in data-driven tests++## Assertions++- Use `Assert.Equal` for value equality+- Use `Assert.Same` for reference equality+- Use `Assert.True`/`Assert.False` for boolean conditions+- Use `Assert.Contains`/`Assert.DoesNotContain` for collections+- Use `Assert.Matches`/`Assert.DoesNotMatch` for regex pattern matching+- Use `Assert.Throws<T>` or `await Assert.ThrowsAsync<T>` to test exceptions+- Use fluent assertions library for more readable assertions++## Mocking and Isolation++- Consider using Moq or NSubstitute alongside XUnit+- Mock dependencies to isolate units under test+- Use interfaces to facilitate mocking+- Consider using a DI container for complex test setups++## Test Organization++- Group tests by feature or component+- Use `[Trait("Category", "CategoryName")]` for categorization+- Use collection fixtures to group tests with shared dependencies+- Consider output helpers (`ITestOutputHelper`) for test diagnostics+- Skip tests conditionally with `Skip = "reason"` in fact/theory attributesdiff --git a/.agents/skills/dotnet-best-practices/SKILL.md b/.agents/skills/dotnet-best-practices/SKILL.mdnew file mode 100644index 0000000..183d3be--- /dev/null+++ b/.agents/skills/dotnet-best-practices/SKILL.md@@ -0,0 +1,85 @@+---+name: dotnet-best-practices+description: 'Ensure .NET/C# code meets best practices for the solution/project.'+---++# .NET/C# Best Practices++Your task is to ensure .NET/C# code in ${selection} meets the best practices specific to this solution/project. This includes:++## Documentation & Structure++- Create comprehensive XML documentation comments for all public classes, interfaces, methods, and properties+- Include parameter descriptions and return value descriptions in XML comments+- Follow the established namespace structure: {Core|Console|App|Service}.{Feature}++## Design Patterns & Architecture++- Use primary constructor syntax for dependency injection (e.g., `public class MyClass(IDependency dependency)`)+- Implement the Command Handler pattern with generic base classes (e.g., `CommandHandler<TOptions>`)+- Use interface segregation with clear naming conventions (prefix interfaces with 'I')+- Follow the Factory pattern for complex object creation.++## Dependency Injection & Services++- Use constructor dependency injection with null checks via ArgumentNullException+- Register services with appropriate lifetimes (Singleton, Scoped, Transient)+- Use Microsoft.Extensions.DependencyInjection patterns+- Implement service interfaces for testability++## Resource Management & Localization++- Use ResourceManager for localized messages and error strings+- Separate LogMessages and ErrorMessages resource files+- Access resources via `_resourceManager.GetString("MessageKey")`++## Async/Await Patterns++- Use async/await for all I/O operations and long-running tasks+- Return Task or Task<T> from async methods+- Use ConfigureAwait(false) where appropriate+- Handle async exceptions properly++## Testing Standards++- Use MSTest framework with FluentAssertions for assertions+- Follow AAA pattern (Arrange, Act, Assert)+- Use Moq for mocking dependencies+- Test both success and failure scenarios+- Include null parameter validation tests++## Configuration & Settings++- Use strongly-typed configuration classes with data annotations+- Implement validation attributes (Required, NotEmptyOrWhitespace)+- Use IConfiguration binding for settings+- Support appsettings.json configuration files++## Semantic Kernel & AI Integration++- Use Microsoft.SemanticKernel for AI operations+- Implement proper kernel configuration and service registration+- Handle AI model settings (ChatCompletion, Embedding, etc.)+- Use structured output patterns for reliable AI responses++## Error Handling & Logging++- Use structured logging with Microsoft.Extensions.Logging+- Include scoped logging with meaningful context+- Throw specific exceptions with descriptive messages+- Use try-catch blocks for expected failure scenarios++## Performance & Security++- Use C# 12+ features and .NET 8 optimizations where applicable+- Implement proper input validation and sanitization+- Use parameterized queries for database operations+- Follow secure coding practices for AI/ML operations++## Code Quality++- Ensure SOLID principles compliance+- Avoid code duplication through base classes and utilities+- Use meaningful names that reflect domain concepts+- Keep methods focused and cohesive+- Implement proper disposal patterns for resourcesdiff --git a/.agents/skills/microsoft-docs/SKILL.md b/.agents/skills/microsoft-docs/SKILL.mdnew file mode 100644index 0000000..bbfd424--- /dev/null+++ b/.agents/skills/microsoft-docs/SKILL.md@@ -0,0 +1,134 @@+---+name: microsoft-docs+description: 'Query official Microsoft documentation to find concepts, tutorials, and code examples across Azure, .NET, Agent Framework, Aspire, VS Code, GitHub, and more. Uses Microsoft Learn MCP as the default, with Context7 and Aspire MCP for content that lives outside learn.microsoft.com.'+---++# Microsoft Docs++Research skill for the Microsoft technology ecosystem. Covers learn.microsoft.com and documentation that lives outside it (VS Code, GitHub, Aspire, Agent Framework repos).++---++## Default: Microsoft Learn MCP++Use these tools for **everything on learn.microsoft.com** — Azure, .NET, M365, Power Platform, Agent Framework, Semantic Kernel, Windows, and more. This is the primary tool for the vast majority of Microsoft documentation queries.++| Tool | Purpose |+|------|---------|+| `microsoft_docs_search` | Search learn.microsoft.com — concepts, guides, tutorials, configuration |+| `microsoft_code_sample_search` | Find working code snippets from Learn docs. Pass `language` (`python`, `csharp`, etc.) for best results |+| `microsoft_docs_fetch` | Get full page content from a specific URL (when search excerpts aren't enough) |++Use `microsoft_docs_fetch` after search when you need complete tutorials, all config options, or when search excerpts are truncated.++### CLI Alternative++If the Learn MCP server is not available, use the `mslearn` CLI from your terminal or shell (for example, Bash, PowerShell, or cmd) instead:++```bash+# Run directly (no install needed)+npx @microsoft/learn-cli search "BlobClient UploadAsync Azure.Storage.Blobs"++# Or install globally, then run+npm install -g @microsoft/learn-cli+mslearn search "BlobClient UploadAsync Azure.Storage.Blobs"+```++| MCP Tool | CLI Command |+|----------|-------------|+| `microsoft_docs_search(query: "...")` | `mslearn search "..."` |+| `microsoft_code_sample_search(query: "...", language: "...")` | `mslearn code-search "..." --language ...` |+| `microsoft_docs_fetch(url: "...")` | `mslearn fetch "..."` |++Pass `--json` to `search` or `code-search` to get raw JSON output for further processing.++---++## Exceptions: When to Use Other Tools++The following categories live **outside** learn.microsoft.com. Use the specified tool instead.++### .NET Aspire — Use Aspire MCP Server (preferred) or Context7++Aspire docs live on **aspire.dev**, not Learn. The best tool depends on your Aspire CLI version:++**CLI 13.2+** (recommended) — The Aspire MCP server includes built-in docs search tools:++| MCP Tool | Description |+|----------|-------------|+| `list_docs` | Lists all available documentation from aspire.dev |+| `search_docs` | Weighted lexical search across aspire.dev content |+| `get_doc` | Retrieves a specific document by slug |++These ship in Aspire CLI 13.2 ([PR #14028](https://github.com/dotnet/aspire/pull/14028)). To update: `aspire update --self --channel daily`. Ref: https://davidpine.dev/posts/aspire-docs-mcp-tools/++**CLI 13.1** — The MCP server provides integration lookup (`list_integrations`, `get_integration_docs`) but **not** docs search. Fall back to Context7:++| Library ID | Use for |+|---|---|+| `/microsoft/aspire.dev` | Primary — guides, integrations, CLI reference, deployment |+| `/dotnet/aspire` | Runtime source — API internals, implementation details |+| `/communitytoolkit/aspire` | Community integrations — Go, Java, Node.js, Ollama |++### VS Code — Use Context7++VS Code docs live on **code.visualstudio.com**, not Learn.++| Library ID | Use for |+|---|---|+| `/websites/code_visualstudio` | User docs — settings, features, debugging, remote dev |+| `/websites/code_visualstudio_api` | Extension API — webviews, TreeViews, commands, contribution points |++### GitHub — Use Context7++GitHub docs live on **docs.github.com** and **cli.github.com**.++| Library ID | Use for |+|---|---|+| `/websites/github_en` | Actions, API, repos, security, admin, Copilot |+| `/websites/cli_github` | GitHub CLI (`gh`) commands and flags |++### Agent Framework — Use Learn MCP + Context7++Agent Framework tutorials are on learn.microsoft.com (use `microsoft_docs_search`), but the **GitHub repo** has API-level detail that is often ahead of published docs — particularly DevUI REST API reference, CLI options, and .NET integration.++| Library ID | Use for |+|---|---|+| `/websites/learn_microsoft_en-us_agent-framework` | Tutorials — DevUI guides, tracing, workflow orchestration |+| `/microsoft/agent-framework` | API detail — DevUI REST endpoints, CLI flags, auth, .NET `AddDevUI`/`MapDevUI` |++**DevUI tip:** Query the Learn website source for how-to guides, then the repo source for API-level specifics (endpoint schemas, proxy config, auth tokens).++---++## Context7 Setup++For any Context7 query, resolve the library ID first (one-time per session):++1. Call `mcp_context7_resolve-library-id` with the technology name+2. Call `mcp_context7_query-docs` with the returned library ID and a specific query++---++## Writing Effective Queries++Be specific — include version, intent, and language:++```+# ❌ Too broad+"Azure Functions"+"agent framework"++# ✅ Specific+"Azure Functions Python v2 programming model"+"Cosmos DB partition key design best practices"+"GitHub Actions workflow_dispatch inputs matrix strategy"+"Aspire AddUvicornApp Python FastAPI integration"+"DevUI serve agents tracing OpenTelemetry directory discovery"+"Agent Framework workflow conditional edges branching handoff"+```++Include context:+- **Version** when relevant (`.NET 8`, `Aspire 13`, `VS Code 1.96`)+- **Task intent** (`quickstart`, `tutorial`, `overview`, `limits`, `API reference`)+- **Language** for polyglot docs (`Python`, `TypeScript`, `C#`)diff --git a/.agents/skills/powershell-windows/SKILL.md b/.agents/skills/powershell-windows/SKILL.mdnew file mode 100644index 0000000..11577a8--- /dev/null+++ b/.agents/skills/powershell-windows/SKILL.md@@ -0,0 +1,172 @@+---+name: powershell-windows+description: "PowerShell Windows patterns. Critical pitfalls, operator syntax, error handling."+risk: unknown+source: community+date_added: "2026-02-27"+---++# PowerShell Windows Patterns++> Critical patterns and pitfalls for Windows PowerShell.++---++## 1. Operator Syntax Rules++### CRITICAL: Parentheses Required++| ❌ Wrong | ✅ Correct |+|----------|-----------|+| `if (Test-Path "a" -or Test-Path "b")` | `if ((Test-Path "a") -or (Test-Path "b"))` |+| `if (Get-Item $x -and $y -eq 5)` | `if ((Get-Item $x) -and ($y -eq 5))` |++**Rule:** Each cmdlet call MUST be in parentheses when using logical operators.++---++## 2. Unicode/Emoji Restriction++### CRITICAL: No Unicode in Scripts++| Purpose | ❌ Don't Use | ✅ Use |+|---------|-------------|--------|+| Success | ✅ ✓ | [OK] [+] |+| Error | ❌ ✗ 🔴 | [!] [X] |+| Warning | ⚠️ 🟡 | [*] [WARN] |+| Info | ℹ️ 🔵 | [i] [INFO] |+| Progress | ⏳ | [...] |++**Rule:** Use ASCII characters only in PowerShell scripts.++---++## 3. Null Check Patterns++### Always Check Before Access++| ❌ Wrong | ✅ Correct |+|----------|-----------|+| `$array.Count -gt 0` | `$array -and $array.Count -gt 0` |+| `$text.Length` | `if ($text) { $text.Length }` |++---++## 4. String Interpolation++### Complex Expressions++| ❌ Wrong | ✅ Correct |+|----------|-----------|+| `"Value: $($obj.prop.sub)"` | Store in variable first |++**Pattern:**+```+$value = $obj.prop.sub+Write-Output "Value: $value"+```++---++## 5. Error Handling++### ErrorActionPreference++| Value | Use |+|-------|-----|+| Stop | Development (fail fast) |+| Continue | Production scripts |+| SilentlyContinue | When errors expected |++### Try/Catch Pattern++- Don't return inside try block+- Use finally for cleanup+- Return after try/catch++---++## 6. File Paths++### Windows Path Rules++| Pattern | Use |+|---------|-----|+| Literal path | `C:\Users\User\file.txt` |+| Variable path | `Join-Path $env:USERPROFILE "file.txt"` |+| Relative | `Join-Path $ScriptDir "data"` |++**Rule:** Use Join-Path for cross-platform safety.++---++## 7. Array Operations++### Correct Patterns++| Operation | Syntax |+|-----------|--------|+| Empty array | `$array = @()` |+| Add item | `$array += $item` |+| ArrayList add | `$list.Add($item) | Out-Null` |++---++## 8. JSON Operations++### CRITICAL: Depth Parameter++| ❌ Wrong | ✅ Correct |+|----------|-----------|+| `ConvertTo-Json` | `ConvertTo-Json -Depth 10` |++**Rule:** Always specify `-Depth` for nested objects.++### File Operations++| Operation | Pattern |+|-----------|---------|+| Read | `Get-Content "file.json" -Raw | ConvertFrom-Json` |+| Write | `$data | ConvertTo-Json -Depth 10 | Out-File "file.json" -Encoding UTF8` |++---++## 9. Common Errors++| Error Message | Cause | Fix |+|---------------|-------|-----|+| "parameter 'or'" | Missing parentheses | Wrap cmdlets in () |+| "Unexpected token" | Unicode character | Use ASCII only |+| "Cannot find property" | Null object | Check null first |+| "Cannot convert" | Type mismatch | Use .ToString() |++---++## 10. Script Template++```powershell+# Strict mode+Set-StrictMode -Version Latest+$ErrorActionPreference = "Continue"++# Paths+$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path++# Main+try {+ # Logic here+ Write-Output "[OK] Done"+ exit 0+}+catch {+ Write-Warning "Error: $_"+ exit 1+}+```++---++> **Remember:** PowerShell has unique syntax rules. Parentheses, ASCII-only, and null checks are non-negotiable.++## When to Use+This skill is applicable to execute the workflow or actions described in the overview.diff --git a/.agents/skills/windows-app-developer/SKILL.md b/.agents/skills/windows-app-developer/SKILL.mdnew file mode 100644index 0000000..31b8c70--- /dev/null+++ b/.agents/skills/windows-app-developer/SKILL.md@@ -0,0 +1,88 @@+---+name: windows-app-developer+description: Expert in building modern Windows applications using WinUI 3, WPF, and the Windows App SDK. Specializes in MSIX packaging, XAML styling, and MVVM architecture.+---++# Windows App Developer++## Purpose+Provides expertise in building modern Windows desktop applications using WinUI 3, WPF, and Windows App SDK. Specializes in XAML-based UI development, MVVM architecture, native Windows integration, and modern packaging with MSIX.++## When to Use+- Building Windows desktop applications with WinUI 3 or WPF+- Implementing MVVM architecture for Windows apps+- Creating XAML layouts and custom controls+- Packaging applications with MSIX+- Integrating with Windows features (notifications, taskbar, system tray)+- Migrating WPF applications to WinUI 3+- Implementing Windows-specific features (jump lists, live tiles)+- Building Microsoft Store-ready applications++## Quick Start+**Invoke this skill when:**+- Building Windows desktop applications with WinUI 3 or WPF+- Implementing MVVM architecture for Windows apps+- Creating XAML layouts and custom controls+- Packaging applications with MSIX+- Integrating with Windows features (notifications, taskbar)++**Do NOT invoke when:**+- Building cross-platform apps → use mobile-developer or electron-pro+- Console applications → use appropriate language skill+- PowerShell GUI → use powershell-ui-architect+- Web applications → use appropriate web skill++## Decision Framework+```+Windows App Task?+├── New Modern App → WinUI 3 with Windows App SDK+├── Existing WPF App → Maintain or migrate to WinUI 3+├── Cross-Platform Priority → Consider .NET MAUI+├── Enterprise Internal → WPF with proven patterns+├── Store Distribution → MSIX packaging required+└── System Integration → P/Invoke or Windows SDK APIs+```++## Core Workflows++### 1. WinUI 3 Application Setup+1. Create project using Windows App SDK template+2. Configure Package.appxmanifest for capabilities+3. Set up MVVM infrastructure (CommunityToolkit.Mvvm)+4. Implement navigation and shell structure+5. Create reusable control library+6. Configure MSIX packaging+7. Set up CI/CD for Store or sideload distribution++### 2. MVVM Implementation+1. Define ViewModels with observable properties+2. Implement commands for user actions+3. Create services for data and business logic+4. Set up dependency injection container+5. Bind Views to ViewModels in XAML+6. Implement navigation service+7. Add design-time data for XAML preview++### 3. MSIX Packaging+1. Configure Package.appxmanifest+2. Define application identity and capabilities+3. Set up visual assets (icons, splash)+4. Configure installation behavior+5. Sign package with certificate+6. Test installation and updates+7. Submit to Microsoft Store or deploy internally++## Best Practices+- Use WinUI 3 for new development, WPF for legacy maintenance+- Implement MVVM strictly for testability and separation+- Use x:Bind for compile-time binding validation+- Leverage Community Toolkit for common patterns+- Package with MSIX for modern installation experience+- Follow Fluent Design System for consistent UX++## Anti-Patterns+- **Code-behind logic** → Move to ViewModels+- **Synchronous UI operations** → Use async/await for I/O+- **Direct service calls from Views** → Go through ViewModels+- **Ignoring DPI awareness** → Test at multiple scale factors+- **Missing capabilities** → Declare required capabilities in manifestdiff --git a/.claude/settings.local.json b/.claude/settings.local.jsondeleted file mode 100644index 304f41e..0000000--- a/.claude/settings.local.json+++ /dev/null@@ -1,8 +0,0 @@-{- "permissions": {- "allow": [- "Bash(test:*)",- "Bash(dotnet build:*)"- ]- }-}diff --git a/.kilocode/skills/csharp-async b/.kilocode/skills/csharp-asyncnew file mode 120000index 0000000..8e8dad5--- /dev/null+++ b/.kilocode/skills/csharp-async@@ -0,0 +1 @@+../../.agents/skills/csharp-async\ No newline at end of filediff --git a/.kilocode/skills/csharp-docs b/.kilocode/skills/csharp-docsnew file mode 120000index 0000000..0fd4bd6--- /dev/null+++ b/.kilocode/skills/csharp-docs@@ -0,0 +1 @@+../../.agents/skills/csharp-docs\ No newline at end of filediff --git a/.kilocode/skills/csharp-xunit b/.kilocode/skills/csharp-xunitnew file mode 120000index 0000000..14503f3--- /dev/null+++ b/.kilocode/skills/csharp-xunit@@ -0,0 +1 @@+../../.agents/skills/csharp-xunit\ No newline at end of filediff --git a/.kilocode/skills/dotnet-best-practices b/.kilocode/skills/dotnet-best-practicesnew file mode 120000index 0000000..dc9ca38--- /dev/null+++ b/.kilocode/skills/dotnet-best-practices@@ -0,0 +1 @@+../../.agents/skills/dotnet-best-practices\ No newline at end of filediff --git a/.kilocode/skills/microsoft-docs b/.kilocode/skills/microsoft-docsnew file mode 120000index 0000000..0f3da12--- /dev/null+++ b/.kilocode/skills/microsoft-docs@@ -0,0 +1 @@+../../.agents/skills/microsoft-docs\ No newline at end of filediff --git a/.kilocode/skills/powershell-windows b/.kilocode/skills/powershell-windowsnew file mode 120000index 0000000..dd1b9ae--- /dev/null+++ b/.kilocode/skills/powershell-windows@@ -0,0 +1 @@+../../.agents/skills/powershell-windows\ No newline at end of filediff --git a/.kilocode/skills/windows-app-developer b/.kilocode/skills/windows-app-developernew file mode 120000index 0000000..ca6ba65--- /dev/null+++ b/.kilocode/skills/windows-app-developer@@ -0,0 +1 @@+../../.agents/skills/windows-app-developer\ No newline at end of filediff --git a/AGENTS.md b/AGENTS.mdindex 6d3ca2d..b4710e5 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -1,284 +1,42 @@# Repository Guidelines-Welcome to the `optimizerDuck` repository! This document provides guidelines for contributing to the project, ensuring consistency and maintainability across the codebase.--## Project Overview--optimizerDuck is a free, open-source Windows optimization tool built with WPF and .NET 10. It provides system performance optimizations, privacy enhancements, disk cleanup, bloatware removal, and startup management features.--## Build, Test & Lint Commands--### Building-```bash-# Build the entire solution-dotnet build optimizerDuck.slnx--# Or use the build script-./build.bat-```--### Testing-```bash-# Run all tests-dotnet test optimizerDuck.Test/optimizerDuck.Test.csproj--# Run a single test class-dotnet test optimizerDuck.Test/optimizerDuck.Test.csproj --filter "FullyQualifiedName~OptimizationServiceTests"--# Run a single test method-dotnet test optimizerDuck.Test/optimizerDuck.Test.csproj --filter "FullyQualifiedName~OptimizationServiceTests.ApplyAsync_Success_PersistsRevertDataFile"--# Run tests with coverage-dotnet test optimizerDuck.Test/optimizerDuck.Test.csproj --collect:"XPlat Code Coverage"-```--### Linting-No explicit lint command is configured. The project uses standard C# conventions enforced by the compiler and IDE. The `.editorconfig` suppresses `CA1416` (Platform compatibility) warnings.-## Project Structure & Module Organization--```-optimizerDuck/-├── optimizerDuck/ # Main application-│ ├── UI/ # XAML views and view models-│ │ ├── Views/-│ │ │ ├── Pages/ # Page views (Dashboard, Settings, etc.)-│ │ │ ├── Windows/ # Window views (MainWindow)-│ │ │ └── Dialogs/ # Dialog views-│ │ └── ViewModels/ # MVVM view models-│ ├── Services/ # Business logic and system operations-│ │ ├── OptimizationServices/ # Registry, Shell, Service, ScheduledTask-│ │ └── Managers/ # RevertManager, ConfigManager, LanguageManager-│ ├── Core/-│ │ ├── Optimizers/ # Optimization category implementations-│ │ ├── Models/ # Data models and interfaces-│ │ └── Interfaces/ # IOptimization, IOptimizationCategory-│ ├── Common/-│ │ ├── Converters/ # XAML value converters-│ │ ├── Helpers/ # Utility classes (Shared, ThemeResource)-│ │ └── Extensions/ # Extension methods-│ └── Resources/-│ ├── Languages/ # Localization .resx files-│ └── Images/ # Application assets-│-└── optimizerDuck.Test/ # Test suite- └── Services/ # Tests mirror main project structure-```+- `optimizerDuck/`: main WPF app (`net10.0-windows`), organized by responsibility:+ - `Domain/` for models/abstractions/attributes.+ - `Services/` for system, optimization, feature, and configuration logic.+ - `UI/` for XAML pages, dialogs, windows, controls, and ViewModels.+ - `Resources/` for images and localization (`Resources/Languages/*.resx`).+- `optimizerDuck.Test/`: xUnit v3 unit tests, mirroring service/execution areas.+- `.github/`: CI, issue templates, PR template, and project policies.+- `publish.bat`: interactive/preset publish entry point (`Portable` or `Single`).++## Build, Test, and Development Commands+- `dotnet restore optimizerDuck.slnx`: restore dependencies.+- `dotnet build optimizerDuck.slnx --configuration Release --no-restore`: CI-aligned build.+- `dotnet test optimizerDuck.Test/optimizerDuck.Test.csproj --configuration Release --no-build`: run unit tests.+- `dotnet run --project optimizerDuck/optimizerDuck.csproj`: run locally.+- `publish.bat portable` or `publish.bat single --skip-tests`: create release artifacts.## Coding Style & Naming Conventions--### C# Conventions--- **Classes, Methods, Properties, Enums**: Use `PascalCase`- ```csharp- public class OptimizationService { }- public void ApplyAsync() { }- public string OptimizationKey { get; }- public enum OptimizationRisk { Safe, Moderate, Risky }- ```--- **Private Fields**: Use `_` prefix with `camelCase`- ```csharp- private readonly ILogger _logger;- private static readonly Dictionary<Guid, bool> _stateCache = new();- ```--- **Local Variables & Parameters**: Use `camelCase`- ```csharp- var optimizationId = optimization.Id;- public Task<ApplyResult> ApplyAsync(IProgress<ProcessingProgress> progress)- ```--- **Constants**: Use `PascalCase` for public, `_PascalCase` for private- ```csharp- public const int MaxRetries = 3;- private const int Win32Priority = 38;- ```--### Import Organization--Imports are ordered alphabetically. `System.*` imports come first, followed by third-party libraries, then project namespaces:--```csharp-using System.IO;-using System.Text.RegularExpressions;-using Microsoft.Extensions.Logging;-using CommunityToolkit.Mvvm.ComponentModel;-using optimizerDuck.Core.Interfaces;-using optimizerDuck.Services.Managers;-```--### Primary Constructors (C# 12+)--The project uses primary constructors for dependency injection. Inject dependencies in the class declaration:--```csharp-public class OptimizationService(- RevertManager revertManager,- ILoggerFactory loggerFactory,- IContentDialogService contentDialogService,- ILogger<OptimizationService> logger)-{- private readonly ILogger _logger = logger;- // ...-}-```--### MVVM Pattern with CommunityToolkit.Mvvm--Use `[ObservableProperty]` for bindable properties and `[RelayCommand]` for commands:--```csharp-public partial class SettingsViewModel : ViewModel-{- [ObservableProperty]- private ApplicationTheme _currentApplicationTheme;-- [RelayCommand]- private void OpenRootDir()- {- // ...- }-}-```--### Nullable Reference Types--Nullable reference types are enabled. Use `?` for nullable types and null checks:--```csharp-public Type? OwnerType { get; set; }-private IHost? _host;--if (result != null)- return result;-```--## Localization--All user-facing text must be localized using the `.resx` files in `optimizerDuck/Resources/Languages/`:--- `Translations.resx` - Default (English)-- Access via `Translations.ResourceName` or `Loc.Instance["Key"]`--Never hardcode UI strings in code. Add new strings to the `.resx` file first.--## Optimization Implementation Pattern--Optimizations follow a specific pattern using attributes and base classes:--```csharp-[OptimizationCategory(typeof(OptimizationPage))]-public class Performance : IOptimizationCategory-{- public string Name { get; init; } = Loc.Instance[$"Optimizer.{nameof(Performance)}"];- public OptimizationCategoryOrder Order { get; init; } = OptimizationCategoryOrder.Performance;- public ObservableCollection<IOptimization> Optimizations { get; init; } = [];-- [Optimization(- Id = "GUID-HERE",- Risk = OptimizationRisk.Safe,- Tags = OptimizationTags.System | OptimizationTags.Performance)]- public class DisableBackgroundApps : BaseOptimization- {- public override Task<ApplyResult> ApplyAsync(- IProgress<ProcessingProgress> progress,- OptimizationContext context)- {- // Use RegistryService, ShellService, etc.- RegistryService.Write(- new RegistryItem(@"HKCU\Software\Path", "ValueName", 1)- );- context.Logger.LogInformation("Applied optimization");- return Task.FromResult(ApplyResult.True());- }- }-}-```--Use `RevertManager.Record()` to enable reverting:--```csharp-RevertManager.Record(new ShellRevertStep-{- ShellType = ShellType.PowerShell,- Command = "revert command"-});-```--## Error Handling--- Use `ILogger` for logging errors, warnings, and information-- Use try-catch for operations that may fail (file I/O, shell commands)-- Return meaningful result objects instead of throwing exceptions for expected failures--```csharp-try-{- // Operation-}-catch (Exception ex)-{- logger.LogError(ex, "Failed to perform operation: {Details}", details);- return ApplyResult.False("Operation failed");-}-```+- Use modern C# with nullable references enabled; prefer DI over direct service construction.+- Indentation: 4 spaces; keep formatting consistent with existing file-scoped namespace style.+- Naming:+ - Types/methods/properties: `PascalCase`.+ - Private fields: `_camelCase`.+ - Locals/parameters: `camelCase`.+- Do not hardcode user-facing strings; add keys to `Translations.resx` and related locale files.## Testing Guidelines--- **Framework**: xUnit with coverlet for coverage-- **Test Class Naming**: Suffix with `Tests` (e.g., `OptimizationServiceTests`)-- **Test Method Naming**: Describe behavior being tested- ```csharp- [Fact]- public async Task ApplyAsync_Success_PersistsRevertDataFile() { }-- [Fact]- public async Task RevertAsync_WithValidData_RemovesFile() { }- ```--- **Test Placement**: Mirror the main project structure- - Tests for `Services/OptimizationService.cs` → `optimizerDuck.Test/Services/OptimizationServiceTests.cs`--- **WPF/STA Tests**: Use the `RunInStaThreadAsync` helper for tests requiring STA thread:- ```csharp- private static Task RunInStaThreadAsync(Func<Task> action)- {- var tcs = new TaskCompletionSource();- var thread = new Thread(() =>- {- try { action().GetAwaiter().GetResult(); tcs.SetResult(); }- catch (Exception ex) { tcs.SetException(ex); }- });- thread.SetApartmentState(ApartmentState.STA);- thread.Start();- return tcs.Task;- }- ```--## Key Dependencies--- **WPF-UI** (4.2.0): Modern WPF controls and theming-- **CommunityToolkit.Mvvm** (8.4.0): MVVM helpers-- **Microsoft.Extensions.Hosting**: Dependency injection and configuration-- **Serilog**: Structured logging-- **Newtonsoft.Json**: JSON serialization-- **TaskScheduler**: Windows scheduled task management+- Framework: xUnit v3 (`[Fact]` tests in `optimizerDuck.Test`).+- Name tests using behavior-focused patterns such as `ApplyAsync_Success_PersistsRevertDataFile`.+- Add/update tests for changes in `Services/`, optimization execution flow, and revert behavior.+- No explicit coverage gate is enforced in CI; prioritize meaningful unit coverage for changed logic.## Commit & Pull Request Guidelines+- Follow Conventional Commits used in history: `feat:`, `fix:`, `refactor:`, `docs:`, `test:`, `i18n:`, `chore:`.+- Branch from `master` (`feature/<name>` or `fix/<issue-id>`).+- PRs should include: clear description, linked issue (`Closes #123`), passing `dotnet build`/`dotnet test`, and screenshot/GIF for UI changes.-Follow **Conventional Commits** format:--- `feat:` - New features (e.g., `feat: add disk cleanup page`)-- `fix:` - Bug fixes (e.g., `fix: correct registry path`)-- `refactor:` - Code restructuring without behavior changes-- `docs:` - Documentation updates-- `test:` - Adding or modifying tests--### Pull Request Checklist--1. Prepend PR title with conventional commit type-2. Ensure build succeeds: `dotnet build optimizerDuck.slnx`-3. Ensure tests pass: `dotnet test optimizerDuck.Test/optimizerDuck.Test.csproj`-4. Provide description of modifications and link relevant issues-5. Include screenshots/GIF for UI changes+## Security & Configuration Tips+- Never commit secrets or machine-specific paths.+- For security issues, use private disclosure via `.github/SECURITY.md` guidance (not public issues).diff --git a/CLAUDE.md b/CLAUDE.mddeleted file mode 100644index f6d0531..0000000--- a/CLAUDE.md+++ /dev/null@@ -1,164 +0,0 @@-# CLAUDE.md--This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.--## Build and Development Commands--### Building the Application-This is a .NET 10.0 WPF application with two publish profiles:--```bash-# Portable build (multiple files, smaller executable)-dotnet publish optimizerDuck/optimizerDuck.csproj /p:PublishProfile=Portable--# Single-file build (single large executable)-dotnet publish optimizerDuck/optimizerDuck.csproj /p:PublishProfile=Single-```--Reference: `build.bat` for the interactive build script.--### Testing-```bash-# Run all tests-dotnet test--# Run tests with specific filter-dotnet test --filter "FullyQualifiedName~OptimizerName"--# Run specific test project-dotnet test optimizerDuck.Test/optimizerDuck.Test.csproj-```--### General Development-```bash-# Restore dependencies-dotnet restore--# Build solution-dotnet build--# Clean solution-dotnet clean-```--## High-Level Architecture--optimizerDuck is a Windows optimization tool built with WPF, following MVVM pattern and modern .NET practices. Understanding the architecture requires knowledge across multiple layers:--### 1. Discovery and Registration System--**Attribute-Based Optimization Discovery**: Optimizations are discovered at startup via reflection using `[Optimization]` attributes. The `OptimizationRegistry` in `Services/OptimizationRegistry.cs` handles this by scanning assemblies for types implementing `IOptimization`.--Key files:-- `OptimizerDuck.Core.Optimizers.BaseOptimization` - Abstract base for all optimizations-- `OptimizerDuck.Services.OptimizationRegistry` - Discovers and registers optimizations-- `OptimizerDuck.Core.Models.Attributes.OptimizationAttribute` - Defines optimization metadata-- `OptimizerDuck.Services.OptimizationPageRegistryExtensions` - DI registration helper--**Category Organization**: Optimizations are grouped by categories (e.g., Performance, Security). Categories use `[OptimizationCategory]` attributes and are ordered via `OptimizationCategoryOrder`.--### 2. Execution and Revert System--**Two-Phase Execution with Revert Support**: Each optimization can modify system state and record a revert plan. This is handled by the `OptimizationService` and `RevertManager`:--- **Apply Phase**: Optimizations execute modifications and capture revert data-- **Revert Data**: Stored as JSON in `%appdata%\optimizerDuck\Revert\{guid}.json`-- **Revert Steps**: Support registry, services, scheduled tasks, and shell command reversions--Key files:-- `OptimizerDuck.Services.OptimizationService` - Coordinates optimization execution-- `OptimizerDuck.Services.Managers.RevertManager` - Manages revert data persistence-- `OptimizerDuck.Core.Models.Execution.OptimizationExecutionContext` - Tracks execution state-- `OptimizerDuck.Core.Models.Revert.*` - Revert data models and step definitions--### 3. Low-Level System Operations--**Service Layer**: System modifications are abstracted through service classes in `Services/OptimizationServices/`:--- `RegistryService` - Windows registry modifications-- `ServiceProcessService` - Windows service control-- `ScheduledTaskService` - Task scheduler operations-- `ShellService` - PowerShell command execution--**Critical Pattern**: These services accept a `password` parameter for privilege elevation. Never hardcode passwords - always accept them as method parameters. The `ShellService.Init()` method configures the elevation approach based on app settings.--### 4. State Management and Tracking--**State Persistence**: Current optimization states are cached in-memory and serialized to disk. The system tracks whether each optimization is applied and when.--- `OptimizationService._stateCache` - In-memory state tracking-- State files stored in `%appdata%\optimizerDuck\`-- State must survive application restarts--### 5. Dependency Injection and App Lifecycle--**DI Container Setup**: The application uses `Microsoft.Extensions.Hosting` and services are registered in `App.xaml.cs`. Key points:--- All major services are registered as singletons-- Optimization pages are registered via `AddAllOptimizationPages()` extension method-- WPF UI services (navigation, dialogs) use WPF-UI framework integration-- Serilog is used for structured logging with a custom `ScopeBlockTextFormatter`--**App Flow**:-1. `App.OnStartup()` builds DI container, validates configuration-2. `OptimizationRegistry.PreloadOptimizations()` discovers optimizations-3. MainWindow shown via navigation service-4. User interactions trigger `OptimizationService.ApplyOptimizationAsync()` or `RevertOptimizationAsync()`-5. `App.OnExit()` flushes logs--### 6. Multi-Language Support--**Resource-Based Localization**: Uses .resx files in `Resources/Languages/`. The `LanguageManager` handles culture switching. Always use resource keys from `Translations.resx` for user-visible strings.--## Important Patterns and Constraints--### Optimization Implementation Pattern--Every optimization must:-1. Inherit from `BaseOptimization`-2. Have `[Optimization]` attribute with unique ID and metadata-3. Implement `IsOptimized()` to check current state-4. Implement `Revert()` to revert changes-5. Record revert steps via `executionContext.RecordRevertStep()`-6. Use async/await for all async operations--### Error Handling and Logging--- Always use `ILogger<T>` for logging (injected via DI)-- Use Serilog's structured logging: `logger.LogInformation("Applied {Count} changes", count)`-- Catch exceptions at optimization boundaries - individual optimization failures shouldn't crash the app-- User-facing errors should use the WPF-UI dialog service--### File System Locations--The app uses these directories (see `Common.Helpers.Shared`):-- `%appdata%\optimizerDuck\` - Root directory for app data-- `%appdata%\optimizerDuck\Revert\` - Revert data storage-- `%appdata%\optimizerDuck\appsettings.json` - Configuration file-- `%appdata%\optimizerDuck\optimizerDuck.log` - Log file--## Testing Approach--The project uses xUnit. When adding new optimizations:-1. Add unit tests for the optimization logic-2. Test revert functionality thoroughly-3. Mock system services using test fakes-4. Integration tests should use a test-friendly DI setup--Reference: `optimizerDuck.Test/Services/Managers/RevertManagerTests.cs` for testing patterns.--## Key Dependencies--- **WPF-UI (4.2.0)**: UI framework, must follow their patterns for controls and dialogs-- **CommunityToolkit.Mvvm (8.4.0)**: MVVM infrastructure, use `[ObservableProperty]` and automatic command generation-- **Serilog (4.3.1)**: Logging framework with structured logging support-- **Microsoft.Extensions.Hosting (10.0.3)**: DI and app lifecycle management--## Important Files--- `optimizerDuck/appsettings.json` (user config, created at runtime) - App configuration including theme, language, elevation password-- `*.pubxml` files - Publish configurations-- `OptimizationService.cs` - Core optimization execution logic-- `BaseOptimization.cs` - Base class for all optimizations-- `RevertManager.cs` - Revert system coordinator-- `app.manifest` - Windows UAC manifest for privilege elevationdiff --git a/GEMINI.md b/GEMINI.mddeleted file mode 100644index bd7f81b..0000000--- a/GEMINI.md+++ /dev/null@@ -1,82 +0,0 @@-# GEMINI.md--This file provides context and instructions for Gemini CLI when working in the **optimizerDuck** repository.--## Project Overview--**optimizerDuck** is a free, open-source Windows optimization tool designed for performance, privacy, and simplicity. It allows users to apply various system tweaks, manage bloatware, cleanup disk space, and manage startup items.--- **Primary Technologies**: .NET 10.0, WPF (Windows Presentation Foundation).-- **Architecture**: MVVM (Model-View-ViewModel) with CommunityToolkit.Mvvm.-- **UI Framework**: [WPF-UI](https://github.com/lepoco/wpfui) for modern Windows 11-style aesthetics.-- **Core Pattern**: Attribute-based optimization discovery and two-phase execution (Apply/Revert).--## Key Components--### 1. Core Engine-- **`BaseOptimization`**: The abstract base class for all system tweaks. Every optimization must implement `ApplyAsync()`.-- **`OptimizationRegistry`**: Discovers optimizations at runtime using reflection by scanning for types implementing `IOptimization` within `IOptimizationCategory` classes.-- **`OptimizationService`**: The central service that manages the execution and state of optimizations.-- **`ExecutionScope`**: An `AsyncLocal` context that tracks executed steps, logs, and revert information during an optimization's lifecycle.-- **`RevertManager`**: Handles the persistence of "revert plans" (JSON files in `%localappdata%\optimizerDuck\Revert\`) to allow safe undoing of changes.--### 2. System Operations-- **`RegistryService`**: Wrapper for Windows Registry modifications. Automatically records revert steps when called within an `ExecutionScope`.-- **`ServiceProcessService`**: Manages Windows services (Start/Stop/Disable).-- **`ScheduledTaskService`**: Manages Windows Task Scheduler items.-- **`ShellService`**: Executes PowerShell commands with support for privilege elevation.--### 3. Application Lifecycle-- **Dependency Injection**: Powered by `Microsoft.Extensions.Hosting`. Services are registered in `App.xaml.cs`.-- **Logging**: Structured logging via Serilog, outputting to `%localappdata%\optimizerDuck\optimizerDuck.log`.-- **Configuration**: User settings are stored in `appsettings.json` in the app data directory.-- **Localization**: Multi-language support using `.resx` files in `Resources/Languages/` accessed via `Loc.Instance`.--## Building and Running--### Build Commands-```powershell-# Build the solution-dotnet build--# Run the application-dotnet run --project optimizerDuck/optimizerDuck.csproj--# Publish - Portable (Multiple files)-dotnet publish optimizerDuck/optimizerDuck.csproj /p:PublishProfile=Portable--# Publish - Single File (One executable)-dotnet publish optimizerDuck/optimizerDuck.csproj /p:PublishProfile=Single-```--### Testing-```powershell-# Run all unit tests-dotnet test--# Run specific test project-dotnet test optimizerDuck.Test/optimizerDuck.Test.csproj-```--## Development Conventions--1. **MVVM Pattern**: Strictly follow MVVM. Use `ObservableProperty` and `RelayCommand` from `CommunityToolkit.Mvvm`.-2. **Optimization Implementation**:- - New optimizations should be added as nested classes within an appropriate category class in `Core/Optimizers/`.- - Must inherit from `BaseOptimization` and have a unique `[Optimization]` attribute (GUID required).- - Use provided services (`RegistryService`, etc.) to ensure revert steps are automatically recorded.-3. **Error Handling**:- - Catch exceptions within optimizations to prevent app crashes.- - Use `ExecutionScope.LogError` or `context.Logger` for logging.-4. **UI/UX**:- - Follow WPF-UI design patterns.- - Use `Translations.resx` for all user-facing strings to support localization.-5. **Privilege Elevation**:- - The app requires administrative privileges for most operations. This is handled via `app.manifest`.--## File System Locations--- **Root Data**: `%localappdata%\optimizerDuck\`-- **Revert Data**: `%localappdata%\optimizerDuck\Revert\`-- **Settings**: `%localappdata%\optimizerDuck\appsettings.json`-- **Logs**: `%localappdata%\optimizerDuck\optimizerDuck.log`diff --git a/skills-lock.json b/skills-lock.jsonnew file mode 100644index 0000000..35362ca--- /dev/null+++ b/skills-lock.json@@ -0,0 +1,40 @@+{+ "version": 1,+ "skills": {+ "csharp-async": {+ "source": "github/awesome-copilot",+ "sourceType": "github",+ "computedHash": "e889958419757528e43fb674607d13fffe331a6673cfcef2b0ab8ff9fb569bb8"+ },+ "csharp-docs": {+ "source": "github/awesome-copilot",+ "sourceType": "github",+ "computedHash": "93da3063bb770f13feec581efa3ff232c69a5a94b75cddfc4ad6e82909835cfe"+ },+ "csharp-xunit": {+ "source": "github/awesome-copilot",+ "sourceType": "github",+ "computedHash": "3c224e79f92ec027de3d5f44d0ca3077f076cb1e1bfff6b0db5b09c34c3aecd2"+ },+ "dotnet-best-practices": {+ "source": "github/awesome-copilot",+ "sourceType": "github",+ "computedHash": "9ef94db7f06c167d544369817e5a4415eeb7886dcff0d47026837a1aada260e3"+ },+ "microsoft-docs": {+ "source": "github/awesome-copilot",+ "sourceType": "github",+ "computedHash": "e49127ff2162330ac79bfde9e7ed1297df15be9ade09164fdebfe697153fcc36"+ },+ "powershell-windows": {+ "source": "sickn33/antigravity-awesome-skills",+ "sourceType": "github",+ "computedHash": "4bb0cdcc99c69e25785c4646e5b9eb010a4a1ec89433113524f291fd098341a3"+ },+ "windows-app-developer": {+ "source": "404kidwiz/claude-supercode-skills",+ "sourceType": "github",+ "computedHash": "16a3be60f5561fc8ce64f0ba09a27b22a04aff203584642777c0f8de435159a5"+ }+ }+}