@xynogen/pix-skills 0.7.12 → 0.7.13

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/skills/harden.md +66 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xynogen/pix-skills",
3
- "version": "0.7.12",
3
+ "version": "0.7.13",
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,66 @@
1
+ ---
2
+ name: harden
3
+ description: Retrofit static analysis onto an existing project in any language — lint, format, type/compile check, tests, dependency hygiene, audit, CI gate. Use only on explicit request — "harden this project", "add static analysis", "set up quality gates".
4
+ disable-model-invocation: true
5
+ ---
6
+ # Project Hardening Directive
7
+
8
+ ## Goal
9
+
10
+ An existing project gains a fail-fast static-analysis gate: one command locally, same command in CI, red blocks merge. Do not scaffold new projects — that is `bootstrap`'s job.
11
+
12
+ ## Phase 1: Audit (read-only)
13
+
14
+ Inventory before touching anything:
15
+
16
+ - **Ecosystem** — detect language(s), build system, package/dependency manager, existing configs (linter, formatter, compiler/type-checker settings, CI files, hooks). Mixed-language repos: audit each language separately.
17
+ - **Existing tools win** — a project with a working linter keeps it; never swap tools for taste. Only fill gaps.
18
+ - **Verify, don't recall** — before proposing any tool, confirm it exists and its flags via `--help` or official docs. Ecosystems move; memory rots.
19
+ - **Gaps checklist** (rank by value/effort, report before applying):
20
+ 1. Formatter + linter present and enforced (not just installed)?
21
+ 2. Warnings fail CI, or are they decorative?
22
+ 3. Strictest static check the language offers covers ALL source including tests — type-check for typed languages, compiler warnings-as-errors, or a type-annotation checker for dynamic ones (mypy/pyright, sorbet, phpstan)?
23
+ 4. Test runner wired with at least one real test? Coverage threshold?
24
+ 5. Dependency vulnerability audit at high severity (`npm audit`, `cargo audit`, `pip-audit`, `govulncheck`, `mvn dependency-check`, `bundler-audit` — whatever the ecosystem ships)?
25
+ 6. Dependency versions locked (lockfile, pinned requirements, go.sum, Cargo.lock) + CI installs exactly those versions (frozen/locked/ci mode)?
26
+ 7. CI exists, runs the same commands as local, pinned toolchain version (never `latest`)?
27
+ 8. Dead-code / unused-dep detection — only for multi-package repos; use the ecosystem's tool if one exists, skip otherwise.
28
+
29
+ ## Phase 2: Propose
30
+
31
+ Present the gap list with one-line fixes and effort estimates. Get approval before installing anything. Skip items the user rejects — no silent extras.
32
+
33
+ ## Phase 3: Apply
34
+
35
+ - **One tool per job.** Prefer the ecosystem's converged default (examples: Biome or ESLint+Prettier; ruff+mypy; gofmt+vet+staticcheck; clippy+rustfmt; ktlint+detekt; php-cs-fixer+phpstan). Unsure what the current default is → check docs, don't guess.
36
+ - **Single gate command** — one entry point chaining format-check → lint → static/type check → tests, fail-fast. Use whatever the project already uses to run tasks: package-manager script, Makefile, justfile, rakefile, cargo alias, gradle task. CI calls this exact entry point, never a diverging copy.
37
+ - **Warnings are errors in CI.** A rule worth having is worth failing on.
38
+ - **Coverage: ratchet, don't aspire.** Set threshold to the current actual percentage; raise it later. Never set an aspirational number that fails on day one.
39
+ - **Pin versions** — tool versions locked by the dependency manager (or a pinned tool-version file: `.tool-versions`, `rust-toolchain.toml`, `.python-version`), toolchain version pinned in CI config.
40
+ - Config over code: use the tool's recommended preset + minimal overrides. No 300-line rule files.
41
+
42
+ ## Phase 4: Verify + Report
43
+
44
+ - Run the full gate once — must pass green on the untouched codebase (fix or downgrade rules until it does; a gate that starts red gets deleted by the next dev).
45
+ - Break one thing on purpose (introduce a lint error), confirm the gate catches it, revert.
46
+
47
+ ```text
48
+ ## Hardened: [project name]
49
+
50
+ **Gate:** `[command]` → PASS
51
+ **Added:** [tool: purpose, one line each]
52
+ **Skipped:** [item: reason]
53
+ **CI:** [file, trigger, runtime pin]
54
+ **Ratchets:** coverage at N% — raise when it grows
55
+ ```
56
+
57
+ Mixed-language repo: repeat the gate per language, one top-level command runs all.
58
+
59
+ ## Red Flags — STOP
60
+
61
+ - Replacing a working tool the project already uses.
62
+ - Installing anything before Phase 2 approval.
63
+ - A gate that is red on the first run after setup.
64
+ - CI commands that differ from the local gate script.
65
+ - Aspirational coverage thresholds.
66
+ - Adding hooks (husky etc.) when a gate script + CI already covers it — hooks are opt-in, ask first.