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
3 changes: 2 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"SonarMark",
"SarifMark",
"buildnotes",
"slnx"
"slnx",
"Propagatable"
],
"ignorePaths": [
"node_modules",
Expand Down
2 changes: 1 addition & 1 deletion .github/agents/code-quality-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Ensure the project is:

1. **Build**: Zero warnings (TreatWarningsAsErrors=true)
2. **Linting**:
- markdownlint (`.markdownlint.json`)
- markdownlint (`.markdownlint-cli2.jsonc`)
- cspell (`.cspell.json`)
- yamllint (`.yamllint.yaml`)
- dotnet format (`.editorconfig`)
Expand Down
30 changes: 29 additions & 1 deletion .github/agents/repo-consistency-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ The agent reviews the following areas for consistency with the template:

#### Quality Configuration

- **Linting Rules**: `.cspell.json`, `.markdownlint.json`, `.yamllint.yaml`
- **Linting Rules**: `.cspell.json`, `.markdownlint-cli2.jsonc`, `.yamllint.yaml`
- Note: Spelling exceptions will be repository-specific
- **Editor Config**: `.editorconfig` settings (file-scoped namespaces, 4-space indent, UTF-8+BOM, LF endings)
- **Code Style**: C# code style rules and analyzer configuration
Expand All @@ -78,6 +78,34 @@ The agent reviews the following areas for consistency with the template:
- `quality/` (auto-generated)
- **Definition Files**: `definition.yaml` files for document generation

### Tracking Template Evolution

To ensure downstream projects benefit from recent template improvements, review recent pull requests
merged into the template repository:

1. **List Recent PRs**: Retrieve recently merged PRs from `demaconsulting/TemplateDotNetTool`
- Review the last 10-20 PRs to identify template improvements

2. **Identify Propagatable Changes**: For each PR, determine if changes should apply to downstream
projects:
- Focus on structural changes (workflows, agents, configurations) over content-specific changes
- Note changes to `.github/`, linting configurations, project patterns, and documentation
structure

3. **Check Downstream Application**: Verify if identified changes exist in the downstream project:
- Check if similar files/patterns exist in downstream
- Compare file contents between template and downstream project
- Look for similar PR titles or commit messages in downstream repository history

4. **Recommend Missing Updates**: For changes not yet applied, include them in the consistency
review with:
- Description of the template change (reference PR number)
- Explanation of benefits for the downstream project
- Specific files or patterns that need updating

This technique ensures downstream projects don't miss important template improvements and helps
maintain long-term consistency.

### Review Process

1. **Identify Differences**: Compare downstream repository structure with template
Expand Down
17 changes: 17 additions & 0 deletions .github/agents/requirements-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,23 @@ Follow the `requirements.yaml` structure:
- Linked to appropriate test(s)
- Enforced via: `dotnet reqstream --requirements requirements.yaml --tests "test-results/**/*.trx" --enforce`

### Test Source Filters

Test links in `requirements.yaml` can include a source filter prefix to restrict which test results count as
evidence. This is critical for platform and framework requirements - **never remove these filters**.

- `windows@TestName` - proves the test passed on a Windows platform
- `ubuntu@TestName` - proves the test passed on a Linux (Ubuntu) platform
- `net8.0@TestName` - proves the test passed under the .NET 8 target framework
- `net9.0@TestName` - proves the test passed under the .NET 9 target framework
- `net10.0@TestName` - proves the test passed under the .NET 10 target framework
- `dotnet8.x@TestName` - proves the self-validation test ran on a machine with .NET 8.x runtime
- `dotnet9.x@TestName` - proves the self-validation test ran on a machine with .NET 9.x runtime
- `dotnet10.x@TestName` - proves the self-validation test ran on a machine with .NET 10.x runtime

Without the source filter, a test result from any platform/framework satisfies the requirement. Removing a
filter invalidates the evidence for platform/framework requirements.

## Defer To

- **Software Developer Agent**: For implementing self-validation tests
Expand Down
61 changes: 61 additions & 0 deletions .github/agents/test-developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,74 @@ public void ClassName_MethodUnderTest_Scenario_ExpectedBehavior()
- Failure-testing and error handling scenarios
- Verifying internal behavior beyond requirement scope

### Test Source Filters

Test links in `requirements.yaml` can include a source filter prefix to restrict which test results count as
evidence. These filters are critical for platform and framework requirements - **do not remove them**.

- `windows@TestName` - proves the test passed on a Windows platform
- `ubuntu@TestName` - proves the test passed on a Linux (Ubuntu) platform
- `net8.0@TestName` - proves the test passed under the .NET 8 target framework
- `net9.0@TestName` - proves the test passed under the .NET 9 target framework
- `net10.0@TestName` - proves the test passed under the .NET 10 target framework
- `dotnet8.x@TestName` - proves the self-validation test ran on a machine with .NET 8.x runtime
- `dotnet9.x@TestName` - proves the self-validation test ran on a machine with .NET 9.x runtime
- `dotnet10.x@TestName` - proves the self-validation test ran on a machine with .NET 10.x runtime

Removing a source filter means a test result from any environment can satisfy the requirement, which invalidates
the evidence-based proof that the tool works on a specific platform or framework.

### ReqStream-Specific

- **NOT self-validation tests** - those are handled by Software Developer Agent
- Unit tests live in `test/` directory
- Use MSTest V4 testing framework
- Follow existing naming conventions in the test suite

### MSTest V4 Best Practices

Common anti-patterns to avoid (not exhaustive):

1. **Avoid Assertions in Catch Blocks (MSTEST0058)** - Instead of wrapping code in try/catch and asserting in the
catch block, use `Assert.ThrowsExactly<T>()`:

```csharp
var ex = Assert.ThrowsExactly<ArgumentNullException>(() => SomeWork());
Assert.Contains("Some message", ex.Message);
```

2. **Avoid using Assert.IsTrue / Assert.IsFalse for equality checks** - Use `Assert.AreEqual` /
`Assert.AreNotEqual` instead, as it provides better failure messages:

```csharp
// ❌ Bad: Assert.IsTrue(result == expected);
// ✅ Good: Assert.AreEqual(expected, result);
```

3. **Avoid non-public test classes and methods** - Test classes and `[TestMethod]` methods must be `public` or
they will be silently ignored:

```csharp
// ❌ Bad: internal class MyTests
// ✅ Good: public class MyTests
```

4. **Avoid Assert.IsTrue(collection.Count == N)** - Use `Assert.HasCount` for count assertions:

```csharp
// ❌ Bad: Assert.IsTrue(collection.Count == 3);
// ✅ Good: Assert.HasCount(3, collection);
```

5. **Avoid Assert.IsTrue for string prefix checks** - Use `Assert.StartsWith` instead of wrapping
`string.StartsWith` in `Assert.IsTrue`, as it produces clearer failure messages that show the expected prefix
and actual value:

```csharp
// ❌ Bad: Assert.IsTrue(value.StartsWith("prefix"));
// ✅ Good: Assert.StartsWith("prefix", value);
```

## Defer To

- **Requirements Agent**: For test strategy and coverage requirements
Expand Down
Loading
Loading