@xynogen/pix-skills 0.4.14 → 0.4.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,7 +7,7 @@ Pi coding agent extension — skill loader tool + skills bundle.
7
7
  | Resource | Type | Description |
8
8
  |---|---|---|
9
9
  | `read_skills` | tool | Browse and load bundled skills. No args → list all. `name` only → description. `name + full=true` → full instructions. |
10
- | `skills/` | skills | 28 bundled skills (auto-loaded by pi at startup — names + descriptions in system prompt) |
10
+ | `skills/` | skills | 29 bundled skills (auto-loaded by pi at startup — names + descriptions in system prompt) |
11
11
 
12
12
  ## How it works
13
13
 
@@ -37,6 +37,7 @@ All skills are model-invocable — pi auto-loads each one on description match.
37
37
  | `commit` | Split, write, and maintain Conventional-Commit-style commits |
38
38
  | `debug` | Root-cause analysis and self-annealing error resolution |
39
39
  | `diff` | Review current git changes via pre-populated status + staged/unstaged diffs |
40
+ | `environment` | Detect OS/distro/kernel/arch/user/CPU before running platform-specific commands |
40
41
  | `explain` | Technical deconstruction and logic tracing of existing code |
41
42
  | `finish` | Structured branch completion — verify, decide, clean up |
42
43
  | `graphify` | Codebase questions via a persistent knowledge graph |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xynogen/pix-skills",
3
- "version": "0.4.14",
3
+ "version": "0.4.16",
4
4
  "description": "Pi extension — agent skill loader (skill tool + skills bundle)",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: environment
3
+ description: "Establish clean awareness of the user's working environment — OS, distro, kernel, arch, user, and CPU — before running or suggesting commands. Use whenever a request depends on the platform such as installing packages, system services, file paths, downloading arch-specific binaries, or any command whose syntax differs across systems. Load this first so actions match the actual machine instead of a guessed default."
4
+ ---
5
+
6
+ # Environment Skill
7
+
8
+ The blocks below are populated with **live** system facts at skill-load time via
9
+ `\!`cmd`` directives. Read them first — they are the ground truth about the
10
+ machine you are operating on. Do not assume a default platform.
11
+
12
+ ## OS release
13
+
14
+ !`cat /etc/os-release`
15
+
16
+ ## Kernel, arch, hostname
17
+
18
+ !`uname -srn`
19
+
20
+ ## CPU count
21
+
22
+ !`nproc`
23
+
24
+ ## Current user
25
+
26
+ !`id -un`
27
+
28
+ ## Working directory
29
+
30
+ !`pwd`
31
+
32
+ ---
33
+
34
+ ## How to use this context
35
+
36
+ **Know the environment, then act inside it.** The facts above tell you the
37
+ distro family (`ID` / `ID_LIKE`), kernel, CPU architecture, user, and where you
38
+ are. Let them shape every platform-sensitive decision — paths, privilege,
39
+ binary selection, parallelism, and command syntax.
40
+
41
+ **Reconcile the user's intent with the real machine.** If a request assumes a
42
+ different platform, surface the mismatch and offer the equivalent rather than
43
+ silently running the wrong thing.
44
+
45
+ *Example — package managers.* `ID`/`ID_LIKE` maps to a specific manager; never
46
+ assume `apt`:
47
+
48
+ | `ID` / `ID_LIKE` | Manager | Refresh index | Install |
49
+ |-------------------------------------|----------|--------------------|----------------------|
50
+ | `debian`, `ubuntu` | `apt` | `apt update` | `apt install <pkg>` |
51
+ | `fedora`, `rhel`, `centos`, `rocky` | `dnf` | `dnf check-update` | `dnf install <pkg>` |
52
+ | `arch`, `manjaro` | `pacman` | `pacman -Sy` | `pacman -S <pkg>` |
53
+ | `opensuse`, `suse` | `zypper` | `zypper refresh` | `zypper install` |
54
+ | `alpine` | `apk` | `apk update` | `apk add <pkg>` |
55
+ | macOS (kernel `Darwin`) | `brew` | `brew update` | `brew install <pkg>` |
56
+
57
+ So if the user says `apt update` on a `fedora` box, say so and run
58
+ `sudo dnf check-update` instead — once confirmed.
59
+
60
+ The same principle applies beyond packages:
61
+
62
+ - **Arch** — pick `x86_64` vs `aarch64` release artifacts to match `uname`.
63
+ - **Privilege** — system changes need root; prefer the `sudo_run` tool over
64
+ inlining `sudo` in a bash command.
65
+ - **Parallelism** — size builds/jobs to the CPU count above (`make -j`, etc.).
66
+ - **Paths** — respect the actual user and home, not a hardcoded `/home/user`.
67
+
68
+ If a fact is missing, blank, or shows `[blocked: …]`, ask the user instead of
69
+ guessing the platform.
@@ -8,8 +8,16 @@ description: Plan a task, break it into small independent units, and fan them ou
8
8
  Plan first, decompose into small independent units, then fan those units out to
9
9
  **cheaper** subagent models running **in parallel**. A capable orchestrator (you)
10
10
  keeps the plan, the decisions, and the final integration. Cheap workers do the
11
- bulk grunt work concurrently. Net effect: faster wall-clock, lower cost, less of
12
- the expensive model's tokens spent on mechanical work.
11
+ bulk grunt work concurrently.
12
+
13
+ **The real trade is not intelligence for speed — it is spending *less of* the
14
+ orchestrator's intelligence.** The strong model's context window and attention
15
+ are the scarce resource. Every mechanical unit it does itself burns that finite
16
+ budget on work that does not need it. Offloading those units to cheap workers
17
+ keeps the smart model's context clean and reserved for the hard 10% — the plan,
18
+ the seams, the integration. Faster wall-clock and lower cost are byproducts; the
19
+ point is preserving the expensive model's intelligence for where it actually
20
+ matters.
13
21
 
14
22
  This skill is for the **parent orchestrator only**. Children receive concrete,
15
23
  self-contained tasks — they do not plan, do not decompose further, and do not
@@ -73,11 +81,42 @@ Split the plan into units that satisfy the independence test:
73
81
  If a unit fails the test, either merge it back, sequence it (chain), or keep it
74
82
  on the orchestrator.
75
83
 
84
+ > **Delegating ≠ branching.** A foreground/blocking subagent call where the
85
+ > parent waits for the result before launching the next is *serial delegation* —
86
+ > it only buys context isolation, **zero wall-clock gain**. The whole point of
87
+ > this skill is branching: all independent units must be launched **together in
88
+ > one fan-out** (`tasks:[...]` with `async: true`, or N background launches in a
89
+ > single turn) so they run concurrently. If you spawn one, wait, spawn the next,
90
+ > you are not using the power of subagents — you are just relaying work serially.
91
+ > Splitting a *dependency chain* into separate agents wins nothing either: they
92
+ > serialize on each other's data. Branch only truly-independent units.
93
+
76
94
  ### 3. Fan out to cheap models
77
95
 
78
96
  Use top-level parallel tasks with a per-task `model` override pointing at a
79
97
  cheaper/smaller model.
80
98
 
99
+ > **Delegating ≠ branching — serial fan-out is pure loss.** A foreground/blocking
100
+ > subagent call where the parent waits for one result before launching the next
101
+ > is *serial delegation*, and it is **strictly worse than doing the work
102
+ > yourself**. The orchestrator stays tied up relaying the unit — so its scarce
103
+ > context/attention was spent anyway — *and* the unit ran on a weaker model. You
104
+ > traded the strong model's intelligence away and got nothing back, not even less
105
+ > of it spent. The only thing serial delegation buys is context isolation, which
106
+ > rarely justifies the quality hit.
107
+ >
108
+ > The entire value of this skill is **branching**: launch every independent unit
109
+ > **together in one fan-out** (`tasks:[...]` with `async: true`, or N background
110
+ > launches in a single turn) so they run concurrently. Concurrency is what makes
111
+ > the trade pay — N units of mechanical work leave the orchestrator's context at
112
+ > once, freeing its budget for the hard parts. Remove the parallelism and you
113
+ > keep none of that upside, only the downside.
114
+ >
115
+ > Corollary: splitting a *dependency chain* into separate agents wins nothing
116
+ > either — the units serialize on each other's data, collapsing back to serial.
117
+ > Branch **only** truly-independent units; if you cannot fan them out
118
+ > concurrently, keep the work on the orchestrator instead of delegating it.
119
+
81
120
  **Resolve the cheap model at call time — never hardcode it.** The active model is
82
121
  dynamic: the user can switch it mid-chat, and the orchestrator's own model is
83
122
  whatever is current. So before fanning out: