xiaohongshu
xiaohongshu
cross-platform-guardian
Ensure cross-platform compatibility across macOS (Intel/ARM), Ubuntu, and Fedora for this dotfiles repository. Detects and auto-fixes hardcoded paths, platform-specific assumptions, package availability issues, and test coverage gaps. Use when adding features, updating configs, bumping Nix flake,...
Full skill instructions
Maintains cross-platform compatibility across macOS (Intel/ARM), Ubuntu, and Fedora by detecting issues, auto-fixing violations, and ensuring reproducibility through Nix + Docker testing.
Use this skill when:
flake.nix or flake.lockScan for anti-patterns:
Hardcoded paths:
# ❌ BAD
DOTFILES_DIR="/Users/wcygan/Development/dotfiles"
CONFIG_PATH="/home/user/.config"
# ✅ GOOD
DOTFILES_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
CONFIG_PATH="${XDG_CONFIG_HOME:-$HOME/.config}"
Platform-specific commands without fallback:
# ❌ BAD
open README.md # macOS only
# ✅ GOOD
if [[ "$OSTYPE" == "darwin"* ]]; then
open README.md
else
xdg-open README.md
fi
Architecture assumptions:
# ❌ BAD
HOMEBREW_PATH="/opt/homebrew" # ARM only
# ✅ GOOD
if [[ -d "/opt/homebrew" ]]; then
HOMEBREW_PATH="/opt/homebrew" # Apple Silicon
elif [[ -d "/usr/local/Homebrew" ]]; then
HOMEBREW_PATH="/usr/local" # Intel Mac
fi
Shell assumptions:
# ❌ BAD - assumes bash arrays work everywhere
declare -a packages=(git fish)
# ✅ GOOD - POSIX-compatible or gated
if [[ -n "$BASH_VERSION" ]]; then
declare -a packages=(git fish)
fi
Verify multi-layer detection exists:
In bash scripts (install.sh, scripts/*.sh):
if [[ "$OSTYPE" == "darwin"* ]]; then
echo "macOS detected"
elif [[ -f /etc/fedora-release ]]; then
echo "Fedora detected"
elif [[ -f /etc/lsb-release ]] && grep -q Ubuntu /etc/lsb-release; then
echo "Ubuntu detected"
elif [[ -f /etc/os-release ]]; then
echo "Generic Linux detected"
else
echo "⚠️ Unsupported OS - proceeding with defaults"
fi
In Fish configs (config/fish/conf.d/*.fish):
switch (uname)
case Darwin
# macOS logic
case Linux
# Linux logic
end
Container detection:
if [[ -f /.dockerenv ]] || [[ -n "$container" ]] || ! command -v systemctl &>/dev/null; then
IS_CONTAINER=true
fi
Check flake.nix supports all target architectures:
allSystems = [
"x86_64-linux" # Intel/AMD Linux
"aarch64-linux" # ARM Linux
"x86_64-darwin" # Intel Mac
"aarch64-darwin" # Apple Silicon
];
Validate package availability:
flake.lock, check if any packages fail on specific platformsnix flake show to verify outputs for all systemsscripts/test-platform-compatibility.sh (create if missing)Auto-fix strategy for unavailable packages:
# Add platform-specific conditionals if needed
packages = with pkgs; [
git fish starship # Universal
] ++ lib.optionals stdenv.isDarwin [
# macOS-specific packages
] ++ lib.optionals stdenv.isLinux [
# Linux-specific packages
];
XDG Base Directory compliance:
| Config Type | macOS | Linux | Standard |
|---|---|---|---|
| Fish | ~/.config/fish | ~/.config/fish | ✅ XDG |
| Starship | ~/.config/starship.toml | ~/.config/starship.toml | ✅ XDG |
| VSCode | ~/Library/Application Support/Code/User | ~/.config/Code/User | ❌ Platform-specific |
| tmux | ~/.tmux.conf | ~/.tmux.conf | ❌ Legacy |
Detection pattern in scripts/link-config.sh:
if [[ "$OSTYPE" == "darwin"* ]]; then
VSCODE_DIR="$HOME/Library/Application Support/Code/User"
else
VSCODE_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/Code/User"
fi
Verify GitHub Actions matrix includes:
# .github/workflows/ci.yml
jobs:
docker-matrix:
strategy:
matrix:
include:
- os: ubuntu-25.04
dockerfile: tests/Dockerfile.ubuntu
- os: fedora-40
dockerfile: tests/Dockerfile.fedora
native-test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
Test script validation (tests/docker-test-commands.fish):
if type -q <tool>When compatibility issues detected:
Step 1: Identify violations
# Use scripts/audit-compatibility.sh (create if missing)
grep -r "/Users/wcygan" scripts/ config/
grep -r "open " scripts/ | grep -v "xdg-open"
Step 2: Apply fixes automatically
# Fix hardcoded paths
sed -i.bak 's|/Users/wcygan/Development/dotfiles|$(cd "$(dirname "${BASH_SOURCE[0]}")/.." \&\& pwd)|g' scripts/*.sh
# Fix platform-specific commands
# Use Edit tool to replace `open` with conditional logic
Step 3: Validate fixes
make test-pre # Local syntax checks
make test-docker # Docker matrix (Ubuntu + Fedora)
Step 4: Update tests
tests/docker-test-commands.fishfix(compat): <description>When user requests flake update or this skill detects outdated lock:
Step 1: Update flake.lock
nix flake update
Step 2: Test across all platforms in CI
# Trigger CI workflow or run locally
make test-docker # Tests Ubuntu + Fedora
Step 3: Check for package availability issues
# Attempt build for each system
nix build .#packages.x86_64-linux.default --dry-run
nix build .#packages.aarch64-linux.default --dry-run
nix build .#packages.x86_64-darwin.default --dry-run
nix build .#packages.aarch64-darwin.default --dry-run
Step 4: Handle failures
flake.lock only if all platforms passIssue: Script uses bash-isms in shebang marked as sh
# ❌ BAD
#!/bin/sh
declare -a arr=(one two) # bash-only
# ✅ GOOD
#!/usr/bin/env bash
declare -a arr=(one two)
Issue: Missing container detection in Nix install
# ✅ GOOD (from scripts/install-nix.sh)
if [[ -f /.dockerenv ]] || [[ -n "$container" ]]; then
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | \
sh -s -- install linux --init none --no-confirm
fi
Issue: Fish config assumes tools exist
# ❌ BAD
eval (starship init fish)
# ✅ GOOD
if type -q starship
eval (starship init fish)
end
Present findings as:
🔴 Critical Issues (blocks installation)
scripts/cleanup-symlinks.sh:104 - Hardcoded user path
$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)🟡 Warnings (may fail on some platforms)
install.sh:45 - Missing Alpine Linux detection
🟢 Suggestions (improvements)
4160763d74f6)nix flake update + test matrixPre-commit checks:
# Add to git pre-commit hook
scripts/audit-compatibility.sh || exit 1
PR checklist (from AGENTS.md):
tests/docker-test-commands.fishmake test-pre && make test-docker passingContinuous monitoring:
flake.nix changesKey compatibility files to monitor:
install.sh - Main entry point, OS detectionscripts/install-nix.sh - Container detection, Nix installerscripts/link-config.sh - Platform-specific paths (VSCode)scripts/cleanup-symlinks.sh - ⚠️ Known hardcoded path issueconfig/fish/conf.d/05-homebrew.fish - macOS Homebrew detectionconfig/fish/conf.d/10-nix.fish - Nix environment setupflake.nix - Package definitions for all platforms.github/workflows/ci.yml - CI test matrixtests/docker-test-commands.fish - Functional test suiteIf auto-fix breaks something:
git diff to review.bak files)git checkout -- <file>make test-pre && make test-localRemember: This repository prioritizes reproducibility via Nix and testing via Docker. Every fix must pass the full test matrix before commit.
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience