Path Scoped Rules — Documentation skill for Claude Code
OpenCode plugin that loads path-scoped Markdown instructions from .claude/rules and .agent as you work on matching files.
How to install Path Scoped Rules
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open jamestkelly/path-scoped-rules and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Path Scoped Rules does
OpenCode plugin that loads path-scoped Markdown instructions from .claude/rules and .agent as you work on matching files.
Alternatives in Documentation
- Translate Doc Zh — Translate English documentation to Chinese 5.7k ★
- Wiki Export Marp — Generate a Marp slide deck from wiki content matching a topic 375 ★
- Token Goat — Token burn reducer and focus keeper for Claude Code, Codex, Copilot, Gemini CLI, and more: surgical read hints 107 ★
README
path-scoped-rules
Give [OpenCode](https://opencode.ai) the Markdown rules that apply to the file it’s working on. Reuse your existing `.claude/rules/` files: a backend logging rule can stay out of the conversation until the agent reads backend code.
Install
To use the plugin in **all your OpenCode projects**, install from the `v1` tag and check that it appears in the plugin list:
opencode plugin add github:jamestkelly/path-scoped-rules#v1
opencode plugin list
`v1` points to the newest compatible 1.x release. To check for and apply updates, use `opencode plugin check` and `opencode plugin update`. For a reproducible install, use a release commit as described below.
Quick start
Save this as `.claude/rules/logging.md`:
---
paths:
- "backend/**/*.ts"
- "!backend/**/deploy/**"
---
Use the project's structured logger in backend code.
After adding or editing a rule, run `/reload` in OpenCode and start a fresh session. For the rule above:
| First file read | Is the logging instruction in the next model request? |
|---|---|
backend/orders/create.ts |
Yes |
backend/orders/deploy/stack.ts |
No — explicitly excluded |
frontend/orders/create.ts |
No — outside backend/ |
Once activated, the rule stays in that session. Reading a different file later does not remove it.
OpenCode’s **Instructions updated** notice shows a dotted path. For `.claude/rules/logging.md`, it displays `api/path-scoped-rules.claude.rules.logging.md`. OpenCode does not allow slashes inside the entry key; special characters in filenames are escaped. Start a fresh session after upgrading if you still see old hash-based entries.
In the OpenCode terminal, enter `/rules` to see the count and paths of the scoped rules applied in the current session. Each path appears once, regardless of how often it matched. The list excludes always-on guidance and rules that appear only in the startup index. “Applied” means delivered as a session instruction, not
Related Skills
Executor Rules
You are a pi-lead EXECUTOR. A lead session delegates work to you as packets (markdown files); your
Claude Generate Docs
Skill: generate project or research documentation, or step-by-step guides with fill-in fields, as a self-conta
Venture
Autonomously build a venture/product end-to-end from a charter (a GOAL.md path or an inline brief), managed cl
Multipov
Review a document by dispatching multiple persona agents against it. The document can be a PDF, markdown, or t
Aplicar Idioma
After onboarding's readback, put the markdown and the creator-facing folders in content_language. Set files_la
Opencode Claude Memory
OpenCode plugin for Claude Code memory: persistent local Markdown memory shared with Claude Code, zero config,
Related Agents
CLI Researcher
Researches how an agent CLI (Codex, Gemini CLI, Kimi CLI, Grok, opencode…) stores its configuration — skills,
Tracker Admin
Designs and maintains the work tracker, whether a tool or plain Markdown files: workflow states, fields, board
Opus5 Prompt Expert
Expert on prompting Claude Opus 5 and on how Claude Code loads instructions. Use before adding, rewording, or