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
31 changes: 31 additions & 0 deletions .claude/hooks/session-start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
# Prepares a Claude Code cloud session so it can build and run the Core tests.
# Local machines are left alone: there you install the .NET 10 SDK yourself.
set -euo pipefail

if [ "${CLAUDE_CODE_REMOTE:-}" != "true" ]; then
exit 0
fi

# The dot.net install script is blocked in cloud sessions; the Ubuntu feed works.
if ! command -v dotnet >/dev/null 2>&1 || ! dotnet --list-sdks | grep -q '^10\.'; then
SUDO=""
if [ "$(id -u)" -ne 0 ]; then SUDO="sudo"; fi
$SUDO apt-get update -qq
$SUDO env DEBIAN_FRONTEND=noninteractive apt-get install -y -qq dotnet-sdk-10.0 >/dev/null
fi

{
echo 'export DOTNET_CLI_TELEMETRY_OPTOUT=1'
echo 'export DOTNET_NOLOGO=1'
echo 'export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1'
} >> "${CLAUDE_ENV_FILE:-/dev/null}"
export DOTNET_CLI_TELEMETRY_OPTOUT=1 DOTNET_NOLOGO=1

cd "${CLAUDE_PROJECT_DIR:-$(dirname "$0")/../..}"

# Restore NuGet packages so the first build/test in the session is quick.
# WPF and Windows projects restore fine on Linux thanks to EnableWindowsTargeting.
if [ -f ProDHCPServer.sln ]; then
dotnet restore ProDHCPServer.sln --verbosity quiet
fi
14 changes: 14 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/session-start.sh"
}
]
}
]
}
}
35 changes: 35 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Formatting preferences shared by Visual Studio, Rider, VS Code and `dotnet format`.
# Style rules are suggestions only: the build treats warnings as errors.
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

[*.{csproj,props,targets,xml,xaml,manifest,json,yml,yaml}]
indent_size = 2

[*.md]
trim_trailing_whitespace = false

[*.{sh,py}]
end_of_line = lf

[*.cs]
csharp_style_namespace_declarations = file_scoped:suggestion
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_new_line_before_open_brace = all
csharp_prefer_braces = when_multiline:suggestion
dotnet_sort_system_directives_first = true

dotnet_naming_rule.private_fields_underscore.symbols = private_fields
dotnet_naming_rule.private_fields_underscore.style = underscore_camel
dotnet_naming_rule.private_fields_underscore.severity = suggestion
dotnet_naming_symbols.private_fields.applicable_kinds = field
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
dotnet_naming_style.underscore_camel.required_prefix = _
dotnet_naming_style.underscore_camel.capitalization = camel_case
13 changes: 13 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Normalise line endings in the repo; Windows checkouts get CRLF where tools expect it.
* text=auto

*.sln text eol=crlf
*.ps1 text eol=crlf
*.sh text eol=lf
*.py text eol=lf

*.ico binary
*.png binary
*.gz binary
*.exe binary
*.dll binary
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Problem on site
description: Something went wrong while using ProDHCPServer with real equipment.
labels: [bug]
body:
- type: textarea
id: what-happened
attributes:
label: What happened
description: What you expected, and what you saw instead. Screenshots of the status panel help.
validations:
required: true
- type: input
id: device
attributes:
label: Device(s) connected
placeholder: e.g. Q-SYS Core 110f direct, or 3 cameras behind a Netgear GS108
- type: input
id: version
attributes:
label: App version
description: Shown in the title bar or Settings. The CI run number also works.
- type: input
id: windows
attributes:
label: Windows version and adapter
placeholder: e.g. Windows 11 24H2, USB-C Realtek adapter
- type: dropdown
id: adapter-restored
attributes:
label: Were your adapter settings put back afterwards?
options:
- "Yes"
- "No, I had to fix them by hand"
- "Not sure"
- type: textarea
id: log
attributes:
label: Session log
description: Paste or attach the exported session log if you have one.
render: text
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: true
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Feature idea
description: Something that would make field work quicker or easier.
labels: [enhancement]
body:
- type: textarea
id: situation
attributes:
label: The situation on site
description: What were you trying to do, and with what equipment?
validations:
required: true
- type: textarea
id: idea
attributes:
label: What would help
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2
updates:
- package-ecosystem: nuget
directory: /
schedule:
interval: monthly
groups:
nuget-minor-and-patch:
update-types: [minor, patch]

- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
groups:
actions:
patterns: ["*"]
13 changes: 13 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## What changes for the user

Before:

After:

## How

## Testing

- [ ] Core tests pass
- [ ] Windows CI run is green (integration tests, publish, smoke-test screenshots)
- [ ] Hardware checklist updated if behaviour on real devices changed
31 changes: 31 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# ProDHCPServer: notes for Claude

Windows 10/11 DHCP server tool for AV field technicians. C# on .NET 10, WPF with the Fluent theme, shipped as one self-contained single-file exe (win-x64). The user is an AV tech, not a developer: anything shown in the UI must be plain English with a suggested next step.

## Layout

- `src/ProDHCPServer.Core`: platform-independent logic (DHCP codec and engine, adapter backup/restore lifecycle, status chain, OUI lookup). No Windows APIs here.
- `src/ProDHCPServer.Windows`: everything that touches the OS (adapters, sockets, ARP, firewall, ping), behind interfaces so Core stays testable with fakes.
- `src/ProDHCPServer.App`: WPF UI (MVVM with CommunityToolkit.Mvvm), elevation manifest, crash handling.
- `tests/ProDHCPServer.Core.Tests`: unit tests, run anywhere. `tests/ProDHCPServer.Windows.Tests`: integration tests, Windows only, must never change adapter settings.
- `docs/hardware-test-phaseN.md`: the manual checklist Simon runs on real hardware at the end of each phase.

## Commands

```
dotnet test tests/ProDHCPServer.Core.Tests # works on Linux
dotnet build ProDHCPServer.sln # builds everything, WPF included, on Linux
dotnet format whitespace ProDHCPServer.sln --verify-no-changes # formatting check
dotnet publish src/ProDHCPServer.App -c Release -r win-x64 -o publish # Windows only in practice
```

In cloud sessions the SessionStart hook (`.claude/hooks/session-start.sh`) installs the .NET 10 SDK from the Ubuntu feed (the dot.net install script is blocked) and restores packages.

## Rules

- `TreatWarningsAsErrors` is on for every project. Fix warnings; don't suppress them without a comment saying why.
- Keep Windows calls out of Core. New OS behaviour goes in the Windows project behind an interface, with a fake in the tests.
- Any change to adapter settings must go through the backup/restore session so Stop, exit and a crash all put the adapter back.
- The Windows integration tests and the UI (smoke-test screenshots) only run on the Windows CI runner. Check the CI run, not just local Linux tests, before calling a change done.
- Work is phased (1: core DHCP loop, 2: ping/logging/profiles, 3: discovery). Each phase ends with Simon's hardware test pass before the next one starts. Don't pull later-phase features forward unasked.
- Builds are downloaded from GitHub Actions artifacts. The exe is not code-signed yet.