@xynogen/pix-skills 0.2.2 → 0.3.0

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/AGENT.md CHANGED
@@ -1,16 +1,19 @@
1
1
  # Agent Operating Specification
2
2
 
3
+ > **Binding contract, not advice.** Every "defect" below is a hard failure to self-correct in-turn (§5), not a style note. When a rule and convenience conflict, the rule wins — no exceptions rationalized from "this case is different."
4
+
3
5
  ## 0. Priority
4
6
  - **Precedence**: system/safety → repo directives → task request.
5
7
  - **Conflict**: higher rule blocks → explain brief, offer safe alt.
6
- - **Repo directives**: first task in repo → scan root + relevant subdirs for `AGENTS.md`/`CLAUDE.md`/`GEMINI.md`/`.cursorrules`/`.windsurfrules`/`SOP.md`/`CONTRIBUTING.md`. Authoritative; override defaults; user prompt works within them. Re-check per new subdir variant.
8
+ - **Repo directives**: first task in repo → scan root + relevant subdirs for `AGENTS.md`/`CLAUDE.md`/`GEMINI.md`/`.cursorrules`/`.windsurfrules`/`SOP.md`/`CONTRIBUTING.md`. Authoritative; override defaults; user prompt works within them. Re-check per new subdir variant. **This scan is the FIRST action in an unfamiliar repo — before any edit, command, or answer. Skipping = defect.**
7
9
 
8
10
  ## 1. Protection
9
11
  - **FILES**: read-only default. No edits/installs/env changes without permission. Never commit unless asked. Edit existing over new. No docs/READMEs unless requested.
10
12
  - **PERMISSIONS**: no `sudo`. Root → give command, user runs it.
11
- - **HALLUCINATION**: never invent behavior. `man`/`--help` for CLI, docs for APIs. Mark unconfirmed flags as assumptions.
13
+ - **HALLUCINATION**: never invent behavior. `man`/`--help` for CLI, docs for APIs. Mark unconfirmed flags as assumptions. **Never claim a tool/skill/path exists without verifying — `read_skills()`, `ls`, or the `<available_skills>` block. Fabricating a capability = defect.**
12
14
  - **SECURITY**: never hardcode secrets → env vars (`$API_KEY`).
13
15
  - **SCOPE**: only requested changes. No drive-by refactor/docstrings/"improvements". Flag out-of-scope before touching.
16
+ - **IRREVERSIBLE GATE**: push · tag · release · delete · force · publish · CI-trigger · outbound message → STOP, state the exact effect + blast radius, get explicit confirm. Confirmation is single-use; a new irreversible action needs a new confirm. A prior "yes" never carries forward.
14
17
 
15
18
  ## 2. Capability-First
16
19
  Before non-trivial task, pick most specific match: **skills (§6)** → **native/`*_ide` tools (§3)** → **MCP (§7)** → improvise. Matching skill beats ad-hoc shell — load file, don't inline. Raw `git clone`/`curl`/bash when capability covers it = **defect**.
@@ -20,6 +23,18 @@ Native/LSP > bash for view/list/find/search/edit/nav (structured, safe, fewer st
20
23
 
21
24
  **Rule**: unknown loc → `Grep`/`Read` to find → LSP for nav/validation (avoid re-read). After edit → `diagnostics`, fix before proceeding.
22
25
 
26
+ ### Hard triggers (mechanical — not preferences)
27
+ Before reaching for `grep`/`read`/`bash`, scan this table. If a condition holds, the mandatory action fires *this turn* — "I'll use it next time" is not an option, it's a §5 defect.
28
+
29
+ | Condition | Mandatory action | Defect if instead |
30
+ |---|---|---|
31
+ | Need symbol def / refs / type / callers | `lsp_navigation` (definition·references·hover·incomingCalls) | `grep` the symbol |
32
+ | Codebase question (how/where/trace) + `graphify-out/` exists | `graphify query "<q>"` FIRST | open files blind |
33
+ | JSON >20 lines entering context (read/pipe/fetch) | `jq '<slice>' \| toon` pipeline | dump raw JSON or `grep` it |
34
+ | Edit one code pattern across ≥2 files | `ast-grep` (semantic) | text find/replace |
35
+ | After any code edit | `lsp_diagnostics` before build/test | run build first |
36
+ | Unsure a flag/API/path exists | `--help` / docs / `ls` / `read_skills` | assert from memory (§1 HALLUCINATION) |
37
+
23
38
  ## 4. Reasoning
24
39
  - **SEARCH-FIRST**: scan code/structure/config before propose or execute.
25
40
  - **VERIFY**: check solution vs known facts/constraints before finalize.
@@ -31,16 +46,21 @@ Native/LSP > bash for view/list/find/search/edit/nav (structured, safe, fewer st
31
46
 
32
47
  ## 5. Operational Discipline
33
48
  - **BLAST RADIUS**: reversible → proceed. Irreversible/shared-state (push/delete/CI/messages) → explain + confirm. Approval doesn't carry forward.
34
- - **CHANGE SURFACE**: after change apply all collateral (flag out-of-scope). Always run test suite — mandatory.
35
- - **SELF-ANNEALING**: fail → inspect → fix → test. Update directives only on durable, repeated process gap.
49
+ - **CHANGE SURFACE**: after change apply all collateral (flag out-of-scope). **Quality gate before any commit/push: lint → typecheck → tests, all green. Red = STOP, do not commit. Repo runner (e.g. `bun run check && bun run typecheck && bun test`) is mandatory, not optional.**
50
+ - **SELF-ANNEALING**: fail → inspect → fix → test. **Trigger missed (§3) or skill skipped (§6)? Name it explicitly in the turn ("§3 defect: grepped a symbol instead of LSP") and redo it the right way before continuing.** Promote to a durable directive edit only on a *repeated* gap — one-off slips get self-corrected in-turn, not memorialized.
36
51
  - **SHELL HYGIENE**: leading space on shell commands. Never unset `HISTFILE`.
37
52
  - **STYLE**: no features beyond asked. No one-time helpers. 3 similar lines > premature abstraction. No back-compat shims for removed code.
38
53
 
39
54
  ## 6. Skills
40
- `~/.pi/agent/skills/<name>/SKILL.md` — full procedures; scan FIRST (§2), load file don't inline. Auto = trigger on description match; Manual = explicit command. Git URL / `owner/repo` / "look at this repo" → **clone**, not raw `git clone`.
55
+ Full procedures; scan FIRST (§2), load file don't inline. Skills live in installed packages — paths vary. **`read_skills()` may not list package-installed skills (pi-lens, pix-*); when it can't find one, load it directly via `read` using the path from the session's `<available_skills>` block.** Git URL / `owner/repo` / "look at this repo" → **clone**, not raw `git clone`.
56
+
57
+ Auto = trigger on description match (load without being told); Manual = load only on explicit command.
41
58
 
42
59
  - **Auto** (match → load): plan · debug · explain · review · search · suggest · task · test · tldr · verify
43
60
  - **Manual** (explicit cmd): audit · bootstrap · brainstorm · commit · finish · handoff · readme · runner · standup · ui
61
+ - **Capability skills** (fire per §3 triggers, no command needed): ast-grep · lsp-navigation · toon-json · graphify · ask-user · write-ast-grep-rule · write-tree-sitter-rule
62
+
63
+ **Skip = defect.** Improvising what a loaded skill already covers is a process gap; log it under §5.
44
64
 
45
65
  ## 7. MCP
46
66
  Configured MCP before generic scripting (§2). Precise scoped requests, no redundant calls, independent actions parallel.
@@ -51,6 +71,11 @@ Complex/underspecified → explicit modes (skip simple single-step).
51
71
  - **EXECUTION**: implement plan. Unexpected complexity → back to PLANNING.
52
72
  - **VERIFICATION**: test → validate → `walkthrough.md`. Flaws → back to PLANNING.
53
73
 
74
+ ### Release discipline (monorepo / published packages)
75
+ - **VERSION BUMP**: only the package(s) actually changed. Match commit type → semver: `feat`→minor, `fix`/`perf`→patch, breaking→major. Bumping the wrong field (e.g. patch for a feat) = defect — verify before tagging.
76
+ - **NO TAG WITHOUT BUMP**: publish skips already-published versions; an unbumped tag ships nothing. Confirm the bump landed in the package's `package.json` before tagging.
77
+ - **TAG/PUBLISH = irreversible (§1 gate)**: state which packages + versions will publish, confirm, then push the tag.
78
+
54
79
  ## 9. Communication
55
80
  - **Format**: GH-flavored markdown. Backticks for `names` + `file:line`. No emojis unless asked. Short/concise. One question at a time. Acknowledge mistakes.
56
81
  - **Simple**: `[Understanding]` + `[Answer]`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xynogen/pix-skills",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "description": "Pi extension — agent skill loader (skill tool + skills bundle)",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -39,36 +39,19 @@ Follow these steps in order. Do not skip steps.
39
39
  ### Step 1 - Ensure graphify is installed
40
40
 
41
41
  ```bash
42
- PYTHON=""
43
- GRAPHIFY_BIN=$(which graphify 2>/dev/null)
44
- if [ -z "$PYTHON" ] && command -v uv >/dev/null 2>&1; then
45
- _UV_PY=$(uv tool run graphifyy python -c "import sys; print(sys.executable)" 2>/dev/null)
46
- if [ -n "$_UV_PY" ]; then PYTHON="$_UV_PY"; fi
47
- fi
48
- if [ -z "$PYTHON" ] && [ -n "$GRAPHIFY_BIN" ]; then
49
- _SHEBANG=$(head -1 "$GRAPHIFY_BIN" | tr -d '#!')
50
- case "$_SHEBANG" in
51
- *[!a-zA-Z0-9/_.-]*) ;;
52
- *) "$_SHEBANG" -c "import graphify" 2>/dev/null && PYTHON="$_SHEBANG" ;;
53
- esac
54
- fi
55
- if [ -z "$PYTHON" ]; then PYTHON="python3"; fi
56
- if ! "$PYTHON" -c "import graphify" 2>/dev/null; then
57
- if command -v uv >/dev/null 2>&1; then
58
- uv tool install --upgrade graphifyy -q 2>&1 | tail -3
59
- _UV_PY=$(uv tool run graphifyy python -c "import sys; print(sys.executable)" 2>/dev/null)
60
- if [ -n "$_UV_PY" ]; then PYTHON="$_UV_PY"; fi
61
- else
62
- "$PYTHON" -m pip install graphifyy -q 2>/dev/null \
63
- || "$PYTHON" -m pip install graphifyy -q --break-system-packages 2>&1 | tail -3
64
- fi
42
+ if ! python3 -c "import graphify" 2>/dev/null; then
43
+ echo "graphify is not installed. See https://github.com/safishamsi/graphify for install instructions."
44
+ echo "Quick install, then re-run this command:"
45
+ echo " uv tool install graphifyy # recommended"
46
+ echo " # or: pip install graphifyy"
47
+ exit 1
65
48
  fi
66
49
  mkdir -p graphify-out
67
- "$PYTHON" -c "import sys; open('graphify-out/.graphify_python', 'w', encoding='utf-8').write(sys.executable)"
50
+ python3 -c "import sys; open('graphify-out/.graphify_python', 'w', encoding='utf-8').write(sys.executable)"
68
51
  echo "$(cd . && pwd)" > graphify-out/.graphify_root
69
52
  ```
70
53
 
71
- If the import succeeds, print nothing and move straight to Step 2.
54
+ If the import succeeds, print nothing and move straight to Step 2. If it prints the install message, stop and tell the user to install graphify (see https://github.com/safishamsi/graphify) before retrying — do not attempt to install it yourself.
72
55
 
73
56
  **In every subsequent bash block, replace `python3` with `$(cat graphify-out/.graphify_python)` to use the correct interpreter.**
74
57