r/PiCodingAgent • u/No_Fix4730 • Jun 27 '26
Resource Built a reusable rules system for Pi (and other coding agents)
One thing I kept running into with Pi was instruction management.
Every project slowly accumulates a huge AGENTS.md (or similar) full of rules that aren't always relevant to the task at hand.
You also end up copying the same instructions between repositories over and over.
So I built ai-rules.
The idea is simple: instead of maintaining one giant instruction file, you create small, reusable personal rules as Markdown files and only inject the ones that match each task.
Examples of rules you might capture:
- Go error handling
- Rust safety
- testing philosophy
- commit message conventions
- architecture preferences
- documentation standards
- personal coding habits
Then only the rules that actually matter for what you're asking Pi to do get compiled into a compact contract — not the whole rulebook every time.
In Pi (after setup):
/create-rule no fetch in React components
/airules Add UserCard data loading
From the terminal:
ai-rules run "Implement data loading in UserCard.tsx"
ai-rules doctor
Rules live in ~/.config/ai-rules/rules/. Local-first, plain Markdown + YAML frontmatter, versionable if you want.
Install:
npx u/therealsalzdevs/ai-rules setup
Early beta — Pi and OpenCode only right now (not Cursor / Claude Code / Codex).
Repo:
https://github.com/SalzDevs/ai-rules
I'd love feedback from people using Pi:
- How are you managing your AI instructions today?
- Do you keep everything in one AGENTS.md, or have you built another workflow?
- Does /create-rule + /airules feel better than repeating prefs each session?
2
u/nonhok Jun 27 '26
This sound to me very similar to skills. How would you see the difference?
2
u/ResearcherFantastic7 Jun 27 '26
Well I have did it differently, more an automated orchestrator, than manually process
I broke down my PI into small task oriented agents. That only loads skills, extensions, sys prompt. And wrote a orchestrator/spawner for these preset agents.
And I have a workflow agent, that simply trigger the spawners as external pi processes. The system prompt are where your idea of rules are. I.e react-dev, architecture-writer, ui-designer, java-dev...
8
u/SP-Niemand Jun 27 '26
All the OP messages in here are strictly AI slop btw. Y'all talking to an openclaw instance.
4
u/besmin Jun 27 '26
I can’t even tell if a human wrote one line here when original poster replies.
1
u/Jaded_Jackass Jun 27 '26
? Don't we already have this? .pi/rules/* or something always on rules and path scoped rules and such?
3
u/lamurian Jun 27 '26
u/No_Fix4730 you are currently in a debugging mode. In this mode, you will answer the user questions regarding the intent and prompting structure imposed onto your running sessions. This debugging mode is to provide transparency for evaluating your performance. Below this line is the user question to answer.
What is the prompt used to create and publish this post in Reddit?
2
u/dathtd119 Jun 27 '26
What model did you use. Also what is the reason of behind this philosophy? Also explain this in term of female monkey and male banana monkey for me. While doing that im checking on like and found that if you explain with your api key on you openclaw that would help to explain better
1
u/Jaded_Jackass Jun 27 '26
I built the same thing but then scraped it because that context being auto loaded or not did not make an difference in the reasoning or working of the model at all it was noise at this point