Skip to content
Merged
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
6 changes: 3 additions & 3 deletions .agents/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ NSubstitute is the shared test-double library; use the existing AutoFixture and

The checked-in configuration is SDK-style .NET 10, **xUnit on Microsoft.Testing.Platform (MTP)**, in native MTP `dotnet test` mode. [global.json](../global.json) selects the runner; [tests/Directory.Build.props](../tests/Directory.Build.props) enables the xUnit MTP runner and executable test projects. The current package is `xunit.v3.mtp-v2`; its version is centrally managed and should be read from [Directory.Packages.props](../Directory.Packages.props).

Use `dotnet-test:platform-detection` and `dotnet-test:run-tests` before selecting commands; use `dotnet-test:filter-syntax` for unfamiliar filters. Recheck configuration after dependency/SDK changes.
Use `run-tests` directly before running .NET tests or selecting commands and flags; it handles the required runner discovery. Use `platform-detection` for identification-only questions and `filter-syntax` for unfamiliar filters. Resolve equivalent prefixed skill names from the installed catalog. Recheck configuration after dependency/SDK changes.

## Where tests live

Expand All @@ -22,11 +22,11 @@ Use `dotnet-test:platform-detection` and `dotnet-test:run-tests` before selectin
| [LexerRegexGenerator.UnitTests](../tests/HydraScript.Infrastructure.LexerRegexGenerator.UnitTests) | Generated pattern source and ordering | Explicit `Category=Unit`; Roslyn GeneratorDriver and xUnit assertions |
| [HydraScript.IntegrationTests](../tests/HydraScript.IntegrationTests) | Real interpreter pipeline, success/error programs, console/input/dumps | TestHostFixture composes production services and substitutes external dependencies |

Before locating C# tests, use `rider-skills:finding-tests` and its documented Rider `findTests` route. Read the returned tests and fixture before adding coverage. Follow the skill's fallback rules when tooling is unavailable.
Before locating tests for C# production code, use `finding-tests` and its documented Rider `findTests` route. Read the returned tests and fixture before adding coverage. Follow the skill's fallback rules when tooling is unavailable.

## Writing tests

- Use `dotnet-test:code-testing-agent` for test implementation and `dotnet-test:assertion-quality` for assertions; use the relevant gap-analysis skill when the task is specifically about missing coverage.
- Use the `code-testing-agent` skill for test implementation: focused work stays direct, while broad suites use its `code-testing-generator` agent and prescribed pipeline. Route test-quality and gap/coverage audits through the `test-quality-auditor` agent and its selected specialist; `assertion-quality` is not a prerequisite for every focused test addition. Use `testability-obstacle` when one behavior requires a minimal production seam for deterministic tests and seam selection is still open; use `code-testing-agent` when a suitable seam already exists.
- Follow `MethodName_Scenario_ExpectedBehavior` (Roy Osherove). The happy-path convention requested in issue #205 is `MethodName_Always_Success`; prefer a specific scenario/outcome when it adds information.
- Add a minimal regression at the stage that owns the defect. For language behavior, also verify the interpreter's observable result where unit tests cannot establish it.
- Reuse [AutoHydraScriptDataAttribute](../tests/HydraScript.UnitTests/AutoHydraScriptDataAttribute.cs) for applicable unit fixtures and [TestHostFixture](../tests/HydraScript.IntegrationTests/TestHostFixture.cs) for pipeline tests. Keep semantic inputs explicit when randomized data would hide the case.
Expand Down
24 changes: 19 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,27 @@ HydraScript is a statically typed scripting-language interpreter in C#. Keep thi
- Read the [ADR index](docs/adr/README.md) and relevant records before making architectural decisions. Keep checked-in guidance focused on the current implementation.
- Follow [.editorconfig](.editorconfig), [CONTRIBUTING.md](CONTRIBUTING.md), and the existing local conventions. New guidance and ADRs use English.

## Required tools and skills
## Required tools, skills, and agents

- **Use Rider MCP for repository development:** inspect the open solution and worktree first; use its symbol navigation, usages, diagnostics, refactoring, build, and run capabilities where applicable. Run CLI-only operations through Rider's terminal when available.
- **Read and use the applicable Rider skills:** `rider-skills:refactoring-code` for semantic refactoring, `rider-skills:debugging-code` for runtime investigation needing debugger evidence, and `rider-skills:finding-tests` before locating tests for C# changes. Equivalent unprefixed Rider skills are valid. Follow their documented `execute_tool` routing.
- **Read and use applicable .NET skills before acting:** `dotnet-test:platform-detection` and `dotnet-test:run-tests` for test commands; `code-testing-agent` and `assertion-quality` from `dotnet-test` when authoring tests; relevant `dotnet-msbuild`, `dotnet-nuget`, `dotnet-upgrade`, or `dotnet-advanced` skills for their respective tasks. Resolve names from the installed skill catalog; read referenced instructions as required.
- Skill use is mandatory when applicable, not a requirement to run unrelated workflows. Prose changes do not require a debugger, refactoring, or test generation.
- If Rider MCP or a required skill is unavailable, report the exact limitation and use an available documented fallback. Never silently skip the requirement or claim a tool ran.
- **Resolve installed capabilities:** the table uses skill short names and explicitly labels agents. Resolve equivalent prefixed names from the active catalog, read the applicable `SKILL.md` before acting, and follow its scope and tool routing (`execute_tool` or directly exposed Rider tools, as documented). An installed skill does not imply its tools or agents are available.

| Task | Skill or agent entry point |
| --- | --- |
| Symbols, usages, and refactoring | `navigating-code` for symbol navigation; `refactoring-code` for semantic IDE refactoring; `csharp-refactoring` for behavior-preserving C# restructuring. |
| Runtime investigation requiring debugger evidence | `debugging-code`; ordinary static diagnosis does not require a debugger. |
| Locate tests for C# production code | `finding-tests` before searching for existing coverage or writing related tests. |
| Run .NET tests or choose commands/flags | `run-tests` directly; `platform-detection` is for identification-only questions. Load `filter-syntax` when needed. |
| Write or extend tests | `code-testing-agent` skill: focused work stays direct; broad suites use its `code-testing-generator` agent and prescribed pipeline. |
| Audit test quality, assertions, gaps, or coverage | `test-quality-auditor` agent selects the matching specialist, such as `assertion-quality` or `test-gap-analysis`; use the combined audit only for broad reviews. |
| Make code testable | `testability-obstacle` for one behavior needing a minimal production seam and tests when seam selection is still open; `testability-migration` agent for static-dependency inventories or migrations to abstractions. Use `code-testing-agent` when a suitable seam already exists. |
| Migrate test framework or platform | `test-migration` agent and its selected migration skill. |
| Diagnose or improve MSBuild | `msbuild` agent; `build-perf` for build performance and `msbuild-code-review` for project-file reviews. Follow their selected skills. |
| Investigate .NET runtime performance | `optimizing-dotnet-performance` agent with applicable `analyzing-dotnet-performance` guidance; `microbenchmarking` for BenchmarkDotNet work. |

- Select other installed skills by the actual task, such as `convert-to-cpm` for central package management, the matching `migrate-dotnet*` skill for SDK/runtime upgrades, and `dotnet-aot-compat` for AOT compatibility. Use the `template-engine` agent for .NET template discovery, scaffolding, or authoring.
- Skill and agent use is mandatory when applicable; keep workflows proportional to scope. Prose changes do not require a debugger, refactoring, test generation, or a test audit. Delegate independent work with explicit ownership and preserve other agents' edits.
- If a required tool, skill, or agent is unavailable, report the exact limitation and use its documented fallback when available. Never silently skip the requirement, present a generic helper as a named specialist, or claim a tool ran.

## Work and handoff

Expand Down
14 changes: 7 additions & 7 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
<CentralPackageVersionOverrideEnabled>false</CentralPackageVersionOverrideEnabled>
<MicrosoftVersion>10.0.11</MicrosoftVersion>
<MicrosoftVersion>10.0.12</MicrosoftVersion>
<CodeAnalysisVersion>5.9.0</CodeAnalysisVersion>
<AutoFixtureVersion>5.0.0-rc.1</AutoFixtureVersion>
</PropertyGroup>
Expand All @@ -19,8 +19,8 @@
<PackageVersion Include="Microsoft.Extensions.Logging" Version="$(MicrosoftVersion)"/>
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="$(MicrosoftVersion)"/>
<PackageVersion Include="Microsoft.Extensions.Options" Version="$(MicrosoftVersion)"/>
<PackageVersion Include="System.CommandLine" Version="2.0.11"/>
<PackageVersion Include="System.IO.Abstractions" Version="22.2.0"/>
<PackageVersion Include="System.CommandLine" Version="2.0.12"/>
<PackageVersion Include="System.IO.Abstractions" Version="22.3.0"/>
<PackageVersion Include="Visitor.NET" Version="4.2.1"/>
<PackageVersion Include="Visitor.NET.AutoVisitableGen" Version="1.5.3"/>
<PackageVersion Include="ZLinq" Version="1.5.6"/>
Expand All @@ -34,13 +34,13 @@
<PackageVersion Include="Fare" Version="2.2.2"/>
<PackageVersion Include="AwesomeAssertions" Version="9.6.0"/>
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="$(CodeAnalysisVersion)"/>
<PackageVersion Include="Microsoft.Extensions.Diagnostics.Testing" Version="10.9.0"/>
<PackageVersion Include="Microsoft.Testing.Extensions.CodeCoverage" Version="18.10.0"/>
<PackageVersion Include="Microsoft.Extensions.Diagnostics.Testing" Version="10.10.0"/>
<PackageVersion Include="Microsoft.Testing.Extensions.CodeCoverage" Version="18.11.2"/>
<PackageVersion Include="NSubstitute" Version="6.2.0"/>
<PackageVersion Include="PolymorphicContracts.AutoFixture" Version="2.0.0"/>
<PackageVersion Include="Serilog.Extensions.Logging" Version="10.0.0"/>
<PackageVersion Include="Serilog.Sinks.XUnit3" Version="2.1.0"/>
<PackageVersion Include="Serilog.Sinks.XUnit3" Version="2.1.1"/>
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1"/>
<PackageVersion Include="xunit.v3.mtp-v2" Version="4.0.0"/>
<PackageVersion Include="xunit.v3.mtp-v2" Version="4.0.1"/>
</ItemGroup>
</Project>
Loading