feat: .agents/rules/ universal rules directory - #19
Merged
Conversation
- Move voice.md from .claude/rules/ to .agents/rules/ - Replace .claude/rules/ with symlink to ../.agents/rules/ - Enables Claude Code native discovery + prepares for Pi extension
- Discovers .agents/rules/ walking up from cwd - Parses frontmatter for path-scoped rules - Records read/edit/write paths per turn - Injects catalog + matching rule content into system prompt - One-shot injection (turn_end clears recorded paths)
Array items under paths: (e.g. '- entries/drafts/**') have no colon,
so the old parser skipped them entirely. Now array items are detected
via trimmed.startsWith('- ') before the colon check, so multi-line
YAML arrays parse correctly.
Contributor
|
✅ All review checks passed. When you're ready, apply the |
A simple rule that triggers on README.md access and produces an unambiguous output marker, making it easy to confirm injection works in both Pi and Claude Code.
Contributor
|
✅ All review checks passed. When you're ready, apply the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Establishes
.agents/rules/as a universal rules directory consumed by both Claude Code and Pi, eliminating content duplication.voice.mdfrom.claude/rules/to.agents/rules/.claude/rules/with a symlink to.agents/rules/so Claude Code discovers rules nativelyrules-loaderPi extension (~/.pi/agent/extensions/rules-loader/) that:.agents/rules/walking up from cwd (with~/.agents/rules/fallback)before_agent_startturn_end.pi/extensions/rules-loader/Test Plan
voice.mdpaths — rule auto-loads via symlinkLoaded rules: voice.md (...)notificationentries/drafts/*.md, verify rule content injected next turn