Agent skill
project-conventions
Core conventions and patterns for PanelNester codebase
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/project-conventions-bschafer01-panelnester
SKILL.md
Context
PanelNester is a WPF desktop app with a WebView2-hosted React UI. Domain logic lives in .NET; visualization in TypeScript/React/Three.js.
Patterns
Bridge Communication
All WPF↔WebView2 communication uses JSON-over-postMessage with type/payload envelope:
interface BridgeMessage {
type: string;
requestId?: string;
payload: unknown;
}
- WPF dispatches by
typewithout deserializingpayloadfirst - Use
requestIdfor request/response correlation - Keep payloads serializable (no functions, circular refs)
Domain Isolation
Domain project has zero dependencies on WPF, WebView2, or persistence:
- Models in
PanelNester.Domain/Models/ - Contracts (interfaces) in
PanelNester.Domain/Contracts/ - Services implement contracts in
PanelNester.Services/
Error Handling
- Domain returns result objects with
success,errors,warningsarrays - Bridge handlers catch exceptions and return error responses
- WebUI displays validation messages inline, critical errors as toasts
Testing
- Framework: xUnit for .NET, Vitest for TypeScript
- Location:
tests/PanelNester.*.Tests/for .NET,src/PanelNester.WebUI/src/**/*.test.tsfor TS - Run:
dotnet testfor .NET,npm testin WebUI directory
Code Style
- .NET: C# 12, nullable enabled, file-scoped namespaces
- TypeScript: Strict mode, no
anywithout justification - Naming: PascalCase for .NET public members, camelCase for TS
File Structure
src/
├── PanelNester.Desktop/ # WPF shell, bridge
├── PanelNester.Domain/ # Pure models, interfaces
├── PanelNester.Services/ # Application services
└── PanelNester.WebUI/ # React frontend
tests/
├── PanelNester.Domain.Tests/
├── PanelNester.Services.Tests/
└── PanelNester.Desktop.Tests/
Examples
// Bridge handler registration
handlers.Register("import-csv", async (payload) => {
var request = Deserialize<ImportRequest>(payload);
var result = await importService.ImportAsync(request.FilePath);
return new ImportResponse(result);
});
// Calling .NET from React
const result = await hostBridge.invoke<NestResponse>('run-nesting', {
parts: validParts,
material: selectedMaterial,
kerfWidth: 0.125
});
Anti-Patterns
- Domain depending on WPF — Keep domain pure; inject dependencies via interfaces.
- Binary payloads over bridge — Stick to JSON; no ArrayBuffer or Blob.
- Tight coupling between pages — Use shared types from
contracts.ts, not direct imports across pages. - Hardcoding file paths — Always use bridge to request native file dialogs.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?