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
8 changes: 5 additions & 3 deletions .claude/agents/developer.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: developer
model: haiku
model: sonnet
color: green
description: >
Writes minimal production code to make failing tests pass (TDD Green phase)
Expand All @@ -26,8 +26,9 @@ You will receive:
- Follow existing patterns (file-scoped namespaces, `readonly struct` where appropriate)
- New or changed `public` API in non-test projects must be declared in `PublicAPI.Unshipped.txt` (enforced by RS0016 — the error includes the exact signature to copy)
5. Run `dotnet build src/ 2>&1 | grep -E 'warning (IDE|CS)'` — fix **all** warnings. Common culprits: block-scoped namespace, `var`, missing braces, `new T()` instead of `new()`.
6. Run `dotnet test src/ --filter "FullyQualifiedName~<target>"` — all targeted tests must pass.
7. Run `dotnet test src/` — no regressions.
6. Run `dotnet format --include <changed_cs_files> --exclude-diagnostics IDE0130` for all changed `.cs` and fix any incorrect formatting.
7. Run `dotnet test src/ --filter "FullyQualifiedName~<target>"` — all targeted tests must pass.
8. Run `dotnet test src/` — no regressions.

## Code Style Quick Reference

Expand Down Expand Up @@ -59,3 +60,4 @@ Report:
- Implement only what the tests demand — resist anticipating future tests
- Do not add `public` API surface beyond what the tests reference
- If a reviewer FIX_IMPLEMENTATION verdict was provided, address each finding while keeping all tests green
- Prefer one type (class, record, interface etc) per file
10 changes: 9 additions & 1 deletion .claude/agents/reviewer.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: reviewer
model: haiku
model: sonnet
color: blue
description: >
Read-only code quality reviewer for the Conjecture .NET project.
Expand All @@ -19,6 +19,11 @@ You will receive one or more of:
- Test results from the preceding Green phase
- Reviewer findings from a previous iteration (if this is a loop retry)

## Steps

1. Run `dotnet format --include <changed_cs_files> --exclude-diagnostics IDE0130 --verify-no-changes` for all changed `.cs` files — all formatting must be correct. If this fails, report it as a FIX_IMPLEMENTATION finding.
2. Review the changed production files for reuse, quality, and efficiency issues (see "What to look for" section below).

## Output format

Always end your response with a structured verdict block:
Expand Down Expand Up @@ -51,6 +56,9 @@ If there are both implementation issues and missing tests, pick the one that is
- Leaky abstractions (exposing internals, breaking encapsulation)
- Unnecessary comments (explaining WHAT, not WHY — flag for removal)
- Stringly-typed code where constants or enums already exist
- Unneccassary warning suppression
- One file per type unless they are nested
- One test class per SUT or feature

### Efficiency
- Unnecessary repeated work or redundant computations
Expand Down
5 changes: 4 additions & 1 deletion .claude/agents/test-developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ You will receive:
- Follow code style: file-scoped namespaces, no `var`, braces on all control flow, `new()` when type is apparent
4. If given a reviewer ADD_TEST verdict, add the missing tests the reviewer identified.
5. Run `dotnet build src/ 2>&1 | grep -E 'warning (IDE|CS)'` — fix any style warnings in the test file itself.
6. Run `dotnet build src/` — must fail (missing production types) or tests must fail. If green, the tests cover nothing new; revise them.
6. Run `dotnet format --include <changed_cs_files> --exclude-diagnostics IDE0130` for all changed `.cs` and fix any incorrect formatting.
7. Run `dotnet build src/` — must fail (missing production types) or tests must fail. If green, the tests cover nothing new; revise them.

## Output

Expand All @@ -46,3 +47,5 @@ Report:
- Prefer `Assert.Equal` / `Assert.True` over `Assert.NotNull` unless null-safety is the behavior under test
- Avoid mocking framework internals; test at the public API surface
- Match production namespace with `.Tests` appended
- Prefer one test class per file
- Prefer one test class per subject under test
95 changes: 48 additions & 47 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -88,55 +88,56 @@ dotnet_code_quality_unused_parameters = all:suggestion
dotnet_remove_unnecessary_suppression_exclusions = none

# Enforce naming rules at build time (requires EnforceCodeStyleInBuild=true in Directory.Build.props)
dotnet_diagnostic.IDE0073.severity = warning # File header
dotnet_diagnostic.IDE1006.severity = warning
dotnet_diagnostic.IDE0073.severity = error # File header
dotnet_diagnostic.IDE1006.severity = error

# Enforce suggestion-level rules at build time
dotnet_diagnostic.IDE0011.severity = warning # Braces
dotnet_diagnostic.IDE0016.severity = warning # Throw expressions
dotnet_diagnostic.IDE0017.severity = warning # Object initializers
dotnet_diagnostic.IDE0018.severity = warning # Inlined variable declaration
dotnet_diagnostic.IDE0019.severity = warning # Pattern matching over as+null check
dotnet_diagnostic.IDE0020.severity = warning # Pattern matching over is+cast
dotnet_diagnostic.IDE0028.severity = warning # Collection initializers
dotnet_diagnostic.IDE0029.severity = warning # Null coalescing (non-nullable)
dotnet_diagnostic.IDE0030.severity = warning # Null coalescing (nullable)
dotnet_diagnostic.IDE0031.severity = warning # Null propagation
dotnet_diagnostic.IDE0032.severity = warning # Auto properties
dotnet_diagnostic.IDE0033.severity = warning # Explicit tuple names
dotnet_diagnostic.IDE0034.severity = warning # Simple default expression
dotnet_diagnostic.IDE0036.severity = warning # Modifier order
dotnet_diagnostic.IDE0037.severity = warning # Inferred tuple/anon type member names
dotnet_diagnostic.IDE0039.severity = warning # Local function over lambda
dotnet_diagnostic.IDE0041.severity = warning # Null check over reference equality
dotnet_diagnostic.IDE0042.severity = warning # Deconstructed variable declaration
dotnet_diagnostic.IDE0045.severity = warning # Ternary over assignment
dotnet_diagnostic.IDE0046.severity = warning # Ternary over return
dotnet_diagnostic.IDE0053.severity = warning # Expression-bodied lambdas
dotnet_diagnostic.IDE0054.severity = warning # Compound assignment
dotnet_diagnostic.IDE0056.severity = warning # Index operator
dotnet_diagnostic.IDE0057.severity = warning # Range operator
dotnet_diagnostic.IDE0059.severity = warning # Unused value assignment
dotnet_diagnostic.IDE0060.severity = warning # Unused parameters
dotnet_diagnostic.IDE0063.severity = warning # Simple using statement
dotnet_diagnostic.IDE0066.severity = warning # Switch expression
dotnet_diagnostic.IDE0071.severity = warning # Simplified interpolation
dotnet_diagnostic.IDE0074.severity = warning # Coalesce compound assignment
dotnet_diagnostic.IDE0075.severity = warning # Simplified boolean expressions
dotnet_diagnostic.IDE0083.severity = warning # not pattern
dotnet_diagnostic.IDE0090.severity = warning # Implicit object creation
dotnet_diagnostic.IDE0130.severity = warning # Namespace matches folder
dotnet_diagnostic.IDE0150.severity = warning # Null check over type check
dotnet_diagnostic.IDE0160.severity = warning # File-scoped namespace
dotnet_diagnostic.IDE0170.severity = warning # Extended property pattern
dotnet_diagnostic.IDE0180.severity = warning # Tuple swap
dotnet_diagnostic.IDE0220.severity = warning # Foreach explicit cast
dotnet_diagnostic.IDE0230.severity = warning # UTF-8 string literals
dotnet_diagnostic.IDE0250.severity = warning # Readonly struct
dotnet_diagnostic.IDE0251.severity = warning # Readonly struct member
dotnet_diagnostic.IDE0258.severity = warning # Static anonymous function
dotnet_diagnostic.IDE0290.severity = warning # Primary constructors
dotnet_diagnostic.IDE1005.severity = warning # Conditional delegate call
dotnet_diagnostic.IDE0011.severity = error # Braces
dotnet_diagnostic.IDE0016.severity = error # Throw expressions
dotnet_diagnostic.IDE0017.severity = error # Object initializers
dotnet_diagnostic.IDE0018.severity = error # Inlined variable declaration
dotnet_diagnostic.IDE0019.severity = error # Pattern matching over as+null check
dotnet_diagnostic.IDE0020.severity = error # Pattern matching over is+cast
dotnet_diagnostic.IDE0028.severity = error # Collection initializers
dotnet_diagnostic.IDE0029.severity = error # Null coalescing (non-nullable)
dotnet_diagnostic.IDE0030.severity = error # Null coalescing (nullable)
dotnet_diagnostic.IDE0031.severity = error # Null propagation
dotnet_diagnostic.IDE0032.severity = error # Auto properties
dotnet_diagnostic.IDE0033.severity = error # Explicit tuple names
dotnet_diagnostic.IDE0034.severity = error # Simple default expression
dotnet_diagnostic.IDE0036.severity = error # Modifier order
dotnet_diagnostic.IDE0037.severity = error # Inferred tuple/anon type member names
dotnet_diagnostic.IDE0039.severity = error # Local function over lambda
dotnet_diagnostic.IDE0041.severity = error # Null check over reference equality
dotnet_diagnostic.IDE0042.severity = error # Deconstructed variable declaration
dotnet_diagnostic.IDE0045.severity = error # Ternary over assignment
dotnet_diagnostic.IDE0046.severity = error # Ternary over return
dotnet_diagnostic.IDE0053.severity = error # Expression-bodied lambdas
dotnet_diagnostic.IDE0054.severity = error # Compound assignment
dotnet_diagnostic.IDE0056.severity = error # Index operator
dotnet_diagnostic.IDE0057.severity = error # Range operator
dotnet_diagnostic.IDE0059.severity = error # Unused value assignment
dotnet_diagnostic.IDE0060.severity = error # Unused parameters
dotnet_diagnostic.IDE0063.severity = error # Simple using statement
dotnet_diagnostic.IDE0066.severity = error # Switch expression
dotnet_diagnostic.IDE0071.severity = error # Simplified interpolation
dotnet_diagnostic.IDE0074.severity = error # Coalesce compound assignment
dotnet_diagnostic.IDE0075.severity = error # Simplified boolean expressions
dotnet_diagnostic.IDE0079.severity = error # Remove unneccessary exclusions
dotnet_diagnostic.IDE0083.severity = error # not pattern
dotnet_diagnostic.IDE0090.severity = error # Implicit object creation
dotnet_diagnostic.IDE0130.severity = none # Disabled: conflicts with dotnet format (GitHub issue dotnet/format#2192)
dotnet_diagnostic.IDE0150.severity = error # Null check over type check
dotnet_diagnostic.IDE0160.severity = error # File-scoped namespace
dotnet_diagnostic.IDE0170.severity = error # Extended property pattern
dotnet_diagnostic.IDE0180.severity = error # Tuple swap
dotnet_diagnostic.IDE0220.severity = error # Foreach explicit cast
dotnet_diagnostic.IDE0230.severity = error # UTF-8 string literals
dotnet_diagnostic.IDE0250.severity = error # Readonly struct
dotnet_diagnostic.IDE0251.severity = error # Readonly struct member
dotnet_diagnostic.IDE0258.severity = error # Static anonymous function
dotnet_diagnostic.IDE0290.severity = error # Primary constructors
dotnet_diagnostic.IDE1005.severity = error # Conditional delegate call

#### C# Coding Conventions ####
[*.cs]
Expand Down
8 changes: 8 additions & 0 deletions CLAUDE.MD
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,16 @@ dotnet build src/
dotnet test src/
dotnet test src/ --filter "FullyQualifiedName~SomeTest"
```
## Format

```bash
dotnet format src/ --include .somedir/somefile.cs .somedir/somefile2.cs
```

## Project Structure

Solution file: `src/Conjecture.slnx`

### Production → Test project mapping

| Production project | Test project |
Expand All @@ -34,5 +41,6 @@ New test files go in the paired test project, mirroring the production file's re
### Other locations

- Architecture decisions (ADRs): `docs/decisions/`
- Documentation site: `docs/site`
- Public API surface: each non-test project has `PublicAPI.Unshipped.txt` — new public symbols must be declared here (enforced by RS0016 at build time; the compiler error includes the exact signature to copy in)
- GitHub repo: `kommundsen/Conjecture`
2 changes: 1 addition & 1 deletion src/Conjecture.Analyzers.CodeFixes/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("Conjecture.Analyzers.Tests")]
[assembly: InternalsVisibleTo("Conjecture.Analyzers.Tests")]
1 change: 1 addition & 0 deletions src/Conjecture.Analyzers.CodeFixes/CON102CodeFix.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeActions;
using Microsoft.CodeAnalysis.CodeFixes;
Expand Down
1 change: 1 addition & 0 deletions src/Conjecture.Analyzers.CodeFixes/CON103CodeFix.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeActions;
using Microsoft.CodeAnalysis.CodeFixes;
Expand Down
2 changes: 2 additions & 0 deletions src/Conjecture.Analyzers.Tests/CON100Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

using System.Collections.Immutable;
using System.IO;

using Conjecture.Analyzers;

using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Diagnostics;
Expand Down
2 changes: 2 additions & 0 deletions src/Conjecture.Analyzers.Tests/CON101Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
using System.Collections.Immutable;
using System.IO;
using System.Linq;

using Conjecture.Analyzers;

using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Diagnostics;
Expand Down
2 changes: 2 additions & 0 deletions src/Conjecture.Analyzers.Tests/CON102Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

using Conjecture.Analyzers;

using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeActions;
using Microsoft.CodeAnalysis.CodeFixes;
Expand Down
2 changes: 2 additions & 0 deletions src/Conjecture.Analyzers.Tests/CON103Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

using Conjecture.Analyzers;

using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeActions;
using Microsoft.CodeAnalysis.CodeFixes;
Expand Down
2 changes: 2 additions & 0 deletions src/Conjecture.Analyzers.Tests/CON104Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
using System.Collections.Immutable;
using System.IO;
using System.Linq;

using Conjecture.Analyzers;

using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Diagnostics;
Expand Down
2 changes: 2 additions & 0 deletions src/Conjecture.Analyzers.Tests/CON105Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
using System.Collections.Immutable;
using System.IO;
using System.Linq;

using Conjecture.Analyzers;

using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Diagnostics;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

using Conjecture.Analyzers;

using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeActions;
using Microsoft.CodeAnalysis.CodeFixes;
Expand Down
1 change: 1 addition & 0 deletions src/Conjecture.Analyzers/CON100Analyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System.Collections.Immutable;
using System.Linq;

using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
Expand Down
1 change: 1 addition & 0 deletions src/Conjecture.Analyzers/CON101Analyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// See LICENSE.txt in the project root or https://mozilla.org/MPL/2.0/

using System.Collections.Immutable;

using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
Expand Down
1 change: 1 addition & 0 deletions src/Conjecture.Analyzers/CON102Analyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System.Collections.Immutable;
using System.Linq;

using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
Expand Down
1 change: 1 addition & 0 deletions src/Conjecture.Analyzers/CON103Analyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using System.Collections.Immutable;

using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
Expand Down
1 change: 1 addition & 0 deletions src/Conjecture.Analyzers/CON104Analyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// See LICENSE.txt in the project root or https://mozilla.org/MPL/2.0/

using System.Collections.Immutable;

using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
Expand Down
1 change: 1 addition & 0 deletions src/Conjecture.Analyzers/CON105Analyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System.Collections.Immutable;
using System.Linq;

using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
Expand Down
2 changes: 0 additions & 2 deletions src/Conjecture.Analyzers/Conjecture.Analyzers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
</ItemGroup>

<ItemGroup>
<AdditionalFiles Include="AnalyzerReleases.Shipped.md" />
<AdditionalFiles Include="AnalyzerReleases.Unshipped.md" />
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions src/Conjecture.Analyzers/PropertyAttributeHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// See LICENSE.txt in the project root or https://mozilla.org/MPL/2.0/

using System.Linq;

using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Syntax;

Expand Down
1 change: 1 addition & 0 deletions src/Conjecture.Benchmarks/CoreDrawBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// See LICENSE.txt in the project root or https://mozilla.org/MPL/2.0/

using BenchmarkDotNet.Attributes;

using Conjecture.Core;
using Conjecture.Core.Internal;

Expand Down
3 changes: 3 additions & 0 deletions src/Conjecture.Benchmarks/GeneratorBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@

using System.IO;
using System.Text;

using BenchmarkDotNet.Attributes;

using Conjecture.Core;
using Conjecture.Core.Internal;
using Conjecture.Generators;

using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;

Expand Down
1 change: 1 addition & 0 deletions src/Conjecture.Benchmarks/Phase1Benchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// See LICENSE.txt in the project root or https://mozilla.org/MPL/2.0/

using BenchmarkDotNet.Attributes;

using Conjecture.Core;
using Conjecture.Core.Internal;

Expand Down
2 changes: 2 additions & 0 deletions src/Conjecture.Benchmarks/Phase2Benchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
// See LICENSE.txt in the project root or https://mozilla.org/MPL/2.0/

using System.Runtime.CompilerServices;

using BenchmarkDotNet.Attributes;

using Conjecture.Core;
using Conjecture.Core.Internal;

Expand Down
Loading