Skip to content

Latest commit

 

History

History
50 lines (38 loc) · 3.88 KB

AGENTS.md

File metadata and controls

50 lines (38 loc) · 3.88 KB

Agent Notes

Repository Shape

  • The solution references sibling repositories under /Users/svante/Documents/xecrets, especially xecrets-net and xecrets-slip39. Build and test commands can read and write outside the current xecrets-cli/src workspace sandbox.
  • Xecrets.Cli is the executable layer. Keep it on Xecrets.Core, Xecrets.Core.Desktop, and Xecrets.Slip39; do not reference AxCrypt.* types directly here.
  • Xecrets.Core and Xecrets.Core.Desktop are thin adapter layers and may bridge to AxCrypt code.
  • Put non-filesystem-backed adapters in Xecrets.Core; put filesystem/stdin/stdout/wipe/CLI platform adapters in Xecrets.Core.Desktop.
  • Do not modify old AxCrypt code for adapter work unless explicitly asked.

Editing Rules

  • Keep one top-level C# type per .cs file. If a file accumulates multiple classes, interfaces, records, or structs, split them before finishing the change.
  • Keep implementation types internal unless they are intentionally part of the external surface or must be consumed from another assembly.
  • Do not modify autogenerated files such as *.Designer.cs, generated obj/ outputs, or other tool-generated sources unless explicitly asked.
  • When moving code between files or within a file during refactoring or rewiring, move accompanying comments with the code instead of deleting them.
  • When asked to restructure, refactor, rearchitect, or rewire code, preserve equivalent behavior and do not add features, improve functionality, or silently change behavior. It is fine to call out specific issues that should be improved, but not to change behavior without being asked.

C# Style

  • Use block namespaces, not file-scoped namespaces.
  • Keep the existing copyright/license header on C# source files.
  • Follow .editorconfig: 4-space indents for code, 2-space indents for project/XML files, braces on all control blocks, and var when the type is obvious.
  • Prefer expression-bodied properties and accessors where it keeps things simple; methods and constructors usually stay block-bodied.
  • Use collection expressions and target-typed new() when they improve clarity.
  • Keep naming descriptive and PascalCase for types, members, enums, and constants.
  • Public option/status identifiers use the Xf prefix already established in the repo.
  • Do not add ArgumentNullException.ThrowIfNull() checks. If null is invalid, follow the existing contract style; if null is valid, allow it.

Build And Test

  • After making code changes, always run an appropriate build or equivalent verification command before finishing. If the command touches sibling project trees or build outputs, request escalation and then run it.
  • Do not run dotnet build, dotnet test, dotnet restore, msbuild, or related .NET verification commands in the default sandbox for this repository. Request escalation first, explain that the command touches sibling project trees/build outputs, and wait for approval.
  • If a build or test command appears stuck, stop it before continuing. Do not leave background build sessions running.
  • After edits, normalize line endings to the host default for the files you touched.
  • There may be unrelated local changes in sibling repositories. Do not revert or normalize those changes unless explicitly asked.

Architecture Patterns

  • Most behavior is organized as small Operation/* classes implementing IExecutionPhases.
  • RunFactory owns the opcode-to-operation wiring.
  • Status is the standard result object for success/failure flow.
  • Logging and progress reporting are separate concerns, with TotalsTracker/IProgressContext handling progress and ILogger handling message output.

Testing Habits

  • Tests use NUnit with [TestFixture], [SetUp], and Assert.That.
  • Test class names commonly start with Test....
  • Use fake AxCrypt runtime helpers where needed.
  • Prefer focused tests around parser behavior, progress updates, and status mapping.