.ai/skills/write-xip/SKILL.md
Reference for writing effective XerahS Improvement Proposals (XIPs), including structure, templates, review checks, and implementation patterns. Use sync-xips for creating, editing, and syncing XIP GitHub issues and local backups.
npx skillsauth add sharex/xerahs XIP Writing ReferenceInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill is the writing reference for XerahS Improvement Proposals (XIPs) that are actionable, well-structured, and aligned with project architecture.
Workflow: GitHub is the source of truth for XIPs; docs/proposals/xip/ is a generated backup. Use this file for structure and writing rules. Use sync-xips for create/edit/sync workflows.
A XIP (XerahS Improvement Proposal) is a design document that:
# XIP0001 Short Descriptive Title
**Status**: Draft | In Review | Ready for Implementation | In Progress | Completed
**Created**: YYYY-MM-DD
**Updated**: YYYY-MM-DD
**Area**: Desktop | Mobile | Core | Uploaders | UI | Architecture
**Goal**: One-sentence description of what this achieves.
---
Format: XIPXXXX Description
| Format | Status |
|--------|--------|
| XIP0030 Mobile Share Feature | ✅ Correct |
| XIP0030: Mobile Share Feature | ❌ No colon |
| [XIP0030] Mobile Share Feature | ❌ No brackets |
| XIP0030 - Mobile Share Feature | ❌ No dash |
| XIP30 Mobile Share Feature | ❌ Must be 4 digits |
This format applies to:
docs/proposals/xip/XIP0030-mobile-share-feature.mdXIP0030 Mobile Share Feature# XIP0030 Mobile Share FeatureBreak into logical phases. Each phase should:
Example Phase Structure:
### Phase N: Phase Name
Description of what this phase accomplishes.
**Key Files:**
- `src/XerahS.Core/Services/NewService.cs`
**Code Example:**
```csharp
// Include representative code
Rules:
#### 4. Non-Negotiable Rules
Explicit constraints that must be followed:
- Do not create duplicate upload pipelines
- Do not call providers directly from platform code
- Do not duplicate TaskSettings cloning logic
- Platform-specific code stays in platform folders
- etc.
#### 5. Deliverables
Numbered list of concrete outputs:
1. New service in XerahS.Core
2. Settings additions
3. Platform implementations
4. UI components
5. Documentation
#### 6. Affected Components
List of projects/files that will change:
- XerahS.Core: Specific classes
- XerahS.App: Platform entry points
- XerahS.Uploaders: Provider changes (if any)
- etc.
#### 7. Architecture Summary (recommended)
ASCII diagram showing data flow:
Component A ↓ Component B ← XerahS.Core ↓ Component C
---
## Writing Principles
### 1. Reuse Existing Infrastructure
**Before writing new code, study:**
- WatchFolderManager pattern for file handling
- TaskManager.StartFileTask for upload triggering
- TaskSettings.Clone for settings handling
- UploaderProviderBase for provider patterns
- TaskHelpers for file naming/storage
**Golden Rule:** If XerahS already does something similar, reuse that pattern.
### 2. Platform Neutrality
- Core logic goes in `XerahS.Core` or `XerahS.Common`
- Platform-specific code stays in `Platforms/` folders
- Use abstractions (interfaces) to bridge platform and core
- Core services must not know about Android, iOS, or Avalonia views
### 3. No Duplicate Logic
Explicitly forbid:
- Parallel upload pipelines
- Copy-pasted file handling code
- Reimplemented file naming logic
- Duplicated settings cloning
- Direct provider calls from platform code
### 4. Privacy and Security First
- Prefer explicit user action over automatic monitoring
- Request permissions only when necessary
- Use platform secure storage for credentials
- Document privacy implications
### 5. Clear Separation of Concerns
| Layer | Responsibility |
|-------|---------------|
| Platform Heads | Receive platform data, convert to local files |
| Core Services | Process files, invoke TaskManager |
| TaskManager | Coordinate upload jobs |
| Providers | Execute actual uploads |
| UI | Display results, user interaction |
### 6. Avalonia-Specific Accuracy for UI XIPs
When a XIP touches Avalonia `.axaml` bindings, write rules using Avalonia semantics (not WPF assumptions):
- Treat `#ElementName.Property` as Avalonia binding syntax used by `Binding`/compiled binding paths.
- Do **not** prescribe `{ReflectionBinding #ElementName.Property}`.
- If dynamic reflection binding is truly required, keep it explicit and avoid `#ElementName` path segments.
---
## XIP Evolution Process
XIPs often evolve during review. Document significant changes:
```markdown
## Evolution History
| Date | Change | Rationale |
|------|--------|-----------|
| 2026-02-12 | Switched from auto-monitoring to share-based | Battery/privacy concerns |
When rewriting a XIP:
Every XIP lives as a GitHub issue (label xip). The issue body is the full XIP content. The docs/proposals/xip/ folder is a backup generated by the sync-xips script.
XIP0001 Brief Description
Must follow XIP naming convention:
Example: XIP0030 Implement Share to XerahS on Mobile
docs/proposals/xip/ backup is updated.Use the sync-xips skill to create issues, edit them, and run sync-from-github.ps1 to refresh the docs/proposals/xip/ backup.
Before finalizing a XIP:
ReflectionBinding guidance for #ElementName paths)When implementing "share" functionality:
When adding an uploader:
When creating a service that works everywhere:
Monitor screenshots folder automatically ← BAD
Let user share files explicitly ← GOOD
Android MainActivity calls S3 directly ← BAD
Android → ShareImportService → TaskManager ← GOOD
Create new settings cloning for mobile ← BAD
Reuse existing TaskSettings.Clone() ← GOOD
Show MessageBox from ShareImportService ← BAD
Return results, let caller display ← GOOD
The docs/proposals/xip/ folder is a backup of GitHub. Sync with .ai/skills/sync-xips/scripts/sync-from-github.ps1. Status is not reflected in paths; all backup files live in docs/proposals/xip/ as XIP####-title-slug.md.
docs/proposals/xip/XIPXXXX-descriptive-name.md (single folder)https://github.com/ShareX/XerahS/issues/XXX# XIP0001 Title
**Status**: Draft
**Created**: YYYY-MM-DD
**Area**: Area
**Goal**: One sentence.
---
## Overview
Problem and approach.
## Prerequisites
- List
## Implementation Phases
### Phase 1: Name
Description.
**Key Files:**
- Path
**Code:**
```csharp
// Example
Rules:
Diagram
---
## Key Takeaways
1. **Study first** - Understand existing patterns before writing
2. **Reuse always** - No duplicate upload pipelines, no duplicate settings logic
3. **Separate concerns** - Platform code handles platform things, Core handles logic
4. **Be explicit** - Non-negotiable rules, clear deliverables, concrete file paths
5. **Privacy first** - Prefer explicit user action over automatic monitoring
6. **GitHub first** - Create/edit XIP in the issue; run sync-xips to update the `docs/proposals/xip/` backup
---
**Remember**: A good XIP is precise, reusable, and respects existing architecture.
documentation
Rules and workflows for updating docs/CHANGELOG.md, including version grouping, consolidation, and commit-entry attribution.
testing
Create and maintain XerahS Improvement Proposals (XIPs) with GitHub as source of truth and docs/proposals/xip folder as backup. Use when creating or editing XIPs, syncing XIPs between GitHub issues and the docs/proposals/xip folder, or when the user mentions XIP, GitHub issues for XIP, or local XIP files.
documentation
Repository maintenance preparation for XerahS. Use before release or changelog work to sync repositories, inspect submodule state, identify version/changelog needs, and hand off commit/push/version rules to git-workflow.
development
Orchestrate XerahS release flow in strict order: run maintenance prep first, update-changelog second (optional only if docs/CHANGELOG.md is intentionally absent), verify build, bump/commit/push/tag while syncing Chocolatey version metadata, monitor GitHub Actions every 2 minutes, ensure standard release notes content, then set pre-release by default (use explicit opt-out for stable). On failures, inspect logs, fix root cause, and retry with the next patch release.