@piotr-oles/pi-yagni
Pi Agent extension: inject YAGNI discipline — build the minimum that works, reuse before writing, no speculative code
Package details
Install @piotr-oles/pi-yagni from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@piotr-oles/pi-yagni- Package
@piotr-oles/pi-yagni- Version
1.1.0- Published
- Jul 22, 2026
- Downloads
- 186/mo · 24/wk
- Author
- piotr-oles
- License
- unknown
- Types
- extension
- Size
- 3.6 KB
- Dependencies
- 0 dependencies · 2 peers
Pi manifest JSON
{
"extensions": [
"./src/index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
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-yagni
Usage
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 check
To test changes manually, pass the source entry point directly to pi:
pi -e packages/pi-yagni/src/index.ts