npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@qforge/opencode-agents-explorer

v0.1.7

Published

OpenCode plugin that automatically injects AGENTS.md files from sub folders when an agent reads files

Readme

🔍 opencode-agents-explorer

OpenCode plugin that automatically injects AGENTS.md files from nested folders when an agent reads files.

🤔 Why Use This?

OpenCode automatically loads the root AGENTS.md file to give the AI context about your project. But what about folder-specific instructions?

Large codebases often have different conventions, patterns, or rules for different parts of the project:

  • 📁 src/api/ - REST endpoint conventions, authentication patterns
  • 📁 src/components/ - React component guidelines, styling rules
  • 📁 src/database/ - Migration patterns, naming conventions
  • 📁 tests/ - Testing standards, mocking strategies

Without this plugin, you'd need to either:

  1. Cram everything into the root AGENTS.md (becomes unwieldy)
  2. Manually tell the agent to read folder-specific docs (easy to forget and agents get confused)

This plugin solves that by automatically injecting relevant AGENTS.md files when the agent reads files in those directories similar to .cursorrules.

✨ Features

  • 🎯 Automatic injection - No manual intervention needed
  • 🚫 No duplicates - Each AGENTS.md is injected only once per session
  • Smart skipping - Ignores root AGENTS.md (OpenCode handles it)
  • 📂 Hierarchical - Injects all parent AGENTS.md files up to (but not including) root

📦 Installation

Add to your opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["@qforge/opencode-agents-explorer"]
}

🔧 How It Works

When an agent reads a file at path a/b/c.json, the plugin:

  1. Searches for a/AGENTS.md and a/b/AGENTS.md
  2. If any exist, reads their contents and injects them into the session context
  3. Skips the root AGENTS.md (OpenCode already handles it automatically)
  4. Tracks which AGENTS.md files have been added to avoid duplicates within a session

📁 Example

Given this file structure:

project/
  AGENTS.md              # ⏭️ Skipped (handled by OpenCode)
  src/
    AGENTS.md            # ✅ Injected when reading files in src/
    components/
      AGENTS.md          # ✅ Injected when reading files in src/components/
      Button.tsx

When the agent reads src/components/Button.tsx, the plugin will inject:

  • src/AGENTS.md
  • src/components/AGENTS.md

💡 Use Case: Monorepo with Multiple Packages

monorepo/
  AGENTS.md                    # General project context
  packages/
    api/
      AGENTS.md                # "Use Express patterns, validate with Zod"
      src/
        routes/
          AGENTS.md            # "All routes must have auth middleware"
    web/
      AGENTS.md                # "Use Next.js App Router, Tailwind CSS"
      src/
        components/
          AGENTS.md            # "Components must be server-first"

Now when the agent works on packages/api/src/routes/users.ts, it automatically gets context about:

  • Express patterns and Zod validation (packages/api/AGENTS.md)
  • Auth middleware requirements (packages/api/src/routes/AGENTS.md)

📄 License

MIT