# Linux Environment

> Safe, unprivileged Linux environment discovery skill. Detects active distribution identity, kernel release, execution context (native, container, virtual machin

- Skill: `eshanized/linux-environment` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx get-skill add eshanized/linux-environment`
- Raw SKILL.md: https://api.skillmd.com/api/skills/eshanized/linux-environment/raw
- Safety review: pending
- Works with: any agent that reads SKILL.md (Claude Code, Claude.ai, Cursor, Codex, Windsurf, 60+ more)
- Category: Coding & Dev Tools
- Author: eshanized (https://skillmd.com/u/eshanized)
- Updated: 2026-11-25
- Page: https://skillmd.com/skills/eshanized/linux-environment

---

---
name: linux-environment
description: Safe, unprivileged Linux environment discovery skill. Detects active distribution identity, kernel release, execution context (native, container, virtual machine, chroot), init system, and installed compiler toolchains (GCC, Clang, Rust, Meson, CMake, Makepkg). Use when starting a new task to establish target version boundaries, when cross-compiling, or when diagnosing environmental constraints.
license: Apache-2.0
compatibility: Requires Linux environment and Python 3.
metadata:
  author: Eshan Roy
  version: "0.1.0"
  claude_context: "fork"
  claude_agent: "general"
---

# Linux Environment: Safe System Discovery

The `linux-environment` skill performs unprivileged, non-invasive reconnaissance of the active Linux system. It provides accurate version boundaries and execution context descriptors to downstream engineering skills without risking host state alteration.

---

## 1. Core Operating Constraints

To ensure host safety and privacy, this skill strictly enforces:
- **No `sudo` or Root Escalation**: All discovery queries must execute as the current unprivileged user.
- **No Package Installation**: Never run `pacman -S`, `apt install`, or `dnf` to install discovery tools.
- **No Configuration Mutations**: Read configuration files in read-only mode (`r`); never touch system files.
- **No Secret or Environment Dumps**: Never dump `env`, shell histories, private keys, or credentials.
- **No Network Scans**: Do not scan network interfaces or connect to remote ports.
- **Graceful Failure**: If a diagnostic utility is missing, report its absence; never invent synthetic data.

---

## 2. Discovery Execution

To perform discovery, execute the deterministic helper script:

```bash
python3 skills/linux-environment/scripts/discover_environment.py --format json
```

Or for human-readable terminal output:
```bash
python3 skills/linux-environment/scripts/discover_environment.py --format text
```

### Discovery Facets Returned
1. **Distribution**: Name, ID (`arch`, `debian`, `fedora`, `ubuntu`), version number, and base family.
2. **Kernel**: Release string, architecture (`x86_64`, `aarch64`), and LTS status.
3. **Execution Context**:
   - `native`: Running directly on host hardware.
   - `container`: Running inside Docker, Podman, LXC, or container runtime.
   - `vm`: Running inside KVM, QEMU, VMware, or VirtualBox.
   - `chroot`: Running in a chroot overlay.
4. **Init System**: Active init daemon (`systemd`, `sysvinit`, or custom) and running version.
5. **Toolchains & Build Systems**:
   - Compilers present (`gcc`, `clang`, `rustc`).
   - Build generators present (`meson`, `cmake`, `make`, `ninja`, `cargo`).
   - Package managers present (`makepkg`, `pacman`, `dpkg`, `rpm`, `apt`).
   - Diagnostic tools present (`systemd-analyze`, `namcap`, `strace`, `gdb`, `perf`).

---

## 3. Interpreting Output for Downstream Routing

The JSON descriptor generated by `discover_environment.py` informs how other skills must act:
- **If `context.type == "container"`**: Note that kernel module testing (`insmod`) is prohibited because containers share the host kernel. Escalate kernel testing to QEMU microVMs.
- **If `distribution.id != "arch"`**: Avoid hardcoding Arch-specific `pacman` or `PKGBUILD` workflows; adapt instructions to the active distribution format.
- **If `toolchains.compilers` lacks `gcc` or `clang`**: Flag missing compiler prerequisites before attempting local software builds.

For detailed detection heuristics and filesystem markers, refer to [references/detection-heuristics.md](references/detection-heuristics.md).

