gentleman-system_skill

This skill guides adding OS support, refining detection, and orchestrating command execution across Termux, Linux, and macOS environments.
  • Shell

1.3k

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill gentleman-programming/gentleman.dots --skill gentleman-system

  • SKILL.md5.9 KB

Overview

This skill describes system detection and command execution patterns used by Gentleman.Dots. It documents the OS type enum, SystemInfo shape, detection priority (Termux first), and the correct command execution helpers for different environments. The goal is to make adding OS support, modifying detection logic, and running platform-specific commands consistent and safe.

How this skill works

Detection builds a SystemInfo struct by checking Termux first, then runtime.GOOS and additional checks for Arch or Debian families. SystemInfo exposes flags like IsTermux, IsARM, HasBrew, and Prefix to drive behavior. Command execution helpers choose proper behavior: plain Run for simple exec, RunWithLogs for streaming output, RunSudo* for privileged ops, RunBrew* for Homebrew, and RunPkg* for Termux pkg manager.

When to use it

  • Adding support for a new OS or variant (add OSType, detection, and installer case).
  • Changing OS detection logic or adding new detection heuristics (Termux, Arch, Debian).
  • Running commands that require platform-specific handling (sudo, brew, pkg).
  • Implementing backup/restore or file operations that depend on HomeDir/Prefix.
  • Choosing the correct exec function when logs, sudo, or package managers are needed.

Best practices

  • Always check Termux first; it runs on Linux but needs special handling.
  • Populate SystemInfo completely so downstream code can branch safely (HasBrew, HasPkg, IsARM, Prefix).
  • Use RunWithLogs or Run*WithLogs when you need real-time output for progress or telemetry.
  • Use CommandExists("tool") before attempting installs to avoid unnecessary operations.
  • When adding a new OS, update Detect(), add an isNewOS() helper, and add an installer case.

Example use cases

  • Add support for a new BSD: add OSType constant, implement isBSD(), update Detect(), and add installer steps.
  • Install a tool: use RunBrewWithLogs on macOS, RunSudoWithLogs on Arch, RunPkgInstall on Termux.
  • Detect Homebrew prefix for Apple Silicon vs Intel using runtime.GOARCH to choose paths.
  • Implement backup: use EnsureDir, CopyFile, and CopyDir with homeDir from SystemInfo.
  • Write tests: run Go tests under installer/internal/system for Detect and Exec behavior.

FAQ

Termux reports as Linux but has different package management and paths; checking it first prevents misclassification.

Which exec helper should I use for installs?

Pick based on platform: RunBrew* for Homebrew, RunSudo* for system package managers on Linux, RunPkg* for Termux; add logging variants when you need streaming logs.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
gentleman-system skill by gentleman-programming/gentleman.dots | VeilStrat