omp packages

@spences10/pi-coding-preferences0.0.16

Configurable Pi guardrails that keep agents aligned with local coding workflow preferences before bad commands run

spences10 Published 1 month ago MIT ~290 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

@spences10/pi-coding-preferences

built with Vite+ tested with Vitest npm version license

my-pi package preview

Keep agents aligned with your local coding standards before bad commands run. pi-coding-preferences turns workflow preferences—like using rg instead of grep—into lightweight guardrails that nudge the model toward the project’s conventions.

It ships with default workflow preferences. Add user preferences at ~/.pi/agent/coding-preferences.json and project preferences at .pi/coding-preferences.json; when either file exists, configured rules are loaded instead of the built-in defaults.

{
	"rules": [
		{
			"name": "no-npm",
			"toolNames": ["bash"],
			"target": "command",
			"pattern": "^npm\\\\b",
			"reason": "Use pnpm in this repo."
		}
	]
}

Rule targets are command, path, or input. Patterns are JavaScript regular expressions. A blocked call reports the rule name and nested input field, but not the matched value.

The input target checks every string in the tool input. For an edit call, this includes both oldText and newText. These checks are not syntax-aware. Use a language-aware linter for identifier naming and other rules that must distinguish code from comments or string content.

pi install npm:@spences10/pi-coding-preferences

This is opt-in: installing the package globally applies it to your Pi sessions, but projects and downstream users do not inherit it unless they install the package.

Development

Package scripts build transitive workspace dependencies first, then run local tools through Vite+ with vp exec.

pnpm --filter @spences10/pi-coding-preferences run check
pnpm --filter @spences10/pi-coding-preferences run test
pnpm --filter @spences10/pi-coding-preferences run build