Skip to content
Back to skills

Windows Specific Patterns

ASecurity

Use for Windows registry resources, symlink capability/junction behavior, elevation delegation, Windows-only cfg gates, or Windows-specific wrapper behavior beyond shared bootstrap. Not for ordinary wrapper parity or checks.

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added August 31, 2026
developmentrustshelltestingapi

Works with

  • cli
  • api

Security analysis

A100/100

Scanned October 1, 2026

npx -y skills add sneivandt/dotfiles --skill windows-specific-patterns --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Windows Specific Patterns?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Windows Specific Patterns
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/sneivandt-windows-specific-patterns/badge)](https://www.skillsdirectory.com/skills/sneivandt-windows-specific-patterns)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: windows-specific-patterns
description: >
  Use for Windows registry resources, symlink capability/junction behavior,
  elevation delegation, Windows-only cfg gates, or Windows-specific wrapper
  behavior beyond shared bootstrap. Not for ordinary wrapper parity or checks.
---

# Windows-Specific Patterns

Prefer capability methods. Use a direct Windows check only when the behavior is
inherently Windows-specific and has no narrower capability, within the platform
abstraction. `#[cfg(windows)]` gates platform-only implementations/imports;
`cfg!(windows)` is a runtime boolean and does not hide unavailable APIs from the
other target. Preserve the boundaries enforced by
[`domain_boundaries`](../../../cli/tests/domain_boundaries.rs).

## Registry

- Registry desired state comes from `conf/registry.toml`.
- Supported paths are HKCU-only; entries are not profile-filtered.
- Preserve the shared batch state query before resource convergence.
- Keep native access in `RegistryResource`, not in the task.

## Symlinks

- Use `infra::fs::is_dir_like()` for classification and
  `create_native_symlink()` for native dispatch.
- Resource code may fall back to junctions for directory links.
- Check capability before mutation. Developer Mode permits unprivileged native
  links. Without that capability, only missing/incorrect file links justify
  elevation; directory links can fall back to junctions.
- Dry-run never requests elevation.

## Elevation

- Keep the parent process unprivileged.
- Delegate only tasks whose current state reports `needs_elevation()`.
- Check current task metadata and assessments rather than maintaining a second
  inventory of elevation-capable tasks. Developer Mode and symlink tasks must
  not prompt once their desired state is already satisfied.
- The child uses explicit selectors and cannot recurse.
- Never prompt in CI or a non-interactive session.
- If elevation is unavailable, skip elevating tasks and their transitive
  dependents. If the child ran successfully, continue dependents normally.
- Build child arguments in a pure, platform-independent function for tests.

## PowerShell wrapper

`dotfiles.ps1` owns bootstrap, checksum/provenance verification, build mode, and
argument forwarding only. Use `$ErrorActionPreference = 'Stop'` and `Join-Path`.
Check native executable exit codes explicitly; PowerShell's error preference
does not by itself make every non-zero native exit terminating. Task behavior
belongs in Rust.

Cover paths with spaces, drive roots, UNC/extended prefixes, and case differences
where the changed code handles paths. Do not approximate Windows path rules by
testing only Unix-looking strings on the host.

Use the native-runtime caveats and checks under
[Platform coverage parity](../../../docs/TESTING.md#platform-coverage-parity)
after Windows-sensitive changes.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.