YukkaiRules — Persistent Rules
YukkaiRules are persistent instructions injected into every session, ensuring your preferences are always followed.
YukkaiRules are persistent instructions that are automatically injected into every conversation. Unlike ad-hoc instructions that are forgotten when a session ends, rules persist across sessions and ensure your preferences are always respected.
How Rules Work
Each rule is a piece of text that gets injected into the system prompt at regular intervals:
- High priority rules are re-injected every 10 messages
- Normal priority rules are re-injected every 20 messages
Managing Rules
Listing Rules
yukkai_rules(action: "list")
Returns all active rules with their IDs, content, priority, and enabled status.
Adding a Rule
yukkai_rules(action: "add",
content: "Always write code comments in English",
priority: "high"
)
| Parameter | Description |
|---|---|
content |
The rule text (required) |
priority |
"high" (every 10 msgs) or "normal" (every 20 msgs). Default: normal |
Updating a Rule
yukkai_rules(action: "update",
id: "rule-123",
content: "Always write code comments in English, even if the codebase is in French",
priority: "high"
)
Toggling a Rule
yukkai_rules(action: "toggle", id: "rule-123")
Disables or re-enables a rule without deleting it — useful for temporarily suspending a rule.
Removing a Rule
yukkai_rules(action: "remove", id: "rule-123")
Permanently deletes the rule.
Auto-Detection
Yukkai automatically detects rule-worthy statements in your messages. When you say things like:
- "Always remember to..."
- "Never do..."
- "From now on,..."
- "Rule: ..."
When to Use Rules
Good Use Cases
| Rule | Priority | Why |
|---|---|---|
| "Always write user-facing messages in English" | High | Language preference should never be forgotten |
| "Use 2-space indentation for Python files" | Normal | Coding convention, less critical |
| "Never delete files without confirming" | High | Safety-critical, must always be enforced |
| "Prefer SwiftUI over UIKit for new views" | Normal | Architecture preference |
| "Always include error handling in generated code" | High | Quality requirement |
Priority Guidelines
- High — Safety-critical, language preferences, hard constraints that must never be violated. Re-injected every 10 messages.
- Normal — Coding conventions, style preferences, soft guidelines. Re-injected every 20 messages.
Rules vs. Skills vs. Personalities
| Feature | YukkaiRules | Skills | Personalities |
|---|---|---|---|
| What it does | Enforces specific behaviours | Adds domain knowledge | Changes communication style |
| Persistence | Across all sessions | Per activation state | Per session |
| Granularity | Single instruction | Full knowledge module | Full persona |
| Auto-injection | Every 10/20 messages | On keyword match | On activation |
| Best for | "Always/Never..." rules | Domain expertise | Tone and voice |
Best Practices
- Keep rules short and unambiguous — "Always write in English" is better than "When writing user-facing content, please ensure the language used is English."
- Use high priority sparingly — Reserve it for truly critical rules. Too many high-priority rules bloat the system prompt.
- Don't duplicate skills — If a rule is really a domain expertise thing (e.g., "Follow Kubernetes best practices"), create a skill instead.
- Review periodically — Run
listand remove rules that are no longer relevant. - Toggle instead of delete — If you're unsure, disable a rule temporarily rather than deleting it permanently.