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):
#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 and is currently on 3.119.3-preview.1.1 for the Avalonia 12 upgrade line.
- 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.9pin. - This guidance applies to all projects including
XerahS.*andShareX.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 buildand 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
.mdfiles that do not properly belong to other specificdocs/subfolders indocs/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.
More from sharex/xerahs
design-ui-window
Redesigns or normalises any XerahS Avalonia .axaml page, dialog, or tool window to consistent app quality. Enforces layout, spacing, theming, surfaces, buttons, scrollbars, accessibility, and visual hierarchy. Only changes visuals, layout, and styles; never business logic, bindings, or public view-model API. Reusable by updating target_view_path.
71sharex workflow and versioning
Canonical Git, commit/push, and Directory.Build.props versioning workflow for XerahS. Use for any task that changes version numbers or requires commit/push.
61changelog management
Rules and workflows for updating CHANGELOG.md, including version grouping, consolidation, and commit handling.
59sharex feature specifications
Detailed specifications for Uploader Plugin System and Annotation Subsystem features
58sharex architecture and porting
Platform abstraction rules, porting guidelines, and architecture standards for XerahS
57avalonia-api
Comprehensive reference for Avalonia UI framework including XAML syntax, controls, data binding, MVVM patterns, styling, custom controls, layout system, responsive layout, navigation, and best practices. Covers CommunityToolkit.Mvvm integration, compiled bindings, dependency properties, attached properties, control templates, container queries, and cross-platform development patterns.
38