@piotr-oles/pi-yagni
v1.0.0
Published
Pi Agent extension: inject YAGNI discipline — build the minimum that works, reuse before writing, no speculative code
Readme
pi-yagni
A pi coding agent extension that injects YAGNI ("You Aren't Gonna Need It") discipline into the agent — build the minimum that works, reuse before writing, no speculative code.
Install
pi install npm:@piotr-oles/pi-yagniUsage
No configuration. Enabled whenever installed. Uninstall to disable.
How it works
Injects a YAGNI instruction block into the system prompt at session start. The block gives the agent a decision ladder — stop at the first rung that holds — before writing any code:
- Does this need to be built at all?
- Does it already exist in this codebase? Reuse it.
- Does the standard library do this?
- Does a native platform feature cover it?
- Does an already-installed dependency solve it?
- Can this be one line?
- Only then: write the minimum code that works.
Plus rules against speculative generality, premature abstraction, and unrequested error handling / caching / logging.
This extension is very lite on context — adds only a few lines of text to the system prompt.
Development
pnpm install
pnpm test
pnpm typecheck
pnpm checkTo test changes manually, pass the source entry point directly to pi:
pi -e packages/pi-yagni/src/index.ts