Skip to content
chrisuthePublic

About

An Agent to make sure other agents and engineers follow OHF standards.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

OHF Sage

A Claude Code agent that knows the Open Home Foundation / Music Assistant project leads' engineering principles — mined from real PR reviews and rejected feature requests, and cross-checked against the maintainers' own AGENTS.md and tool configs. Point your other agents at it to get the leads' standards applied automatically, with a citation for every call.

It has two modes:

  • Consult — ask it before you build something: "should I do it this way or that way?", "would this be accepted upstream?", "is this in scope, or something the project won't support?"
  • Review — hand it a diff, PR, or set of files and it checks the change against the principles, citing the PR/issue (or maintainer doc) behind each note.

Every answer is grounded in principles/principles.md — it doesn't invent standards, it applies ones on record. Home Assistant is out of scope.


Install

You only need one file: agent/ohf-sage.md (plus the corpus for fallback review history).

Get the latest (recommended) — pull from the latest release:

python scripts/install.py /path/to/your/project --from-release

That drops the agent and corpus into /path/to/your/project/.claude/agents/. The corpus is published via GitHub Releases (refreshed weekly by CI), not committed to git — so --from-release always gets the newest.

One project — from a clone of this repo:

git clone https://github.com/chrisuthe/ohf-sage.git
cd ohf-sage
python scripts/install.py /path/to/your/project

That drops the agent into /path/to/your/project/.claude/agents/.

Everywhere (all your projects) — copy it into your user-level agents folder:

mkdir -p ~/.claude/agents && cp agent/ohf-sage.md ~/.claude/agents/

No clone — pull just the agent and corpus files into a project:

mkdir -p .claude/agents
curl -L -o .claude/agents/ohf-sage.md \
  https://github.com/chrisuthe/ohf-sage/releases/latest/download/ohf-sage.md
curl -L -o .claude/agents/ohf-sage-corpus.jsonl \
  https://github.com/chrisuthe/ohf-sage/releases/latest/download/ohf-sage-corpus.jsonl

Contributing to a repo you don't own (e.g. a Music Assistant fork)? Add --local-exclude so the agent is available locally but never tracked, committed, or pushed:

python scripts/install.py /path/to/the/repo --local-exclude

install.py also fetches the Music Assistant maintainers' shared memory and its skill for your user account (what and where).

More detail and platform-specific (PowerShell) commands: INSTALL.md. You don't need Python just to use the agent — the copy/curl routes are plain file copies; only install.py uses Python (3.9+).

Full local setup (skills + CLIs across all your repos)

The drop-in agent works on its own. To also use the add-manual-principle / propose-principle-upstream skills and the search / capture CLIs from any repo — not just this checkout — do this one-time setup from a clone:

pip install -e .   # makes `ohf_principles` importable everywhere (+ ohf-sage-search / ohf-sage-capture commands)
cp -r .claude/skills/add-manual-principle .claude/skills/propose-principle-upstream ~/.claude/skills/

Then install the agent into each repo you work in (see Install above). Paste-mode capture needs neither step; only the GitHub-URL capture mode and the search / capture CLIs require the pip install -e.

Using it

Once installed, ask Claude Code to bring it in. Example prompts:

  • "Run this approach past the ohf-sage before I build it."
  • "Have the ohf-sage review my diff."
  • "I want to add a music provider that caches streamed audio to disk — check it against the project principles first."

It responds with a verdict first (e.g. "won't be accepted as-is"), then the governing principle(s), each linking to the PR/issue or maintainer doc it came from, and separates hard MUST / "won't support" rules from softer preferences.

When no distilled rule covers a question, ohf-sage greps a shipped review-history corpus (.claude/agents/ohf-sage-corpus.jsonl, ~6 MB, copied in by install.py; use --no-corpus to skip it) and cites the real comments, labelled as retrieved.

Searching the review history

Query the raw mined comments directly:

python -m ohf_principles.search "<terms>" [--repo <owner/repo>] [--author <login>] [--top N]

Prints the top matching review comments — author, permalink, and a snippet — ranked by keyword overlap, author authority, and 👍 reactions.

Understanding its answers

Every rule the advisor cites ends with a provenance marker telling you how it knows — weigh its confidence accordingly:

Marker Meaning
[authored+mined] A maintainer doc and PR reviews agree — strongest
[authored] Stated in a maintainer doc (AGENTS.md, CONTRIBUTING.md, …) — firm policy
[enforced] Codified in a tool/CI config (ruff/mypy/pre-commit) — mechanically checked
[mined · N PRs · 👍] Inferred from review history across N distinct PRs; · 👍 when maintainers endorsed it
[captured] Manually added from a GitHub URL; carries a real permalink
[attested: who · channel · date] Manually added from a paste (Slack/verbal); user-attested, not publicly verifiable

Adding out-of-band guidance

You can add your own principles locally without updating the shipped corpus. (The skills below need the one-time Full local setup.)

  • Run the add-manual-principle skill to capture a principle from a paste (Slack message, verbal note) — marked [attested: who · channel · date] — or from a GitHub URL — marked [captured]. It writes a local, git-excluded .claude/agents/ohf-sage-manual.md that ohf-sage applies automatically. Nothing is published; the entry stays private to your setup.

  • To contribute an entry to the shared repo, run propose-principle-upstream, which opens a GitHub issue for maintainer review. This publishes your claim publicly, so it asks for explicit confirmation before opening the issue. For a Music Assistant entry, someone who can write to the maintainers' shared memory is sent to its Memory: PR flow instead.

Whose principles these are

Principle strength depends on who said it:

  • marcelveldt — authoritative across every OHF project.
  • MarvinSchenkel — authoritative for Music Assistant.
  • Other core maintainers per project (e.g. OzGav, florianhorner on the server).

Only these voices are treated as principle signal. The current pass covers the Music Assistant repos (server, support, frontend, mobile-app, desktop-app); the doc is honest about thin or unmined areas rather than inventing rules.

Regenerating or extending

This repo is also the pipeline that produced the agent. To refresh the principles, mine additional OHF repos, or change how distillation works, see DEVELOPING.md.

About

An Agent to make sure other agents and engineers follow OHF standards.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages