# ShareX Core Standards

> Apply XerahS C# license headers and project configuration conventions. Use for code or project-file changes, not release workflow.

- Skill: `sharex/sharex-core-standards` (Agent Skill)
- Install (CLI): `npx skillmds@latest add sharex/sharex-core-standards`
- Raw SKILL.md: https://api.skillmd.com/api/skills/sharex/sharex-core-standards/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: sharex (https://skillmd.com/u/sharex)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/sharex/sharex-core-standards

---


## License Header Requirement

When creating or editing C# files (`.cs`) in this repository, include the following license header at the top of the file (tailored for the Avalonia implementation):

```csharp
#region License Information (GPL v3)

/*
    XerahS - The Avalonia UI implementation of ShareX
    Copyright (c) 2007-2026 ShareX Team

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

    Optionally you can also view the license at <http://www.gnu.org/licenses/>.
*/

#endregion License Information (GPL v3)
```

## Build Configuration Rules

### Windows Target Framework Moniker (TFM)

**CRITICAL**: When configuring projects to target Windows, use the **explicit TFM** format that includes the platform version:
`net10.0-windows10.0.26100.0`

**Do NOT use**:
`<TargetFramework>net10.0-windows</TargetFramework>` with a separate `<TargetPlatformVersion>...` property.
This is required to avoid "Windows Metadata not provided" errors during full solution builds with CsWinRT.

### SkiaSharp Version Guidance

**IMPORTANT:** SkiaSharp is centrally managed in the root `Directory.Packages.props`; keep managed and native packages on the same current version.

- When adding SkiaSharp to a new project, prefer the shared central package version instead of introducing an inline project-local version.
- If you encounter version conflicts, align with the root central package management entry rather than reintroducing the legacy `2.88.9` pin.
- This guidance applies to all projects including `XerahS.*` and `ShareX.ImageEditor`.

## General Coding Rules

### Code and Config Changes

- Follow existing patterns in each project area.
- Keep changes minimal and targeted.
- Add small comments only when necessary to explain non-obvious logic.
- **CRITICAL:** After modifying code, always run `dotnet build` and fix all build errors before finishing.
- For Git workflow, commit format, and version bump behavior, follow `.ai/skills/git-workflow/SKILL.md`.
- **Ensure you can compile, and if not, fix the issues.** This is a mandatory check before finishing any coding task.

### Change Safety

- Do not remove or rewrite unrelated content.
- Apply version changes only via the workflow defined in `.ai/skills/git-workflow/SKILL.md`.
- Flag assumptions clearly when requirements are ambiguous.

### Testing

- If you modify executable code, suggest relevant tests.
- If tests are added, align them with current test conventions.

### Documentation

- Update or add docs when behavior or usage changes.
- Keep filenames and headings descriptive and stable.
- **Technical Documentation Location**: Automatically save all technical `.md` files that do not properly belong to other specific `docs/` subfolders in `docs/technical`. Do not save them in the root folder.
- Commit expectations for documentation follow `.ai/skills/git-workflow/SKILL.md`.

### Security

- Do not include secrets or tokens.
- Avoid logging sensitive data in examples.

### Output Format

- For changes, summarize what changed and where.
- Provide next steps only when they are natural and actionable.

